String.prototype.stripHTML = function() {
    return this.replace(/<br>/g, "\n").replace(/(<([^>]+)>)/ig,"");
};
/**
 * @param maxCaracteres Numero maximo de caracteres que o texto deve ter (Default = 30)
 * @returns Texto truncado (com reticencias se for maior)
 */
String.prototype.truncateEllipsis = function(maxCaracteres) {
    if(!maxCaracteres)
        maxCaracteres = 30;
    if(this.length <= maxCaracteres)
        return this;
    return this.substring(0, maxCaracteres-3) + "...";
};

/**
 * Transformar um formulario em objeto<br />Converte nome hifenizado em camelCase<br />Nomes com o prefixo "check-" tem valores convertidos para true<br />Nomes com o prefixo "mask-" tem valores convertidos numerico
 * @returns Objeto com os valores do formulario
 */
$.fn.serializeObject = function() {
    var o = {},
        a = this.serializeArray(), n, isCheck = false, val;
    $.each(a, function() {
        if(this.name.split("-")[0] == "check") {
            isCheck = true;
            this.name = this.name.substr(this.name.indexOf("-")+1);
        } else {
            isCheck = false;
            if(this.name.split("-")[0] == "mask") {
                val = this.value.split(" ")[0].replace(",",".");
                this.value = Number(val) || (val == 0 && val !== "" ? 0 : -1);
                this.name = this.name.substr(this.name.indexOf("-")+1);
            }
        }
        n = this.name.replace(/-([a-z])/g, function (g) {
            return g[1].toUpperCase();
        });
        if (o[n] !== undefined) {
            if (!o[n].push) {
                o[n] = [o[n]];
            }
            o[n].push(this.value || "");
        } else {
            o[n] = isCheck || this.value;
            if(this.value == undefined)
                o[n] = "";
        }
    });
    return o;
};

$(function() {
    /********************************
     Preloader
     ********************************/
    $(".loading-container").fadeOut(1000, function() {
        $(this).remove();
    });

    /********************************
     Toggle Aside Menu
     ********************************/
    $("#btn-navbar-toggle").on("click", function() {
        $("aside.left-panel").toggleClass("collapsed");

        var width = 140;
        if($("aside.left-panel").hasClass("collapsed")) {
            width = 50;
            $(".user-name").addClass("hidden");
        } else {
            $(".user-name").removeClass("hidden");
        }

        $(".user img").width(width);
    });

    /********************************
     Aside Navigation Menu
     ********************************/

    $("aside.left-panel nav.navigation > ul > li:has(ul) > a").click(function() {
        if ($("aside.left-panel").hasClass("collapsed") == false || $(window).width() < 768) {
            $("aside.left-panel nav.navigation > ul > li > ul").slideUp(300);
            $("aside.left-panel nav.navigation > ul > li").removeClass("active");
            if (!$(this).next().is(":visible"))
            {
                $(this).next().slideToggle(300, function() {
                    $("aside.left-panel:not(.collapsed)").getNiceScroll().resize();
                });
                $(this).closest("li").addClass("active");
            }
            return false;
        }
    });

    /********************************
     popover
     ********************************/
    if ($.isFunction($.fn.popover)) {
        $(".popover-btn").popover();
    }

    /********************************
     tooltip
     ********************************/
    if ($.isFunction($.fn.tooltip)) {
        $(".tooltip-btn").tooltip();
    }

    /********************************
     NanoScroll - fancy scroll bar
     ********************************/
    if ($.isFunction($.fn.niceScroll)) {
        $(".nicescroll").niceScroll({
            cursorcolor: "#9d9ea5",
            cursorborderradius: "0px"
        });
        $("aside.left-panel:not(.collapsed)").niceScroll({
            cursorcolor: "#8e909a",
            cursorborder: "0px solid #fff",
            cursorwidth: "7px",
            cursoropacitymax: "0.5",
            cursorborderradius: "5px"
        });
    }

    /********************************
     Input Mask
     ********************************/
    if ($.isFunction($.fn.inputmask)) {
        $(".inputmask").inputmask();
    }

    /********************************
     TagsInput
     ********************************/
    if ($.isFunction($.fn.tagsinput)) {
        $(".tagsinput").tagsinput();
    }

    /********************************
     Chosen Select
     ********************************/
    if ($.isFunction($.fn.chosen)) {
        $(".chosen-select").chosen();
        $(".chosen-select-deselect").chosen({allow_single_deselect: true});
    }

    /********************************
     wysihtml5
     ********************************/
    if ($.isFunction($.fn.wysihtml5)) {
        $(".wysihtml").wysihtml5();
    }

    /********************************
     wysihtml5
     ********************************/
    if ($.isFunction($.fn.ckeditor)) {
        CKEDITOR.disableAutoInline = true;
        $("#ckeditor").ckeditor();
        $(".inlineckeditor").ckeditor();
    }

    /********************************
     Scroll To Top
     ********************************/
    $(".scrollToTop").click(function() {
        $("html, body").animate({scrollTop: 0}, 800);
        return false;
    });

    /********************************
     Layout Btn Licenca
     ********************************/
    var classeLicenca = "",
        btnLicenca = document.getElementById("btn-tipo-licenca"),
        nomeLicenca = $(btnLicenca).text(),
        diasExpirar;
    switch(nomeLicenca) {
        case "Licen�a Gratuita":
            classeLicenca = "btn-licenca-gratuita";
            break;
        case "Licen�a Estudante":
            classeLicenca = "btn-licenca-estudante";
            break;
        case "Licen�a Mensal":
            classeLicenca = "btn-licenca-mensal";
            break;
        case "Licen�a Semestral":
            classeLicenca = "btn-licenca-semestral";
            break;
        case "Licen�a Anual":
            classeLicenca = "btn-licenca-anual";
            break;
    }




    var modalImg = $("#modal-imagem-nutri");
    modalImg.on("hidden.bs.modal", function () {
        document.getElementById("cortarImagemNutri").innerHTML = "<img id='imagemNutriCrop' src='assets/images/avtar/usr.jpg' />";
        $("#trocarFotoNutri").parent().trigger("reset");
    });

    /********************************
     Layout Item Aberto Menu Lateral
     ********************************/
    $(".navigation ul li").removeClass("active");
    $(".navigation ul li ul").removeClass("active");
    $(".navigation ul li ul li").removeClass("active");
    var index = (window.location.pathname + window.location.search).search("&"), paginaAtual;
    if(index == -1) index = undefined;
    paginaAtual = (window.location.pathname + window.location.search).substr(0, index);
    // Menu Meus Pacientes Ativo
    switch(paginaAtual) {
        case "/software-de-nutricao/buscar-paciente.jsp":
            $(".menu-pacientes").addClass("active");
            $(".menu-pacientes-buscar").addClass("active");
            break;
        case "/software-de-nutricao/novo-paciente.jsp":
        case "/software-de-nutricao/ServletController?action=EditarPaciente":
            $(".menu-pacientes").addClass("active");
            $(".menu-pacientes-cadastrar").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=PerfilNutricional":
        case "/software-de-nutricao/ServletController?action=Dashboard":
            $(".menu-pacientes").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=Alimentos":
            $(".menu-alimentos").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=Agenda":
            $(".menu-agenda").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=ListasSubstituicao":
            $(".menu-lista-subst").addClass("active");
            if(window.location.search == "?action=ListasSubstituicao&type=Buscar")
                $(".menu-lista-subst-buscar").addClass("active");
            else
                $(".menu-lista-subst-cadastrar").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=Suplementos":
            $(".menu-suplementos").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=Fitoterapicos":
            $(".menu-fitoterapicos").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=Logs":
            $(".menu-logs").addClass("active");
            break;
        case "/software-de-nutricao/ServletController?action=ModelosAlimentares":
            $(".menu-modelos-alimentares").addClass("active");
            break;
    }

    /********************************
     Src Modal Analise de Perfil
     ********************************/
    $("#modal-analise-de-perfil").on("shown.bs.modal", function(){
        if(!document.getElementById("iframe-questionario").src)
            document.getElementById("iframe-questionario").src = "https://docs.google.com/forms/d/10CX7c724CHtHkTTGIAGIqB5oJC1oKryzzT6NYnMGiyI/viewform?embedded=true";
    });
});


/********************************
 Toggle Full Screen
 ********************************/

function toggleFullScreen() {
    if ((document.fullScreenElement && document.fullScreenElement !== null) || (!document.mozFullScreen && !document.webkitIsFullScreen)) {
        if (document.documentElement.requestFullScreen) {
            document.documentElement.requestFullScreen();
        } else if (document.documentElement.mozRequestFullScreen) {
            document.documentElement.mozRequestFullScreen();
        } else if (document.documentElement.webkitRequestFullScreen) {
            document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
        }
    } else {
        if (document.cancelFullScreen) {
            document.cancelFullScreen();
        } else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
        } else if (document.webkitCancelFullScreen) {
            document.webkitCancelFullScreen();
        }
    }
}

/* *******************************
 Cortar Imagem Nutri
 ********************************/
function carregarAplicativos() {
    $.ajax({
        url: "ServletController?action=DadosAplicativo",
        type: "POST",
        data: {actionItem: "listarAplicativos"},
        success: function (result) {
            var apps = JSON.parse(result.replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/\r/g, "\\r"));
            apps = apps || [];
            listarAplicativos(apps);
        },
        error: function (err) {
            console.log("Error: " + err.status);
            console.log("Error Message: " + err.statusText);
        }
    });
}

function listarAplicativos(apps) {
    var list = document.getElementById("listApps"), divList, aItem;

    for (var i = 0; i < apps.length; i++) {
        divList = document.createElement("div");
        divList.setAttribute("class", "list-group  tooltip-btn");
        divList.setAttribute("data-toggle", "tooltip");
        divList.setAttribute("data-placement", "left");
        divList.setAttribute("data-original-title", apps[i].descricao);
        aItem = document.createElement("a");
        aItem.setAttribute("href", "#");
        aItem.setAttribute("data-link", apps[i].link);
        aItem.setAttribute("class", "list-group-item");
        aItem.innerHTML = "<div class='media'><div class='pull-left'>" +
            "<img class='media-object img-circle pull-left' src='http://nutrisoft.com.br/mobile_photos/icone_aplicativos/"+apps[i].id+".png' width='40' />" +
            "</div><div class='media-body'>" +
            "<h5 class='media-heading'>Aplicativo "+apps[i].titulo+"</h5>" +
            "<small class='text-muted'>Dispon�vel em: "+apps[i].disponivel+"</small>" +
            "</div></div>";
        aItem.addEventListener("click", function(event){
            event.preventDefault();
            var link = event.currentTarget.getAttribute("data-link");
            window.open(link, "_blank");
        });
        divList.appendChild(aItem);
        list.appendChild(divList);
    }

    /********************************
     tooltip
     ********************************/
    if ($.isFunction($.fn.tooltip)) {
        $(".tooltip-btn").tooltip();
    }
}

function verificarLimitePacientes(inserir) {
    var retorno = -1;
    $.ajax({
        url: "ServletController?action=VerificarLimitePacientes",
        type: "POST",
        data: {inserir: inserir},
        async: false,
        success: function (result) {
            if(result && !isNaN(result))
                retorno = Number(result);
            else
                retorno = -1;
        },
        error: function (err) {
            retorno = -1;
        }
    });
    return retorno;
}

function licencaExpirada(abrirModal) {
    if(verificarLimitePacientes() == 0) {
        if(abrirModal)
            $("#modal-licenca-profissional").modal();
        return true;
    }
    return false;
}

function openModalError(erro) {
    /*    openModalMessage("Desculpe, parece que sua internet caiu :( Verifique e tente novamente", "danger");
     logErroFront(erro);*/
}

/**
 * @param mensagem Obrigat�rio - Mensagem a ser exibida no modal
 * @param tipoMensagem Opcional - Tipo de Mensagem ("success", "warning", "danger")
 * @param tempoAberto Opcional - se incluido, fecha o modal apos tempo passado (em segundos)
 */
function openModalMessage(mensagem, tipoMensagem, tempoAberto) {
    if(!tipoMensagem)
        tipoMensagem = "info";
    var msg = document.getElementById("msg-modal-msg"),
        $modal = $("#modal-msg");
    if(!$modal[0])
        return;
    msg.innerHTML = mensagem;
    msg.parentNode.setAttribute("class", "alert alert-"+tipoMensagem);
    if(!$modal.hasClass("in"))
        $modal.modal();
    if(tempoAberto) {
        setTimeout(function() {
            $modal.modal("hide");
        }, tempoAberto * 1000);
    }
}

/**
 * Contador de caracteres para um textArea
 * @param textArea id do TextArea que vai ser contado
 * @param limite Tamanho maximo - Se nao definido, padrao eh 200
 * @param span id do Span pra printar os caracteres restantes
 * @param negativo permitir que numero fique negativo (mostra em vermelho no span)
 */
function contadorDeCaracteres(textArea, limite, span, negativo) {
    textArea = document.getElementById(textArea);
    span = document.getElementById(span);
    if(!textArea)
        return;
    if(!limite) limite = 200;
    textArea.onkeyup = function(){
        var tamanhoAtual = this.value.length,
            quebras = this.value.match(/\n/g),
            limiteQuebra = limite,
            caracteresRestantes;
        if(quebras) {
            tamanhoAtual += quebras.length;
            limiteQuebra -= quebras.length;
        }
        caracteresRestantes = limite - tamanhoAtual;
        if(caracteresRestantes < 0) {
            if(negativo) {
                $(span).parent().addClass("text-danger");
            } else {
                this.value = this.value.substr(0, limiteQuebra);
                caracteresRestantes = 0;
            }
        } else {
            $(span).parent().removeClass("text-danger");
        }
        span.innerHTML = caracteresRestantes;
    };
}

/**
 *
 * @param valor Valor numerico a ser mostrado
 * @param unidade Unidade para exibir apos o valor
 * @param casas Qtde de casas decimais
 * @returns Valor adaptado
 */
function getValor(valor, unidade, casas) {
    if(isNaN(valor) || valor == -1) return "-";
    valor = Number(valor);
    casas = (casas == undefined ? 2 : casas);
    return valor.toFixed(casas).replace(".",",") + " " + (unidade || "");
}



/* chosen.jquery.js  */
(function () {
    var f, a, g, d, e, b = {}.hasOwnProperty, c = function (k, i) {
        for (var h in i) {
            if (b.call(i, h)) {
                k[h] = i[h]
            }
        }
        function j() {
            this.constructor = k
        }

        j.prototype = i.prototype;
        k.prototype = new j();
        k.__super__ = i.prototype;
        return k
    };
    d = (function () {
        function h() {
            this.options_index = 0;
            this.parsed = []
        }

        h.prototype.add_node = function (i) {
            if (i.nodeName.toUpperCase() === "OPTGROUP") {
                return this.add_group(i)
            } else {
                return this.add_option(i)
            }
        };
        h.prototype.add_group = function (o) {
            var n, k, m, j, l, i;
            n = this.parsed.length;
            this.parsed.push({
                array_index: n,
                group: true,
                label: this.escapeExpression(o.label),
                children: 0,
                disabled: o.disabled
            });
            l = o.childNodes;
            i = [];
            for (m = 0, j = l.length; m < j; m++) {
                k = l[m];
                i.push(this.add_option(k, n, o.disabled))
            }
            return i
        };
        h.prototype.add_option = function (j, k, i) {
            if (j.nodeName.toUpperCase() === "OPTION") {
                if (j.text !== "") {
                    if (k != null) {
                        this.parsed[k].children += 1
                    }
                    this.parsed.push({
                        array_index: this.parsed.length,
                        options_index: this.options_index,
                        value: j.value,
                        text: j.text,
                        html: j.innerHTML,
                        selected: j.selected,
                        disabled: i === true ? i : j.disabled,
                        group_array_index: k,
                        classes: j.className,
                        style: j.style.cssText
                    })
                } else {
                    this.parsed.push({array_index: this.parsed.length, options_index: this.options_index, empty: true})
                }
                return this.options_index += 1
            }
        };
        h.prototype.escapeExpression = function (k) {
            var j, i;
            if ((k == null) || k === false) {
                return ""
            }
            if (!/[\&\<\>\"\'\`]/.test(k)) {
                return k
            }
            j = {"<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;"};
            i = /&(?!\w+;)|[\<\>\"\'\`]/g;
            return k.replace(i, function (l) {
                return j[l] || "&amp;"
            })
        };
        return h
    })();
    d.select_to_array = function (h) {
        var m, l, k, i, j;
        l = new d();
        j = h.childNodes;
        for (k = 0, i = j.length; k < i; k++) {
            m = j[k];
            l.add_node(m)
        }
        return l.parsed
    };
    a = (function () {
        function h(i, j) {
            this.form_field = i;
            this.options = j != null ? j : {};
            if (!h.browser_is_supported()) {
                return
            }
            this.is_multiple = this.form_field.multiple;
            this.set_default_text();
            this.set_default_values();
            this.setup();
            this.set_up_html();
            this.register_observers()
        }

        h.prototype.set_default_values = function () {
            var i = this;
            this.click_test_action = function (j) {
                return i.test_active_click(j)
            };
            this.activate_action = function (j) {
                return i.activate_field(j)
            };
            this.active_field = false;
            this.mouse_on_container = false;
            this.results_showing = false;
            this.result_highlighted = null;
            this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
            this.disable_search_threshold = this.options.disable_search_threshold || 0;
            this.disable_search = this.options.disable_search || false;
            this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
            this.group_search = this.options.group_search != null ? this.options.group_search : true;
            this.search_contains = this.options.search_contains || false;
            this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
            this.max_selected_options = this.options.max_selected_options || Infinity;
            this.inherit_select_classes = this.options.inherit_select_classes || false;
            this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
            return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true
        };
        h.prototype.set_default_text = function () {
            if (this.form_field.getAttribute("data-placeholder")) {
                this.default_text = this.form_field.getAttribute("data-placeholder")
            } else {
                if (this.is_multiple) {
                    this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || h.default_multiple_text
                } else {
                    this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || h.default_single_text
                }
            }
            return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || h.default_no_result_text
        };
        h.prototype.mouse_enter = function () {
            return this.mouse_on_container = true
        };
        h.prototype.mouse_leave = function () {
            return this.mouse_on_container = false
        };
        h.prototype.input_focus = function (i) {
            var j = this;
            if (this.is_multiple) {
                if (!this.active_field) {
                    return setTimeout((function () {
                        return j.container_mousedown()
                    }), 50)
                }
            } else {
                if (!this.active_field) {
                    return this.activate_field()
                }
            }
        };
        h.prototype.input_blur = function (i) {
            var j = this;
            if (!this.mouse_on_container) {
                this.active_field = false;
                return setTimeout((function () {
                    return j.blur_test()
                }), 100)
            }
        };
        h.prototype.results_option_build = function (j) {
            var k, n, m, i, l;
            k = "";
            l = this.results_data;
            for (m = 0, i = l.length; m < i; m++) {
                n = l[m];
                if (n.group) {
                    k += this.result_add_group(n)
                } else {
                    k += this.result_add_option(n)
                }
                if (j != null ? j.first : void 0) {
                    if (n.selected && this.is_multiple) {
                        this.choice_build(n)
                    } else {
                        if (n.selected && !this.is_multiple) {
                            this.single_set_selected_text(n.text)
                        }
                    }
                }
            }
            return k
        };
        h.prototype.result_add_option = function (k) {
            var j, i;
            if (!k.search_match) {
                return ""
            }
            if (!this.include_option_in_results(k)) {
                return ""
            }
            j = [];
            if (!k.disabled && !(k.selected && this.is_multiple)) {
                j.push("active-result")
            }
            if (k.disabled && !(k.selected && this.is_multiple)) {
                j.push("disabled-result")
            }
            if (k.selected) {
                j.push("result-selected")
            }
            if (k.group_array_index != null) {
                j.push("group-option")
            }
            if (k.classes !== "") {
                j.push(k.classes)
            }
            i = document.createElement("li");
            i.className = j.join(" ");
            i.style.cssText = k.style;
            i.setAttribute("data-option-array-index", k.array_index);
            i.innerHTML = k.search_text;
            return this.outerHTML(i)
        };
        h.prototype.result_add_group = function (j) {
            var i;
            if (!(j.search_match || j.group_match)) {
                return ""
            }
            if (!(j.active_options > 0)) {
                return ""
            }
            i = document.createElement("li");
            i.className = "group-result";
            i.innerHTML = j.search_text;
            return this.outerHTML(i)
        };
        h.prototype.results_update_field = function () {
            this.set_default_text();
            if (!this.is_multiple) {
                this.results_reset_cleanup()
            }
            this.result_clear_highlight();
            this.results_build();
            if (this.results_showing) {
                return this.winnow_results()
            }
        };
        h.prototype.reset_single_select_options = function () {
            var i, m, k, l, j;
            l = this.results_data;
            j = [];
            for (m = 0, k = l.length; m < k; m++) {
                i = l[m];
                if (i.selected) {
                    j.push(i.selected = false)
                } else {
                    j.push(void 0)
                }
            }
            return j
        };
        h.prototype.results_toggle = function () {
            if (this.results_showing) {
                return this.results_hide()
            } else {
                return this.results_show()
            }
        };
        h.prototype.results_search = function (i) {
            if (this.results_showing) {
                return this.winnow_results()
            } else {
                return this.results_show()
            }
        };
        h.prototype.winnow_results = function () {
            var t, n, q, m, i, s, o, r, j, k, p, l;
            this.no_results_clear();
            m = 0;
            s = this.get_search_text();
            t = s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
            j = new RegExp(t, "i");
            q = this.get_search_regex(t);
            l = this.results_data;
            for (k = 0, p = l.length; k < p; k++) {
                n = l[k];
                n.search_match = false;
                i = null;
                if (this.include_option_in_results(n)) {
                    if (n.group) {
                        n.group_match = false;
                        n.active_options = 0
                    }
                    if ((n.group_array_index != null) && this.results_data[n.group_array_index]) {
                        i = this.results_data[n.group_array_index];
                        if (i.active_options === 0 && i.search_match) {
                            m += 1
                        }
                        i.active_options += 1
                    }
                    if (!(n.group && !this.group_search)) {
                        n.search_text = n.group ? n.label : n.text;
                        n.search_match = this.search_string_match(n.search_text, q);
                        if (n.search_match && !n.group) {
                            m += 1
                        }
                        if (n.search_match) {
                            if (s.length) {
                                o = n.search_text.search(j);
                                r = n.search_text.substr(0, o + s.length) + "</em>" + n.search_text.substr(o + s.length);
                                n.search_text = r.substr(0, o) + "<em>" + r.substr(o)
                            }
                            if (i != null) {
                                i.group_match = true
                            }
                        } else {
                            if ((n.group_array_index != null) && this.results_data[n.group_array_index].search_match) {
                                n.search_match = true
                            }
                        }
                    }
                }
            }
            this.result_clear_highlight();
            if (m < 1 && s.length) {
                this.update_results_content("");
                return this.no_results(s)
            } else {
                this.update_results_content(this.results_option_build());
                return this.winnow_results_set_highlight()
            }
        };
        h.prototype.get_search_regex = function (j) {
            var i;
            i = this.search_contains ? "" : "^";
            return new RegExp(i + j, "i")
        };
        h.prototype.search_string_match = function (n, k) {
            var j, m, l, i;
            if (k.test(n)) {
                return true
            } else {
                if (this.enable_split_word_search && (n.indexOf(" ") >= 0 || n.indexOf("[") === 0)) {
                    m = n.replace(/\[|\]/g, "").split(" ");
                    if (m.length) {
                        for (l = 0, i = m.length; l < i; l++) {
                            j = m[l];
                            if (k.test(j)) {
                                return true
                            }
                        }
                    }
                }
            }
        };
        h.prototype.choices_count = function () {
            var j, l, i, k;
            if (this.selected_option_count != null) {
                return this.selected_option_count
            }
            this.selected_option_count = 0;
            k = this.form_field.options;
            for (l = 0, i = k.length; l < i; l++) {
                j = k[l];
                if (j.selected) {
                    this.selected_option_count += 1
                }
            }
            return this.selected_option_count
        };
        h.prototype.choices_click = function (i) {
            i.preventDefault();
            if (!(this.results_showing || this.is_disabled)) {
                return this.results_show()
            }
        };
        h.prototype.keyup_checker = function (i) {
            var k, j;
            k = (j = i.which) != null ? j : i.keyCode;
            this.search_field_scale();
            switch (k) {
                case 8:
                    if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
                        return this.keydown_backstroke()
                    } else {
                        if (!this.pending_backstroke) {
                            this.result_clear_highlight();
                            return this.results_search()
                        }
                    }
                    break;
                case 13:
                    i.preventDefault();
                    if (this.results_showing) {
                        return this.result_select(i)
                    }
                    break;
                case 27:
                    if (this.results_showing) {
                        this.results_hide()
                    }
                    return true;
                case 9:
                case 38:
                case 40:
                case 16:
                case 91:
                case 17:
                    break;
                default:
                    return this.results_search()
            }
        };
        h.prototype.clipboard_event_checker = function (i) {
            var j = this;
            return setTimeout((function () {
                return j.results_search()
            }), 50)
        };
        h.prototype.container_width = function () {
            if (this.options.width != null) {
                return this.options.width
            } else {
                return "" + this.form_field.offsetWidth + "px"
            }
        };
        h.prototype.include_option_in_results = function (i) {
            if (this.is_multiple && (!this.display_selected_options && i.selected)) {
                return false
            }
            if (!this.display_disabled_options && i.disabled) {
                return false
            }
            if (i.empty) {
                return false
            }
            return true
        };
        h.prototype.search_results_touchstart = function (i) {
            this.touch_started = true;
            return this.search_results_mouseover(i)
        };
        h.prototype.search_results_touchmove = function (i) {
            this.touch_started = false;
            return this.search_results_mouseout(i)
        };
        h.prototype.search_results_touchend = function (i) {
            if (this.touch_started) {
                return this.search_results_mouseup(i)
            }
        };
        h.prototype.outerHTML = function (j) {
            var i;
            if (j.outerHTML) {
                return j.outerHTML
            }
            i = document.createElement("div");
            i.appendChild(j);
            return i.innerHTML
        };
        h.browser_is_supported = function () {
            if (window.navigator.appName === "Microsoft Internet Explorer") {
                return document.documentMode >= 8
            }
            if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
                return false
            }
            if (/Android/i.test(window.navigator.userAgent)) {
                if (/Mobile/i.test(window.navigator.userAgent)) {
                    return false
                }
            }
            return true
        };
        h.default_multiple_text = "Select Some Options";
        h.default_single_text = "Select an Option";
        h.default_no_result_text = "No results match";
        return h
    })();
    f = jQuery;
    f.fn.extend({
        chosen: function (h) {
            if (!a.browser_is_supported()) {
                return this
            }
            return this.each(function (j) {
                var k, i;
                k = f(this);
                i = k.data("chosen");
                if (h === "destroy" && i instanceof g) {
                    i.destroy()
                } else {
                    if (!(i instanceof g)) {
                        k.data("chosen", new g(this, h))
                    }
                }
            })
        }
    });
    g = (function (h) {
        c(i, h);
        function i() {
            e = i.__super__.constructor.apply(this, arguments);
            return e
        }

        i.prototype.setup = function () {
            this.form_field_jq = f(this.form_field);
            this.current_selectedIndex = this.form_field.selectedIndex;
            return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl")
        };
        i.prototype.set_up_html = function () {
            var j, k;
            j = ["chosen-container"];
            j.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
            if (this.inherit_select_classes && this.form_field.className) {
                j.push(this.form_field.className)
            }
            if (this.is_rtl) {
                j.push("chosen-rtl")
            }
            k = {"class": j.join(" "), style: "width: " + (this.container_width()) + ";", title: this.form_field.title};
            if (this.form_field.id.length) {
                k.id = this.form_field.id.replace(/[^\w]/g, "_") + "_chosen"
            }
            this.container = f("<div />", k);
            if (this.is_multiple) {
                this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>')
            } else {
                this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>')
            }
            this.form_field_jq.hide().after(this.container);
            this.dropdown = this.container.find("div.chosen-drop").first();
            this.search_field = this.container.find("input").first();
            this.search_results = this.container.find("ul.chosen-results").first();
            this.search_field_scale();
            this.search_no_results = this.container.find("li.no-results").first();
            if (this.is_multiple) {
                this.search_choices = this.container.find("ul.chosen-choices").first();
                this.search_container = this.container.find("li.search-field").first()
            } else {
                this.search_container = this.container.find("div.chosen-search").first();
                this.selected_item = this.container.find(".chosen-single").first()
            }
            this.results_build();
            this.set_tab_index();
            this.set_label_behavior();
            return this.form_field_jq.trigger("chosen:ready", {chosen: this})
        };
        i.prototype.register_observers = function () {
            var j = this;
            this.container.bind("touchstart.chosen", function (k) {
                j.container_mousedown(k)
            });
            this.container.bind("touchend.chosen", function (k) {
                j.container_mouseup(k)
            });
            this.container.bind("mousedown.chosen", function (k) {
                j.container_mousedown(k)
            });
            this.container.bind("mouseup.chosen", function (k) {
                j.container_mouseup(k)
            });
            this.container.bind("mouseenter.chosen", function (k) {
                j.mouse_enter(k)
            });
            this.container.bind("mouseleave.chosen", function (k) {
                j.mouse_leave(k)
            });
            this.search_results.bind("mouseup.chosen", function (k) {
                j.search_results_mouseup(k)
            });
            this.search_results.bind("mouseover.chosen", function (k) {
                j.search_results_mouseover(k)
            });
            this.search_results.bind("mouseout.chosen", function (k) {
                j.search_results_mouseout(k)
            });
            this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen", function (k) {
                j.search_results_mousewheel(k)
            });
            this.search_results.bind("touchstart.chosen", function (k) {
                j.search_results_touchstart(k)
            });
            this.search_results.bind("touchmove.chosen", function (k) {
                j.search_results_touchmove(k)
            });
            this.search_results.bind("touchend.chosen", function (k) {
                j.search_results_touchend(k)
            });
            this.form_field_jq.bind("chosen:updated.chosen", function (k) {
                j.results_update_field(k)
            });
            this.form_field_jq.bind("chosen:activate.chosen", function (k) {
                j.activate_field(k)
            });
            this.form_field_jq.bind("chosen:open.chosen", function (k) {
                j.container_mousedown(k)
            });
            this.form_field_jq.bind("chosen:close.chosen", function (k) {
                j.input_blur(k)
            });
            this.search_field.bind("blur.chosen", function (k) {
                j.input_blur(k)
            });
            this.search_field.bind("keyup.chosen", function (k) {
                j.keyup_checker(k)
            });
            this.search_field.bind("keydown.chosen", function (k) {
                j.keydown_checker(k)
            });
            this.search_field.bind("focus.chosen", function (k) {
                j.input_focus(k)
            });
            this.search_field.bind("cut.chosen", function (k) {
                j.clipboard_event_checker(k)
            });
            this.search_field.bind("paste.chosen", function (k) {
                j.clipboard_event_checker(k)
            });
            if (this.is_multiple) {
                return this.search_choices.bind("click.chosen", function (k) {
                    j.choices_click(k)
                })
            } else {
                return this.container.bind("click.chosen", function (k) {
                    k.preventDefault()
                })
            }
        };
        i.prototype.destroy = function () {
            f(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
            if (this.search_field[0].tabIndex) {
                this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex
            }
            this.container.remove();
            this.form_field_jq.removeData("chosen");
            return this.form_field_jq.show()
        };
        i.prototype.search_field_disabled = function () {
            this.is_disabled = this.form_field_jq[0].disabled;
            if (this.is_disabled) {
                this.container.addClass("chosen-disabled");
                this.search_field[0].disabled = true;
                if (!this.is_multiple) {
                    this.selected_item.unbind("focus.chosen", this.activate_action)
                }
                return this.close_field()
            } else {
                this.container.removeClass("chosen-disabled");
                this.search_field[0].disabled = false;
                if (!this.is_multiple) {
                    return this.selected_item.bind("focus.chosen", this.activate_action)
                }
            }
        };
        i.prototype.container_mousedown = function (j) {
            if (!this.is_disabled) {
                if (j && j.type === "mousedown" && !this.results_showing) {
                    j.preventDefault()
                }
                if (!((j != null) && (f(j.target)).hasClass("search-choice-close"))) {
                    if (!this.active_field) {
                        if (this.is_multiple) {
                            this.search_field.val("")
                        }
                        f(this.container[0].ownerDocument).bind("click.chosen", this.click_test_action);
                        this.results_show()
                    } else {
                        if (!this.is_multiple && j && ((f(j.target)[0] === this.selected_item[0]) || f(j.target).parents("a.chosen-single").length)) {
                            j.preventDefault();
                            this.results_toggle()
                        }
                    }
                    return this.activate_field()
                }
            }
        };
        i.prototype.container_mouseup = function (j) {
            if (j.target.nodeName === "ABBR" && !this.is_disabled) {
                return this.results_reset(j)
            }
        };
        i.prototype.search_results_mousewheel = function (j) {
            var k;
            if (j.originalEvent) {
                k = j.originalEvent.deltaY || -j.originalEvent.wheelDelta || j.originalEvent.detail
            }
            if (k != null) {
                j.preventDefault();
                if (j.type === "DOMMouseScroll") {
                    k = k * 40
                }
                return this.search_results.scrollTop(k + this.search_results.scrollTop())
            }
        };
        i.prototype.blur_test = function (j) {
            if (!this.active_field && this.container.hasClass("chosen-container-active")) {
                return this.close_field()
            }
        };
        i.prototype.close_field = function () {
            f(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
            this.active_field = false;
            this.results_hide();
            this.container.removeClass("chosen-container-active");
            this.clear_backstroke();
            this.show_search_field_default();
            return this.search_field_scale()
        };
        i.prototype.activate_field = function () {
            this.container.addClass("chosen-container-active");
            this.active_field = true;
            this.search_field.val(this.search_field.val());
            return this.search_field.focus()
        };
        i.prototype.test_active_click = function (j) {
            var k;
            k = f(j.target).closest(".chosen-container");
            if (k.length && this.container[0] === k[0]) {
                return this.active_field = true
            } else {
                return this.close_field()
            }
        };
        i.prototype.results_build = function () {
            this.parsing = true;
            this.selected_option_count = null;
            this.results_data = d.select_to_array(this.form_field);
            if (this.is_multiple) {
                this.search_choices.find("li.search-choice").remove()
            } else {
                if (!this.is_multiple) {
                    this.single_set_selected_text();
                    if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
                        this.search_field[0].readOnly = true;
                        this.container.addClass("chosen-container-single-nosearch")
                    } else {
                        this.search_field[0].readOnly = false;
                        this.container.removeClass("chosen-container-single-nosearch")
                    }
                }
            }
            this.update_results_content(this.results_option_build({first: true}));
            this.search_field_disabled();
            this.show_search_field_default();
            this.search_field_scale();
            return this.parsing = false
        };
        i.prototype.result_do_highlight = function (k) {
            var o, n, l, m, j;
            if (k.length) {
                this.result_clear_highlight();
                this.result_highlight = k;
                this.result_highlight.addClass("highlighted");
                l = parseInt(this.search_results.css("maxHeight"), 10);
                j = this.search_results.scrollTop();
                m = l + j;
                n = this.result_highlight.position().top + this.search_results.scrollTop();
                o = n + this.result_highlight.outerHeight();
                if (o >= m) {
                    return this.search_results.scrollTop((o - l) > 0 ? o - l : 0)
                } else {
                    if (n < j) {
                        return this.search_results.scrollTop(n)
                    }
                }
            }
        };
        i.prototype.result_clear_highlight = function () {
            if (this.result_highlight) {
                this.result_highlight.removeClass("highlighted")
            }
            return this.result_highlight = null
        };
        i.prototype.results_show = function () {
            if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                this.form_field_jq.trigger("chosen:maxselected", {chosen: this});
                return false
            }
            this.container.addClass("chosen-with-drop");
            this.results_showing = true;
            this.search_field.focus();
            this.search_field.val(this.search_field.val());
            this.winnow_results();
            return this.form_field_jq.trigger("chosen:showing_dropdown", {chosen: this})
        };
        i.prototype.update_results_content = function (j) {
            return this.search_results.html(j)
        };
        i.prototype.results_hide = function () {
            if (this.results_showing) {
                this.result_clear_highlight();
                this.container.removeClass("chosen-with-drop");
                this.form_field_jq.trigger("chosen:hiding_dropdown", {chosen: this})
            }
            return this.results_showing = false
        };
        i.prototype.set_tab_index = function (k) {
            var j;
            if (this.form_field.tabIndex) {
                j = this.form_field.tabIndex;
                this.form_field.tabIndex = -1;
                return this.search_field[0].tabIndex = j
            }
        };
        i.prototype.set_label_behavior = function () {
            var j = this;
            this.form_field_label = this.form_field_jq.parents("label");
            if (!this.form_field_label.length && this.form_field.id.length) {
                this.form_field_label = f("label[for='" + this.form_field.id + "']")
            }
            if (this.form_field_label.length > 0) {
                return this.form_field_label.bind("click.chosen", function (k) {
                    if (j.is_multiple) {
                        return j.container_mousedown(k)
                    } else {
                        return j.activate_field()
                    }
                })
            }
        };
        i.prototype.show_search_field_default = function () {
            if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
                this.search_field.val(this.default_text);
                return this.search_field.addClass("default")
            } else {
                this.search_field.val("");
                return this.search_field.removeClass("default")
            }
        };
        i.prototype.search_results_mouseup = function (j) {
            var k;
            k = f(j.target).hasClass("active-result") ? f(j.target) : f(j.target).parents(".active-result").first();
            if (k.length) {
                this.result_highlight = k;
                this.result_select(j);
                return this.search_field.focus()
            }
        };
        i.prototype.search_results_mouseover = function (j) {
            var k;
            k = f(j.target).hasClass("active-result") ? f(j.target) : f(j.target).parents(".active-result").first();
            if (k) {
                return this.result_do_highlight(k)
            }
        };
        i.prototype.search_results_mouseout = function (j) {
            if (f(j.target).hasClass("active-result" || f(j.target).parents(".active-result").first())) {
                return this.result_clear_highlight()
            }
        };
        i.prototype.choice_build = function (k) {
            var j, l, m = this;
            j = f("<li />", {"class": "search-choice"}).html("<span>" + k.html + "</span>");
            if (k.disabled) {
                j.addClass("search-choice-disabled")
            } else {
                l = f("<a />", {"class": "search-choice-close", "data-option-array-index": k.array_index});
                l.bind("click.chosen", function (n) {
                    return m.choice_destroy_link_click(n)
                });
                j.append(l)
            }
            return this.search_container.before(j)
        };
        i.prototype.choice_destroy_link_click = function (j) {
            j.preventDefault();
            j.stopPropagation();
            if (!this.is_disabled) {
                return this.choice_destroy(f(j.target))
            }
        };
        i.prototype.choice_destroy = function (j) {
            if (this.result_deselect(j[0].getAttribute("data-option-array-index"))) {
                this.show_search_field_default();
                if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
                    this.results_hide()
                }
                j.parents("li").first().remove();
                return this.search_field_scale()
            }
        };
        i.prototype.results_reset = function () {
            this.reset_single_select_options();
            this.form_field.options[0].selected = true;
            this.single_set_selected_text();
            this.show_search_field_default();
            this.results_reset_cleanup();
            this.form_field_jq.trigger("change");
            if (this.active_field) {
                return this.results_hide()
            }
        };
        i.prototype.results_reset_cleanup = function () {
            this.current_selectedIndex = this.form_field.selectedIndex;
            return this.selected_item.find("abbr").remove()
        };
        i.prototype.result_select = function (j) {
            var l, k;
            if (this.result_highlight) {
                l = this.result_highlight;
                this.result_clear_highlight();
                if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
                    this.form_field_jq.trigger("chosen:maxselected", {chosen: this});
                    return false
                }
                if (this.is_multiple) {
                    l.removeClass("active-result")
                } else {
                    this.reset_single_select_options()
                }
                k = this.results_data[l[0].getAttribute("data-option-array-index")];
                k.selected = true;
                this.form_field.options[k.options_index].selected = true;
                this.selected_option_count = null;
                if (this.is_multiple) {
                    this.choice_build(k)
                } else {
                    this.single_set_selected_text(k.text)
                }
                if (!((j.metaKey || j.ctrlKey) && this.is_multiple)) {
                    this.results_hide()
                }
                this.search_field.val("");
                if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
                    this.form_field_jq.trigger("change", {selected: this.form_field.options[k.options_index].value})
                }
                this.current_selectedIndex = this.form_field.selectedIndex;
                return this.search_field_scale()
            }
        };
        i.prototype.single_set_selected_text = function (j) {
            if (j == null) {
                j = this.default_text
            }
            if (j === this.default_text) {
                this.selected_item.addClass("chosen-default")
            } else {
                this.single_deselect_control_build();
                this.selected_item.removeClass("chosen-default")
            }
            return this.selected_item.find("span").text(j)
        };
        i.prototype.result_deselect = function (k) {
            var j;
            j = this.results_data[k];
            if (!this.form_field.options[j.options_index].disabled) {
                j.selected = false;
                this.form_field.options[j.options_index].selected = false;
                this.selected_option_count = null;
                this.result_clear_highlight();
                if (this.results_showing) {
                    this.winnow_results()
                }
                this.form_field_jq.trigger("change", {deselected: this.form_field.options[j.options_index].value});
                this.search_field_scale();
                return true
            } else {
                return false
            }
        };
        i.prototype.single_deselect_control_build = function () {
            if (!this.allow_single_deselect) {
                return
            }
            if (!this.selected_item.find("abbr").length) {
                this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')
            }
            return this.selected_item.addClass("chosen-single-with-deselect")
        };
        i.prototype.get_search_text = function () {
            if (this.search_field.val() === this.default_text) {
                return ""
            } else {
                return f("<div/>").text(f.trim(this.search_field.val())).html()
            }
        };
        i.prototype.winnow_results_set_highlight = function () {
            var j, k;
            k = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
            j = k.length ? k.first() : this.search_results.find(".active-result").first();
            if (j != null) {
                return this.result_do_highlight(j)
            }
        };
        i.prototype.no_results = function (j) {
            var k;
            k = f('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
            k.find("span").first().html(j);
            this.search_results.append(k);
            return this.form_field_jq.trigger("chosen:no_results", {chosen: this})
        };
        i.prototype.no_results_clear = function () {
            return this.search_results.find(".no-results").remove()
        };
        i.prototype.keydown_arrow = function () {
            var j;
            if (this.results_showing && this.result_highlight) {
                j = this.result_highlight.nextAll("li.active-result").first();
                if (j) {
                    return this.result_do_highlight(j)
                }
            } else {
                return this.results_show()
            }
        };
        i.prototype.keyup_arrow = function () {
            var j;
            if (!this.results_showing && !this.is_multiple) {
                return this.results_show()
            } else {
                if (this.result_highlight) {
                    j = this.result_highlight.prevAll("li.active-result");
                    if (j.length) {
                        return this.result_do_highlight(j.first())
                    } else {
                        if (this.choices_count() > 0) {
                            this.results_hide()
                        }
                        return this.result_clear_highlight()
                    }
                }
            }
        };
        i.prototype.keydown_backstroke = function () {
            var j;
            if (this.pending_backstroke) {
                this.choice_destroy(this.pending_backstroke.find("a").first());
                return this.clear_backstroke()
            } else {
                j = this.search_container.siblings("li.search-choice").last();
                if (j.length && !j.hasClass("search-choice-disabled")) {
                    this.pending_backstroke = j;
                    if (this.single_backstroke_delete) {
                        return this.keydown_backstroke()
                    } else {
                        return this.pending_backstroke.addClass("search-choice-focus")
                    }
                }
            }
        };
        i.prototype.clear_backstroke = function () {
            if (this.pending_backstroke) {
                this.pending_backstroke.removeClass("search-choice-focus")
            }
            return this.pending_backstroke = null
        };
        i.prototype.keydown_checker = function (k) {
            var l, j;
            l = (j = k.which) != null ? j : k.keyCode;
            this.search_field_scale();
            if (l !== 8 && this.pending_backstroke) {
                this.clear_backstroke()
            }
            switch (l) {
                case 8:
                    this.backstroke_length = this.search_field.val().length;
                    break;
                case 9:
                    if (this.results_showing && !this.is_multiple) {
                        this.result_select(k)
                    }
                    this.mouse_on_container = false;
                    break;
                case 13:
                    if (this.results_showing) {
                        k.preventDefault()
                    }
                    break;
                case 32:
                    if (this.disable_search) {
                        k.preventDefault()
                    }
                    break;
                case 38:
                    k.preventDefault();
                    this.keyup_arrow();
                    break;
                case 40:
                    k.preventDefault();
                    this.keydown_arrow();
                    break
            }
        };
        i.prototype.search_field_scale = function () {
            var j, n, m, k, q, r, p, l, o;
            if (this.is_multiple) {
                m = 0;
                p = 0;
                q = "position:absolute; left: -1000px; top: -1000px; display:none;";
                r = ["font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"];
                for (l = 0, o = r.length; l < o; l++) {
                    k = r[l];
                    q += k + ":" + this.search_field.css(k) + ";"
                }
                j = f("<div />", {style: q});
                j.text(this.search_field.val());
                f("body").append(j);
                p = j.width() + 25;
                j.remove();
                n = this.container.outerWidth();
                if (p > n - 10) {
                    p = n - 10
                }
                return this.search_field.css({width: p + "px"})
            }
        };
        return i
    })(a)
}).call(this);

/* jquery.inputmask.bundle.js  */
!function (a) {
    function b(a) {
        var b = document.createElement("input"), c = "on" + a, d = c in b;
        return d || (b.setAttribute(c, "return;"), d = "function" == typeof b[c]), b = null, d
    }

    function c(a) {
        var b = document.createElement("input");
        b.setAttribute("type", a);
        var c = "text" !== b.type;
        return b = null, c
    }

    function d(b, c, e) {
        var f = e.aliases[b];
        return f ? (f.alias && d(f.alias, void 0, e), a.extend(!0, e, f), a.extend(!0, e, c), !0) : !1
    }

    function e(b, c) {
        function d(a) {
            function c(a, b, c, d) {
                this.matches = [], this.isGroup = a || !1, this.isOptional = b || !1, this.isQuantifier = c || !1, this.isAlternator = d || !1, this.quantifier = {
                    min: 1,
                    max: 1
                }
            }

            function d(a, c, d) {
                var e = b.definitions[c], f = 0 == a.matches.length;
                if (d = void 0 != d ? d : a.matches.length, e && !l) {
                    for (var g = e.prevalidator, h = g ? g.length : 0, i = 1; i < e.cardinality; i++) {
                        var j = h >= i ? g[i - 1] : [], k = j.validator, m = j.cardinality;
                        a.matches.splice(d++, 0, {
                            fn: k ? "string" == typeof k ? new RegExp(k) : new function () {
                                        this.test = k
                                    } : new RegExp("."),
                            cardinality: m ? m : 1,
                            optionality: a.isOptional,
                            newBlockMarker: f,
                            casing: e.casing,
                            def: e.definitionSymbol || c,
                            placeholder: e.placeholder,
                            mask: c
                        })
                    }
                    a.matches.splice(d++, 0, {
                        fn: e.validator ? "string" == typeof e.validator ? new RegExp(e.validator) : new function () {
                                    this.test = e.validator
                                } : new RegExp("."),
                        cardinality: e.cardinality,
                        optionality: a.isOptional,
                        newBlockMarker: f,
                        casing: e.casing,
                        def: e.definitionSymbol || c,
                        placeholder: e.placeholder,
                        mask: c
                    })
                } else a.matches.splice(d++, 0, {
                    fn: null,
                    cardinality: 0,
                    optionality: a.isOptional,
                    newBlockMarker: f,
                    casing: null,
                    def: c,
                    placeholder: void 0,
                    mask: c
                }), l = !1
            }

            for (var e, f, g, h, i, j, k = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g, l = !1, m = new c, n = [], o = []; e = k.exec(a);)switch (f = e[0], f.charAt(0)) {
                case b.optionalmarker.end:
                case b.groupmarker.end:
                    if (g = n.pop(), n.length > 0) {
                        if (h = n[n.length - 1], h.matches.push(g), h.isAlternator) {
                            i = n.pop();
                            for (var p = 0; p < i.matches.length; p++)i.matches[p].isGroup = !1;
                            n.length > 0 ? (h = n[n.length - 1], h.matches.push(i)) : m.matches.push(i)
                        }
                    } else m.matches.push(g);
                    break;
                case b.optionalmarker.start:
                    n.push(new c(!1, !0));
                    break;
                case b.groupmarker.start:
                    n.push(new c(!0));
                    break;
                case b.quantifiermarker.start:
                    var q = new c(!1, !1, !0);
                    f = f.replace(/[{}]/g, "");
                    var r = f.split(","), s = isNaN(r[0]) ? r[0] : parseInt(r[0]), t = 1 == r.length ? s : isNaN(r[1]) ? r[1] : parseInt(r[1]);
                    if (("*" == t || "+" == t) && (s = "*" == t ? 0 : 1), q.quantifier = {
                            min: s,
                            max: t
                        }, n.length > 0) {
                        var u = n[n.length - 1].matches;
                        if (e = u.pop(), !e.isGroup) {
                            var v = new c(!0);
                            v.matches.push(e), e = v
                        }
                        u.push(e), u.push(q)
                    } else {
                        if (e = m.matches.pop(), !e.isGroup) {
                            var v = new c(!0);
                            v.matches.push(e), e = v
                        }
                        m.matches.push(e), m.matches.push(q)
                    }
                    break;
                case b.escapeChar:
                    l = !0;
                    break;
                case b.alternatormarker:
                    n.length > 0 ? (h = n[n.length - 1], j = h.matches.pop()) : j = m.matches.pop(), j.isAlternator ? n.push(j) : (i = new c(!1, !1, !1, !0), i.matches.push(j), n.push(i));
                    break;
                default:
                    if (n.length > 0) {
                        if (h = n[n.length - 1], h.matches.length > 0 && (j = h.matches[h.matches.length - 1], j.isGroup && (j.isGroup = !1, d(j, b.groupmarker.start, 0), d(j, b.groupmarker.end))), d(h, f), h.isAlternator) {
                            i = n.pop();
                            for (var p = 0; p < i.matches.length; p++)i.matches[p].isGroup = !1;
                            n.length > 0 ? (h = n[n.length - 1], h.matches.push(i)) : m.matches.push(i)
                        }
                    } else m.matches.length > 0 && (j = m.matches[m.matches.length - 1], j.isGroup && (j.isGroup = !1, d(j, b.groupmarker.start, 0), d(j, b.groupmarker.end))), d(m, f)
            }
            return m.matches.length > 0 && (j = m.matches[m.matches.length - 1], j.isGroup && (j.isGroup = !1, d(j, b.groupmarker.start, 0), d(j, b.groupmarker.end)), o.push(m)), o
        }

        function e(c, e) {
            if (b.numericInput && b.multi !== !0) {
                c = c.split("").reverse();
                for (var f = 0; f < c.length; f++)c[f] == b.optionalmarker.start ? c[f] = b.optionalmarker.end : c[f] == b.optionalmarker.end ? c[f] = b.optionalmarker.start : c[f] == b.groupmarker.start ? c[f] = b.groupmarker.end : c[f] == b.groupmarker.end && (c[f] = b.groupmarker.start);
                c = c.join("")
            }
            if (void 0 == c || "" == c)return void 0;
            if (b.repeat > 0 || "*" == b.repeat || "+" == b.repeat) {
                var g = "*" == b.repeat ? 0 : "+" == b.repeat ? 1 : b.repeat;
                c = b.groupmarker.start + c + b.groupmarker.end + b.quantifiermarker.start + g + "," + b.repeat + b.quantifiermarker.end
            }
            return void 0 == a.inputmask.masksCache[c] && (a.inputmask.masksCache[c] = {
                mask: c,
                maskToken: d(c),
                validPositions: {},
                _buffer: void 0,
                buffer: void 0,
                tests: {},
                metadata: e
            }), a.extend(!0, {}, a.inputmask.masksCache[c])
        }

        var f = [];
        if (a.isFunction(b.mask) && (b.mask = b.mask.call(this, b)), a.isArray(b.mask))if (c)a.each(b.mask, function (b, c) {
            f.push(void 0 == c.mask || a.isFunction(c.mask) ? e(c.toString(), c) : e(c.mask.toString(), c))
        }); else {
            b.keepStatic = void 0 == b.keepStatic ? !0 : b.keepStatic;
            var g = "(";
            a.each(b.mask, function (b, c) {
                g.length > 1 && (g += ")|("), g += void 0 == c.mask || a.isFunction(c.mask) ? c.toString() : c.mask.toString()
            }), g += ")", f = e(g, b.mask)
        } else 1 == b.mask.length && 0 == b.greedy && 0 != b.repeat && (b.placeholder = ""), f = void 0 == b.mask.mask || a.isFunction(b.mask.mask) ? e(b.mask.toString(), b.mask) : e(b.mask.mask.toString(), b.mask);
        return f
    }

    function f(b, d, e) {
        function f(a, b, c) {
            b = b || 0;
            var d, f, g, i = [], j = 0;
            do {
                if (a === !0 && h().validPositions[j]) {
                    var k = h().validPositions[j];
                    f = k.match, d = k.locator.slice(), i.push(null == f.fn ? f.def : c === !0 ? k.input : f.placeholder || e.placeholder.charAt(j % e.placeholder.length))
                } else {
                    if (b > j) {
                        var l = v(j, d, j - 1);
                        g = l[0]
                    } else g = s(j, d, j - 1);
                    f = g.match, d = g.locator.slice(), i.push(null == f.fn ? f.def : void 0 != f.placeholder ? f.placeholder : e.placeholder.charAt(j % e.placeholder.length))
                }
                j++
            } while ((void 0 == eb || eb > j - 1) && null != f.fn || null == f.fn && "" != f.def || b >= j);
            return i.pop(), i
        }

        function h() {
            return d
        }

        function o(a) {
            var b = h();
            b.buffer = void 0, b.tests = {}, a !== !0 && (b._buffer = void 0, b.validPositions = {}, b.p = 0)
        }

        function p(a) {
            var b = h(), c = -1, d = b.validPositions;
            void 0 == a && (a = -1);
            var e = c, f = c;
            for (var g in d) {
                var i = parseInt(g);
                (-1 == a || null != d[i].match.fn) && (a > i && (e = i), i >= a && (f = i))
            }
            return c = a - e > 1 || a > f ? e : f
        }

        function q(b, c, d) {
            if (e.insertMode && void 0 != h().validPositions[b] && void 0 == d) {
                var f, g = a.extend(!0, {}, h().validPositions), i = p();
                for (f = b; i >= f; f++)delete h().validPositions[f];
                h().validPositions[b] = c;
                var j = !0;
                for (f = b; i >= f; f++) {
                    var k = g[f];
                    if (void 0 != k) {
                        var l = null == k.match.fn ? f + 1 : D(f);
                        j = u(l, k.match.def) ? j && A(l, k.input, !0, !0) !== !1 : !1
                    }
                    if (!j)break
                }
                if (!j)return h().validPositions = a.extend(!0, {}, g), !1
            } else h().validPositions[b] = c;
            return !0
        }

        function r(a, b) {
            var c, d = a;
            for (void 0 != h().validPositions[a] && h().validPositions[a].input == e.radixPoint && (b++, d++), c = d; b > c; c++)void 0 == h().validPositions[c] || h().validPositions[c].input == e.radixPoint && c != p() || delete h().validPositions[c];
            for (c = b; c <= p();) {
                var f = h().validPositions[c], g = h().validPositions[d];
                void 0 != f && void 0 == g ? (u(d, f.match.def) && A(d, f.input, !0) !== !1 && (delete h().validPositions[c], c++), d++) : c++
            }
            var i = p();
            i >= a && void 0 != h().validPositions[i] && h().validPositions[i].input == e.radixPoint && delete h().validPositions[i], o(!0)
        }

        function s(b, c, d) {
            for (var f, g = v(b, c, d), i = p(), j = h().validPositions[i] || v(0)[0], k = void 0 != j.alternation ? j.locator[j.alternation].split(",") : [], l = 0; l < g.length && (f = g[l], !e.greedy && (!f.match || f.match.optionality !== !1 && f.match.newBlockMarker !== !1 || f.match.optionalQuantifier === !0 || void 0 != j.alternation && (void 0 == f.locator[j.alternation] || -1 != a.inArray(f.locator[j.alternation].toString(), k)))); l++);
            return f
        }

        function t(a) {
            return h().validPositions[a] ? h().validPositions[a].match : v(a)[0].match
        }

        function u(a, b) {
            for (var c = !1, d = v(a), e = 0; e < d.length; e++)if (d[e].match && d[e].match.def == b) {
                c = !0;
                break
            }
            return c
        }

        function v(b, c, d) {
            function f(c, d, g, j) {
                function m(g, j, o) {
                    if (i > 1e4)return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + h().mask), !0;
                    if (i == b && void 0 == g.matches)return k.push({match: g, locator: j.reverse()}), !0;
                    if (void 0 != g.matches) {
                        if (g.isGroup && o !== !0) {
                            if (g = m(c.matches[n + 1], j))return !0
                        } else if (g.isOptional) {
                            var p = g;
                            if (g = f(g, d, j, o)) {
                                var q = k[k.length - 1].match, r = 0 == a.inArray(q, p.matches);
                                r && (l = !0), i = b
                            }
                        } else if (g.isAlternator) {
                            var s, t = g, u = [], v = k.slice(), w = j.length, x = d.length > 0 ? d.shift() : -1;
                            if (-1 == x || "string" == typeof x) {
                                var y, z = i, A = d.slice();
                                "string" == typeof x && (y = x.split(","));
                                for (var B = 0; B < t.matches.length; B++) {
                                    k = [], g = m(t.matches[B], [B].concat(j), o) || g, s = k.slice(), i = z, k = [];
                                    for (var C = 0; C < A.length; C++)d[C] = A[C];
                                    for (var D = 0; D < s.length; D++)for (var E = s[D], F = 0; F < u.length; F++) {
                                        var G = u[F];
                                        if (E.match.mask == G.match.mask && ("string" != typeof x || -1 != a.inArray(E.locator[w].toString(), y))) {
                                            s.splice(D, 1), G.locator[w] = G.locator[w] + "," + E.locator[w], G.alternation = w;
                                            break
                                        }
                                    }
                                    u = u.concat(s)
                                }
                                "string" == typeof x && (u = a.map(u, function (b, c) {
                                    if (isFinite(c)) {
                                        var d, e = b.locator[w].toString().split(",");
                                        b.locator[w] = void 0, b.alternation = void 0;
                                        for (var f = 0; f < e.length; f++)d = -1 != a.inArray(e[f], y), d && (void 0 != b.locator[w] ? (b.locator[w] += ",", b.alternation = w, b.locator[w] += e[f]) : b.locator[w] = parseInt(e[f]));
                                        if (void 0 != b.locator[w])return b
                                    }
                                })), k = v.concat(u), l = !0
                            } else g = m(t.matches[x], [x].concat(j), o);
                            if (g)return !0
                        } else if (g.isQuantifier && o !== !0) {
                            var H = g;
                            e.greedy = e.greedy && isFinite(H.quantifier.max);
                            for (var I = d.length > 0 && o !== !0 ? d.shift() : 0; I < (isNaN(H.quantifier.max) ? I + 1 : H.quantifier.max) && b >= i; I++) {
                                var J = c.matches[a.inArray(H, c.matches) - 1];
                                if (g = m(J, [I].concat(j), !0)) {
                                    var q = k[k.length - 1].match;
                                    q.optionalQuantifier = I > H.quantifier.min - 1;
                                    var r = 0 == a.inArray(q, J.matches);
                                    if (r) {
                                        if (I > H.quantifier.min - 1) {
                                            l = !0, i = b;
                                            break
                                        }
                                        return !0
                                    }
                                    return !0
                                }
                            }
                        } else if (g = f(g, d, j, o))return !0
                    } else i++
                }

                for (var n = d.length > 0 ? d.shift() : 0; n < c.matches.length; n++)if (c.matches[n].isQuantifier !== !0) {
                    var o = m(c.matches[n], [n].concat(g), j);
                    if (o && i == b)return o;
                    if (i > b)break
                }
            }

            var g = h().maskToken, i = c ? d : 0, j = c || [0], k = [], l = !1;
            if (void 0 == c) {
                for (var m, n = b - 1; void 0 == (m = h().validPositions[n]) && n > -1;)n--;
                if (void 0 != m && n > -1)i = n, j = m.locator.slice(); else {
                    for (n = b - 1; void 0 == (m = h().tests[n]) && n > -1;)n--;
                    void 0 != m && n > -1 && (i = n, j = m[0].locator.slice())
                }
            }
            for (var o = j.shift(); o < g.length; o++) {
                var p = f(g[o], j, [o]);
                if (p && i == b || i > b)break
            }
            return (0 == k.length || l) && k.push({
                match: {
                    fn: null,
                    cardinality: 0,
                    optionality: !0,
                    casing: null,
                    def: ""
                }, locator: []
            }), h().tests[b] = a.extend(!0, [], k), h().tests[b]
        }

        function w() {
            return void 0 == h()._buffer && (h()._buffer = f(!1, 1)), h()._buffer
        }

        function x() {
            return void 0 == h().buffer && (h().buffer = f(!0, p(), !0)), h().buffer
        }

        function y(a, b) {
            var c = x().slice();
            if (a === !0)o(), a = 0, b = c.length; else for (var d = a; b > d; d++)delete h().validPositions[d], delete h().tests[d];
            for (var d = a; b > d; d++)c[d] != e.skipOptionalPartCharacter && A(d, c[d], !0, !0)
        }

        function z(a, b) {
            switch (b.casing) {
                case"upper":
                    a = a.toUpperCase();
                    break;
                case"lower":
                    a = a.toLowerCase()
            }
            return a
        }

        function A(b, c, d, f) {
            function g(b, c, d, f) {
                var g = !1;
                return a.each(v(b), function (i, j) {
                    for (var k = j.match, l = c ? 1 : 0, m = "", n = (x(), k.cardinality); n > l; n--)m += F(b - (n - 1));
                    if (c && (m += c), g = null != k.fn ? k.fn.test(m, h(), b, d, e) : c != k.def && c != e.skipOptionalPartCharacter || "" == k.def ? !1 : {
                                    c: k.def,
                                    pos: b
                                }, g !== !1) {
                        var s = void 0 != g.c ? g.c : c;
                        s = s == e.skipOptionalPartCharacter && null === k.fn ? k.def : s;
                        var t = b;
                        if (void 0 != g.remove && r(g.remove, g.remove + 1), g.refreshFromBuffer) {
                            var u = g.refreshFromBuffer;
                            if (d = !0, y(u === !0 ? u : u.start, u.end), void 0 == g.pos && void 0 == g.c)return g.pos = p(), !1;
                            if (t = void 0 != g.pos ? g.pos : b, t != b)return g = a.extend(g, A(t, s, !0)), !1
                        } else if (g !== !0 && void 0 != g.pos && g.pos != b && (t = g.pos, y(b, t), t != b))return g = a.extend(g, A(t, s, !0)), !1;
                        return 1 != g && void 0 == g.pos && void 0 == g.c ? !1 : (i > 0 && o(!0), q(t, a.extend({}, j, {input: z(s, k)}), f) || (g = !1), !1)
                    }
                }), g
            }

            function i(b, c, d, f) {
                if (e.keepStatic) {
                    var g, i, j = a.extend(!0, {}, h().validPositions);
                    for (g = p(); g >= 0; g--)if (h().validPositions[g] && void 0 != h().validPositions[g].alternation) {
                        i = h().validPositions[g].alternation;
                        break
                    }
                    if (void 0 != i)for (var k in h().validPositions)if (parseInt(k) > parseInt(g) && void 0 === h().validPositions[k].alternation) {
                        for (var l = h().validPositions[k], m = l.locator[i], n = h().validPositions[g].locator[i].split(","), q = 0; q < n.length; q++)if (m < n[q]) {
                            for (var r, s, t = k - 1; t >= 0; t--)if (r = h().validPositions[t], void 0 != r) {
                                s = r.locator[i], r.locator[i] = n[q];
                                break
                            }
                            if (m != r.locator[i]) {
                                for (var u = x().slice(), v = k; v < p() + 1; v++)delete h().validPositions[v], delete h().tests[v];
                                o(!0), e.keepStatic = !e.keepStatic;
                                for (var v = k; v < u.length; v++)u[v] != e.skipOptionalPartCharacter && A(p() + 1, u[v], !1, !0);
                                r.locator[i] = s;
                                var w = p() + 1 == b && A(b, c, d, f);
                                if (e.keepStatic = !e.keepStatic, w)return w;
                                o(), h().validPositions = a.extend(!0, {}, j)
                            }
                        }
                        break
                    }
                }
                return !1
            }

            d = d === !0;
            for (var j = x(), k = b - 1; k > -1 && (!h().validPositions[k] || null != h().validPositions[k].match.fn); k--)void 0 == h().validPositions[k] && (!B(k) || j[k] != H(k)) && v(k).length > 1 && g(k, j[k], !0);
            var l = b;
            if (l >= C()) {
                if (!f)return i(b, c, d, f);
                if (o(!0), l >= C())return i(b, c, d, f)
            }
            var m = g(l, c, d, f);
            if (!d && m === !1) {
                var n = h().validPositions[l];
                if (!n || null != n.match.fn || n.match.def != c && c != e.skipOptionalPartCharacter) {
                    if ((e.insertMode || void 0 == h().validPositions[D(l)]) && !B(l))for (var s = l + 1, t = D(l); t >= s; s++)if (m = g(s, c, d, f), m !== !1) {
                        l = s;
                        break
                    }
                } else m = {caret: D(l)}
            }
            return m === !0 && (m = {pos: l}), m
        }

        function B(a) {
            var b = t(a);
            return null != b.fn ? b.fn : !1
        }

        function C() {
            var a;
            if (eb = db.prop("maxLength"), -1 == eb && (eb = void 0), 0 == e.greedy) {
                var b, c = p(), d = h().validPositions[c], f = void 0 != d ? d.locator.slice() : void 0;
                for (b = c + 1; void 0 == d || null != d.match.fn || null == d.match.fn && "" != d.match.def; b++)d = s(b, f, b - 1), f = d.locator.slice();
                a = b
            } else a = x().length;
            return void 0 == eb || eb > a ? a : eb
        }

        function D(a) {
            var b = C();
            if (a >= b)return b;
            for (var c = a; ++c < b && !B(c) && (e.nojumps !== !0 || e.nojumpsThreshold > c););
            return c
        }

        function E(a) {
            var b = a;
            if (0 >= b)return 0;
            for (; --b > 0 && !B(b););
            return b
        }

        function F(a) {
            return void 0 == h().validPositions[a] ? H(a) : h().validPositions[a].input
        }

        function G(a, b, c) {
            a._valueSet(b.join("")), void 0 != c && N(a, c)
        }

        function H(a, b) {
            return b = b || t(a), b.placeholder || (null == b.fn ? b.def : e.placeholder.charAt(a % e.placeholder.length))
        }

        function I(b, c, d, f, g) {
            var i = void 0 != f ? f.slice() : K(b._valueGet()).split("");
            if (o(), c && b._valueSet(""), a.each(i, function (c, e) {
                    if (g === !0) {
                        var f = p(), i = -1 == f ? c : D(f);
                        -1 == a.inArray(e, w().slice(f + 1, i)) && X.call(b, void 0, !0, e.charCodeAt(0), !1, d, d ? c : h().p)
                    } else X.call(b, void 0, !0, e.charCodeAt(0), !1, d, d ? c : h().p), d = d || c > 0 && c > h().p
                }), c) {
                var j = e.onKeyPress.call(this, void 0, x(), 0, e);
                V(b, j), G(b, x(), a(b).is(":focus") ? D(p(0)) : void 0)
            }
        }

        function J(b) {
            return a.inputmask.escapeRegex.call(this, b)
        }

        function K(a) {
            return a.replace(new RegExp("(" + J(w().join("")) + ")*$"), "")
        }

        function L(b) {
            if (b.data("_inputmask") && !b.hasClass("hasDatepicker")) {
                var c = [], d = h().validPositions;
                for (var f in d)d[f].match && null != d[f].match.fn && c.push(d[f].input);
                var g = (fb ? c.reverse() : c).join(""), i = (fb ? x().slice().reverse() : x()).join("");
                return a.isFunction(e.onUnMask) && (g = e.onUnMask.call(b, i, g, e)), g
            }
            return b[0]._valueGet()
        }

        function M(a) {
            if (fb && "number" == typeof a && (!e.greedy || "" != e.placeholder)) {
                var b = x().length;
                a = b - a
            }
            return a
        }

        function N(b, c, d) {
            var f, g = b.jquery && b.length > 0 ? b[0] : b;
            if ("number" != typeof c) {
                var h = a(g).data("_inputmask");
                return !a(g).is(":visible") && h && void 0 != h.caret ? (c = h.caret.begin, d = h.caret.end) : g.setSelectionRange ? (c = g.selectionStart, d = g.selectionEnd) : document.selection && document.selection.createRange && (f = document.selection.createRange(), c = 0 - f.duplicate().moveStart("character", -1e5), d = c + f.text.length), c = M(c), d = M(d), {
                    begin: c,
                    end: d
                }
            }
            c = M(c), d = M(d), d = "number" == typeof d ? d : c;
            var h = a(g).data("_inputmask") || {};
            h.caret = {
                begin: c,
                end: d
            }, a(g).data("_inputmask", h), a(g).is(":visible") && (g.scrollLeft = g.scrollWidth, 0 == e.insertMode && c == d && d++, g.setSelectionRange ? (g.selectionStart = c, g.selectionEnd = d) : g.createTextRange && (f = g.createTextRange(), f.collapse(!0), f.moveEnd("character", d), f.moveStart("character", c), f.select()))
        }

        function O(b) {
            var c, d, e = x(), f = e.length, g = p(), i = {}, j = h().validPositions[g], k = void 0 != j ? j.locator.slice() : void 0;
            for (c = g + 1; c < e.length; c++)d = s(c, k, c - 1), k = d.locator.slice(), i[c] = a.extend(!0, {}, d);
            var l = j && void 0 != j.alternation ? j.locator[j.alternation].split(",") : [];
            for (c = f - 1; c > g && (d = i[c].match, (d.optionality || d.optionalQuantifier || j && void 0 != j.alternation && void 0 != i[c].locator[j.alternation] && -1 != a.inArray(i[c].locator[j.alternation].toString(), l)) && e[c] == H(c, d)); c--)f--;
            return b ? {l: f, def: i[f] ? i[f].match : void 0} : f
        }

        function P(a) {
            for (var b = x(), c = b.slice(), d = O(), e = c.length - 1; e > d && !B(e); e--);
            c.splice(d, e + 1 - d), G(a, c)
        }

        function Q(b) {
            if (a.isFunction(e.isComplete))return e.isComplete.call(db, b, e);
            if ("*" == e.repeat)return void 0;
            var c = !1, d = O(!0), f = E(d.l), g = p();
            if (g == f && (void 0 == d.def || d.def.newBlockMarker || d.def.optionalQuantifier)) {
                c = !0;
                for (var h = 0; f >= h; h++) {
                    var i = B(h);
                    if (i && (void 0 == b[h] || b[h] == H(h)) || !i && b[h] != H(h)) {
                        c = !1;
                        break
                    }
                }
            }
            return c
        }

        function R(a, b) {
            return fb ? a - b > 1 || a - b == 1 && e.insertMode : b - a > 1 || b - a == 1 && e.insertMode
        }

        function S(b) {
            var c = a._data(b).events;
            a.each(c, function (b, c) {
                a.each(c, function (a, b) {
                    if ("inputmask" == b.namespace && "setvalue" != b.type) {
                        var c = b.handler;
                        b.handler = function (a) {
                            return this.readOnly || this.disabled ? void a.preventDefault : c.apply(this, arguments)
                        }
                    }
                })
            })
        }

        function T(b) {
            function c(b) {
                if (void 0 == a.valHooks[b] || 1 != a.valHooks[b].inputmaskpatch) {
                    var c = a.valHooks[b] && a.valHooks[b].get ? a.valHooks[b].get : function (a) {
                            return a.value
                        }, d = a.valHooks[b] && a.valHooks[b].set ? a.valHooks[b].set : function (a, b) {
                            return a.value = b, a
                        };
                    a.valHooks[b] = {
                        get: function (b) {
                            var d = a(b);
                            if (d.data("_inputmask")) {
                                if (d.data("_inputmask").opts.autoUnmask)return d.inputmask("unmaskedvalue");
                                var e = c(b), f = d.data("_inputmask"), g = f.maskset, h = g._buffer;
                                return h = h ? h.join("") : "", e != h ? e : ""
                            }
                            return c(b)
                        }, set: function (b, c) {
                            var e, f = a(b), g = f.data("_inputmask");
                            return g ? (e = d(b, a.isFunction(g.opts.onBeforeMask) ? g.opts.onBeforeMask.call(nb, c, g.opts) : c), f.triggerHandler("setvalue.inputmask")) : e = d(b, c), e
                        }, inputmaskpatch: !0
                    }
                }
            }

            function d() {
                var b = a(this), c = a(this).data("_inputmask");
                return c ? c.opts.autoUnmask ? b.inputmask("unmaskedvalue") : g.call(this) != w().join("") ? g.call(this) : "" : g.call(this)
            }

            function e(b) {
                var c = a(this).data("_inputmask");
                c ? (h.call(this, a.isFunction(c.opts.onBeforeMask) ? c.opts.onBeforeMask.call(nb, b, c.opts) : b), a(this).triggerHandler("setvalue.inputmask")) : h.call(this, b)
            }

            function f(b) {
                a(b).bind("mouseenter.inputmask", function () {
                    var b = a(this), c = this, d = c._valueGet();
                    "" != d && d != x().join("") && b.trigger("setvalue")
                });
                var c = a._data(b).events, d = c.mouseover;
                if (d) {
                    for (var e = d[d.length - 1], f = d.length - 1; f > 0; f--)d[f] = d[f - 1];
                    d[0] = e
                }
            }

            var g, h;
            if (!b._valueGet) {
                if (Object.getOwnPropertyDescriptor) {
                    Object.getOwnPropertyDescriptor(b, "value")
                }
                document.__lookupGetter__ && b.__lookupGetter__("value") ? (g = b.__lookupGetter__("value"), h = b.__lookupSetter__("value"), b.__defineGetter__("value", d), b.__defineSetter__("value", e)) : (g = function () {
                        return b.value
                    }, h = function (a) {
                        b.value = a
                    }, c(b.type), f(b)), b._valueGet = function () {
                    return fb ? g.call(this).split("").reverse().join("") : g.call(this)
                }, b._valueSet = function (a) {
                    h.call(this, fb ? a.split("").reverse().join("") : a)
                }
            }
        }

        function U(a, b, c) {
            if ((e.numericInput || fb) && (b == e.keyCode.BACKSPACE ? b = e.keyCode.DELETE : b == e.keyCode.DELETE && (b = e.keyCode.BACKSPACE), fb)) {
                var d = c.end;
                c.end = c.begin, c.begin = d
            }
            b == e.keyCode.BACKSPACE && c.end - c.begin <= 1 ? c.begin = E(c.begin) : b == e.keyCode.DELETE && c.begin == c.end && c.end++, r(c.begin, c.end);
            var f = p(c.begin);
            h().p = f < c.begin ? D(f) : c.begin
        }

        function V(a, b, c) {
            if (b && b.refreshFromBuffer) {
                var d = b.refreshFromBuffer;
                y(d === !0 ? d : d.start, d.end), o(!0), void 0 != c && (G(a, x()), N(a, b.caret || c.begin, b.caret || c.end))
            }
        }

        function W(b) {
            gb = !1;
            var c = this, d = a(c), f = b.keyCode, g = N(c);
            f == e.keyCode.BACKSPACE || f == e.keyCode.DELETE || i && 127 == f || b.ctrlKey && 88 == f ? (b.preventDefault(), 88 == f && (cb = x().join("")), U(c, f, g), G(c, x(), h().p), c._valueGet() == w().join("") && d.trigger("cleared"), e.showTooltip && d.prop("title", h().mask)) : f == e.keyCode.END || f == e.keyCode.PAGE_DOWN ? setTimeout(function () {
                        var a = D(p());
                        e.insertMode || a != C() || b.shiftKey || a--, N(c, b.shiftKey ? g.begin : a, a)
                    }, 0) : f == e.keyCode.HOME && !b.shiftKey || f == e.keyCode.PAGE_UP ? N(c, 0, b.shiftKey ? g.begin : 0) : f == e.keyCode.ESCAPE || 90 == f && b.ctrlKey ? (I(c, !0, !1, cb.split("")), d.click()) : f != e.keyCode.INSERT || b.shiftKey || b.ctrlKey ? 0 != e.insertMode || b.shiftKey || (f == e.keyCode.RIGHT ? setTimeout(function () {
                                        var a = N(c);
                                        N(c, a.begin)
                                    }, 0) : f == e.keyCode.LEFT && setTimeout(function () {
                                        var a = N(c);
                                        N(c, fb ? a.begin + 1 : a.begin - 1)
                                    }, 0)) : (e.insertMode = !e.insertMode, N(c, e.insertMode || g.begin != C() ? g.begin : g.begin - 1));
            var j = N(c), k = e.onKeyDown.call(this, b, x(), j.begin, e);
            V(c, k, j), ib = -1 != a.inArray(f, e.ignorables)
        }

        function X(b, c, d, f, g, i) {
            if (void 0 == d && gb)return !1;
            gb = !0;
            var j = this, k = a(j);
            b = b || window.event;
            var d = c ? d : b.which || b.charCode || b.keyCode;
            if (!(c === !0 || b.ctrlKey && b.altKey) && (b.ctrlKey || b.metaKey || ib))return !0;
            if (d) {
                c !== !0 && 46 == d && 0 == b.shiftKey && "," == e.radixPoint && (d = 44);
                var l, m = c ? {begin: i, end: i} : N(j), n = String.fromCharCode(d), p = R(m.begin, m.end);
                p && (h().undoPositions = a.extend(!0, {}, h().validPositions), U(j, e.keyCode.DELETE, m), e.insertMode || (e.insertMode = !e.insertMode, q(m.begin, g), e.insertMode = !e.insertMode), p = !e.multi), h().writeOutBuffer = !0;
                var r = fb && !p ? m.end : m.begin, s = A(r, n, g);
                if (s !== !1) {
                    if (s !== !0 && (r = void 0 != s.pos ? s.pos : r, n = void 0 != s.c ? s.c : n), o(!0), void 0 != s.caret)l = s.caret; else {
                        var t = h().validPositions;
                        l = !e.keepStatic && (void 0 != t[r + 1] && v(r + 1, t[r].locator.slice(), r).length > 1 || void 0 != t[r].alternation) ? r + 1 : D(r)
                    }
                    h().p = l
                }
                if (f !== !1) {
                    var u = this;
                    if (setTimeout(function () {
                            e.onKeyValidation.call(u, s, e)
                        }, 0), h().writeOutBuffer && s !== !1) {
                        var w = x();
                        G(j, w, c ? void 0 : e.numericInput ? E(l) : l), c !== !0 && setTimeout(function () {
                            Q(w) === !0 && k.trigger("complete"), hb = !0, k.trigger("input")
                        }, 0)
                    } else p && (h().buffer = void 0, h().validPositions = h().undoPositions)
                } else p && (h().buffer = void 0, h().validPositions = h().undoPositions);
                if (e.showTooltip && k.prop("title", h().mask), b && 1 != c) {
                    b.preventDefault();
                    var y = N(j), z = e.onKeyPress.call(this, b, x(), y.begin, e);
                    V(j, z, y)
                }
            }
        }

        function Y(b) {
            var c = a(this), d = this, f = b.keyCode, g = x(), h = N(d), i = e.onKeyUp.call(this, b, g, h.begin, e);
            V(d, i, h), f == e.keyCode.TAB && e.showMaskOnFocus && (c.hasClass("focus-inputmask") && 0 == d._valueGet().length ? (o(), g = x(), G(d, g), N(d, 0), cb = x().join("")) : (G(d, g), N(d, M(0), M(C()))))
        }

        function Z(b) {
            if (hb === !0 && "input" == b.type)return hb = !1, !0;
            var c = this, d = a(c), f = c._valueGet();
            if ("propertychange" == b.type && c._valueGet().length <= C())return !0;
            "paste" == b.type && (window.clipboardData && window.clipboardData.getData ? f = window.clipboardData.getData("Text") : b.originalEvent && b.originalEvent.clipboardData && b.originalEvent.clipboardData.getData && (f = b.originalEvent.clipboardData.getData("text/plain")));
            var g = a.isFunction(e.onBeforePaste) ? e.onBeforePaste.call(c, f, e) : f;
            return I(c, !0, !1, fb ? g.split("").reverse() : g.split(""), !0), d.click(), Q(x()) === !0 && d.trigger("complete"), !1
        }

        function $(a) {
            if (hb === !0 && "input" == a.type)return hb = !1, !0;
            var b = this, c = N(b), d = b._valueGet();
            d = d.replace(new RegExp("(" + J(w().join("")) + ")*"), ""), c.begin > d.length && (N(b, d.length), c = N(b)), x().length - d.length != 1 || d.charAt(c.begin) == x()[c.begin] || d.charAt(c.begin + 1) == x()[c.begin] || B(c.begin) || (a.keyCode = e.keyCode.BACKSPACE, W.call(b, a)), a.preventDefault()
        }

        function _(b) {
            if (hb === !0 && "input" == b.type)return hb = !1, !0;
            var c = this, d = N(c), f = c._valueGet();
            N(c, d.begin - 1);
            var g = a.Event("keypress");
            g.which = f.charCodeAt(d.begin - 1), gb = !1, ib = !1, X.call(c, g, void 0, void 0, !1);
            var i = h().p;
            G(c, x(), e.numericInput ? E(i) : i), b.preventDefault()
        }

        function ab(b) {
            hb = !0;
            var c = this;
            return setTimeout(function () {
                N(c, N(c).begin - 1);
                var d = a.Event("keypress");
                d.which = b.originalEvent.data.charCodeAt(0), gb = !1, ib = !1, X.call(c, d, void 0, void 0, !1);
                var f = h().p;
                G(c, x(), e.numericInput ? E(f) : f)
            }, 0), !1
        }

        function bb(b) {
            if (db = a(b), db.is(":input") && !c(db.attr("type"))) {
                if (db.data("_inputmask", {
                        maskset: d,
                        opts: e,
                        isRTL: !1
                    }), e.showTooltip && db.prop("title", h().mask), ("rtl" == b.dir || e.rightAlign) && db.css("text-align", "right"), "rtl" == b.dir || e.numericInput) {
                    b.dir = "ltr", db.removeAttr("dir");
                    var f = db.data("_inputmask");
                    f.isRTL = !0, db.data("_inputmask", f), fb = !0
                }
                db.unbind(".inputmask"), db.removeClass("focus-inputmask"), db.closest("form").bind("submit", function () {
                    cb != x().join("") && db.change(), db[0]._valueGet && db[0]._valueGet() == w().join("") && db[0]._valueSet(""), e.autoUnmask && e.removeMaskOnSubmit && db.inputmask("remove")
                }).bind("reset", function () {
                    setTimeout(function () {
                        db.trigger("setvalue")
                    }, 0)
                }), db.bind("mouseenter.inputmask", function () {
                    var b = a(this), c = this;
                    !b.hasClass("focus-inputmask") && e.showMaskOnHover && c._valueGet() != x().join("") && G(c, x())
                }).bind("blur.inputmask", function () {
                    var b = a(this), c = this;
                    if (b.data("_inputmask")) {
                        var d = c._valueGet(), f = x();
                        b.removeClass("focus-inputmask"), cb != x().join("") && b.change(), e.clearMaskOnLostFocus && "" != d && (d == w().join("") ? c._valueSet("") : P(c)), Q(f) === !1 && (b.trigger("incomplete"), e.clearIncomplete && (o(), e.clearMaskOnLostFocus ? c._valueSet("") : (f = w().slice(), G(c, f))))
                    }
                }).bind("focus.inputmask", function () {
                    var b = a(this), c = this, d = c._valueGet();
                    e.showMaskOnFocus && !b.hasClass("focus-inputmask") && (!e.showMaskOnHover || e.showMaskOnHover && "" == d) && c._valueGet() != x().join("") && G(c, x(), D(p())), b.addClass("focus-inputmask"), cb = x().join("")
                }).bind("mouseleave.inputmask", function () {
                    var b = a(this), c = this;
                    e.clearMaskOnLostFocus && (b.hasClass("focus-inputmask") || c._valueGet() == b.attr("placeholder") || (c._valueGet() == w().join("") || "" == c._valueGet() ? c._valueSet("") : P(c)))
                }).bind("click.inputmask", function () {
                    var b = this;
                    a(b).is(":focus") && setTimeout(function () {
                        var c = N(b);
                        if (c.begin == c.end) {
                            var d = fb ? M(c.begin) : c.begin, f = p(d), g = D(f);
                            g >= d ? B(d) ? N(b, d) : N(b, -1 == f && "" != e.radixPoint ? a.inArray(e.radixPoint, x()) : D(d)) : N(b, g)
                        }
                    }, 0)
                }).bind("dblclick.inputmask", function () {
                    var a = this;
                    setTimeout(function () {
                        N(a, 0, D(p()))
                    }, 0)
                }).bind(n + ".inputmask dragdrop.inputmask drop.inputmask", Z).bind("setvalue.inputmask", function () {
                    var a = this;
                    I(a, !0, !1, void 0, !0), cb = x().join(""), (e.clearMaskOnLostFocus || e.clearIncomplete) && a._valueGet() == w().join("") && a._valueSet("")
                }).bind("complete.inputmask", e.oncomplete).bind("incomplete.inputmask", e.onincomplete).bind("cleared.inputmask", e.oncleared), db.bind("keydown.inputmask", W).bind("keypress.inputmask", X).bind("keyup.inputmask", Y).bind("compositionupdate.inputmask", ab), "paste" !== n || g || db.bind("input.inputmask", _), g && db.bind("input.inputmask", Z), (j || l || k || m) && ("input" == n && db.unbind(n + ".inputmask"), db.bind("input.inputmask", $)), T(b);
                var i = a.isFunction(e.onBeforeMask) ? e.onBeforeMask.call(b, b._valueGet(), e) : b._valueGet();
                I(b, !0, !1, i.split(""), !0), cb = x().join("");
                var q;
                try {
                    q = document.activeElement
                } catch (r) {
                }
                Q(x()) === !1 && e.clearIncomplete && o(), e.clearMaskOnLostFocus ? x().join("") == w().join("") ? b._valueSet("") : P(b) : G(b, x()), q === b && (db.addClass("focus-inputmask"), N(b, D(p()))), S(b)
            }
        }

        var cb, db, eb, fb = !1, gb = !1, hb = !1, ib = !1;
        if (void 0 != b)switch (b.action) {
            case"isComplete":
                return db = a(b.el), d = db.data("_inputmask").maskset, e = db.data("_inputmask").opts, Q(b.buffer);
            case"unmaskedvalue":
                return db = b.$input, d = db.data("_inputmask").maskset, e = db.data("_inputmask").opts, fb = b.$input.data("_inputmask").isRTL, L(b.$input);
            case"mask":
                cb = x().join(""), bb(b.el);
                break;
            case"format":
                db = a({}), db.data("_inputmask", {
                    maskset: d,
                    opts: e,
                    isRTL: e.numericInput
                }), e.numericInput && (fb = !0);
                var jb = (a.isFunction(e.onBeforeMask) ? e.onBeforeMask.call(db, b.value, e) : b.value).split("");
                return I(db, !1, !1, fb ? jb.reverse() : jb, !0), e.onKeyPress.call(this, void 0, x(), 0, e), b.metadata ? {
                        value: fb ? x().slice().reverse().join("") : x().join(""),
                        metadata: db.inputmask("getmetadata")
                    } : fb ? x().slice().reverse().join("") : x().join("");
            case"isValid":
                db = a({}), db.data("_inputmask", {
                    maskset: d,
                    opts: e,
                    isRTL: e.numericInput
                }), e.numericInput && (fb = !0);
                var jb = b.value.split("");
                I(db, !1, !0, fb ? jb.reverse() : jb);
                for (var kb = x(), lb = O(), mb = kb.length - 1; mb > lb && !B(mb); mb--);
                return kb.splice(lb, mb + 1 - lb), Q(kb) && b.value == kb.join("");
            case"getemptymask":
                return db = a(b.el), d = db.data("_inputmask").maskset, e = db.data("_inputmask").opts, w();
            case"remove":
                var nb = b.el;
                db = a(nb), d = db.data("_inputmask").maskset, e = db.data("_inputmask").opts, nb._valueSet(L(db)), db.unbind(".inputmask"), db.removeClass("focus-inputmask"), db.removeData("_inputmask");
                var ob;
                Object.getOwnPropertyDescriptor && (ob = Object.getOwnPropertyDescriptor(nb, "value")), ob && ob.get ? nb._valueGet && Object.defineProperty(nb, "value", {
                        get: nb._valueGet,
                        set: nb._valueSet
                    }) : document.__lookupGetter__ && nb.__lookupGetter__("value") && nb._valueGet && (nb.__defineGetter__("value", nb._valueGet), nb.__defineSetter__("value", nb._valueSet));
                try {
                    delete nb._valueGet, delete nb._valueSet
                } catch (pb) {
                    nb._valueGet = void 0, nb._valueSet = void 0
                }
                break;
            case"getmetadata":
                if (db = a(b.el), d = db.data("_inputmask").maskset, e = db.data("_inputmask").opts, a.isArray(d.metadata)) {
                    for (var qb, rb = p(), sb = rb; sb >= 0; sb--)if (h().validPositions[sb] && void 0 != h().validPositions[sb].alternation) {
                        qb = h().validPositions[sb].alternation;
                        break
                    }
                    return void 0 != qb ? d.metadata[h().validPositions[rb].locator[qb]] : d.metadata[0]
                }
                return d.metadata
        }
    }

    if (void 0 === a.fn.inputmask) {
        var g = "function" == typeof ScriptEngineMajorVersion ? ScriptEngineMajorVersion() : new Function("/*@cc_on return @_jscript_version; @*/")() >= 10, h = navigator.userAgent, i = null !== h.match(new RegExp("iphone", "i")), j = null !== h.match(new RegExp("android.*safari.*", "i")), k = null !== h.match(new RegExp("android.*chrome.*", "i")), l = null !== h.match(new RegExp("android.*firefox.*", "i")), m = /Kindle/i.test(h) || /Silk/i.test(h) || /KFTT/i.test(h) || /KFOT/i.test(h) || /KFJWA/i.test(h) || /KFJWI/i.test(h) || /KFSOWI/i.test(h) || /KFTHWA/i.test(h) || /KFTHWI/i.test(h) || /KFAPWA/i.test(h) || /KFAPWI/i.test(h), n = b("paste") ? "paste" : b("input") ? "input" : "propertychange";
        a.inputmask = {
            defaults: {
                placeholder: "_",
                optionalmarker: {start: "[", end: "]"},
                quantifiermarker: {start: "{", end: "}"},
                groupmarker: {start: "(", end: ")"},
                alternatormarker: "|",
                escapeChar: "\\",
                mask: null,
                oncomplete: a.noop,
                onincomplete: a.noop,
                oncleared: a.noop,
                repeat: 0,
                greedy: !0,
                autoUnmask: !1,
                removeMaskOnSubmit: !0,
                clearMaskOnLostFocus: !0,
                insertMode: !0,
                clearIncomplete: !1,
                aliases: {},
                alias: null,
                onKeyUp: a.noop,
                onKeyPress: a.noop,
                onKeyDown: a.noop,
                onBeforeMask: void 0,
                onBeforePaste: void 0,
                onUnMask: void 0,
                showMaskOnFocus: !0,
                showMaskOnHover: !0,
                onKeyValidation: a.noop,
                skipOptionalPartCharacter: " ",
                showTooltip: !1,
                numericInput: !1,
                rightAlign: !1,
                radixPoint: "",
                nojumps: !1,
                nojumpsThreshold: 0,
                keepStatic: void 0,
                definitions: {
                    9: {validator: "[0-9]", cardinality: 1, definitionSymbol: "*"},
                    a: {validator: "[A-Za-z�?-�?�?ёÀ-ÿµ]", cardinality: 1, definitionSymbol: "*"},
                    "*": {validator: "[0-9A-Za-z�?-�?�?ёÀ-ÿµ]", cardinality: 1}
                },
                keyCode: {
                    ALT: 18,
                    BACKSPACE: 8,
                    CAPS_LOCK: 20,
                    COMMA: 188,
                    COMMAND: 91,
                    COMMAND_LEFT: 91,
                    COMMAND_RIGHT: 93,
                    CONTROL: 17,
                    DELETE: 46,
                    DOWN: 40,
                    END: 35,
                    ENTER: 13,
                    ESCAPE: 27,
                    HOME: 36,
                    INSERT: 45,
                    LEFT: 37,
                    MENU: 93,
                    NUMPAD_ADD: 107,
                    NUMPAD_DECIMAL: 110,
                    NUMPAD_DIVIDE: 111,
                    NUMPAD_ENTER: 108,
                    NUMPAD_MULTIPLY: 106,
                    NUMPAD_SUBTRACT: 109,
                    PAGE_DOWN: 34,
                    PAGE_UP: 33,
                    PERIOD: 190,
                    RIGHT: 39,
                    SHIFT: 16,
                    SPACE: 32,
                    TAB: 9,
                    UP: 38,
                    WINDOWS: 91
                },
                ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123],
                isComplete: void 0
            }, masksCache: {}, escapeRegex: function (a) {
                var b = ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\"];
                return a.replace(new RegExp("(\\" + b.join("|\\") + ")", "gim"), "\\$1")
            }, format: function (b, c, g) {
                var h = a.extend(!0, {}, a.inputmask.defaults, c);
                return d(h.alias, c, h), f({action: "format", value: b, metadata: g}, e(h), h)
            }, isValid: function (b, c) {
                var g = a.extend(!0, {}, a.inputmask.defaults, c);
                return d(g.alias, c, g), f({action: "isValid", value: b}, e(g), g)
            }
        }, a.fn.inputmask = function (b, c, g, h, i) {
            function j(b, c) {
                var d = a(b);
                for (var e in c) {
                    var f = d.data("inputmask-" + e.toLowerCase());
                    void 0 != f && (c[e] = f)
                }
                return c
            }

            g = g || f, h = h || "_inputmask";
            var k, l = a.extend(!0, {}, a.inputmask.defaults, c);
            if ("string" == typeof b)switch (b) {
                case"mask":
                    return j(this, l), d(l.alias, c, l), k = e(l, g !== f), 0 == k.length ? this : this.each(function () {
                            g({action: "mask", el: this}, a.extend(!0, {}, k), l)
                        });
                case"unmaskedvalue":
                    var m = a(this);
                    return m.data(h) ? g({action: "unmaskedvalue", $input: m}) : m.val();
                case"remove":
                    return this.each(function () {
                        var b = a(this);
                        b.data(h) && g({action: "remove", el: this})
                    });
                case"getemptymask":
                    return this.data(h) ? g({action: "getemptymask", el: this}) : "";
                case"hasMaskedValue":
                    return this.data(h) ? !this.data(h).opts.autoUnmask : !1;
                case"isComplete":
                    return this.data(h) ? g({
                            action: "isComplete",
                            buffer: this[0]._valueGet().split(""),
                            el: this
                        }) : !0;
                case"getmetadata":
                    return this.data(h) ? g({action: "getmetadata", el: this}) : void 0;
                case"_detectScope":
                    return d(l.alias, c, l), void 0 == i || d(i, c, l) || -1 != a.inArray(i, ["mask", "unmaskedvalue", "remove", "getemptymask", "hasMaskedValue", "isComplete", "getmetadata", "_detectScope"]) || (l.mask = i), a.isFunction(l.mask) && (l.mask = l.mask.call(this, l)), a.isArray(l.mask);
                default:
                    return j(this, l), d(l.alias, c, l), d(b, c, l) || (l.mask = b), k = e(l, g !== f), void 0 == k ? this : this.each(function () {
                            g({action: "mask", el: this}, a.extend(!0, {}, k), l)
                        })
            } else {
                if ("object" == typeof b)return l = a.extend(!0, {}, a.inputmask.defaults, b), j(this, l), d(l.alias, b, l), k = e(l, g !== f), void 0 == k ? this : this.each(function () {
                        g({action: "mask", el: this}, a.extend(!0, {}, k), l)
                    });
                if (void 0 == b)return this.each(function () {
                    var b = a(this).attr("data-inputmask");
                    if (b && "" != b)try {
                        b = b.replace(new RegExp("'", "g"), '"');
                        var e = a.parseJSON("{" + b + "}");
                        a.extend(!0, e, c), l = a.extend(!0, {}, a.inputmask.defaults, e), d(l.alias, e, l), l.alias = void 0, a(this).inputmask("mask", l, g)
                    } catch (f) {
                    }
                    (a(this).attr("data-inputmask-mask") || a(this).attr("data-inputmask-alias")) && a(this).inputmask("mask", {}, g)
                })
            }
        }
    }
    return a.fn.inputmask
}(jQuery), function (a) {
    return a.extend(a.inputmask.defaults.definitions, {
        h: {
            validator: "[01][0-9]|2[0-3]",
            cardinality: 2,
            prevalidator: [{validator: "[0-2]", cardinality: 1}]
        },
        s: {validator: "[0-5][0-9]", cardinality: 2, prevalidator: [{validator: "[0-5]", cardinality: 1}]},
        d: {validator: "0[1-9]|[12][0-9]|3[01]", cardinality: 2, prevalidator: [{validator: "[0-3]", cardinality: 1}]},
        m: {validator: "0[1-9]|1[012]", cardinality: 2, prevalidator: [{validator: "[01]", cardinality: 1}]},
        y: {
            validator: "(19|20)\\d{2}",
            cardinality: 4,
            prevalidator: [{validator: "[12]", cardinality: 1}, {
                validator: "(19|20)",
                cardinality: 2
            }, {validator: "(19|20)\\d", cardinality: 3}]
        }
    }), a.extend(a.inputmask.defaults.aliases, {
        "dd/mm/yyyy": {
            mask: "1/2/y",
            placeholder: "dd/mm/yyyy",
            regex: {
                val1pre: new RegExp("[0-3]"), val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), val2pre: function (b) {
                    var c = a.inputmask.escapeRegex.call(this, b);
                    return new RegExp("((0[1-9]|[12][0-9]|3[01])" + c + "[01])")
                }, val2: function (b) {
                    var c = a.inputmask.escapeRegex.call(this, b);
                    return new RegExp("((0[1-9]|[12][0-9])" + c + "(0[1-9]|1[012]))|(30" + c + "(0[13-9]|1[012]))|(31" + c + "(0[13578]|1[02]))")
                }
            },
            leapday: "29/02/",
            separator: "/",
            yearrange: {minyear: 1900, maxyear: 2099},
            isInYearRange: function (a, b, c) {
                if (isNaN(a))return !1;
                var d = parseInt(a.concat(b.toString().slice(a.length))), e = parseInt(a.concat(c.toString().slice(a.length)));
                return (isNaN(d) ? !1 : d >= b && c >= d) || (isNaN(e) ? !1 : e >= b && c >= e)
            },
            determinebaseyear: function (a, b, c) {
                var d = (new Date).getFullYear();
                if (a > d)return a;
                if (d > b) {
                    for (var e = b.toString().slice(0, 2), f = b.toString().slice(2, 4); e + c > b;)e--;
                    var g = e + f;
                    return a > g ? a : g
                }
                return d
            },
            onKeyUp: function (b, c, d, e) {
                var f = a(this);
                if (b.ctrlKey && b.keyCode == e.keyCode.RIGHT) {
                    var g = new Date;
                    f.val(g.getDate().toString() + (g.getMonth() + 1).toString() + g.getFullYear().toString())
                }
            },
            definitions: {
                1: {
                    validator: function (a, b, c, d, e) {
                        var f = e.regex.val1.test(a);
                        return d || f || a.charAt(1) != e.separator && -1 == "-./".indexOf(a.charAt(1)) || !(f = e.regex.val1.test("0" + a.charAt(0))) ? f : (b.buffer[c - 1] = "0", {
                                refreshFromBuffer: {
                                    start: c - 1,
                                    end: c
                                }, pos: c, c: a.charAt(0)
                            })
                    }, cardinality: 2, prevalidator: [{
                        validator: function (a, b, c, d, e) {
                            isNaN(b.buffer[c + 1]) || (a += b.buffer[c + 1]);
                            var f = 1 == a.length ? e.regex.val1pre.test(a) : e.regex.val1.test(a);
                            return d || f || !(f = e.regex.val1.test("0" + a)) ? f : (b.buffer[c] = "0", c++, {pos: c})
                        }, cardinality: 1
                    }]
                }, 2: {
                    validator: function (a, b, c, d, e) {
                        var f = e.mask.indexOf("2") == e.mask.length - 1 ? b.buffer.join("").substr(5, 3) : b.buffer.join("").substr(0, 3);
                        -1 != f.indexOf(e.placeholder[0]) && (f = "01" + e.separator);
                        var g = e.regex.val2(e.separator).test(f + a);
                        if (!d && !g && (a.charAt(1) == e.separator || -1 != "-./".indexOf(a.charAt(1))) && (g = e.regex.val2(e.separator).test(f + "0" + a.charAt(0))))return b.buffer[c - 1] = "0", {
                            refreshFromBuffer: {
                                start: c - 1,
                                end: c
                            }, pos: c, c: a.charAt(0)
                        };
                        if (e.mask.indexOf("2") == e.mask.length - 1 && g) {
                            var h = b.buffer.join("").substr(4, 4) + a;
                            if (h != e.leapday)return !0;
                            var i = parseInt(b.buffer.join("").substr(0, 4), 10);
                            return i % 4 === 0 ? i % 100 === 0 ? i % 400 === 0 ? !0 : !1 : !0 : !1
                        }
                        return g
                    }, cardinality: 2, prevalidator: [{
                        validator: function (a, b, c, d, e) {
                            isNaN(b.buffer[c + 1]) || (a += b.buffer[c + 1]);
                            var f = e.mask.indexOf("2") == e.mask.length - 1 ? b.buffer.join("").substr(5, 3) : b.buffer.join("").substr(0, 3);
                            -1 != f.indexOf(e.placeholder[0]) && (f = "01" + e.separator);
                            var g = 1 == a.length ? e.regex.val2pre(e.separator).test(f + a) : e.regex.val2(e.separator).test(f + a);
                            return d || g || !(g = e.regex.val2(e.separator).test(f + "0" + a)) ? g : (b.buffer[c] = "0", c++, {pos: c})
                        }, cardinality: 1
                    }]
                }, y: {
                    validator: function (a, b, c, d, e) {
                        if (e.isInYearRange(a, e.yearrange.minyear, e.yearrange.maxyear)) {
                            var f = b.buffer.join("").substr(0, 6);
                            if (f != e.leapday)return !0;
                            var g = parseInt(a, 10);
                            return g % 4 === 0 ? g % 100 === 0 ? g % 400 === 0 ? !0 : !1 : !0 : !1
                        }
                        return !1
                    }, cardinality: 4, prevalidator: [{
                        validator: function (a, b, c, d, e) {
                            var f = e.isInYearRange(a, e.yearrange.minyear, e.yearrange.maxyear);
                            if (!d && !f) {
                                var g = e.determinebaseyear(e.yearrange.minyear, e.yearrange.maxyear, a + "0").toString().slice(0, 1);
                                if (f = e.isInYearRange(g + a, e.yearrange.minyear, e.yearrange.maxyear))return b.buffer[c++] = g.charAt(0), {pos: c};
                                if (g = e.determinebaseyear(e.yearrange.minyear, e.yearrange.maxyear, a + "0").toString().slice(0, 2), f = e.isInYearRange(g + a, e.yearrange.minyear, e.yearrange.maxyear))return b.buffer[c++] = g.charAt(0), b.buffer[c++] = g.charAt(1), {pos: c}
                            }
                            return f
                        }, cardinality: 1
                    }, {
                        validator: function (a, b, c, d, e) {
                            var f = e.isInYearRange(a, e.yearrange.minyear, e.yearrange.maxyear);
                            if (!d && !f) {
                                var g = e.determinebaseyear(e.yearrange.minyear, e.yearrange.maxyear, a).toString().slice(0, 2);
                                if (f = e.isInYearRange(a[0] + g[1] + a[1], e.yearrange.minyear, e.yearrange.maxyear))return b.buffer[c++] = g.charAt(1), {pos: c};
                                if (g = e.determinebaseyear(e.yearrange.minyear, e.yearrange.maxyear, a).toString().slice(0, 2), e.isInYearRange(g + a, e.yearrange.minyear, e.yearrange.maxyear)) {
                                    var h = b.buffer.join("").substr(0, 6);
                                    if (h != e.leapday)f = !0; else {
                                        var i = parseInt(a, 10);
                                        f = i % 4 === 0 ? i % 100 === 0 ? i % 400 === 0 ? !0 : !1 : !0 : !1
                                    }
                                } else f = !1;
                                if (f)return b.buffer[c - 1] = g.charAt(0), b.buffer[c++] = g.charAt(1), b.buffer[c++] = a.charAt(0), {
                                    refreshFromBuffer: {
                                        start: c - 3,
                                        end: c
                                    }, pos: c
                                }
                            }
                            return f
                        }, cardinality: 2
                    }, {
                        validator: function (a, b, c, d, e) {
                            return e.isInYearRange(a, e.yearrange.minyear, e.yearrange.maxyear)
                        }, cardinality: 3
                    }]
                }
            },
            insertMode: !1,
            autoUnmask: !1
        },
        "mm/dd/yyyy": {
            placeholder: "mm/dd/yyyy", alias: "dd/mm/yyyy", regex: {
                val2pre: function (b) {
                    var c = a.inputmask.escapeRegex.call(this, b);
                    return new RegExp("((0[13-9]|1[012])" + c + "[0-3])|(02" + c + "[0-2])")
                }, val2: function (b) {
                    var c = a.inputmask.escapeRegex.call(this, b);
                    return new RegExp("((0[1-9]|1[012])" + c + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + c + "30)|((0[13578]|1[02])" + c + "31)")
                }, val1pre: new RegExp("[01]"), val1: new RegExp("0[1-9]|1[012]")
            }, leapday: "02/29/", onKeyUp: function (b, c, d, e) {
                var f = a(this);
                if (b.ctrlKey && b.keyCode == e.keyCode.RIGHT) {
                    var g = new Date;
                    f.val((g.getMonth() + 1).toString() + g.getDate().toString() + g.getFullYear().toString())
                }
            }
        },
        "yyyy/mm/dd": {
            mask: "y/1/2",
            placeholder: "yyyy/mm/dd",
            alias: "mm/dd/yyyy",
            leapday: "/02/29",
            onKeyUp: function (b, c, d, e) {
                var f = a(this);
                if (b.ctrlKey && b.keyCode == e.keyCode.RIGHT) {
                    var g = new Date;
                    f.val(g.getFullYear().toString() + (g.getMonth() + 1).toString() + g.getDate().toString())
                }
            }
        },
        "dd.mm.yyyy": {
            mask: "1.2.y",
            placeholder: "dd.mm.yyyy",
            leapday: "29.02.",
            separator: ".",
            alias: "dd/mm/yyyy"
        },
        "dd-mm-yyyy": {
            mask: "1-2-y",
            placeholder: "dd-mm-yyyy",
            leapday: "29-02-",
            separator: "-",
            alias: "dd/mm/yyyy"
        },
        "mm.dd.yyyy": {
            mask: "1.2.y",
            placeholder: "mm.dd.yyyy",
            leapday: "02.29.",
            separator: ".",
            alias: "mm/dd/yyyy"
        },
        "mm-dd-yyyy": {
            mask: "1-2-y",
            placeholder: "mm-dd-yyyy",
            leapday: "02-29-",
            separator: "-",
            alias: "mm/dd/yyyy"
        },
        "yyyy.mm.dd": {
            mask: "y.1.2",
            placeholder: "yyyy.mm.dd",
            leapday: ".02.29",
            separator: ".",
            alias: "yyyy/mm/dd"
        },
        "yyyy-mm-dd": {
            mask: "y-1-2",
            placeholder: "yyyy-mm-dd",
            leapday: "-02-29",
            separator: "-",
            alias: "yyyy/mm/dd"
        },
        datetime: {
            mask: "1/2/y h:s",
            placeholder: "dd/mm/yyyy hh:mm",
            alias: "dd/mm/yyyy",
            regex: {
                hrspre: new RegExp("[012]"),
                hrs24: new RegExp("2[0-4]|1[3-9]"),
                hrs: new RegExp("[01][0-9]|2[0-4]"),
                ampm: new RegExp("^[a|p|A|P][m|M]"),
                mspre: new RegExp("[0-5]"),
                ms: new RegExp("[0-5][0-9]")
            },
            timeseparator: ":",
            hourFormat: "24",
            definitions: {
                h: {
                    validator: function (a, b, c, d, e) {
                        if ("24" == e.hourFormat && 24 == parseInt(a, 10))return b.buffer[c - 1] = "0", b.buffer[c] = "0", {
                            refreshFromBuffer: {
                                start: c - 1,
                                end: c
                            }, c: "0"
                        };
                        var f = e.regex.hrs.test(a);
                        if (!d && !f && (a.charAt(1) == e.timeseparator || -1 != "-.:".indexOf(a.charAt(1))) && (f = e.regex.hrs.test("0" + a.charAt(0))))return b.buffer[c - 1] = "0", b.buffer[c] = a.charAt(0), c++, {
                            refreshFromBuffer: {
                                start: c - 2,
                                end: c
                            }, pos: c, c: e.timeseparator
                        };
                        if (f && "24" !== e.hourFormat && e.regex.hrs24.test(a)) {
                            var g = parseInt(a, 10);
                            return 24 == g ? (b.buffer[c + 5] = "a", b.buffer[c + 6] = "m") : (b.buffer[c + 5] = "p", b.buffer[c + 6] = "m"), g -= 12, 10 > g ? (b.buffer[c] = g.toString(), b.buffer[c - 1] = "0") : (b.buffer[c] = g.toString().charAt(1), b.buffer[c - 1] = g.toString().charAt(0)), {
                                refreshFromBuffer: {
                                    start: c - 1,
                                    end: c + 6
                                }, c: b.buffer[c]
                            }
                        }
                        return f
                    }, cardinality: 2, prevalidator: [{
                        validator: function (a, b, c, d, e) {
                            var f = e.regex.hrspre.test(a);
                            return d || f || !(f = e.regex.hrs.test("0" + a)) ? f : (b.buffer[c] = "0", c++, {pos: c})
                        }, cardinality: 1
                    }]
                }, s: {
                    validator: "[0-5][0-9]", cardinality: 2, prevalidator: [{
                        validator: function (a, b, c, d, e) {
                            var f = e.regex.mspre.test(a);
                            return d || f || !(f = e.regex.ms.test("0" + a)) ? f : (b.buffer[c] = "0", c++, {pos: c})
                        }, cardinality: 1
                    }]
                }, t: {
                    validator: function (a, b, c, d, e) {
                        return e.regex.ampm.test(a + "m")
                    }, casing: "lower", cardinality: 1
                }
            },
            insertMode: !1,
            autoUnmask: !1
        },
        datetime12: {mask: "1/2/y h:s t\\m", placeholder: "dd/mm/yyyy hh:mm xm", alias: "datetime", hourFormat: "12"},
        "hh:mm t": {mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12"},
        "h:s t": {mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12"},
        "hh:mm:ss": {mask: "h:s:s", placeholder: "hh:mm:ss", alias: "datetime", autoUnmask: !1},
        "hh:mm": {mask: "h:s", placeholder: "hh:mm", alias: "datetime", autoUnmask: !1},
        date: {alias: "dd/mm/yyyy"},
        "mm/yyyy": {mask: "1/y", placeholder: "mm/yyyy", leapday: "donotuse", separator: "/", alias: "mm/dd/yyyy"}
    }), a.fn.inputmask
}(jQuery), function (a) {
    return a.extend(a.inputmask.defaults.definitions, {
        A: {
            validator: "[A-Za-z�?-�?�?ёÀ-ÿµ]",
            cardinality: 1,
            casing: "upper"
        }, "#": {validator: "[0-9A-Za-z�?-�?�?ёÀ-ÿµ]", cardinality: 1, casing: "upper"}
    }), a.extend(a.inputmask.defaults.aliases, {
        url: {
            mask: "ir",
            placeholder: "",
            separator: "",
            defaultPrefix: "http://",
            regex: {
                urlpre1: new RegExp("[fh]"),
                urlpre2: new RegExp("(ft|ht)"),
                urlpre3: new RegExp("(ftp|htt)"),
                urlpre4: new RegExp("(ftp:|http|ftps)"),
                urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"),
                urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"),
                urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"),
                urlpre8: new RegExp("(ftp://|ftps://|http://|https://)")
            },
            definitions: {
                i: {
                    validator: function () {
                        return !0
                    }, cardinality: 8, prevalidator: function () {
                        for (var a = [], b = 8, c = 0; b > c; c++)a[c] = function () {
                            var a = c;
                            return {
                                validator: function (b, c, d, e, f) {
                                    if (f.regex["urlpre" + (a + 1)]) {
                                        var g, h = b;
                                        a + 1 - b.length > 0 && (h = c.buffer.join("").substring(0, a + 1 - b.length) + "" + h);
                                        var i = f.regex["urlpre" + (a + 1)].test(h);
                                        if (!e && !i) {
                                            for (d -= a, g = 0; g < f.defaultPrefix.length; g++)c.buffer[d] = f.defaultPrefix[g], d++;
                                            for (g = 0; g < h.length - 1; g++)c.buffer[d] = h[g], d++;
                                            return {pos: d}
                                        }
                                        return i
                                    }
                                    return !1
                                }, cardinality: a
                            }
                        }();
                        return a
                    }()
                }, r: {validator: ".", cardinality: 50}
            },
            insertMode: !1,
            autoUnmask: !1
        },
        ip: {
            mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]", definitions: {
                i: {
                    validator: function (a, b, c) {
                        return c - 1 > -1 && "." != b.buffer[c - 1] ? (a = b.buffer[c - 1] + a, a = c - 2 > -1 && "." != b.buffer[c - 2] ? b.buffer[c - 2] + a : "0" + a) : a = "00" + a, new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(a)
                    }, cardinality: 1
                }
            }
        },
        email: {
            mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,20}][.*{2,6}][.*{1,2}]",
            greedy: !1,
            onBeforePaste: function (a) {
                return a = a.toLowerCase(), a.replace("mailto:", "")
            },
            definitions: {"*": {validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]", cardinality: 1, casing: "lower"}}
        }
    }), a.fn.inputmask
}(jQuery), function (a) {
    return a.extend(a.inputmask.defaults.aliases, {
        numeric: {
            mask: function (a) {
                if (0 !== a.repeat && isNaN(a.integerDigits) && (a.integerDigits = a.repeat), a.repeat = 0, a.groupSeparator == a.radixPoint && (a.groupSeparator = "." == a.radixPoint ? "," : "," == a.radixPoint ? "." : ""), " " === a.groupSeparator && (a.skipOptionalPartCharacter = void 0), a.autoGroup = a.autoGroup && "" != a.groupSeparator, a.autoGroup && isFinite(a.integerDigits)) {
                    var b = Math.floor(a.integerDigits / a.groupSize), c = a.integerDigits % a.groupSize;
                    a.integerDigits += 0 == c ? b - 1 : b
                }
                a.definitions[";"] = a.definitions["~"], a.definitions[":"].placeholder = a.radixPoint;
                var d = a.prefix;
                return d += "[+]", d += "~{1," + a.integerDigits + "}", void 0 != a.digits && (isNaN(a.digits) || parseInt(a.digits) > 0) && (d += a.digitsOptional ? "[" + (a.decimalProtect ? ":" : a.radixPoint) + ";{" + a.digits + "}]" : (a.decimalProtect ? ":" : a.radixPoint) + ";{" + a.digits + "}"), d += a.suffix
            },
            placeholder: "",
            greedy: !1,
            digits: "*",
            digitsOptional: !0,
            groupSeparator: "",
            radixPoint: ".",
            groupSize: 3,
            autoGroup: !1,
            allowPlus: !0,
            allowMinus: !0,
            integerDigits: "+",
            prefix: "",
            suffix: "",
            rightAlign: !0,
            decimalProtect: !0,
            postFormat: function (b, c, d, e) {
                var f = !1, g = b[c];
                if ("" == e.groupSeparator || -1 != a.inArray(e.radixPoint, b) && c >= a.inArray(e.radixPoint, b) || new RegExp("[-+]").test(g))return {pos: c};
                var h = b.slice();
                g == e.groupSeparator && (h.splice(c--, 1), g = h[c]), d ? h[c] = "?" : h.splice(c, 0, "?");
                var i = h.join("");
                if (e.autoGroup || d && -1 != i.indexOf(e.groupSeparator)) {
                    var j = a.inputmask.escapeRegex.call(this, e.groupSeparator);
                    f = 0 == i.indexOf(e.groupSeparator), i = i.replace(new RegExp(j, "g"), "");
                    var k = i.split(e.radixPoint);
                    if (i = k[0], i != e.prefix + "?0" && i.length >= e.groupSize + e.prefix.length) {
                        f = !0;
                        for (var l = new RegExp("([-+]?[\\d?]+)([\\d?]{" + e.groupSize + "})"); l.test(i);)i = i.replace(l, "$1" + e.groupSeparator + "$2"), i = i.replace(e.groupSeparator + e.groupSeparator, e.groupSeparator)
                    }
                    k.length > 1 && (i += e.radixPoint + k[1])
                }
                b.length = i.length;
                for (var m = 0, n = i.length; n > m; m++)b[m] = i.charAt(m);
                var o = a.inArray("?", b);
                return d ? b[o] = g : b.splice(o, 1), {pos: o, refreshFromBuffer: f}
            },
            onKeyDown: function (b, c, d, e) {
                if (b.keyCode == e.keyCode.TAB && "0" != e.placeholder.charAt(0)) {
                    var f = a.inArray(e.radixPoint, c);
                    if (-1 != f && isFinite(e.digits)) {
                        for (var g = 1; g <= e.digits; g++)(void 0 == c[f + g] || c[f + g] == e.placeholder.charAt(0)) && (c[f + g] = "0");
                        return {refreshFromBuffer: {start: ++f, end: f + e.digits}}
                    }
                } else if (e.autoGroup && (b.keyCode == e.keyCode.DELETE || b.keyCode == e.keyCode.BACKSPACE)) {
                    var h = e.postFormat(c, d - 1, !0, e);
                    return h.caret = h.pos + 1, h
                }
            },
            onKeyPress: function (a, b, c, d) {
                if (d.autoGroup) {
                    var e = d.postFormat(b, c - 1, !0, d);
                    return e.caret = e.pos + 1, e
                }
            },
            regex: {
                integerPart: function () {
                    return new RegExp("[-+]?\\d+")
                }
            },
            negationhandler: function (a, b, c, d, e) {
                if (!d && e.allowMinus && "-" === a) {
                    var f = b.join("").match(e.regex.integerPart(e));
                    if (f.length > 0)return "+" == b[f.index] ? {
                            pos: f.index,
                            c: "-",
                            remove: f.index,
                            caret: c
                        } : "-" == b[f.index] ? {remove: f.index, caret: c - 1} : {pos: f.index, c: "-", caret: c + 1}
                }
                return !1
            },
            radixhandler: function (b, c, d, e, f) {
                if (!e && b === f.radixPoint) {
                    var g = a.inArray(f.radixPoint, c.buffer.join("")), h = c.buffer.join("").match(f.regex.integerPart(f));
                    if (-1 != g)return c.validPositions[g - 1] ? {caret: g + 1} : {pos: h.index, c: h[0], caret: g + 1}
                }
                return !1
            },
            leadingZeroHandler: function (b, c, d, e, f) {
                var g = c.buffer.join("").match(f.regex.integerPart(f)), h = a.inArray(f.radixPoint, c.buffer);
                if (g && !e && (-1 == h || g.index < h))if (0 == g[0].indexOf("0") && d >= f.prefix.length) {
                    if (-1 == h || h >= d && void 0 == c.validPositions[h])return c.buffer.splice(g.index, 1), d = d > g.index ? d - 1 : g.index, {
                        pos: d,
                        remove: g.index
                    };
                    if (d > g.index && h >= d)return c.buffer.splice(g.index, 1), d = d > g.index ? d - 1 : g.index, {
                        pos: d,
                        remove: g.index
                    }
                } else if ("0" == b && d <= g.index)return !1;
                return !0
            },
            definitions: {
                "~": {
                    validator: function (b, c, d, e, f) {
                        var g = f.negationhandler(b, c.buffer, d, e, f);
                        if (!g && (g = f.radixhandler(b, c, d, e, f), !g && (g = e ? new RegExp("[0-9" + a.inputmask.escapeRegex.call(this, f.groupSeparator) + "]").test(b) : new RegExp("[0-9]").test(b), g === !0 && (g = f.leadingZeroHandler(b, c, d, e, f), g === !0)))) {
                            var h = a.inArray(f.radixPoint, c.buffer);
                            return f.digitsOptional === !1 && d > h && !e ? {pos: d, remove: d} : {pos: d}
                        }
                        return g
                    }, cardinality: 1, prevalidator: null
                }, "+": {
                    validator: function (a, b, c, d, e) {
                        var f = "[";
                        return e.allowMinus === !0 && (f += "-"), e.allowPlus === !0 && (f += "+"), f += "]", new RegExp(f).test(a)
                    }, cardinality: 1, prevalidator: null
                }, ":": {
                    validator: function (b, c, d, e, f) {
                        var g = f.negationhandler(b, c.buffer, d, e, f);
                        if (!g) {
                            var h = "[" + a.inputmask.escapeRegex.call(this, f.radixPoint) + "]";
                            g = new RegExp(h).test(b), g && c.validPositions[d] && c.validPositions[d].match.placeholder == f.radixPoint && (g = {
                                pos: d,
                                remove: d
                            })
                        }
                        return g
                    }, cardinality: 1, prevalidator: null, placeholder: ""
                }
            },
            insertMode: !0,
            autoUnmask: !1,
            onUnMask: function (b, c, d) {
                var e = b.replace(d.prefix, "");
                return e = e.replace(d.suffix, ""), e = e.replace(new RegExp(a.inputmask.escapeRegex.call(this, d.groupSeparator), "g"), "")
            },
            isComplete: function (b, c) {
                var d = b.join(""), e = b.slice();
                if (c.postFormat(e, 0, !0, c), e.join("") != d)return !1;
                var f = d.replace(c.prefix, "");
                return f = f.replace(c.suffix, ""), f = f.replace(new RegExp(a.inputmask.escapeRegex.call(this, c.groupSeparator), "g"), ""), f = f.replace(a.inputmask.escapeRegex.call(this, c.radixPoint), "."), isFinite(f)
            },
            onBeforeMask: function (b, c) {
                if (isFinite(b))return b.toString().replace(".", c.radixPoint);
                var d = b.match(/,/g), e = b.match(/\./g);
                return e && d ? e.length > d.length ? (b = b.replace(/\./g, ""), b = b.replace(",", c.radixPoint)) : d.length > e.length && (b = b.replace(/,/g, ""), b = b.replace(".", c.radixPoint)) : b = b.replace(new RegExp(a.inputmask.escapeRegex.call(this, c.groupSeparator), "g"), ""), b
            }
        },
        currency: {
            prefix: "$ ",
            groupSeparator: ",",
            radixPoint: ".",
            alias: "numeric",
            placeholder: "0",
            autoGroup: !0,
            digits: 2,
            digitsOptional: !1,
            clearMaskOnLostFocus: !1,
            decimalProtect: !0
        },
        decimal: {alias: "numeric"},
        integer: {alias: "numeric", digits: "0"}
    }), a.fn.inputmask
}(jQuery), function (a) {
    return a.extend(a.inputmask.defaults.aliases, {
        phone: {
            url: "phone-codes/phone-codes.js",
            maskInit: "+pp(pp)pppppppp",
            mask: function (b) {
                b.definitions = {
                    p: {
                        validator: function () {
                            return !1
                        }, cardinality: 1
                    }, "#": {validator: "[0-9]", cardinality: 1}
                };
                var c = [];
                return a.ajax({
                    url: b.url, async: !1, dataType: "json", success: function (a) {
                        c = a
                    }
                }), c.splice(0, 0, b.maskInit), c.sort(function (a, b) {
                    return a.length - b.length
                }), c
            },
            nojumps: !0,
            nojumpsThreshold: 1
        }, phonebe: {alias: "phone", url: "phone-codes/phone-be.js", maskInit: "+32(pp)pppppppp", nojumpsThreshold: 4}
    }), a.fn.inputmask
}(jQuery), function (a) {
    return a.extend(a.inputmask.defaults.aliases, {
        Regex: {
            mask: "r",
            greedy: !1,
            repeat: "*",
            regex: null,
            regexTokens: null,
            tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
            quantifierFilter: /[0-9]+[^,]/,
            isComplete: function (a, b) {
                return new RegExp(b.regex).test(a.join(""))
            },
            definitions: {
                r: {
                    validator: function (b, c, d, e, f) {
                        function g(a, b) {
                            this.matches = [], this.isGroup = a || !1, this.isQuantifier = b || !1, this.quantifier = {
                                min: 1,
                                max: 1
                            }, this.repeaterPart = void 0
                        }

                        function h() {
                            var a, b, c = new g, d = [];
                            for (f.regexTokens = []; a = f.tokenizer.exec(f.regex);)switch (b = a[0], b.charAt(0)) {
                                case"(":
                                    d.push(new g(!0));
                                    break;
                                case")":
                                    var e = d.pop();
                                    d.length > 0 ? d[d.length - 1].matches.push(e) : c.matches.push(e);
                                    break;
                                case"{":
                                case"+":
                                case"*":
                                    var h = new g(!1, !0);
                                    b = b.replace(/[{}]/g, "");
                                    var i = b.split(","), j = isNaN(i[0]) ? i[0] : parseInt(i[0]), k = 1 == i.length ? j : isNaN(i[1]) ? i[1] : parseInt(i[1]);
                                    if (h.quantifier = {min: j, max: k}, d.length > 0) {
                                        var l = d[d.length - 1].matches;
                                        if (a = l.pop(), !a.isGroup) {
                                            var e = new g(!0);
                                            e.matches.push(a), a = e
                                        }
                                        l.push(a), l.push(h)
                                    } else {
                                        if (a = c.matches.pop(), !a.isGroup) {
                                            var e = new g(!0);
                                            e.matches.push(a), a = e
                                        }
                                        c.matches.push(a), c.matches.push(h)
                                    }
                                    break;
                                default:
                                    d.length > 0 ? d[d.length - 1].matches.push(b) : c.matches.push(b)
                            }
                            c.matches.length > 0 && f.regexTokens.push(c)
                        }

                        function i(b, c) {
                            var d = !1;
                            c && (k += "(", m++);
                            for (var e = 0; e < b.matches.length; e++) {
                                var f = b.matches[e];
                                if (1 == f.isGroup)d = i(f, !0); else if (1 == f.isQuantifier) {
                                    var g = a.inArray(f, b.matches), h = b.matches[g - 1], j = k;
                                    if (isNaN(f.quantifier.max)) {
                                        for (; f.repeaterPart && f.repeaterPart != k && f.repeaterPart.length > k.length && !(d = i(h, !0)););
                                        d = d || i(h, !0), d && (f.repeaterPart = k), k = j + f.quantifier.max
                                    } else {
                                        for (var l = 0, o = f.quantifier.max - 1; o > l && !(d = i(h, !0)); l++);
                                        k = j + "{" + f.quantifier.min + "," + f.quantifier.max + "}"
                                    }
                                } else if (void 0 != f.matches)for (var p = 0; p < f.length && !(d = i(f[p], c)); p++); else {
                                    var q;
                                    if ("[" == f.charAt(0)) {
                                        q = k, q += f;
                                        for (var r = 0; m > r; r++)q += ")";
                                        var s = new RegExp("^(" + q + ")$");
                                        d = s.test(n)
                                    } else for (var t = 0, u = f.length; u > t; t++)if ("\\" != f.charAt(t)) {
                                        q = k, q += f.substr(0, t + 1), q = q.replace(/\|$/, "");
                                        for (var r = 0; m > r; r++)q += ")";
                                        var s = new RegExp("^(" + q + ")$");
                                        if (d = s.test(n))break
                                    }
                                    k += f
                                }
                                if (d)break
                            }
                            return c && (k += ")", m--), d
                        }

                        null == f.regexTokens && h();
                        var j = c.buffer.slice(), k = "", l = !1, m = 0;
                        j.splice(d, 0, b);
                        for (var n = j.join(""), o = 0; o < f.regexTokens.length; o++) {
                            var g = f.regexTokens[o];
                            if (l = i(g, g.isGroup))break
                        }
                        return l
                    }, cardinality: 1
                }
            }
        }
    }), a.fn.inputmask
}(jQuery);

/* moment.js  */
(function (G) {
    var T, aI = "2.8.1", a6 = typeof global !== "undefined" ? global : this, at, aa = Math.round, ai, z = 0, j = 1, aZ = 2, y = 3, aF = 4, w = 5, X = 6, aq = {}, aS = [], ar = (typeof module !== "undefined" && module.exports), e = /^\/?Date\((\-?\d+)/i, a9 = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, aK = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, aw = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, ah = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, k = /\d\d?/, aj = /\d{1,3}/, H = /\d{1,4}/, bf = /[+\-]?\d{1,6}/, a4 = /\d+/, L = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, r = /Z|[\+\-]\d\d:?\d\d/gi, n = /T/i, aU = /[\+\-]?\d+(\.\d{1,3})?/, bl = /\d{1,2}/, ag = /\d/, u = /\d\d/, a8 = /\d{3}/, aT = /\d{4}/, an = /[+-]?\d{6}/, ae = /[+-]?\d+/, aQ = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, Y = "YYYY-MM-DDTHH:mm:ssZ", a7 = [["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/], ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/], ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/], ["GGGG-[W]WW", /\d{4}-W\d{2}/], ["YYYY-DDD", /\d{4}-\d{3}/]], J = [["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/], ["HH:mm", /(T| )\d\d:\d\d/], ["HH", /(T| )\d\d/]], af = /([\+\-]|\d\d)/gi, aM = "Date|Hours|Minutes|Seconds|Milliseconds".split("|"), F = {
        Milliseconds: 1,
        Seconds: 1000,
        Minutes: 60000,
        Hours: 3600000,
        Days: 86400000,
        Months: 2592000000,
        Years: 31536000000
    }, f = {
        ms: "millisecond",
        s: "second",
        m: "minute",
        h: "hour",
        d: "day",
        D: "date",
        w: "week",
        W: "isoWeek",
        M: "month",
        Q: "quarter",
        y: "year",
        DDD: "dayOfYear",
        e: "weekday",
        E: "isoWeekday",
        gg: "weekYear",
        GG: "isoWeekYear"
    }, a3 = {
        dayofyear: "dayOfYear",
        isoweekday: "isoWeekday",
        isoweek: "isoWeek",
        weekyear: "weekYear",
        isoweekyear: "isoWeekYear"
    }, ap = {}, A = {
        s: 45,
        m: 45,
        h: 22,
        d: 26,
        M: 11
    }, aY = "DDD w W M D d".split(" "), au = "M D H h m s w W".split(" "), a0 = {
        M: function () {
            return this.month() + 1
        }, MMM: function (i) {
            return this.localeData().monthsShort(this, i)
        }, MMMM: function (i) {
            return this.localeData().months(this, i)
        }, D: function () {
            return this.date()
        }, DDD: function () {
            return this.dayOfYear()
        }, d: function () {
            return this.day()
        }, dd: function (i) {
            return this.localeData().weekdaysMin(this, i)
        }, ddd: function (i) {
            return this.localeData().weekdaysShort(this, i)
        }, dddd: function (i) {
            return this.localeData().weekdays(this, i)
        }, w: function () {
            return this.week()
        }, W: function () {
            return this.isoWeek()
        }, YY: function () {
            return M(this.year() % 100, 2)
        }, YYYY: function () {
            return M(this.year(), 4)
        }, YYYYY: function () {
            return M(this.year(), 5)
        }, YYYYYY: function () {
            var bm = this.year(), i = bm >= 0 ? "+" : "-";
            return i + M(Math.abs(bm), 6)
        }, gg: function () {
            return M(this.weekYear() % 100, 2)
        }, gggg: function () {
            return M(this.weekYear(), 4)
        }, ggggg: function () {
            return M(this.weekYear(), 5)
        }, GG: function () {
            return M(this.isoWeekYear() % 100, 2)
        }, GGGG: function () {
            return M(this.isoWeekYear(), 4)
        }, GGGGG: function () {
            return M(this.isoWeekYear(), 5)
        }, e: function () {
            return this.weekday()
        }, E: function () {
            return this.isoWeekday()
        }, a: function () {
            return this.localeData().meridiem(this.hours(), this.minutes(), true)
        }, A: function () {
            return this.localeData().meridiem(this.hours(), this.minutes(), false)
        }, H: function () {
            return this.hours()
        }, h: function () {
            return this.hours() % 12 || 12
        }, m: function () {
            return this.minutes()
        }, s: function () {
            return this.seconds()
        }, S: function () {
            return O(this.milliseconds() / 100)
        }, SS: function () {
            return M(O(this.milliseconds() / 10), 2)
        }, SSS: function () {
            return M(this.milliseconds(), 3)
        }, SSSS: function () {
            return M(this.milliseconds(), 3)
        }, Z: function () {
            var bm = -this.zone(), i = "+";
            if (bm < 0) {
                bm = -bm;
                i = "-"
            }
            return i + M(O(bm / 60), 2) + ":" + M(O(bm) % 60, 2)
        }, ZZ: function () {
            var bm = -this.zone(), i = "+";
            if (bm < 0) {
                bm = -bm;
                i = "-"
            }
            return i + M(O(bm / 60), 2) + M(O(bm) % 60, 2)
        }, z: function () {
            return this.zoneAbbr()
        }, zz: function () {
            return this.zoneName()
        }, X: function () {
            return this.unix()
        }, Q: function () {
            return this.quarter()
        }
    }, a = {}, Z = ["months", "monthsShort", "weekdays", "weekdaysShort", "weekdaysMin"];

    function aV(bm, i, bn) {
        switch (arguments.length) {
            case 2:
                return bm != null ? bm : i;
            case 3:
                return bm != null ? bm : i != null ? i : bn;
            default:
                throw new Error("Implement me")
        }
    }

    function al() {
        return {
            empty: false,
            unusedTokens: [],
            unusedInput: [],
            overflow: -2,
            charsLeftOver: 0,
            nullInput: false,
            invalidMonth: null,
            invalidFormat: false,
            userInvalidated: false,
            iso: false
        }
    }

    function bk(i) {
        if (T.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
            console.warn("Deprecation warning: " + i)
        }
    }

    function bi(bm, i) {
        var bn = true;
        return aG(function () {
            if (bn) {
                bk(bm);
                bn = false
            }
            return i.apply(this, arguments)
        }, i)
    }

    function g(i, bm) {
        if (!a[i]) {
            bk(bm);
            a[i] = true
        }
    }

    function Q(bm, i) {
        return function (bn) {
            return M(bm.call(this, bn), i)
        }
    }

    function l(i, bm) {
        return function (bn) {
            return this.localeData().ordinal(i.call(this, bn), bm)
        }
    }

    while (aY.length) {
        ai = aY.pop();
        a0[ai + "o"] = l(a0[ai], ai)
    }
    while (au.length) {
        ai = au.pop();
        a0[ai + ai] = Q(a0[ai], 2)
    }
    a0.DDDD = Q(a0.DDD, 3);
    function ad() {
    }

    function N(bm, i) {
        if (i !== false) {
            bc(bm)
        }
        aO(this, bm);
        this._d = new Date(+bm._d)
    }

    function ak(bq) {
        var bs = o(bq), br = bs.year || 0, bm = bs.quarter || 0, bn = bs.month || 0, i = bs.week || 0, bv = bs.day || 0, bt = bs.hour || 0, bp = bs.minute || 0, bu = bs.second || 0, bo = bs.millisecond || 0;
        this._milliseconds = +bo + bu * 1000 + bp * 60000 + bt * 3600000;
        this._days = +bv + i * 7;
        this._months = +bn + bm * 3 + br * 12;
        this._data = {};
        this._locale = T.localeData();
        this._bubble()
    }

    function aG(bn, bm) {
        for (var bo in bm) {
            if (bm.hasOwnProperty(bo)) {
                bn[bo] = bm[bo]
            }
        }
        if (bm.hasOwnProperty("toString")) {
            bn.toString = bm.toString
        }
        if (bm.hasOwnProperty("valueOf")) {
            bn.valueOf = bm.valueOf
        }
        return bn
    }

    function aO(bq, bp) {
        var bm, bo, bn;
        if (typeof bp._isAMomentObject !== "undefined") {
            bq._isAMomentObject = bp._isAMomentObject
        }
        if (typeof bp._i !== "undefined") {
            bq._i = bp._i
        }
        if (typeof bp._f !== "undefined") {
            bq._f = bp._f
        }
        if (typeof bp._l !== "undefined") {
            bq._l = bp._l
        }
        if (typeof bp._strict !== "undefined") {
            bq._strict = bp._strict
        }
        if (typeof bp._tzm !== "undefined") {
            bq._tzm = bp._tzm
        }
        if (typeof bp._isUTC !== "undefined") {
            bq._isUTC = bp._isUTC
        }
        if (typeof bp._offset !== "undefined") {
            bq._offset = bp._offset
        }
        if (typeof bp._pf !== "undefined") {
            bq._pf = bp._pf
        }
        if (typeof bp._locale !== "undefined") {
            bq._locale = bp._locale
        }
        if (aS.length > 0) {
            for (bm in aS) {
                bo = aS[bm];
                bn = bp[bo];
                if (typeof bn !== "undefined") {
                    bq[bo] = bn
                }
            }
        }
        return bq
    }

    function p(i) {
        if (i < 0) {
            return Math.ceil(i)
        } else {
            return Math.floor(i)
        }
    }

    function M(bp, bo, bn) {
        var bm = "" + Math.abs(bp), i = bp >= 0;
        while (bm.length < bo) {
            bm = "0" + bm
        }
        return (i ? (bn ? "+" : "") : "-") + bm
    }

    function d(bn, i) {
        var bm = {milliseconds: 0, months: 0};
        bm.months = i.month() - bn.month() + (i.year() - bn.year()) * 12;
        if (bn.clone().add(bm.months, "M").isAfter(i)) {
            --bm.months
        }
        bm.milliseconds = +i - +(bn.clone().add(bm.months, "M"));
        return bm
    }

    function ab(bn, i) {
        var bm;
        i = B(i, bn);
        if (bn.isBefore(i)) {
            bm = d(bn, i)
        } else {
            bm = d(i, bn);
            bm.milliseconds = -bm.milliseconds;
            bm.months = -bm.months
        }
        return bm
    }

    function U(bm, i) {
        return function (bq, bp) {
            var bo, bn;
            if (bp !== null && !isNaN(+bp)) {
                g(i, "moment()." + i + "(period, number) is deprecated. Please use moment()." + i + "(number, period).");
                bn = bq;
                bq = bp;
                bp = bn
            }
            bq = typeof bq === "string" ? +bq : bq;
            bo = T.duration(bq, bp);
            I(this, bo, bm);
            return this
        }
    }

    function I(bn, bq, bp, bo) {
        var bm = bq._milliseconds, br = bq._days, i = bq._months;
        bo = bo == null ? true : bo;
        if (bm) {
            bn._d.setTime(+bn._d + bm * bp)
        }
        if (br) {
            aW(bn, "Date", bj(bn, "Date") + br * bp)
        }
        if (i) {
            be(bn, bj(bn, "Month") + i * bp)
        }
        if (bo) {
            T.updateOffset(bn, br || i)
        }
    }

    function b(i) {
        return Object.prototype.toString.call(i) === "[object Array]"
    }

    function h(i) {
        return Object.prototype.toString.call(i) === "[object Date]" || i instanceof Date
    }

    function aX(br, bq, bn) {
        var bm = Math.min(br.length, bq.length), bo = Math.abs(br.length - bq.length), bs = 0, bp;
        for (bp = 0; bp < bm; bp++) {
            if ((bn && br[bp] !== bq[bp]) || (!bn && O(br[bp]) !== O(bq[bp]))) {
                bs++
            }
        }
        return bs + bo
    }

    function a2(bm) {
        if (bm) {
            var i = bm.toLowerCase().replace(/(.)s$/, "$1");
            bm = f[bm] || a3[i] || i
        }
        return bm
    }

    function o(bn) {
        var bm = {}, i, bo;
        for (bo in bn) {
            if (bn.hasOwnProperty(bo)) {
                i = a2(bo);
                if (i) {
                    bm[i] = bn[bo]
                }
            }
        }
        return bm
    }

    function aC(bm) {
        var i, bn;
        if (bm.indexOf("week") === 0) {
            i = 7;
            bn = "day"
        } else {
            if (bm.indexOf("month") === 0) {
                i = 12;
                bn = "month"
            } else {
                return
            }
        }
        T[bm] = function (bs, bp) {
            var br, bo, bt = T._locale[bm], bq = [];
            if (typeof bs === "number") {
                bp = bs;
                bs = G
            }
            bo = function (bv) {
                var bu = T().utc().set(bn, bv);
                return bt.call(T._locale, bu, bs || "")
            };
            if (bp != null) {
                return bo(bp)
            } else {
                for (br = 0; br < i; br++) {
                    bq.push(bo(br))
                }
                return bq
            }
        }
    }

    function O(i) {
        var bn = +i, bm = 0;
        if (bn !== 0 && isFinite(bn)) {
            if (bn >= 0) {
                bm = Math.floor(bn)
            } else {
                bm = Math.ceil(bn)
            }
        }
        return bm
    }

    function ba(i, bm) {
        return new Date(Date.UTC(i, bm + 1, 0)).getUTCDate()
    }

    function aL(i, bn, bm) {
        return E(T([i, 11, 31 + bn - bm]), bn, bm).week
    }

    function a5(i) {
        return aP(i) ? 366 : 365
    }

    function aP(i) {
        return (i % 4 === 0 && i % 100 !== 0) || i % 400 === 0
    }

    function bc(i) {
        var bm;
        if (i._a && i._pf.overflow === -2) {
            bm = i._a[j] < 0 || i._a[j] > 11 ? j : i._a[aZ] < 1 || i._a[aZ] > ba(i._a[z], i._a[j]) ? aZ : i._a[y] < 0 || i._a[y] > 23 ? y : i._a[aF] < 0 || i._a[aF] > 59 ? aF : i._a[w] < 0 || i._a[w] > 59 ? w : i._a[X] < 0 || i._a[X] > 999 ? X : -1;
            if (i._pf._overflowDayOfYear && (bm < z || bm > aZ)) {
                bm = aZ
            }
            i._pf.overflow = bm
        }
    }

    function aH(i) {
        if (i._isValid == null) {
            i._isValid = !isNaN(i._d.getTime()) && i._pf.overflow < 0 && !i._pf.empty && !i._pf.invalidMonth && !i._pf.nullInput && !i._pf.invalidFormat && !i._pf.userInvalidated;
            if (i._strict) {
                i._isValid = i._isValid && i._pf.charsLeftOver === 0 && i._pf.unusedTokens.length === 0
            }
        }
        return i._isValid
    }

    function aR(i) {
        return i ? i.toLowerCase().replace("_", "-") : i
    }

    function az(br) {
        var bp = 0, bn, bq, bm, bo;
        while (bp < br.length) {
            bo = aR(br[bp]).split("-");
            bn = bo.length;
            bq = aR(br[bp + 1]);
            bq = bq ? bq.split("-") : null;
            while (bn > 0) {
                bm = c(bo.slice(0, bn).join("-"));
                if (bm) {
                    return bm
                }
                if (bq && bq.length >= bn && aX(bo, bq, true) >= bn - 1) {
                    break
                }
                bn--
            }
            bp++
        }
        return null
    }

    function c(i) {
        var bn = null;
        if (!aq[i] && ar) {
            try {
                bn = T.locale();
                require("./locale/" + i);
                T.locale(bn)
            } catch (bm) {
            }
        }
        return aq[i]
    }

    function B(i, bm) {
        return bm._isUTC ? T(i).zone(bm._offset || 0) : T(i).local()
    }

    aG(ad.prototype, {
        set: function (bm) {
            var bo, bn;
            for (bn in bm) {
                bo = bm[bn];
                if (typeof bo === "function") {
                    this[bn] = bo
                } else {
                    this["_" + bn] = bo
                }
            }
        },
        _months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
        months: function (i) {
            return this._months[i.month()]
        },
        _monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
        monthsShort: function (i) {
            return this._monthsShort[i.month()]
        },
        monthsParse: function (bm) {
            var bn, bp, bo;
            if (!this._monthsParse) {
                this._monthsParse = []
            }
            for (bn = 0; bn < 12; bn++) {
                if (!this._monthsParse[bn]) {
                    bp = T.utc([2000, bn]);
                    bo = "^" + this.months(bp, "") + "|^" + this.monthsShort(bp, "");
                    this._monthsParse[bn] = new RegExp(bo.replace(".", ""), "i")
                }
                if (this._monthsParse[bn].test(bm)) {
                    return bn
                }
            }
        },
        _weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
        weekdays: function (i) {
            return this._weekdays[i.day()]
        },
        _weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
        weekdaysShort: function (i) {
            return this._weekdaysShort[i.day()]
        },
        _weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
        weekdaysMin: function (i) {
            return this._weekdaysMin[i.day()]
        },
        weekdaysParse: function (bp) {
            var bm, bo, bn;
            if (!this._weekdaysParse) {
                this._weekdaysParse = []
            }
            for (bm = 0; bm < 7; bm++) {
                if (!this._weekdaysParse[bm]) {
                    bo = T([2000, 1]).day(bm);
                    bn = "^" + this.weekdays(bo, "") + "|^" + this.weekdaysShort(bo, "") + "|^" + this.weekdaysMin(bo, "");
                    this._weekdaysParse[bm] = new RegExp(bn.replace(".", ""), "i")
                }
                if (this._weekdaysParse[bm].test(bp)) {
                    return bm
                }
            }
        },
        _longDateFormat: {
            LT: "h:mm A",
            L: "MM/DD/YYYY",
            LL: "MMMM D, YYYY",
            LLL: "MMMM D, YYYY LT",
            LLLL: "dddd, MMMM D, YYYY LT"
        },
        longDateFormat: function (bm) {
            var i = this._longDateFormat[bm];
            if (!i && this._longDateFormat[bm.toUpperCase()]) {
                i = this._longDateFormat[bm.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (bn) {
                    return bn.slice(1)
                });
                this._longDateFormat[bm] = i
            }
            return i
        },
        isPM: function (i) {
            return ((i + "").toLowerCase().charAt(0) === "p")
        },
        _meridiemParse: /[ap]\.?m?\.?/i,
        meridiem: function (i, bm, bn) {
            if (i > 11) {
                return bn ? "pm" : "PM"
            } else {
                return bn ? "am" : "AM"
            }
        },
        _calendar: {
            sameDay: "[Today at] LT",
            nextDay: "[Tomorrow at] LT",
            nextWeek: "dddd [at] LT",
            lastDay: "[Yesterday at] LT",
            lastWeek: "[Last] dddd [at] LT",
            sameElse: "L"
        },
        calendar: function (bm, bn) {
            var i = this._calendar[bm];
            return typeof i === "function" ? i.apply(bn) : i
        },
        _relativeTime: {
            future: "in %s",
            past: "%s ago",
            s: "a few seconds",
            m: "a minute",
            mm: "%d minutes",
            h: "an hour",
            hh: "%d hours",
            d: "a day",
            dd: "%d days",
            M: "a month",
            MM: "%d months",
            y: "a year",
            yy: "%d years"
        },
        relativeTime: function (bo, bn, bm, bp) {
            var i = this._relativeTime[bm];
            return (typeof i === "function") ? i(bo, bn, bm, bp) : i.replace(/%d/i, bo)
        },
        pastFuture: function (bn, i) {
            var bm = this._relativeTime[bn > 0 ? "future" : "past"];
            return typeof bm === "function" ? bm(i) : bm.replace(/%s/i, i)
        },
        ordinal: function (i) {
            return this._ordinal.replace("%d", i)
        },
        _ordinal: "%d",
        preparse: function (i) {
            return i
        },
        postformat: function (i) {
            return i
        },
        week: function (i) {
            return E(i, this._week.dow, this._week.doy).week
        },
        _week: {dow: 0, doy: 6},
        _invalidDate: "Invalid date",
        invalidDate: function () {
            return this._invalidDate
        }
    });
    function ao(i) {
        if (i.match(/\[[\s\S]/)) {
            return i.replace(/^\[|\]$/g, "")
        }
        return i.replace(/\\/g, "")
    }

    function v(bo) {
        var bp = bo.match(aw), bm, bn;
        for (bm = 0, bn = bp.length; bm < bn; bm++) {
            if (a0[bp[bm]]) {
                bp[bm] = a0[bp[bm]]
            } else {
                bp[bm] = ao(bp[bm])
            }
        }
        return function (bq) {
            var i = "";
            for (bm = 0; bm < bn; bm++) {
                i += bp[bm] instanceof Function ? bp[bm].call(bq, bo) : bp[bm]
            }
            return i
        }
    }

    function av(i, bm) {
        if (!i.isValid()) {
            return i.localeData().invalidDate()
        }
        bm = bg(bm, i.localeData());
        if (!ap[bm]) {
            ap[bm] = v(bm)
        }
        return ap[bm](i)
    }

    function bg(bp, bm) {
        var bn = 5;

        function bo(i) {
            return bm.longDateFormat(i) || i
        }

        ah.lastIndex = 0;
        while (bn >= 0 && ah.test(bp)) {
            bp = bp.replace(ah, bo);
            ah.lastIndex = 0;
            bn -= 1
        }
        return bp
    }

    function aA(bo, bn) {
        var bm, i = bn._strict;
        switch (bo) {
            case"Q":
                return ag;
            case"DDDD":
                return a8;
            case"YYYY":
            case"GGGG":
            case"gggg":
                return i ? aT : H;
            case"Y":
            case"G":
            case"g":
                return ae;
            case"YYYYYY":
            case"YYYYY":
            case"GGGGG":
            case"ggggg":
                return i ? an : bf;
            case"S":
                if (i) {
                    return ag
                }
            case"SS":
                if (i) {
                    return u
                }
            case"SSS":
                if (i) {
                    return a8
                }
            case"DDD":
                return aj;
            case"MMM":
            case"MMMM":
            case"dd":
            case"ddd":
            case"dddd":
                return L;
            case"a":
            case"A":
                return bn._locale._meridiemParse;
            case"X":
                return aU;
            case"Z":
            case"ZZ":
                return r;
            case"T":
                return n;
            case"SSSS":
                return a4;
            case"MM":
            case"DD":
            case"YY":
            case"GG":
            case"gg":
            case"HH":
            case"hh":
            case"mm":
            case"ss":
            case"ww":
            case"WW":
                return i ? u : k;
            case"M":
            case"D":
            case"d":
            case"H":
            case"h":
            case"m":
            case"s":
            case"w":
            case"W":
            case"e":
            case"E":
                return k;
            case"Do":
                return bl;
            default:
                bm = new RegExp(bd(aE(bo.replace("\\", "")), "i"));
                return bm
        }
    }

    function C(bm) {
        bm = bm || "";
        var i = (bm.match(r) || []), bp = i[i.length - 1] || [], bo = (bp + "").match(af) || ["-", 0, 0], bn = +(bo[1] * 60) + O(bo[2]);
        return bo[0] === "+" ? -bn : bn
    }

    function aD(bp, bn, bo) {
        var bm, i = bo._a;
        switch (bp) {
            case"Q":
                if (bn != null) {
                    i[j] = (O(bn) - 1) * 3
                }
                break;
            case"M":
            case"MM":
                if (bn != null) {
                    i[j] = O(bn) - 1
                }
                break;
            case"MMM":
            case"MMMM":
                bm = bo._locale.monthsParse(bn);
                if (bm != null) {
                    i[j] = bm
                } else {
                    bo._pf.invalidMonth = bn
                }
                break;
            case"D":
            case"DD":
                if (bn != null) {
                    i[aZ] = O(bn)
                }
                break;
            case"Do":
                if (bn != null) {
                    i[aZ] = O(parseInt(bn, 10))
                }
                break;
            case"DDD":
            case"DDDD":
                if (bn != null) {
                    bo._dayOfYear = O(bn)
                }
                break;
            case"YY":
                i[z] = T.parseTwoDigitYear(bn);
                break;
            case"YYYY":
            case"YYYYY":
            case"YYYYYY":
                i[z] = O(bn);
                break;
            case"a":
            case"A":
                bo._isPm = bo._locale.isPM(bn);
                break;
            case"H":
            case"HH":
            case"h":
            case"hh":
                i[y] = O(bn);
                break;
            case"m":
            case"mm":
                i[aF] = O(bn);
                break;
            case"s":
            case"ss":
                i[w] = O(bn);
                break;
            case"S":
            case"SS":
            case"SSS":
            case"SSSS":
                i[X] = O(("0." + bn) * 1000);
                break;
            case"X":
                bo._d = new Date(parseFloat(bn) * 1000);
                break;
            case"Z":
            case"ZZ":
                bo._useUTC = true;
                bo._tzm = C(bn);
                break;
            case"dd":
            case"ddd":
            case"dddd":
                bm = bo._locale.weekdaysParse(bn);
                if (bm != null) {
                    bo._w = bo._w || {};
                    bo._w.d = bm
                } else {
                    bo._pf.invalidWeekday = bn
                }
                break;
            case"w":
            case"ww":
            case"W":
            case"WW":
            case"d":
            case"e":
            case"E":
                bp = bp.substr(0, 1);
            case"gggg":
            case"GGGG":
            case"GGGGG":
                bp = bp.substr(0, 2);
                if (bn) {
                    bo._w = bo._w || {};
                    bo._w[bp] = O(bn)
                }
                break;
            case"gg":
            case"GG":
                bo._w = bo._w || {};
                bo._w[bp] = T.parseTwoDigitYear(bn)
        }
    }

    function V(bn) {
        var i, bp, bo, bq, bs, br, bm;
        i = bn._w;
        if (i.GG != null || i.W != null || i.E != null) {
            bs = 1;
            br = 4;
            bp = aV(i.GG, bn._a[z], E(T(), 1, 4).year);
            bo = aV(i.W, 1);
            bq = aV(i.E, 1)
        } else {
            bs = bn._locale._week.dow;
            br = bn._locale._week.doy;
            bp = aV(i.gg, bn._a[z], E(T(), bs, br).year);
            bo = aV(i.w, 1);
            if (i.d != null) {
                bq = i.d;
                if (bq < bs) {
                    ++bo
                }
            } else {
                if (i.e != null) {
                    bq = i.e + bs
                } else {
                    bq = bs
                }
            }
        }
        bm = x(bp, bo, bq, br, bs);
        bn._a[z] = bm.year;
        bn._dayOfYear = bm.dayOfYear
    }

    function am(bq) {
        var br, bp, bo = [], bn, bm;
        if (bq._d) {
            return
        }
        bn = q(bq);
        if (bq._w && bq._a[aZ] == null && bq._a[j] == null) {
            V(bq)
        }
        if (bq._dayOfYear) {
            bm = aV(bq._a[z], bn[z]);
            if (bq._dayOfYear > a5(bm)) {
                bq._pf._overflowDayOfYear = true
            }
            bp = K(bm, 0, bq._dayOfYear);
            bq._a[j] = bp.getUTCMonth();
            bq._a[aZ] = bp.getUTCDate()
        }
        for (br = 0; br < 3 && bq._a[br] == null; ++br) {
            bq._a[br] = bo[br] = bn[br]
        }
        for (; br < 7; br++) {
            bq._a[br] = bo[br] = (bq._a[br] == null) ? (br === 2 ? 1 : 0) : bq._a[br]
        }
        bq._d = (bq._useUTC ? K : ax).apply(null, bo);
        if (bq._tzm != null) {
            bq._d.setUTCMinutes(bq._d.getUTCMinutes() + bq._tzm)
        }
    }

    function aJ(bm) {
        var i;
        if (bm._d) {
            return
        }
        i = o(bm._i);
        bm._a = [i.year, i.month, i.day, i.hour, i.minute, i.second, i.millisecond];
        am(bm)
    }

    function q(bm) {
        var i = new Date();
        if (bm._useUTC) {
            return [i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()]
        } else {
            return [i.getFullYear(), i.getMonth(), i.getDate()]
        }
    }

    function S(bo) {
        if (bo._f === T.ISO_8601) {
            ay(bo);
            return
        }
        bo._a = [];
        bo._pf.empty = true;
        var br = "" + bo._i, bq, bn, bu, bp, bt, bm = br.length, bs = 0;
        bu = bg(bo._f, bo._locale).match(aw) || [];
        for (bq = 0; bq < bu.length; bq++) {
            bp = bu[bq];
            bn = (br.match(aA(bp, bo)) || [])[0];
            if (bn) {
                bt = br.substr(0, br.indexOf(bn));
                if (bt.length > 0) {
                    bo._pf.unusedInput.push(bt)
                }
                br = br.slice(br.indexOf(bn) + bn.length);
                bs += bn.length
            }
            if (a0[bp]) {
                if (bn) {
                    bo._pf.empty = false
                } else {
                    bo._pf.unusedTokens.push(bp)
                }
                aD(bp, bn, bo)
            } else {
                if (bo._strict && !bn) {
                    bo._pf.unusedTokens.push(bp)
                }
            }
        }
        bo._pf.charsLeftOver = bm - bs;
        if (br.length > 0) {
            bo._pf.unusedInput.push(br)
        }
        if (bo._isPm && bo._a[y] < 12) {
            bo._a[y] += 12
        }
        if (bo._isPm === false && bo._a[y] === 12) {
            bo._a[y] = 0
        }
        am(bo);
        bc(bo)
    }

    function aE(i) {
        return i.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (bm, bq, bp, bo, bn) {
            return bq || bp || bo || bn
        })
    }

    function bd(i) {
        return i.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
    }

    function a1(bm) {
        var bq, bo, bp, bn, br;
        if (bm._f.length === 0) {
            bm._pf.invalidFormat = true;
            bm._d = new Date(NaN);
            return
        }
        for (bn = 0; bn < bm._f.length; bn++) {
            br = 0;
            bq = aO({}, bm);
            bq._pf = al();
            bq._f = bm._f[bn];
            S(bq);
            if (!aH(bq)) {
                continue
            }
            br += bq._pf.charsLeftOver;
            br += bq._pf.unusedTokens.length * 10;
            bq._pf.score = br;
            if (bp == null || br < bp) {
                bp = br;
                bo = bq
            }
        }
        aG(bm, bo || bq)
    }

    function ay(bp) {
        var bq, bm, bo = bp._i, bn = aQ.exec(bo);
        if (bn) {
            bp._pf.iso = true;
            for (bq = 0, bm = a7.length; bq < bm; bq++) {
                if (a7[bq][1].exec(bo)) {
                    bp._f = a7[bq][0] + (bn[6] || " ");
                    break
                }
            }
            for (bq = 0, bm = J.length; bq < bm; bq++) {
                if (J[bq][1].exec(bo)) {
                    bp._f += J[bq][0];
                    break
                }
            }
            if (bo.match(r)) {
                bp._f += "Z"
            }
            S(bp)
        } else {
            bp._isValid = false
        }
    }

    function m(i) {
        ay(i);
        if (i._isValid === false) {
            delete i._isValid;
            T.createFromInputFallback(i)
        }
    }

    function R(bn) {
        var bm = bn._i, i;
        if (bm === G) {
            bn._d = new Date()
        } else {
            if (h(bm)) {
                bn._d = new Date(+bm)
            } else {
                if ((i = e.exec(bm)) !== null) {
                    bn._d = new Date(+i[1])
                } else {
                    if (typeof bm === "string") {
                        m(bn)
                    } else {
                        if (b(bm)) {
                            bn._a = bm.slice(0);
                            am(bn)
                        } else {
                            if (typeof(bm) === "object") {
                                aJ(bn)
                            } else {
                                if (typeof(bm) === "number") {
                                    bn._d = new Date(bm)
                                } else {
                                    T.createFromInputFallback(bn)
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    function ax(bs, i, bq, bp, br, bo, bn) {
        var bm = new Date(bs, i, bq, bp, br, bo, bn);
        if (bs < 1970) {
            bm.setFullYear(bs)
        }
        return bm
    }

    function K(bm) {
        var i = new Date(Date.UTC.apply(null, arguments));
        if (bm < 1970) {
            i.setUTCFullYear(bm)
        }
        return i
    }

    function bb(bm, i) {
        if (typeof bm === "string") {
            if (!isNaN(bm)) {
                bm = parseInt(bm, 10)
            } else {
                bm = i.weekdaysParse(bm);
                if (typeof bm !== "number") {
                    return null
                }
            }
        }
        return bm
    }

    function aN(bm, bo, bn, bp, i) {
        return i.relativeTime(bo || 1, !!bn, bm, bp)
    }

    function D(bp, bm, bt) {
        var bn = T.duration(bp).abs(), bu = aa(bn.as("s")), bo = aa(bn.as("m")), bs = aa(bn.as("h")), bv = aa(bn.as("d")), i = aa(bn.as("M")), bq = aa(bn.as("y")), br = bu < A.s && ["s", bu] || bo === 1 && ["m"] || bo < A.m && ["mm", bo] || bs === 1 && ["h"] || bs < A.h && ["hh", bs] || bv === 1 && ["d"] || bv < A.d && ["dd", bv] || i === 1 && ["M"] || i < A.M && ["MM", i] || bq === 1 && ["y"] || ["yy", bq];
        br[2] = bm;
        br[3] = +bp > 0;
        br[4] = bt;
        return aN.apply({}, br)
    }

    function E(bp, bn, bq) {
        var bm = bq - bn, i = bq - bp.day(), bo;
        if (i > bm) {
            i -= 7
        }
        if (i < bm - 7) {
            i += 7
        }
        bo = T(bp).add(i, "d");
        return {week: Math.ceil(bo.dayOfYear() / 7), year: bo.year()}
    }

    function x(bp, bo, bq, bs, i) {
        var br = K(bp, 0, 1).getUTCDay(), bn, bm;
        br = br === 0 ? 7 : br;
        bq = bq != null ? bq : i;
        bn = i - br + (br > bs ? 7 : 0) - (br < i ? 7 : 0);
        bm = 7 * (bo - 1) + (bq - i) + bn + 1;
        return {year: bm > 0 ? bp : bp - 1, dayOfYear: bm > 0 ? bm : a5(bp - 1) + bm}
    }

    function P(bm) {
        var i = bm._i, bn = bm._f;
        bm._locale = bm._locale || T.localeData(bm._l);
        if (i === null || (bn === G && i === "")) {
            return T.invalid({nullInput: true})
        }
        if (typeof i === "string") {
            bm._i = i = bm._locale.preparse(i)
        }
        if (T.isMoment(i)) {
            return new N(i, true)
        } else {
            if (bn) {
                if (b(bn)) {
                    a1(bm)
                } else {
                    S(bm)
                }
            } else {
                R(bm)
            }
        }
        return new N(bm)
    }

    T = function (bn, bo, i, bm) {
        var bp;
        if (typeof(i) === "boolean") {
            bm = i;
            i = G
        }
        bp = {};
        bp._isAMomentObject = true;
        bp._i = bn;
        bp._f = bo;
        bp._l = i;
        bp._strict = bm;
        bp._isUTC = false;
        bp._pf = al();
        return P(bp)
    };
    T.suppressDeprecationWarnings = false;
    T.createFromInputFallback = bi("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function (i) {
        i._d = new Date(i._i)
    });
    function aB(bo, bp) {
        var bn, bm;
        if (bp.length === 1 && b(bp[0])) {
            bp = bp[0]
        }
        if (!bp.length) {
            return T()
        }
        bn = bp[0];
        for (bm = 1; bm < bp.length; ++bm) {
            if (bp[bm][bo](bn)) {
                bn = bp[bm]
            }
        }
        return bn
    }

    T.min = function () {
        var i = [].slice.call(arguments, 0);
        return aB("isBefore", i)
    };
    T.max = function () {
        var i = [].slice.call(arguments, 0);
        return aB("isAfter", i)
    };
    T.utc = function (bn, bo, i, bm) {
        var bp;
        if (typeof(i) === "boolean") {
            bm = i;
            i = G
        }
        bp = {};
        bp._isAMomentObject = true;
        bp._useUTC = true;
        bp._isUTC = true;
        bp._l = i;
        bp._i = bn;
        bp._f = bo;
        bp._strict = bm;
        bp._pf = al();
        return P(bp).utc()
    };
    T.unix = function (i) {
        return T(i * 1000)
    };
    T.duration = function (bn, br) {
        var bs = bn, bq = null, bm, bp, bo, i;
        if (T.isDuration(bn)) {
            bs = {ms: bn._milliseconds, d: bn._days, M: bn._months}
        } else {
            if (typeof bn === "number") {
                bs = {};
                if (br) {
                    bs[br] = bn
                } else {
                    bs.milliseconds = bn
                }
            } else {
                if (!!(bq = a9.exec(bn))) {
                    bm = (bq[1] === "-") ? -1 : 1;
                    bs = {
                        y: 0,
                        d: O(bq[aZ]) * bm,
                        h: O(bq[y]) * bm,
                        m: O(bq[aF]) * bm,
                        s: O(bq[w]) * bm,
                        ms: O(bq[X]) * bm
                    }
                } else {
                    if (!!(bq = aK.exec(bn))) {
                        bm = (bq[1] === "-") ? -1 : 1;
                        bo = function (bu) {
                            var bt = bu && parseFloat(bu.replace(",", "."));
                            return (isNaN(bt) ? 0 : bt) * bm
                        };
                        bs = {
                            y: bo(bq[2]),
                            M: bo(bq[3]),
                            d: bo(bq[4]),
                            h: bo(bq[5]),
                            m: bo(bq[6]),
                            s: bo(bq[7]),
                            w: bo(bq[8])
                        }
                    } else {
                        if (typeof bs === "object" && ("from" in bs || "to" in bs)) {
                            i = ab(T(bs.from), T(bs.to));
                            bs = {};
                            bs.ms = i.milliseconds;
                            bs.M = i.months
                        }
                    }
                }
            }
        }
        bp = new ak(bs);
        if (T.isDuration(bn) && bn.hasOwnProperty("_locale")) {
            bp._locale = bn._locale
        }
        return bp
    };
    T.version = aI;
    T.defaultFormat = Y;
    T.ISO_8601 = function () {
    };
    T.momentProperties = aS;
    T.updateOffset = function () {
    };
    T.relativeTimeThreshold = function (i, bm) {
        if (A[i] === G) {
            return false
        }
        if (bm === G) {
            return A[i]
        }
        A[i] = bm;
        return true
    };
    T.lang = bi("moment.lang is deprecated. Use moment.locale instead.", function (i, bm) {
        return T.locale(i, bm)
    });
    T.locale = function (bm, i) {
        var bn;
        if (bm) {
            if (typeof(i) !== "undefined") {
                bn = T.defineLocale(bm, i)
            } else {
                bn = T.localeData(bm)
            }
            if (bn) {
                T.duration._locale = T._locale = bn
            }
        }
        return T._locale._abbr
    };
    T.defineLocale = function (bm, i) {
        if (i !== null) {
            i.abbr = bm;
            if (!aq[bm]) {
                aq[bm] = new ad()
            }
            aq[bm].set(i);
            T.locale(bm);
            return aq[bm]
        } else {
            delete aq[bm];
            return null
        }
    };
    T.langData = bi("moment.langData is deprecated. Use moment.localeData instead.", function (i) {
        return T.localeData(i)
    });
    T.localeData = function (bm) {
        var i;
        if (bm && bm._locale && bm._locale._abbr) {
            bm = bm._locale._abbr
        }
        if (!bm) {
            return T._locale
        }
        if (!b(bm)) {
            i = c(bm);
            if (i) {
                return i
            }
            bm = [bm]
        }
        return az(bm)
    };
    T.isMoment = function (i) {
        return i instanceof N || (i != null && i.hasOwnProperty("_isAMomentObject"))
    };
    T.isDuration = function (i) {
        return i instanceof ak
    };
    for (ai = Z.length - 1; ai >= 0; --ai) {
        aC(Z[ai])
    }
    T.normalizeUnits = function (i) {
        return a2(i)
    };
    T.invalid = function (bm) {
        var i = T.utc(NaN);
        if (bm != null) {
            aG(i._pf, bm)
        } else {
            i._pf.userInvalidated = true
        }
        return i
    };
    T.parseZone = function () {
        return T.apply(null, arguments).parseZone()
    };
    T.parseTwoDigitYear = function (i) {
        return O(i) + (O(i) > 68 ? 1900 : 2000)
    };
    aG(T.fn = N.prototype, {
        clone: function () {
            return T(this)
        },
        valueOf: function () {
            return +this._d + ((this._offset || 0) * 60000)
        },
        unix: function () {
            return Math.floor(+this / 1000)
        },
        toString: function () {
            return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
        },
        toDate: function () {
            return this._offset ? new Date(+this) : this._d
        },
        toISOString: function () {
            var i = T(this).utc();
            if (0 < i.year() && i.year() <= 9999) {
                return av(i, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
            } else {
                return av(i, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
            }
        },
        toArray: function () {
            var i = this;
            return [i.year(), i.month(), i.date(), i.hours(), i.minutes(), i.seconds(), i.milliseconds()]
        },
        isValid: function () {
            return aH(this)
        },
        isDSTShifted: function () {
            if (this._a) {
                return this.isValid() && aX(this._a, (this._isUTC ? T.utc(this._a) : T(this._a)).toArray()) > 0
            }
            return false
        },
        parsingFlags: function () {
            return aG({}, this._pf)
        },
        invalidAt: function () {
            return this._pf.overflow
        },
        utc: function (i) {
            return this.zone(0, i)
        },
        local: function (i) {
            if (this._isUTC) {
                this.zone(0, i);
                this._isUTC = false;
                if (i) {
                    this.add(this._d.getTimezoneOffset(), "m")
                }
            }
            return this
        },
        format: function (bm) {
            var i = av(this, bm || T.defaultFormat);
            return this.localeData().postformat(i)
        },
        add: U(1, "add"),
        subtract: U(-1, "subtract"),
        diff: function (bp, bo, i) {
            var bq = B(bp, this), bm = (this.zone() - bq.zone()) * 60000, br, bn;
            bo = a2(bo);
            if (bo === "year" || bo === "month") {
                br = (this.daysInMonth() + bq.daysInMonth()) * 43200000;
                bn = ((this.year() - bq.year()) * 12) + (this.month() - bq.month());
                bn += ((this - T(this).startOf("month")) - (bq - T(bq).startOf("month"))) / br;
                bn -= ((this.zone() - T(this).startOf("month").zone()) - (bq.zone() - T(bq).startOf("month").zone())) * 60000 / br;
                if (bo === "year") {
                    bn = bn / 12
                }
            } else {
                br = (this - bq);
                bn = bo === "second" ? br / 1000 : bo === "minute" ? br / 60000 : bo === "hour" ? br / 3600000 : bo === "day" ? (br - bm) / 86400000 : bo === "week" ? (br - bm) / 604800000 : br
            }
            return i ? bn : p(bn)
        },
        from: function (bm, i) {
            return T.duration({to: this, from: bm}).locale(this.locale()).humanize(!i)
        },
        fromNow: function (i) {
            return this.from(T(), i)
        },
        calendar: function (bp) {
            var bm = bp || T(), i = B(bm, this).startOf("day"), bo = this.diff(i, "days", true), bn = bo < -6 ? "sameElse" : bo < -1 ? "lastWeek" : bo < 0 ? "lastDay" : bo < 1 ? "sameDay" : bo < 2 ? "nextDay" : bo < 7 ? "nextWeek" : "sameElse";
            return this.format(this.localeData().calendar(bn, this))
        },
        isLeapYear: function () {
            return aP(this.year())
        },
        isDST: function () {
            return (this.zone() < this.clone().month(0).zone() || this.zone() < this.clone().month(5).zone())
        },
        day: function (bm) {
            var i = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
            if (bm != null) {
                bm = bb(bm, this.localeData());
                return this.add(bm - i, "d")
            } else {
                return i
            }
        },
        month: t("Month", true),
        startOf: function (i) {
            i = a2(i);
            switch (i) {
                case"year":
                    this.month(0);
                case"quarter":
                case"month":
                    this.date(1);
                case"week":
                case"isoWeek":
                case"day":
                    this.hours(0);
                case"hour":
                    this.minutes(0);
                case"minute":
                    this.seconds(0);
                case"second":
                    this.milliseconds(0)
            }
            if (i === "week") {
                this.weekday(0)
            } else {
                if (i === "isoWeek") {
                    this.isoWeekday(1)
                }
            }
            if (i === "quarter") {
                this.month(Math.floor(this.month() / 3) * 3)
            }
            return this
        },
        endOf: function (i) {
            i = a2(i);
            return this.startOf(i).add(1, (i === "isoWeek" ? "week" : i)).subtract(1, "ms")
        },
        isAfter: function (bm, i) {
            i = typeof i !== "undefined" ? i : "millisecond";
            return +this.clone().startOf(i) > +T(bm).startOf(i)
        },
        isBefore: function (bm, i) {
            i = typeof i !== "undefined" ? i : "millisecond";
            return +this.clone().startOf(i) < +T(bm).startOf(i)
        },
        isSame: function (bm, i) {
            i = i || "ms";
            return +this.clone().startOf(i) === +B(bm, this).startOf(i)
        },
        min: bi("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function (i) {
            i = T.apply(null, arguments);
            return i < this ? this : i
        }),
        max: bi("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function (i) {
            i = T.apply(null, arguments);
            return i > this ? this : i
        }),
        zone: function (i, bo) {
            var bn = this._offset || 0, bm;
            if (i != null) {
                if (typeof i === "string") {
                    i = C(i)
                }
                if (Math.abs(i) < 16) {
                    i = i * 60
                }
                if (!this._isUTC && bo) {
                    bm = this._d.getTimezoneOffset()
                }
                this._offset = i;
                this._isUTC = true;
                if (bm != null) {
                    this.subtract(bm, "m")
                }
                if (bn !== i) {
                    if (!bo || this._changeInProgress) {
                        I(this, T.duration(bn - i, "m"), 1, false)
                    } else {
                        if (!this._changeInProgress) {
                            this._changeInProgress = true;
                            T.updateOffset(this, true);
                            this._changeInProgress = null
                        }
                    }
                }
            } else {
                return this._isUTC ? bn : this._d.getTimezoneOffset()
            }
            return this
        },
        zoneAbbr: function () {
            return this._isUTC ? "UTC" : ""
        },
        zoneName: function () {
            return this._isUTC ? "Coordinated Universal Time" : ""
        },
        parseZone: function () {
            if (this._tzm) {
                this.zone(this._tzm)
            } else {
                if (typeof this._i === "string") {
                    this.zone(this._i)
                }
            }
            return this
        },
        hasAlignedHourOffset: function (i) {
            if (!i) {
                i = 0
            } else {
                i = T(i).zone()
            }
            return (this.zone() - i) % 60 === 0
        },
        daysInMonth: function () {
            return ba(this.year(), this.month())
        },
        dayOfYear: function (i) {
            var bm = aa((T(this).startOf("day") - T(this).startOf("year")) / 86400000) + 1;
            return i == null ? bm : this.add((i - bm), "d")
        },
        quarter: function (i) {
            return i == null ? Math.ceil((this.month() + 1) / 3) : this.month((i - 1) * 3 + this.month() % 3)
        },
        weekYear: function (i) {
            var bm = E(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
            return i == null ? bm : this.add((i - bm), "y")
        },
        isoWeekYear: function (i) {
            var bm = E(this, 1, 4).year;
            return i == null ? bm : this.add((i - bm), "y")
        },
        week: function (i) {
            var bm = this.localeData().week(this);
            return i == null ? bm : this.add((i - bm) * 7, "d")
        },
        isoWeek: function (i) {
            var bm = E(this, 1, 4).week;
            return i == null ? bm : this.add((i - bm) * 7, "d")
        },
        weekday: function (i) {
            var bm = (this.day() + 7 - this.localeData()._week.dow) % 7;
            return i == null ? bm : this.add(i - bm, "d")
        },
        isoWeekday: function (i) {
            return i == null ? this.day() || 7 : this.day(this.day() % 7 ? i : i - 7)
        },
        isoWeeksInYear: function () {
            return aL(this.year(), 1, 4)
        },
        weeksInYear: function () {
            var i = this.localeData()._week;
            return aL(this.year(), i.dow, i.doy)
        },
        get: function (i) {
            i = a2(i);
            return this[i]()
        },
        set: function (i, bm) {
            i = a2(i);
            if (typeof this[i] === "function") {
                this[i](bm)
            }
            return this
        },
        locale: function (i) {
            if (i === G) {
                return this._locale._abbr
            } else {
                this._locale = T.localeData(i);
                return this
            }
        },
        lang: bi("moment().lang() is deprecated. Use moment().localeData() instead.", function (i) {
            if (i === G) {
                return this.localeData()
            } else {
                this._locale = T.localeData(i);
                return this
            }
        }),
        localeData: function () {
            return this._locale
        }
    });
    function be(i, bm) {
        var bn;
        if (typeof bm === "string") {
            bm = i.localeData().monthsParse(bm);
            if (typeof bm !== "number") {
                return i
            }
        }
        bn = Math.min(i.date(), ba(i.year(), bm));
        i._d["set" + (i._isUTC ? "UTC" : "") + "Month"](bm, bn);
        return i
    }

    function bj(bm, i) {
        return bm._d["get" + (bm._isUTC ? "UTC" : "") + i]()
    }

    function aW(bm, i, bn) {
        if (i === "Month") {
            return be(bm, bn)
        } else {
            return bm._d["set" + (bm._isUTC ? "UTC" : "") + i](bn)
        }
    }

    function t(i, bm) {
        return function (bn) {
            if (bn != null) {
                aW(this, i, bn);
                T.updateOffset(this, bm);
                return this
            } else {
                return bj(this, i)
            }
        }
    }

    T.fn.millisecond = T.fn.milliseconds = t("Milliseconds", false);
    T.fn.second = T.fn.seconds = t("Seconds", false);
    T.fn.minute = T.fn.minutes = t("Minutes", false);
    T.fn.hour = T.fn.hours = t("Hours", true);
    T.fn.date = t("Date", true);
    T.fn.dates = bi("dates accessor is deprecated. Use date instead.", t("Date", true));
    T.fn.year = t("FullYear", true);
    T.fn.years = bi("years accessor is deprecated. Use year instead.", t("FullYear", true));
    T.fn.days = T.fn.day;
    T.fn.months = T.fn.month;
    T.fn.weeks = T.fn.week;
    T.fn.isoWeeks = T.fn.isoWeek;
    T.fn.quarters = T.fn.quarter;
    T.fn.toJSON = T.fn.toISOString;
    function s(i) {
        return i * 400 / 146097
    }

    function bh(i) {
        return i * 146097 / 400
    }

    aG(T.duration.fn = ak.prototype, {
        _bubble: function () {
            var bn = this._milliseconds, bs = this._days, i = this._months, bq = this._data, br, bp, bm, bo = 0;
            bq.milliseconds = bn % 1000;
            br = p(bn / 1000);
            bq.seconds = br % 60;
            bp = p(br / 60);
            bq.minutes = bp % 60;
            bm = p(bp / 60);
            bq.hours = bm % 24;
            bs += p(bm / 24);
            bo = p(s(bs));
            bs -= p(bh(bo));
            i += p(bs / 30);
            bs %= 30;
            bo += p(i / 12);
            i %= 12;
            bq.days = bs;
            bq.months = i;
            bq.years = bo
        },
        abs: function () {
            this._milliseconds = Math.abs(this._milliseconds);
            this._days = Math.abs(this._days);
            this._months = Math.abs(this._months);
            this._data.milliseconds = Math.abs(this._data.milliseconds);
            this._data.seconds = Math.abs(this._data.seconds);
            this._data.minutes = Math.abs(this._data.minutes);
            this._data.hours = Math.abs(this._data.hours);
            this._data.months = Math.abs(this._data.months);
            this._data.years = Math.abs(this._data.years);
            return this
        },
        weeks: function () {
            return p(this.days() / 7)
        },
        valueOf: function () {
            return this._milliseconds + this._days * 86400000 + (this._months % 12) * 2592000000 + O(this._months / 12) * 31536000000
        },
        humanize: function (bm) {
            var i = D(this, !bm, this.localeData());
            if (bm) {
                i = this.localeData().pastFuture(+this, i)
            }
            return this.localeData().postformat(i)
        },
        add: function (i, bn) {
            var bm = T.duration(i, bn);
            this._milliseconds += bm._milliseconds;
            this._days += bm._days;
            this._months += bm._months;
            this._bubble();
            return this
        },
        subtract: function (i, bn) {
            var bm = T.duration(i, bn);
            this._milliseconds -= bm._milliseconds;
            this._days -= bm._days;
            this._months -= bm._months;
            this._bubble();
            return this
        },
        get: function (i) {
            i = a2(i);
            return this[i.toLowerCase() + "s"]()
        },
        as: function (bm) {
            var bn, i;
            bm = a2(bm);
            bn = this._days + this._milliseconds / 86400000;
            if (bm === "month" || bm === "year") {
                i = this._months + s(bn) * 12;
                return bm === "month" ? i : i / 12
            } else {
                bn += bh(this._months / 12);
                switch (bm) {
                    case"week":
                        return bn / 7;
                    case"day":
                        return bn;
                    case"hour":
                        return bn * 24;
                    case"minute":
                        return bn * 24 * 60;
                    case"second":
                        return bn * 24 * 60 * 60;
                    case"millisecond":
                        return bn * 24 * 60 * 60 * 1000;
                    default:
                        throw new Error("Unknown unit " + bm)
                }
            }
        },
        lang: T.fn.lang,
        locale: T.fn.locale,
        toIsoString: bi("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", function () {
            return this.toISOString()
        }),
        toISOString: function () {
            var bo = Math.abs(this.years()), i = Math.abs(this.months()), bq = Math.abs(this.days()), bm = Math.abs(this.hours()), bn = Math.abs(this.minutes()), bp = Math.abs(this.seconds() + this.milliseconds() / 1000);
            if (!this.asSeconds()) {
                return "P0D"
            }
            return (this.asSeconds() < 0 ? "-" : "") + "P" + (bo ? bo + "Y" : "") + (i ? i + "M" : "") + (bq ? bq + "D" : "") + ((bm || bn || bp) ? "T" : "") + (bm ? bm + "H" : "") + (bn ? bn + "M" : "") + (bp ? bp + "S" : "")
        },
        localeData: function () {
            return this._locale
        }
    });
    function ac(i) {
        T.duration.fn[i] = function () {
            return this._data[i]
        }
    }

    for (ai in F) {
        if (F.hasOwnProperty(ai)) {
            ac(ai.toLowerCase())
        }
    }
    T.duration.fn.asMilliseconds = function () {
        return this.as("ms")
    };
    T.duration.fn.asSeconds = function () {
        return this.as("s")
    };
    T.duration.fn.asMinutes = function () {
        return this.as("m")
    };
    T.duration.fn.asHours = function () {
        return this.as("h")
    };
    T.duration.fn.asDays = function () {
        return this.as("d")
    };
    T.duration.fn.asWeeks = function () {
        return this.as("weeks")
    };
    T.duration.fn.asMonths = function () {
        return this.as("M")
    };
    T.duration.fn.asYears = function () {
        return this.as("y")
    };
    T.locale("en", {
        ordinal: function (bn) {
            var i = bn % 10, bm = (O(bn % 100 / 10) === 1) ? "th" : (i === 1) ? "st" : (i === 2) ? "nd" : (i === 3) ? "rd" : "th";
            return bn + bm
        }
    });
    function W(i) {
        if (typeof ender !== "undefined") {
            return
        }
        at = a6.moment;
        if (i) {
            a6.moment = bi("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.", T)
        } else {
            a6.moment = T
        }
    }

    if (ar) {
        module.exports = T
    } else {
        if (typeof define === "function" && define.amd) {
            define("moment", function (bm, i, bn) {
                if (bn.config && bn.config() && bn.config().noGlobal === true) {
                    a6.moment = at
                }
                return T
            });
            W(true)
        } else {
            W()
        }
    }
}).call(this);

/* bootstrap-datetimepicker.js  */
(function (a, b) {
    if (typeof define === "function" && define.amd) {
        define(["jquery.dataTables", "moment"], b)
    } else {
        if (typeof exports === "object") {
            b(require("jquery"), require("moment"))
        } else {
            if (!jQuery) {
                throw new Error("bootstrap-datetimepicker requires jQuery to be loaded first")
            }
            if (!moment) {
                throw new Error("bootstrap-datetimepicker requires moment.js to be loaded first")
            }
            b(a.jQuery, moment)
        }
    }
}(this, function (c, d) {
    if (typeof d === "undefined") {
        throw new Error("momentjs is required")
    }
    var b = 0, a = function (o, s) {
        var C = c.fn.datetimepicker.defaults, Q = {
            time: "glyphicon glyphicon-time",
            date: "glyphicon glyphicon-calendar",
            up: "glyphicon glyphicon-chevron-up",
            down: "glyphicon glyphicon-chevron-down"
        }, k = this, n = false, q, M = function () {
            var W = false, V, U;
            k.options = c.extend({}, C, s);
            k.options.icons = c.extend({}, Q, k.options.icons);
            k.element = c(o);
            e();
            if (!(k.options.pickTime || k.options.pickDate)) {
                throw new Error("Must choose at least one picker")
            }
            k.id = b++;
            d.locale(k.options.language);
            k.date = d();
            k.unset = false;
            k.isInput = k.element.is("input");
            k.component = false;
            if (k.element.hasClass("input-group")) {
                if (k.element.find(".datepickerbutton").size() === 0) {
                    k.component = k.element.find('[class^="input-group-"]')
                } else {
                    k.component = k.element.find(".datepickerbutton")
                }
            }
            k.format = k.options.format;
            V = d().localeData();
            if (!k.format) {
                k.format = (k.options.pickDate ? V.longDateFormat("L") : "");
                if (k.options.pickDate && k.options.pickTime) {
                    k.format += " "
                }
                k.format += (k.options.pickTime ? V.longDateFormat("LT") : "");
                if (k.options.useSeconds) {
                    if (V.longDateFormat("LT").indexOf(" A") !== -1) {
                        k.format = k.format.split(" A")[0] + ":ss A"
                    } else {
                        k.format += ":ss"
                    }
                }
            }
            k.use24hours = (k.format.toLowerCase().indexOf("a") < 0 && k.format.indexOf("h") < 0);
            if (k.component) {
                W = k.component.find("span")
            }
            if (k.options.pickTime) {
                if (W) {
                    W.addClass(k.options.icons.time)
                }
            }
            if (k.options.pickDate) {
                if (W) {
                    W.removeClass(k.options.icons.time);
                    W.addClass(k.options.icons.date)
                }
            }
            k.options.widgetParent = typeof k.options.widgetParent === "string" && k.options.widgetParent || k.element.parents().filter(function () {
                    return "scroll" === c(this).css("overflow-y")
                }).get(0) || "body";
            k.widget = c(T()).appendTo(k.options.widgetParent);
            k.minViewMode = k.options.minViewMode || 0;
            if (typeof k.minViewMode === "string") {
                switch (k.minViewMode) {
                    case"months":
                        k.minViewMode = 1;
                        break;
                    case"years":
                        k.minViewMode = 2;
                        break;
                    default:
                        k.minViewMode = 0;
                        break
                }
            }
            k.viewMode = k.options.viewMode || 0;
            if (typeof k.viewMode === "string") {
                switch (k.viewMode) {
                    case"months":
                        k.viewMode = 1;
                        break;
                    case"years":
                        k.viewMode = 2;
                        break;
                    default:
                        k.viewMode = 0;
                        break
                }
            }
            k.viewMode = Math.max(k.viewMode, k.minViewMode);
            k.options.disabledDates = E(k.options.disabledDates);
            k.options.enabledDates = E(k.options.enabledDates);
            k.startViewMode = k.viewMode;
            k.setMinDate(k.options.minDate);
            k.setMaxDate(k.options.maxDate);
            L();
            w();
            x();
            v();
            g();
            B();
            f();
            if (!z().prop("disabled")) {
                N()
            }
            if (k.options.defaultDate !== "" && z().val() === "") {
                k.setValue(k.options.defaultDate)
            }
            if (k.options.minuteStepping !== 1) {
                U = k.options.minuteStepping;
                k.date.minutes((Math.round(k.date.minutes() / U) * U) % 60).seconds(0)
            }
        }, z = function () {
            var U;
            if (k.isInput) {
                return k.element
            }
            U = k.element.find(".datepickerinput");
            if (U.size() === 0) {
                U = k.element.find("input")
            } else {
                if (!U.is("input")) {
                    throw new Error('CSS class "datepickerinput" cannot be applied to non input element')
                }
            }
            return U
        }, e = function () {
            var U;
            if (k.element.is("input")) {
                U = k.element.data()
            } else {
                U = k.element.find("input").data()
            }
            if (U.dateFormat !== undefined) {
                k.options.format = U.dateFormat
            }
            if (U.datePickdate !== undefined) {
                k.options.pickDate = U.datePickdate
            }
            if (U.datePicktime !== undefined) {
                k.options.pickTime = U.datePicktime
            }
            if (U.dateUseminutes !== undefined) {
                k.options.useMinutes = U.dateUseminutes
            }
            if (U.dateUseseconds !== undefined) {
                k.options.useSeconds = U.dateUseseconds
            }
            if (U.dateUsecurrent !== undefined) {
                k.options.useCurrent = U.dateUsecurrent
            }
            if (U.calendarWeeks !== undefined) {
                k.options.calendarWeeks = U.calendarWeeks
            }
            if (U.dateMinutestepping !== undefined) {
                k.options.minuteStepping = U.dateMinutestepping
            }
            if (U.dateMindate !== undefined) {
                k.options.minDate = U.dateMindate
            }
            if (U.dateMaxdate !== undefined) {
                k.options.maxDate = U.dateMaxdate
            }
            if (U.dateShowtoday !== undefined) {
                k.options.showToday = U.dateShowtoday
            }
            if (U.dateCollapse !== undefined) {
                k.options.collapse = U.dateCollapse
            }
            if (U.dateLanguage !== undefined) {
                k.options.language = U.dateLanguage
            }
            if (U.dateDefaultdate !== undefined) {
                k.options.defaultDate = U.dateDefaultdate
            }
            if (U.dateDisableddates !== undefined) {
                k.options.disabledDates = U.dateDisableddates
            }
            if (U.dateEnableddates !== undefined) {
                k.options.enabledDates = U.dateEnableddates
            }
            if (U.dateIcons !== undefined) {
                k.options.icons = U.dateIcons
            }
            if (U.dateUsestrict !== undefined) {
                k.options.useStrict = U.dateUsestrict
            }
            if (U.dateDirection !== undefined) {
                k.options.direction = U.dateDirection
            }
            if (U.dateSidebyside !== undefined) {
                k.options.sideBySide = U.dateSidebyside
            }
            if (U.dateDaysofweekdisabled !== undefined) {
                k.options.daysOfWeekDisabled = U.dateDaysofweekdisabled
            }
        }, i = function () {
            var U = "absolute", X = k.component ? k.component.offset() : k.element.offset(), W = c(window), V;
            k.width = k.component ? k.component.outerWidth() : k.element.outerWidth();
            X.top = X.top + k.element.outerHeight();
            if (k.options.direction === "up") {
                V = "top"
            } else {
                if (k.options.direction === "bottom") {
                    V = "bottom"
                } else {
                    if (k.options.direction === "auto") {
                        if (X.top + k.widget.height() > W.height() + W.scrollTop() && k.widget.height() + k.element.outerHeight() < X.top) {
                            V = "top"
                        } else {
                            V = "bottom"
                        }
                    }
                }
            }
            if (V === "top") {
                X.bottom = W.height() - X.top + k.element.outerHeight() + 3;
                k.widget.addClass("top").removeClass("bottom")
            } else {
                X.top += 1;
                k.widget.addClass("bottom").removeClass("top")
            }
            if (k.options.width !== undefined) {
                k.widget.width(k.options.width)
            }
            if (k.options.orientation === "left") {
                k.widget.addClass("left-oriented");
                X.left = X.left - k.widget.width() + 20
            }
            if (F()) {
                U = "fixed";
                X.top -= W.scrollTop();
                X.left -= W.scrollLeft()
            }
            if (W.width() < X.left + k.widget.outerWidth()) {
                X.right = W.width() - X.left - k.width;
                X.left = "auto";
                k.widget.addClass("pull-right")
            } else {
                X.right = "auto";
                k.widget.removeClass("pull-right")
            }
            if (V === "top") {
                k.widget.css({position: U, bottom: X.bottom, top: "auto", left: X.left, right: X.right})
            } else {
                k.widget.css({position: U, top: X.top, bottom: "auto", left: X.left, right: X.right})
            }
        }, p = function (V, U) {
            if (d(k.date).isSame(d(V)) && !n) {
                return
            }
            n = false;
            k.element.trigger({type: "dp.change", date: d(k.date), oldDate: d(V)});
            if (U !== "change") {
                k.element.change()
            }
        }, G = function (U) {
            n = true;
            k.element.trigger({type: "dp.error", date: d(U, k.format, k.options.useStrict)})
        }, B = function (U) {
            d.locale(k.options.language);
            var V = U;
            if (!V) {
                V = z().val();
                if (V) {
                    k.date = d(V, k.format, k.options.useStrict)
                }
                if (!k.date) {
                    k.date = d()
                }
            }
            k.viewDate = d(k.date).startOf("month");
            m();
            j()
        }, L = function () {
            d.locale(k.options.language);
            var W = c("<tr>"), U = d.weekdaysMin(), V;
            if (k.options.calendarWeeks === true) {
                W.append('<th class="cw">#</th>')
            }
            if (d().localeData()._week.dow === 0) {
                for (V = 0; V < 7; V++) {
                    W.append('<th class="dow">' + U[V] + "</th>")
                }
            } else {
                for (V = 1; V < 8; V++) {
                    if (V === 7) {
                        W.append('<th class="dow">' + U[0] + "</th>")
                    } else {
                        W.append('<th class="dow">' + U[V] + "</th>")
                    }
                }
            }
            k.widget.find(".datepicker-days thead").append(W)
        }, w = function () {
            d.locale(k.options.language);
            var V = "", U, W = d.monthsShort();
            for (U = 0; U < 12; U++) {
                V += '<span class="month">' + W[U] + "</span>"
            }
            k.widget.find(".datepicker-months td").append(V)
        }, m = function () {
            if (!k.options.pickDate) {
                return
            }
            d.locale(k.options.language);
            var ag = k.viewDate.year(), ae = k.viewDate.month(), af = k.options.minDate.year(), ai = k.options.minDate.month(), aj = k.options.maxDate.year(), ac = k.options.maxDate.month(), V, Y, ab, aa = [], ak, X, Z, ah, W, ad, U = d.months();
            k.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");
            k.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");
            k.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");
            k.widget.find(".datepicker-days th:eq(1)").text(U[ae] + " " + ag);
            Y = d(k.viewDate, k.format, k.options.useStrict).subtract(1, "months");
            ah = Y.daysInMonth();
            Y.date(ah).startOf("week");
            if ((ag === af && ae <= ai) || ag < af) {
                k.widget.find(".datepicker-days th:eq(0)").addClass("disabled")
            }
            if ((ag === aj && ae >= ac) || ag > aj) {
                k.widget.find(".datepicker-days th:eq(2)").addClass("disabled")
            }
            ab = d(Y).add(42, "d");
            while (Y.isBefore(ab)) {
                if (Y.weekday() === d().startOf("week").weekday()) {
                    ak = c("<tr>");
                    aa.push(ak);
                    if (k.options.calendarWeeks === true) {
                        ak.append('<td class="cw">' + Y.week() + "</td>")
                    }
                }
                X = "";
                if (Y.year() < ag || (Y.year() === ag && Y.month() < ae)) {
                    X += " old"
                } else {
                    if (Y.year() > ag || (Y.year() === ag && Y.month() > ae)) {
                        X += " new"
                    }
                }
                if (Y.isSame(d({y: k.date.year(), M: k.date.month(), d: k.date.date()}))) {
                    X += " active"
                }
                if (S(Y, "day") || !u(Y)) {
                    X += " disabled"
                }
                if (k.options.showToday === true) {
                    if (Y.isSame(d(), "day")) {
                        X += " today"
                    }
                }
                if (k.options.daysOfWeekDisabled) {
                    for (Z = 0; Z < k.options.daysOfWeekDisabled.length; Z++) {
                        if (Y.day() === k.options.daysOfWeekDisabled[Z]) {
                            X += " disabled";
                            break
                        }
                    }
                }
                ak.append('<td class="day' + X + '">' + Y.date() + "</td>");
                V = Y.date();
                Y.add(1, "d");
                if (V === Y.date()) {
                    Y.add(1, "d")
                }
            }
            k.widget.find(".datepicker-days tbody").empty().append(aa);
            ad = k.date.year();
            U = k.widget.find(".datepicker-months").find("th:eq(1)").text(ag).end().find("span").removeClass("active");
            if (ad === ag) {
                U.eq(k.date.month()).addClass("active")
            }
            if (ag - 1 < af) {
                k.widget.find(".datepicker-months th:eq(0)").addClass("disabled")
            }
            if (ag + 1 > aj) {
                k.widget.find(".datepicker-months th:eq(2)").addClass("disabled")
            }
            for (Z = 0; Z < 12; Z++) {
                if ((ag === af && ai > Z) || (ag < af)) {
                    c(U[Z]).addClass("disabled")
                } else {
                    if ((ag === aj && ac < Z) || (ag > aj)) {
                        c(U[Z]).addClass("disabled")
                    }
                }
            }
            aa = "";
            ag = parseInt(ag / 10, 10) * 10;
            W = k.widget.find(".datepicker-years").find("th:eq(1)").text(ag + "-" + (ag + 9)).parents("table").find("td");
            k.widget.find(".datepicker-years").find("th").removeClass("disabled");
            if (af > ag) {
                k.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")
            }
            if (aj < ag + 9) {
                k.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled")
            }
            ag -= 1;
            for (Z = -1; Z < 11; Z++) {
                aa += '<span class="year' + (Z === -1 || Z === 10 ? " old" : "") + (ad === ag ? " active" : "") + ((ag < af || ag > aj) ? " disabled" : "") + '">' + ag + "</span>";
                ag += 1
            }
            W.html(aa)
        }, x = function () {
            d.locale(k.options.language);
            var X = k.widget.find(".timepicker .timepicker-hours table"), W = "", Y, V, U;
            X.parent().hide();
            if (k.use24hours) {
                Y = 0;
                for (V = 0; V < 6; V += 1) {
                    W += "<tr>";
                    for (U = 0; U < 4; U += 1) {
                        W += '<td class="hour">' + R(Y.toString()) + "</td>";
                        Y++
                    }
                    W += "</tr>"
                }
            } else {
                Y = 1;
                for (V = 0; V < 3; V += 1) {
                    W += "<tr>";
                    for (U = 0; U < 4; U += 1) {
                        W += '<td class="hour">' + R(Y.toString()) + "</td>";
                        Y++
                    }
                    W += "</tr>"
                }
            }
            X.html(W)
        }, v = function () {
            var Y = k.widget.find(".timepicker .timepicker-minutes table"), W = "", Z = 0, V, U, X = k.options.minuteStepping;
            Y.parent().hide();
            if (X === 1) {
                X = 5
            }
            for (V = 0; V < Math.ceil(60 / X / 4); V++) {
                W += "<tr>";
                for (U = 0; U < 4; U += 1) {
                    if (Z < 60) {
                        W += '<td class="minute">' + R(Z.toString()) + "</td>";
                        Z += X
                    } else {
                        W += "<td></td>"
                    }
                }
                W += "</tr>"
            }
            Y.html(W)
        }, g = function () {
            var X = k.widget.find(".timepicker .timepicker-seconds table"), W = "", Y = 0, V, U;
            X.parent().hide();
            for (V = 0; V < 3; V++) {
                W += "<tr>";
                for (U = 0; U < 4; U += 1) {
                    W += '<td class="second">' + R(Y.toString()) + "</td>";
                    Y += 5
                }
                W += "</tr>"
            }
            X.html(W)
        }, j = function () {
            if (!k.date) {
                return
            }
            var W = k.widget.find(".timepicker span[data-time-component]"), U = k.date.hours(), V = k.date.format("A");
            if (!k.use24hours) {
                if (U === 0) {
                    U = 12
                } else {
                    if (U !== 12) {
                        U = U % 12
                    }
                }
                k.widget.find(".timepicker [data-action=togglePeriod]").text(V)
            }
            W.filter("[data-time-component=hours]").text(R(U));
            W.filter("[data-time-component=minutes]").text(R(k.date.minutes()));
            W.filter("[data-time-component=seconds]").text(R(k.date.second()))
        }, D = function (aa) {
            aa.stopPropagation();
            aa.preventDefault();
            k.unset = false;
            var Z = c(aa.target).closest("span, td, th"), Y, W, X, U, V = d(k.date);
            if (Z.length === 1) {
                if (!Z.is(".disabled")) {
                    switch (Z[0].nodeName.toLowerCase()) {
                        case"th":
                            switch (Z[0].className) {
                                case"picker-switch":
                                    f(1);
                                    break;
                                case"prev":
                                case"next":
                                    X = y.modes[k.viewMode].navStep;
                                    if (Z[0].className === "prev") {
                                        X = X * -1
                                    }
                                    k.viewDate.add(X, y.modes[k.viewMode].navFnc);
                                    m();
                                    break
                            }
                            break;
                        case"span":
                            if (Z.is(".month")) {
                                Y = Z.parent().find("span").index(Z);
                                k.viewDate.month(Y)
                            } else {
                                W = parseInt(Z.text(), 10) || 0;
                                k.viewDate.year(W)
                            }
                            if (k.viewMode === k.minViewMode) {
                                k.date = d({
                                    y: k.viewDate.year(),
                                    M: k.viewDate.month(),
                                    d: k.viewDate.date(),
                                    h: k.date.hours(),
                                    m: k.date.minutes(),
                                    s: k.date.seconds()
                                });
                                t();
                                p(V, aa.type)
                            }
                            f(-1);
                            m();
                            break;
                        case"td":
                            if (Z.is(".day")) {
                                U = parseInt(Z.text(), 10) || 1;
                                Y = k.viewDate.month();
                                W = k.viewDate.year();
                                if (Z.is(".old")) {
                                    if (Y === 0) {
                                        Y = 11;
                                        W -= 1
                                    } else {
                                        Y -= 1
                                    }
                                } else {
                                    if (Z.is(".new")) {
                                        if (Y === 11) {
                                            Y = 0;
                                            W += 1
                                        } else {
                                            Y += 1
                                        }
                                    }
                                }
                                k.date = d({
                                    y: W,
                                    M: Y,
                                    d: U,
                                    h: k.date.hours(),
                                    m: k.date.minutes(),
                                    s: k.date.seconds()
                                });
                                k.viewDate = d({y: W, M: Y, d: Math.min(28, U)});
                                m();
                                t();
                                p(V, aa.type);
                                if (k.widget.hasClass("picker-open")) {
                                    k.widget.hide();
                                    k.widget.removeClass("picker-open")
                                }
                            }
                            break
                    }
                }
            }
        }, H = {
            incrementHours: function () {
                l("add", "hours", 1)
            }, incrementMinutes: function () {
                l("add", "minutes", k.options.minuteStepping)
            }, incrementSeconds: function () {
                l("add", "seconds", 1)
            }, decrementHours: function () {
                l("subtract", "hours", 1)
            }, decrementMinutes: function () {
                l("subtract", "minutes", k.options.minuteStepping)
            }, decrementSeconds: function () {
                l("subtract", "seconds", 1)
            }, togglePeriod: function () {
                var U = k.date.hours();
                if (U >= 12) {
                    U -= 12
                } else {
                    U += 12
                }
                k.date.hours(U)
            }, showPicker: function () {
                k.widget.find(".timepicker > div:not(.timepicker-picker)").hide();
                k.widget.find(".timepicker .timepicker-picker").show()
            }, showHours: function () {
                k.widget.find(".timepicker .timepicker-picker").hide();
                k.widget.find(".timepicker .timepicker-hours").show()
            }, showMinutes: function () {
                k.widget.find(".timepicker .timepicker-picker").hide();
                k.widget.find(".timepicker .timepicker-minutes").show()
            }, showSeconds: function () {
                k.widget.find(".timepicker .timepicker-picker").hide();
                k.widget.find(".timepicker .timepicker-seconds").show()
            }, selectHour: function (V) {
                var U = parseInt(c(V.target).text(), 10);
                if (!k.use24hours) {
                    if (k.date.hours() >= 12) {
                        if (U !== 12) {
                            U += 12
                        }
                    } else {
                        if (U === 12) {
                            U = 0
                        }
                    }
                }
                k.date.hours(U);
                H.showPicker.call(k)
            }, selectMinute: function (U) {
                k.date.minutes(parseInt(c(U.target).text(), 10));
                H.showPicker.call(k)
            }, selectSecond: function (U) {
                k.date.seconds(parseInt(c(U.target).text(), 10));
                H.showPicker.call(k)
            }
        }, A = function (W) {
            var U = d(k.date), V = c(W.currentTarget).data("action"), X = H[V].apply(k, arguments);
            O(W);
            if (!k.date) {
                k.date = d({y: 1970})
            }
            t();
            j();
            p(U, W.type);
            return X
        }, O = function (U) {
            U.stopPropagation();
            U.preventDefault()
        }, r = function (U) {
            if (U.keyCode === 27) {
                k.hide()
            }
        }, h = function (X) {
            d.locale(k.options.language);
            var V = c(X.target), W = d(k.date), U = d(V.val(), k.format, k.options.useStrict);
            if (U.isValid() && !S(U) && u(U)) {
                B();
                k.setValue(U);
                p(W, X.type);
                t()
            } else {
                k.viewDate = W;
                k.unset = true;
                p(W, X.type);
                G(U)
            }
        }, f = function (U) {
            if (U) {
                k.viewMode = Math.max(k.minViewMode, Math.min(2, k.viewMode + U))
            }
            k.widget.find(".datepicker > div").hide().filter(".datepicker-" + y.modes[k.viewMode].clsName).show()
        }, N = function () {
            var Y, X, V, U, W;
            k.widget.on("click", ".datepicker *", c.proxy(D, this));
            k.widget.on("click", "[data-action]", c.proxy(A, this));
            k.widget.on("mousedown", c.proxy(O, this));
            k.element.on("keydown", c.proxy(r, this));
            if (k.options.pickDate && k.options.pickTime) {
                k.widget.on("click.togglePicker", ".accordion-toggle", function (Z) {
                    Z.stopPropagation();
                    Y = c(this);
                    X = Y.closest("ul");
                    V = X.find(".in");
                    U = X.find(".collapse:not(.in)");
                    if (V && V.length) {
                        W = V.data("collapse");
                        if (W && W.transitioning) {
                            return
                        }
                        V.collapse("hide");
                        U.collapse("show");
                        Y.find("span").toggleClass(k.options.icons.time + " " + k.options.icons.date);
                        if (k.component) {
                            k.component.find("span").toggleClass(k.options.icons.time + " " + k.options.icons.date)
                        }
                    }
                })
            }
            if (k.isInput) {
                k.element.on({
                    click: c.proxy(k.show, this),
                    focus: c.proxy(k.show, this),
                    change: c.proxy(h, this),
                    blur: c.proxy(k.hide, this)
                })
            } else {
                k.element.on({change: c.proxy(h, this)}, "input");
                if (k.component) {
                    k.component.on("click", c.proxy(k.show, this));
                    k.component.on("mousedown", c.proxy(O, this))
                } else {
                    k.element.on("click", c.proxy(k.show, this))
                }
            }
        }, P = function () {
            c(window).on("resize.datetimepicker" + k.id, c.proxy(i, this));
            if (!k.isInput) {
                c(document).on("mousedown.datetimepicker" + k.id, c.proxy(k.hide, this))
            }
        }, J = function () {
            k.widget.off("click", ".datepicker *", k.click);
            k.widget.off("click", "[data-action]");
            k.widget.off("mousedown", k.stopEvent);
            if (k.options.pickDate && k.options.pickTime) {
                k.widget.off("click.togglePicker")
            }
            if (k.isInput) {
                k.element.off({focus: k.show, change: h, click: k.show, blur: k.hide})
            } else {
                k.element.off({change: h}, "input");
                if (k.component) {
                    k.component.off("click", k.show);
                    k.component.off("mousedown", k.stopEvent)
                } else {
                    k.element.off("click", k.show)
                }
            }
        }, I = function () {
            c(window).off("resize.datetimepicker" + k.id);
            if (!k.isInput) {
                c(document).off("mousedown.datetimepicker" + k.id)
            }
        }, F = function () {
            if (k.element) {
                var V = k.element.parents(), U = false, W;
                for (W = 0; W < V.length; W++) {
                    if (c(V[W]).css("position") === "fixed") {
                        U = true;
                        break
                    }
                }
                return U
            } else {
                return false
            }
        }, t = function () {
            d.locale(k.options.language);
            var U = "";
            if (!k.unset) {
                U = d(k.date).format(k.format)
            }
            z().val(U);
            k.element.data("date", U);
            if (!k.options.pickTime) {
                k.hide()
            }
        }, l = function (X, W, V) {
            d.locale(k.options.language);
            var U;
            if (X === "add") {
                U = d(k.date);
                if (U.hours() === 23) {
                    U.add(V, W)
                }
                U.add(V, W)
            } else {
                U = d(k.date).subtract(V, W)
            }
            if (S(d(U.subtract(V, W))) || S(U)) {
                G(U.format(k.format));
                return
            }
            if (X === "add") {
                k.date.add(V, W)
            } else {
                k.date.subtract(V, W)
            }
            k.unset = false
        }, S = function (U, W) {
            d.locale(k.options.language);
            var X = d(k.options.maxDate, k.format, k.options.useStrict), V = d(k.options.minDate, k.format, k.options.useStrict);
            if (W) {
                X = X.endOf(W);
                V = V.startOf(W)
            }
            if (U.isAfter(X) || U.isBefore(V)) {
                return true
            }
            if (k.options.disabledDates === false) {
                return false
            }
            return k.options.disabledDates[U.format("YYYY-MM-DD")] === true
        }, u = function (U) {
            d.locale(k.options.language);
            if (k.options.enabledDates === false) {
                return true
            }
            return k.options.enabledDates[U.format("YYYY-MM-DD")] === true
        }, E = function (W) {
            var X = {}, U = 0, V;
            for (V = 0; V < W.length; V++) {
                if (d.isMoment(W[V]) || W[V] instanceof Date) {
                    q = d(W[V])
                } else {
                    q = d(W[V], k.format, k.options.useStrict)
                }
                if (q.isValid()) {
                    X[q.format("YYYY-MM-DD")] = true;
                    U++
                }
            }
            if (U > 0) {
                return X
            }
            return false
        }, R = function (U) {
            U = U.toString();
            if (U.length >= 2) {
                return U
            }
            return "0" + U
        }, T = function () {
            var V = '<thead><tr><th class="prev">&lsaquo;</th><th colspan="' + (k.options.calendarWeeks ? "6" : "5") + '" class="picker-switch"></th><th class="next">&rsaquo;</th></tr></thead>', U = '<tbody><tr><td colspan="' + (k.options.calendarWeeks ? "8" : "7") + '"></td></tr></tbody>', X = '<div class="datepicker-days"><table class="table-condensed">' + V + '<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">' + V + U + '</table></div><div class="datepicker-years"><table class="table-condensed">' + V + U + "</table></div>", W = "";
            if (k.options.pickDate && k.options.pickTime) {
                W = '<div class="bootstrap-datetimepicker-widget' + (k.options.sideBySide ? " timepicker-sbs" : "") + (k.use24hours ? " usetwentyfour" : "") + ' dropdown-menu" style="z-index:9999 !important;">';
                if (k.options.sideBySide) {
                    W += '<div class="row"><div class="col-sm-6 datepicker">' + X + '</div><div class="col-sm-6 timepicker">' + K.getTemplate() + "</div></div>"
                } else {
                    W += '<ul class="list-unstyled"><li' + (k.options.collapse ? ' class="collapse in"' : "") + '><div class="datepicker">' + X + '</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="' + k.options.icons.time + '"></span></a></li><li' + (k.options.collapse ? ' class="collapse"' : "") + '><div class="timepicker">' + K.getTemplate() + "</div></li></ul>"
                }
                W += "</div>";
                return W
            }
            if (k.options.pickTime) {
                return ('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">' + K.getTemplate() + "</div></div>")
            }
            return ('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">' + X + "</div></div>")
        }, y = {
            modes: [{clsName: "days", navFnc: "month", navStep: 1}, {
                clsName: "months",
                navFnc: "year",
                navStep: 1
            }, {clsName: "years", navFnc: "year", navStep: 10}]
        }, K = {
            hourTemplate: '<span data-action="showHours"   data-time-component="hours"   class="timepicker-hour"></span>',
            minuteTemplate: '<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',
            secondTemplate: '<span data-action="showSeconds"  data-time-component="seconds" class="timepicker-second"></span>'
        };
        K.getTemplate = function () {
            return ('<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="' + k.options.icons.up + '"></span></a></td><td class="separator"></td><td>' + (k.options.useMinutes ? '<a href="#" class="btn" data-action="incrementMinutes"><span class="' + k.options.icons.up + '"></span></a>' : "") + "</td>" + (k.options.useSeconds ? '<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="' + k.options.icons.up + '"></span></a></td>' : "") + (k.use24hours ? "" : '<td class="separator"></td>') + "</tr><tr><td>" + K.hourTemplate + '</td> <td class="separator">:</td><td>' + (k.options.useMinutes ? K.minuteTemplate : '<span class="timepicker-minute">00</span>') + "</td> " + (k.options.useSeconds ? '<td class="separator">:</td><td>' + K.secondTemplate + "</td>" : "") + (k.use24hours ? "" : '<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>') + '</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="' + k.options.icons.down + '"></span></a></td><td class="separator"></td><td>' + (k.options.useMinutes ? '<a href="#" class="btn" data-action="decrementMinutes"><span class="' + k.options.icons.down + '"></span></a>' : "") + "</td>" + (k.options.useSeconds ? '<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="' + k.options.icons.down + '"></span></a></td>' : "") + (k.use24hours ? "" : '<td class="separator"></td>') + '</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>' + (k.options.useSeconds ? '<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>' : ""))
        };
        k.destroy = function () {
            J();
            I();
            k.widget.remove();
            k.element.removeData("DateTimePicker");
            if (k.component) {
                k.component.removeData("DateTimePicker")
            }
        };
        k.show = function (W) {
            if (z().prop("disabled")) {
                return
            }
            if (k.options.useCurrent) {
                if (z().val() === "") {
                    if (k.options.minuteStepping !== 1) {
                        var V = d(), U = k.options.minuteStepping;
                        V.minutes((Math.round(V.minutes() / U) * U) % 60).seconds(0);
                        k.setValue(V.format(k.format))
                    } else {
                        k.setValue(d().format(k.format))
                    }
                    p("", W.type)
                }
            }
            if (W && W.type === "click" && k.isInput && k.widget.hasClass("picker-open")) {
                return
            }
            if (k.widget.hasClass("picker-open")) {
                k.widget.hide();
                k.widget.removeClass("picker-open")
            } else {
                k.widget.show();
                k.widget.addClass("picker-open")
            }
            k.height = k.component ? k.component.outerHeight() : k.element.outerHeight();
            i();
            k.element.trigger({type: "dp.show", date: d(k.date)});
            P();
            if (W) {
                O(W)
            }
        };
        k.disable = function () {
            var U = z();
            if (U.prop("disabled")) {
                return
            }
            U.prop("disabled", true);
            J()
        };
        k.enable = function () {
            var U = z();
            if (!U.prop("disabled")) {
                return
            }
            U.prop("disabled", false);
            N()
        };
        k.hide = function () {
            var W = k.widget.find(".collapse"), U, V;
            for (U = 0; U < W.length; U++) {
                V = W.eq(U).data("collapse");
                if (V && V.transitioning) {
                    return
                }
            }
            k.widget.hide();
            k.widget.removeClass("picker-open");
            k.viewMode = k.startViewMode;
            f();
            k.element.trigger({type: "dp.hide", date: d(k.date)});
            I()
        };
        k.setValue = function (U) {
            d.locale(k.options.language);
            if (!U) {
                k.unset = true;
                t()
            } else {
                k.unset = false
            }
            if (!d.isMoment(U)) {
                U = (U instanceof Date) ? d(U) : d(U, k.format, k.options.useStrict)
            } else {
                U = U.locale(k.options.language)
            }
            if (U.isValid()) {
                k.date = U;
                t();
                k.viewDate = d({y: k.date.year(), M: k.date.month()});
                m();
                j()
            } else {
                G(U)
            }
        };
        k.getDate = function () {
            if (k.unset) {
                return null
            }
            return d(k.date)
        };
        k.setDate = function (U) {
            var V = d(k.date);
            if (!U) {
                k.setValue(null)
            } else {
                k.setValue(U)
            }
            p(V, "function")
        };
        k.setDisabledDates = function (U) {
            k.options.disabledDates = E(U);
            if (k.viewDate) {
                B()
            }
        };
        k.setEnabledDates = function (U) {
            k.options.enabledDates = E(U);
            if (k.viewDate) {
                B()
            }
        };
        k.setMaxDate = function (U) {
            if (U === undefined) {
                return
            }
            if (d.isMoment(U) || U instanceof Date) {
                k.options.maxDate = d(U)
            } else {
                k.options.maxDate = d(U, k.format, k.options.useStrict)
            }
            if (k.viewDate) {
                B()
            }
        };
        k.setMinDate = function (U) {
            if (U === undefined) {
                return
            }
            if (d.isMoment(U) || U instanceof Date) {
                k.options.minDate = d(U)
            } else {
                k.options.minDate = d(U, k.format, k.options.useStrict)
            }
            if (k.viewDate) {
                B()
            }
        };
        M()
    };
    c.fn.datetimepicker = function (e) {
        return this.each(function () {
            var g = c(this), f = g.data("DateTimePicker");
            if (!f) {
                g.data("DateTimePicker", new a(this, e))
            }
        })
    };
    c.fn.datetimepicker.defaults = {
        format: false,
        pickDate: true,
        pickTime: true,
        useMinutes: true,
        useSeconds: false,
        useCurrent: true,
        calendarWeeks: false,
        minuteStepping: 1,
        minDate: d({y: 1900}),
        maxDate: d().add(100, "y"),
        showToday: true,
        collapse: true,
        language: d.locale(),
        defaultDate: "",
        disabledDates: false,
        enabledDates: false,
        icons: {},
        useStrict: false,
        direction: "auto",
        sideBySide: false,
        daysOfWeekDisabled: [],
        widgetParent: false
    }
}));
