// source --> https://www.medi-karriere.ch/wp-content/themes/praktischArzt-theme/js/front.js?ver=1774355026 
! function(e) {
    var typingTimer; // Timer identifier // PO-1192
	var doneTypingInterval = 1000; // Time in milliseconds (1 second) // PO-1192
    JobEngine.Views.App = Backbone.View.extend({
        el: "body",
        header: {},
        templates: {},
        currentUser: {},
        auth: {},
        initialize: function() {
            if (e.validator.setDefaults({
                    onsubmit: !1,
                    onfocusout: function(e, t) {
                        (this.checkable(e) || "textarea" !== e.tagName.toLowerCase()) && (this.checkable(e) || !(e.name in this.submitted) && this.optional(e)) || this.element(e)
                    },
                    validClass: "valid",
                    errorClass: "message",
                    errorElement: "div",
                    errorPlacement: function(t, i) {
                        e(i).closest("div").append(t)
                    },
                    highlight: function(t, i, o) {
                        var a = e(t).closest("div");
                        a.hasClass("error") || a.addClass("error").removeClass(o).append('<span class="icon" data-icon="!"></span>')
                    },
                    unhighlight: function(t, i, o) {
                        var a = e(t).closest("div");
                        a.hasClass("error") && a.removeClass("error").addClass(o), a.find("div.message").remove().end().find("span.icon").remove()
                    }
                }), this.header = new JobEngine.Views.Header, this.auth = new JobEngine.Models.Auth, null != (t = this.$("#current_user_data").html())) var t = (t = t.replace("/*<![CDATA[*/", "")).replace("/*]]>*/", "");
            t && (t = JSON.parse(t)), this.currentUser = new JobEngine.Models.Company(t), this.templates.notification = new _.template('<div class="notification autohide <%= type %>-bg"><div class="main-center"><%= msg %></div></div>'), pubsub.on("je:notification", this.showNotice, this), pubsub.on("je:response:auth", this.handleAuth, this), pubsub.on("je:response:request_reset_password", this.handleRequestResetPassword, this), pubsub.on("je:response:reset_password", this.handleResetPassword, this), pubsub.on("je:response:logout", this.handleLogout, this), this.currentUser.on("change:id", this.header.updateAuthButtons, this.header)
        },
        showNotice: function(e) {
			if(e.msg == '') return false; /*PO-1598*/
            jQuery("div.notification").remove();
            var t = jQuery(this.templates.notification({
                msg: e.msg,
                type: e.notice_type
            }));
            0 !== jQuery("#wpadminbar").length && t.addClass("having-adminbar"), t.hide().prependTo("body").fadeIn("fast").delay(1e3).fadeOut(3e3, function() {
                jQuery(this).remove()
            })
        },
        handleAuth: function(e, t, i) {
            if (e.status) {
                pubsub.trigger("je:notification", {
                    msg: e.msg,
                    notice_type: "success"
                });
                var o = e.data;
                et_globals.is_single_job ? o.is_admin && window.location.reload() : "page-jobseeker-signup.php" !== et_globals.page_template && "page-stelle-schalten.php" !== et_globals.page_template && "page-post-a-job.php" !== et_globals.page_template && "page-upgrade-account.php" !== et_globals.page_template && window.location.reload(), et_globals.is_single_job && window.location.reload(), this.currentUser.set(e.data), void 0 !== o.redirect_url && (window.location.href = o.redirect_url)
            } else pubsub.trigger("je:notification", {
                msg: e.msg,
                notice_type: "error"
            })
        },
        handleRequestResetPassword: function(e, t, i) {
            pubsub.trigger("je:notification", {
                notice_type: e.success ? "success" : "error",
                msg: e.msg
            })
        },
        handleResetPassword: function(e, t, i) {
            pubsub.trigger("je:notification", {
                notice_type: e.success ? "success" : "error",
                msg: e.msg
            })
        },
        handleLogout: function(e, t, i) {
            this.currentUser.clear(), pubsub.trigger("je:notification", {
                msg: e.msg,
                notice_type: "success"
            }), "page-post-a-job.php" !== et_globals.page_template && "page-stelle-schalten.php" !== et_globals.page_template && "page-upgrade-account.php" !== et_globals.page_template && (window.location.href = et_globals.homeURL)
        }
    }), JobEngine.Views.Header = Backbone.View.extend({
        el: "header",
        modal_login: {},
        modal_register: {},
        modal_forgot_pass: {},
        templates: {
            login: '<li><a id="requestLogin" class="login-modal header-btn bg-btn-header" href="#login"><span class="icon" data-icon="U"></span></a></li>',
            auth: _.template('<li><a href="<%= profile_url %>" class="bg-btn-header header-btn"><span class="icon" data-icon="U"></span></a></li><li><a href="' + et_globals.logoutURL + '" id="requestLogout" class="bg-btn-header header-btn"><span class="icon" data-icon="Q"></span></a></li>')
        },
        events: {
            "click a#requestLogout": "doLogout",
            "click a#requestLogin": "doLogin",
            "click a#requestRegister": "doRegister"
        },
        initialize: function() {
            this.modal_login && this.modal_login instanceof JobEngine.Views.Modal_Login || (this.modal_login = new JobEngine.Views.Modal_Login), this.modal_register && this.modal_register instanceof JobEngine.Views.Modal_Register || (this.modal_register = new JobEngine.Views.Modal_Register), this.modal_forgot_pass && this.modal_forgot_pass instanceof JobEngine.Views.Modal_Forgot_Pass || (this.modal_forgot_pass = new JobEngine.Views.Modal_Forgot_Pass)
        },
        updateAuthButtons: function() {
            JobEngine.app.currentUser.isNew() ? this.$("div.account ul").html(this.templates.login) : this.$("div.account ul").html(this.templates.auth(JobEngine.app.currentUser.attributes)), pubsub.trigger("afterUserChange", JobEngine.app.currentUser.isNew())
        },
        doLogout: function(e) {
            e.preventDefault(), pubsub.trigger("je:request:logout"), JobEngine.app.auth.doLogout()
        },
        doLogin: function(e) {
            e.preventDefault(), pubsub.trigger("je:request:auth")
        },
        doRegister: function(e) {
            e.preventDefault(), pubsub.trigger("je:request:register")
        }
    }), JobEngine.Views.JobListView = Backbone.View.extend({
        tagName: "div",
        className: "jobs_container",
        initialize: function() {
            var t = this;
			// PO-1709
            _.bindAll(this, 'addJob', 'removeJob', 'render', 'nextPageBeforeSend', 'nextPageSuccess', 'filterBeforeSend', 'filterSuccess');
			// -/ PO-1709
			
			this.listConfig = _.extend({
                disableAction: !1
            }, {
                disableAction: this.options.disableAction
            }), this.listView = [], this.collection && this.el && this.collection.each(function(e, i, o) {
                var a = t.$("li:eq(" + i + ")");
                0 !== a.length && (t.listView[i] = new JobEngine.Views.JobListItemView({
                    el: a,
                    model: e,
                    listConfig: t.listConfig
                }))
            }), void 0 !== this.collection && (this.collection.on("add", this.addJob, this), this.collection.on("unshift", this.addJob, this), this.collection.on("remove", this.removeJob, this), this.collection.on("reset", this.render, this), this.collection.bind("nextPageBeforeSend", this.nextPageBeforeSend), this.collection.bind("nextPageSuccess", this.nextPageSuccess), this.collection.bind("filterBeforeSend", this.filterBeforeSend), this.collection.bind("filterSuccess", this.filterSuccess)), this.blockUi = new JobEngine.Views.BlockUi({
                image: et_globals.imgURL + "/loading_big.gif",
                opacity: .7,
                background_color: e("body").css("background-color")
            })
        },
        addJob: function(e, t, i) {
            var o = new JobEngine.Views.JobListItemView({
                    model: e,
                    listConfig: this.listConfig
                }),
                a = o.render().$el.hide(),
                s = this.$("li.job-item"),
                n = i && "index" in i ? i.index : s.length,
                l = s.eq(n);
            0 === this.listView.length || 0 === l.length ? a.appendTo(this.$el.find("ul")).fadeIn("slow") : a.insertBefore(l).fadeIn("slow"), this.listView.splice(n, 0, o)
        },
        removeJob: function(e, t, i) {
            var o = this.listView.splice(i.index, 1);
            o.length > 0 && o[0].$el.fadeOut("slow", function() {
                o[0].remove().undelegateEvents(), pubsub.trigger("je:job:afterRemoveJobView", e)
            })
        },
        render: function() {
            var e = this.$el.find("ul"),
                t = e.children(),
                i = this,
                o = t.length;
            return i.$("div.button-more").hide(), this.collection.length > 0 ? (e.fadeOut("fast"), _.each(this.listView, function(e) {
                e.remove().undelegateEvents()
            }), 0 !== o ? t.fadeOut("normal", function() {
                jQuery(this).remove(), 0 === --o && i.collection.each(i.addJob)
            }) : this.collection.each(this.addJob), this.$(".main-title").html(this.collection.list_title), e.fadeIn("slow", function() {
                i.collection.paginateData.paged >= i.collection.paginateData.total_pages ? i.$("div.button-more").hide() : i.$("div.button-more").fadeIn("slow")
            })) : (e.html("").append('<li class="no-job-found">' + et_globals.no_job_found + "</li>"), i.$("div.button-more").hide()), this
        },
        nextPageBeforeSend: function() {
            this.loadingBtn = new JobEngine.Views.LoadingButton({
                el: this.$(".button-more button")
            }), this.loadingBtn.loading()
        },
        nextPageSuccess: function() {
            this.loadingBtn.finish()
        },
        filterBeforeSend: function() {
            this.blockUi.block(this.$el.find("ul"))
        },
        filterSuccess: function() {
            this.blockUi.unblock()
        }
    }), JobEngine.Views.JobListItemView = Backbone.View.extend({
        tagName: "div",
        className: "div-job-item",
        events: {
            "click .actions .action-featured": "toggleFeature",
            "click .actions .action-approve": "approveJob",
            "click .actions .action-reject": "rejectJob",
            "click .actions .action-archive": "archiveJob",
            "click .actions .action-edit": "editJob"
        },
        isProcessing: !1,
        initialize: function() {
            this.model && (pubsub.on("je:job:onAuthorChanged:" + this.model.get("author_id"), this.renderAuthor, this), this.model.on("change", this.render, this)), this.blockUi = new JobEngine.Views.BlockUi
        },
        render: function() {
            var t = this,
                o = (this.model.toJSON(), this.model.get("template_id") ? this.model.get("template_id") : "no");
            jQuery("#template_" + o).length > 0 ? this.template = jQuery("#template_" + o) : this.template = jQuery("#latest_jobs_data"), this.template.length > 0 && (this.template = _.template(this.template.html()));
            var a = !0 === this.model.get("is_external_post");
            if (a || this.model.author.has("user_logo") && this.model.author.has("post_url") && this.model.author.has("display_name")) {
                this.model.updateJobAuthor();
                var s = 0,
                    n = et_globals.homeURL + "/wp-content/themes/praktischArzt-theme/img/default_logo.jpg";
                a ? (n = "" != this.model.get("et_user_logo") ? this.model.get("et_user_logo") : n, this.model.author.set("display_name", this.model.get("author")), this.model.author.set("company_post_types", ""), this.model.author.set("nicename", this.model.get("author")), this.model.author.set("ID", "0"), this.model.author.set("post_url", "")) : n = "" != this.model.get("author_data").user_logo["company-logo"][0] ? this.model.get("author_data").user_logo["company-logo"][0] : n, 1 == this.model.get("datasort") && (s = 1), this.model.get("pack"), void 0 != this.model.get("company_label") ? verband_logo = this.model.get("company_label") : verband_logo = "", void 0 != this.model.get("company_zertifikat") ? zertifikat_logo = this.model.get("company_zertifikat") : zertifikat_logo = "";
                void 0 != this.model.get("company_zertifikat") && '<img src="' + this.model.get("company_zertifikat") + '" style="width: 40px; height:40px;" alt=""/>', void 0 != this.model.get("company_label") && '<img src="' + this.model.get("company_label") + '" style="width: 40px; height:40px;" alt=""/>';
                var l = "",
                    r = this.model.get("pack"),
                    d = "",
                    c = "",
                    u = "";
                this.model.get("job_types").length > 0 && (d = this.model.get("job_types")[0].name, c = this.model.get("job_types")[0].url, u = this.model.get("job_types")[0].color);
                var h = "";
                if (this.model.get("categories").length > 0) {
                    var g = [];
                    for (i = 0; i < this.model.get("categories").length; i++) g.push('<a href="' + this.model.get("categories")[i].url + '"> ' + this.model.get("categories")[i].name + " </a>");
                    h = g.join(", ")
                }
                var p = !1,
                    m = this.model.get("featured");
                if (0 == m || 1 == m) var b = this.model.get("date_de");
                else if (2 == m) b = "TopJob";
                else if (3 == m) b = "PremiumJob";
                if (e("input#template_partner").length && 1 == e("input#template_partner").val() && (p = !0), 1 == p) {
                    var f = this.model.author.get("company_post_types"),
                        v = "",
                        y = e(location).attr("href");
                    if (f && "" != f)
                        for (i = 0; i < f.length; i++) {
                            var w = f[i].name,
                                j = f[i].url,
                                k = f[i].color;
                            null != w && null != k && null != j && (v += '<div class="job-type color-' + k + '">', v += '<span class="flag"></span><a href="' + j + '" title="Alle in ' + w + ' veröffentlichten Stellen ansehen">' + w + "</a></div>")
                        }
                    l = '<div class="box-job ' + r + '" data-sort="' + s + '"><li class="job-item clearfix clear ' + r + '"><div class="row-fluid"> <div class="span2 logo"><div class="thumb" style="vertical-align: middle;"> <a id="job_author_thumb" href="' + y + this.model.author.get("nicename") + '" title="' + this.model.author.get("display_name") + '" class="thumb"><img src="' + n + '" id="company_logo_thumb" data="0"></a> </div> </div> <div class="span10 job-info"> <br> <div class="row-fluid"> <div class="span3 desc"> <div class="cat company_name"><a data="' + this.model.author.get("ID") + '" href="' + y + this.model.author.get("nicename") + '" title="Von praktischArzt veröffentlichte Stellen anzeigen">' + this.model.author.get("display_name") + '</a> </div> <div> <span class="icon location" data-icon="@"></span><span class="nline">' + this.model.get("full_location") + '</span></div> </div> <div class="span9"> <div class="span4 desc"> <div class="company_label">' + zertifikat_logo + verband_logo + '</span></div> </div> <div class="span8"> <div class="span6"> <div class="desc">  <div class=""> <span class="icon" data-icon="t"></span><span class="job-date">' + b + '</span></div> <div class="is_klinik"> <span class="icon" data-icon="H"></span><span>' + this.model.get("clinici") + '</span>                                    </div>\x3c!-- is klinik --\x3e</div> </div> <div class="span6"> <div class="desc">' + v + '</div></div></div></div> </div> <br class="clear"></li></div>'
                } else l = '<div class="box-job ' + r + '" data-sort="' + s + '"><li class="job-item clearfix clear ' + r + '"><div class="row-fluid"> <div class="span2 logo"><div class="thumb" style="vertical-align: middle;"> <a id="job_author_thumb" ' + (a ? "nohref" : 'href="' + this.model.author.get("post_url") + '"') + ' title="' + this.model.get("title") + '" class="thumb"><img src="' + n + '" id="company_logo_thumb" data="0"></a> </div> </div> <div class="span10 job-info"> <div class="row-fluid"><a class="title-link title" href="' + this.model.get("permalink") + '" title="' + this.model.get("title") + '"><h2>' + this.model.get("title") + '</h2> </a> </div> <div class="row-fluid"> <div class="span4 desc"> <div class="cat company_name"><a data="' + this.model.get("author_id") + '" href="' + this.model.get("author_url") + '" title="Von praktischArzt veröffentlichte Stellen anzeigen">' + this.model.get("author") + '</a> </div> <div> <span class="icon location" data-icon="@"></span><span class="nline">' + this.model.get("full_location") + '</span></div> </div> <div class="span8"> <div class="span5 desc"> <div> <span class="nline">' + h + '</span></div> <div class="company_label">' + zertifikat_logo + verband_logo + '</span></div> </div> <div class="span7"> <div class="span6"> <div class="desc">  <div class="job-type color-' + u + '"> <span class="flag"></span><a href="' + c + '" title="Alle in ' + d + ' veröffentlichten Stellen ansehen">' + d + '</a></div> <div class=""> <span class="icon" data-icon="t"></span><span class="job-date">' + b + '</span></div> <div class="is_klinik"> <span class="icon" data-icon="H"></span><span>' + this.model.get("clinici") + '</span>                                    </div>\x3c!-- is klinik --\x3e</div> </div> <div class="span6"> <div class="btn-select f-right"><a class="title-link" href="' + this.model.get("permalink") + '" title="' + this.model.get("title") + '"><button class="bg-btn-hyperlink border-radius">   Stelle ansehen   </button></a></div></div> </div></div></div></div> </div> <br class="clear"></li></div>';
                this.$el.addClass("job-item").html(l)
            } else this.model.author.fetch({
                silent: !0,
                success: function(i, o) {
                    t.model.set("author_data", {
                        id: i.get("id"),
                        user_url: i.get("user_url"),
                        display_name: i.get("display_name"),
                        user_logo: i.get("user_logo"),
                        post_url: i.get("post_url"),
                        apply_method: i.get("apply_method"),
                        apply_email: i.get("apply_email"),
                        applicant_detail: i.get("applicant_detail")
                    }, {
                        silent: !0
                    }), t.$el.addClass("job-item").html(t.template(e.extend({}, t.model.toJSON(), t.options.listConfig)))
                }
            });
            return this
        },
        blockItem: function() {
            this.blockUi.block(this.$el)
        },
        unblockItem: function() {
            this.blockUi.unblock()
        },
        renderAuthor: function(e) {
            var t = this.$(".thumb").empty(),
                i = this.$(".content .company_name"),
                o = "small_thumb" in e.user_logo ? e.user_logo.small_thumb[0] : e.user_logo.thumbnail[0],
                a = "<a data='" + e.id + "' href='" + e.post_url + "' id='job_author_name' class='thumb' title='" + e.display_name + "'>";
            t.html(a + "<img src='" + o + "' alt='" + e.display_name + "'/></a>"), i.html(a + e.display_name + "</a>")
        },
        toggleFeature: function(e) {
            var t = this;
            e.preventDefault(), this.model.save({}, {
                data: {
                    id: this.model.id
                },
                method: "toggleFeature",
                beforeSend: function() {
                    t.blockItem()
                },
                success: function(e, i) {
                    t.unblockItem(), i.success && (pubsub.trigger("je:job:afterToggleFeature", e, i), pubsub.trigger("je:notification", {
                        msg: i.msg,
                        notice_type: "success"
                    }))
                }
            })
        },
        approveJob: function(e) {
            e.preventDefault();
            var t = this;
            this.model.approve({
                silent: !0,
                beforeSend: function() {
                    t.blockItem()
                },
                success: function() {
                    t.unblockItem()
                }
            })
        },
        rejectJob: function(e) {
            e.preventDefault(), pubsub.trigger("je:job:onReject", {
                model: this.model,
                itemView: this
            })
        },
        archiveJob: function(e) {
            var t = this;
            e.preventDefault(), this.model.archive({
                silent: !0,
                beforeSend: function() {
                    t.blockItem()
                },
                success: function() {
                    t.unblockItem()
                }
            })
        },
        editJob: function(e) {
            e.preventDefault(), this.model.has("id") || this.model.set("id", this.model.get("id"), {
                silent: !0
            }), pubsub.trigger("je:job:onEdit", this.model)
        }
    }), JobEngine.Views.Modal_Edit_Job = JobEngine.Views.Modal_Box.extend({
        el: "div#modal_edit_job",
        events: {
            "click a#edit-single-job": "openModal",
            "click div.modal-close": "closeModal",
            //"keyup input#full_location": "geocoding", // PO-1192
            //"blur input#full_location, click div#submit-form": "resetLocation", // PO-1192
            "keyup input#full_location": "onKeyUp", // PO-1192
            "click .apply input:radio": "switchApplyMethod",
            "change #user_url": "autoCompleteUrl"
        },
        initialize: function() {
            JobEngine.Views.Modal_Box.prototype.initialize.apply(this, arguments);
            var e = this,
                t = this.$("#user_logo_container");
			// PO-1709
            _.bindAll(this, 'closeModal', 'waiting', 'endWaiting');
			// -/ PO-1709
            var i = new JobEngine.Views.BlockUi;
            this.logo_uploader = new JobEngine.Views.File_Uploader({
                el: t,
                uploaderID: "user_logo",
                thumbsize: "company-logo",
                multipart_params: {
                    _ajax_nonce: t.find(".et_ajaxnonce").attr("id"),
                    action: "et_logo_upload"
                },
                cbUploaded: function(t, i, o) {
                    o.success ? e.model.author.set("user_logo", o.data, {
                        silent: !0
                    }) : pubsub.trigger("je:notification", {
                        msg: o.msg,
                        notice_type: "error"
                    })
                },
                beforeSend: function(e) {
                    i.block(t.find(".thumbs"))
                },
                success: function() {
                    i.unblock()
                }
            }), pubsub.on("je:job:afterEditJob", this.closeModal, this), this.bind("waiting", this.waiting, this), this.bind("endWaiting", this.endWaiting, this)
        },
        onEdit: function(e, t) {
            t = t || null, !(e instanceof JobEngine.Models.Job && e.has("id")) || this.model instanceof JobEngine.Models.Job && this.model.has("id") && this.model.id === e.id ? this.model.has("id") || pubsub.trigger("je:notification", {
                msg: "Invalid Job ID",
                notice_type: "error"
            }) : this.model = e, this.model.has("id") && this.model.has("author_id") && this.model.has("title") && this.model.has("content") && this.model.has("location") && this.model.has("categories") && this.model.has("job_types") ? this.model.author.has("display_name") && this.model.author.has("user_url") && this.model.author.has("user_logo") ? this.setupFieldsAndOpenModal() : null !== t ? (this.model.author.set(t, {
                silent: !0
            }), this.setupFieldsAndOpenModal()) : (this.model.author.set("id", this.model.get("author_id"), {
                silent: !0
            }), this.model.author.fetch({
                silent: !0,
                success: this.setupFieldsAndOpenModal
            })) : this.model.fetch({
                silent: !0,
                success: this.setupFieldsAndOpenModal
            })
        },
        setupFieldsAndOpenModal: function() {
            var e = this;
            this.logo_uploader.updateConfig({
                multipart_params: {
                    author: this.model.author.get("id")
                },
                updateThumbnail: !0,
                data: this.model.author.get("user_logo")
            }), this.openModal(), this.setupFields(this.model), this.model.set("prev_cats", jQuery.map(this.model.get("categories"), function(e, t) {
                return e.slug
            }), {
                silent: !0
            }), this.model.set("prev_status", this.model.get("status"), {
                silent: !0
            })

            // PO-1192 
            const full_address = this.model.get("full_location");
            //console.log(full_address,"full_address");
            
            if(full_address !='') {
                var that = this;
                $.ajax({
                    url: front_job_data.ajaxURL, // Localized AJAX URL
                    type: 'POST',
                    data: {
                        action: 'get_et_locations',
                        nonce: front_job_data.nonce,
                        full_location: full_address,
                    },
                    beforeSend: function () {
                        $('.address__loader').show();
                    },
                    success: function (response) {
                        //console.log('AJAX Success:', response);
                        if(response.status) {
                                if(response.location_data) {
                                    $('#street_number').val(response.location_data.street_number);
                                    $('#establishment').val(response.location_data.route);
                                    $('#postal_code').val(response.location_data.postal_code);
                                    $('#city').val(response.location_data.city);
                                    $('#state').val(response.location_data.state);
                                    $('#country').val(response.location_data.country);
                                    $('#et_location_lat').val(response.location_data.geometry.lat);
                                    $('#et_location_lng').val(response.location_data.geometry.lng);
                                    that.drawGoogleMap(response.location_data.geometry.lat, response.location_data.geometry.lng);
                                    //$('.maps').html('<a href="https://www.google.com/maps/place/@'+response.location_data.geometry.lat+','+response.location_data.geometry.lng+',12z/?hl=de&entry=ttu" target="_blank"><img class="zoom-img" src="'+response.location_data.map_image+'"></a>');
                                    //that.drawGoogleMap(response.location_data.geometry.lat, response.location_data.geometry.lng);
                                    //const jmapLink = document.querySelector(".maps a");

                                        // Check if the element exists before applying styles
                                        // if (jmapLink) {
                                        //     Object.assign(jmapLink.style, {
                                        //         backgroundImage: `url(${response.location_data.map_image})`,
                                        //         backgroundPosition: "center",
                                        //         width: "100%",
                                        //         height: "170px",
                                        //         display: "block",
                                        //         backgroundRepeat: "no-repeat",
                                        //         backgroundSize: "100% auto"
                                        //     });
                                        // }
                                }

                        }
                    },
                    complete: function () {
                        $('.address__loader').hide(); // Hide loading indicator
                    }
                });
            }
            /*
            , this.initMap(), this.initValidator(), this.validator.resetForm(), "undefined" != typeof GMaps && "function" == typeof this.map.refresh && (this.map.refresh(), this.model.has("location_lat") && this.model.has("location_lng") && GMaps.geocode({
                address: this.model.get("full_location"),
                callback: function(t, i) {
                    if ("OK" == i) {
                        var o = t[0].geometry.location;
                        e.map.setCenter(o.lat(), o.lng()), e.map.markers = [], e.map.addMarker({
                            lat: o.lat(),
                            lng: o.lng(),
                            draggable: !0,
                            dragend: function(t) {
                                e.$("#location_lat").val(this.position.lat()), e.$("#location_lng").val(this.position.lng())
                            }
                        }), e.$("#location_lat").val(o.lat()), e.$("#location_lng").val(o.lng())
                    }
                }
            }))
            PO-1192
            */
        },
        initMap: function() {
            void 0 === this.map && "undefined" != typeof GMaps && (this.map = new GMaps({
                div: "#map",
                lat: 10.7966064,
                lng: 106.6902172,
                zoom: 12,
                panControl: !1,
                zoomControl: !1,
                mapTypeControl: !1
            }))
        },
        initValidator: function() {
            void 0 === this.validator && (this.validator = this.$("form#job_form").validate({
                ignore: "select, .plupload input",
                rules: {
                    title: "required",
                    content: "required",
                    display_name: "required",
                    user_url: {
                        required: !0,
                        url: !0
                    }
                }
            }))
        },
        setupFields: function(t) {
            var i, o, a = this.$("div#job-details"),
                s = (this.$("div#company-details"), t.get("job_types")),
                n = t.get("categories"),
                l = t.get("status"),
                r = a.find("select#job_status");
            _.isArray(s) && void 0 !== s[0] && "slug" in s[0] && (i = s[0].slug), _.isArray(n) && void 0 !== n[0] && "slug" in n[0] && (o = n[0].slug);
            s = e("#job-details select#job_types").val();
            var d = e("#job-details input#id").val(),
                c = {
                    type: "POST",
                    dataType: "html",
                    url: et_globals.ajaxURL,
                    data: {
                        action: "et_conditions_sync",
                        job_types: s,
                        job_id: d
                    },
                    success: function(t) {
                        e("#load_conditions_by_job_type").html(t)
                    }
                };
            jQuery.ajax(c), setTimeout(function() {
                e("input#id").val(t.get("ID")), e("input#status").val(t.get("status")), e("input#featured").val(t.get("featured")), e("input#author_id").val(t.get("author_id")), e("input#title").val(t.get("title")), e("input#location").val(t.get("location")), e("#full_location").val(t.get("full_location")), e("#location_lat").val(t.get("location_lat")), e("#location_lng").val(t.get("location_lng")), e("#arbeitgeber_typ").val(t.get("arbeitgeber_typ")).change();
                var s = t.get("location_geocoding");
                s && "undefined" != s && ("undefined" != s.street_number && "" != s.street_number && e("#street_number").val(s.street_number), "undefined" != s.route && "" != s.route && e("#route").val(s.route), "undefined" != s.postal_code && "" != s.postal_code && e("#postal_code").val(s.postal_code), "undefined" != s.city && "" != s.city && e("#city").val(s.city), "undefined" != s.country && "" != s.country && e("#country").val(s.country)), e("select#job_types").val(i).change(), e("select#categories").val(o).change(), e("#add_sample").html('"' + t.get("location") + '"'), e("input#add_sample_input").val(t.get("location")), e("input#apply_email").val(t.get("apply_email")), e("input#apply_method").val(t.get("apply_method")), e("input#display_name").val(t.author.get("employer_name")), e("input#user_url").val(t.author.get("user_url")), "ishowtoapply" == t.get("apply_method") ? (e("#ishowtoapply").attr("checked", !0), e("#applicant_detail").addClass("required")) : (e("#isapplywithprofile").attr("checked", !0), e("#apply_email").addClass("required email")), 0 !== r.length && r.val(l).change(), /* PO-1709 tinyMCE.get("content").setContent(t.get("content")), tinyMCE.get("applicant_detail").setContent(t.get("applicant_detail")), */ pubsub.trigger("je:job:modal_edit:afterSetupFields", t, a)
            }, 500)
        },
        geocoding: function(t) {
            var i = this,
                o = e(t.currentTarget);
            void 0 !== this.t && clearTimeout(this.t), this.t = setTimeout(function() {
                GMaps.geocode({
                    address: o.val().trim(),
                    callback: function(e, t) {
                        if ("OK" === t) {
                            var o = e[0].geometry.location;
                            i.map.setCenter(o.lat(), o.lng()), i.map.removeMarkers(), i.map.addMarker({
                                lat: o.lat(),
                                lng: o.lng(),
                                draggable: !0,
                                dragend: function(e) {
                                    i.$("#location_lat").val(this.position.lat()), i.$("#location_lng").val(this.position.lng())
                                }
                            }), i.$("#location_lat").val(o.lat()), i.$("#location_lng").val(o.lng());
                            var a, s = e[0].address_components,
                                n = "",
                                l = "",
                                r = "",
                                d = "",
                                c = "",
                                u = "";
                            for (a = 0; a < s.length; a++)
                                if ("" != s[a].types[0] && "undefined" !== s[a].long_name) switch (s[a].types[0]) {
                                    case "establishment":
                                        n = s[a].long_name;
                                        break;
                                    case "street_number":
                                        l = s[a].long_name;
                                        break;
                                    case "route":
                                        r = s[a].long_name;
                                        break;
                                    case "postal_code":
                                        d = s[a].long_name;
                                        break;
                                    case "locality":
                                        c = s[a].long_name;
                                        break;
                                    case "country":
                                        "Germany" == s[a].long_name && (s[a].long_name = "Deutschland"), u = s[a].long_name
                                }
                            i.$("#establishment").val(n), i.$("#street_number").val(l), i.$("#route").val(r), i.$("#postal_code").val(d), i.$("#city").val(c), i.$("#country").val(u)
                        }
                    }
                })
            }, 500)
        },
        resetLocation: function(t) {
            var i = e(t.currentTarget),
                o = (this.$("#location_lat").val(), this.$("#location_lng").val(), this.$("#full_location").val()),
                a = this.$("#location");
            "" === e.trim(i.val()) ? (this.$("#street_number").val(""), this.$("#route").val(""), this.$("#postal_code").val(""), this.$("#city").val(""), this.$("#country").val("")) : "undefined" != typeof GMaps && GMaps.geocode({
                address: o,
                callback: function(e, t) {
                    if ("OK" == t) {
                        var i = e[0].address_components.length,
                            o = e[0].address_components,
                            s = (e[0].formatted_address, " "),
                            n = " ";
                        for (l = 0; i > l; l++) "administrative_area_level_2" == o[l].types[0] && "undefined" !== o[l].long_name && (s = o[l].long_name + ", "), "administrative_area_level_1" == o[l].types[0] && "undefined" !== o[l].long_name && (n = o[l].long_name);
                        a.val(s + n);
                        o = e[0].address_components;
                        var l, r = "",
                            d = "",
                            c = "",
                            u = "",
                            h = (n = "", "");
                        for (l = 0; l < o.length; l++)
                            if ("" != o[l].types[0] && "undefined" !== o[l].long_name) switch (o[l].types[0]) {
                                case "establishment":
                                    r = o[l].long_name;
                                    break;
                                case "street_number":
                                    d = o[l].long_name;
                                    break;
                                case "route":
                                    c = o[l].long_name;
                                    break;
                                case "postal_code":
                                    u = o[l].long_name;
                                    break;
                                case "locality":
                                    n = o[l].long_name;
                                    break;
                                case "country":
                                    "Germany" == o[l].long_name && (o[l].long_name = "Deutschland"), h = o[l].long_name
                            }
                        this.$("#establishment").val(r), this.$("#street_number").val(d), this.$("#route").val(c), this.$("#postal_code").val(u), this.$("#city").val(n), this.$("#country").val(h)
                    }
                }
            })
        },

        // PO-1192
        onKeyUp: function(event) {
            clearTimeout(typingTimer);
            typingTimer = setTimeout(this.getFullAddress.bind(this, event), doneTypingInterval);
        },

        getFullAddress : function(event) {
            var that = this;
            let full_address = $(event.currentTarget).val();
            if(full_address != '') {
                $.ajax({
                    url: front_job_data.ajaxURL, // Localized AJAX URL
                    type: 'POST',
                    data: {
                        action: 'get_et_locations',
                        nonce: front_job_data.nonce,
                        full_location: full_address,
                    },
                    beforeSend: function () {
                        $('.address__loader').show();
                    },
                    success: function (response) {
                        //console.log('AJAX Success:', response);
                        if(response.status) {
                                if(response.location_data) {
                                    $('#street_number').val(response.location_data.street_number);
                                    $('#establishment').val(response.location_data.route);
                                    $('#postal_code').val(response.location_data.postal_code);
                                    $('#city').val(response.location_data.city);
                                    $('#state').val(response.location_data.state);
                                    $('#country').val(response.location_data.country);
                                    $('#et_location_lat').val(response.location_data.geometry.lat);
                                    $('#et_location_lng').val(response.location_data.geometry.lng);
                                    that.drawGoogleMap(response.location_data.geometry.lat, response.location_data.geometry.lng);
                                }

                        }
                    },
                    complete: function () {
                        $('.address__loader').hide(); // Hide loading indicator
                    }
                });
            } else {
                $('#et_location_street').val('');
                $('#et_location_route').val('');
                $('#et_location_po').val('');
                $('#et_location_city').val('');
                $('#et_location_state').val('');
                $('#et_location_country').val('');
                $('#et_location_lat').val('');
                $('#et_location_lng').val('');
            }
            
        },

        drawGoogleMap: function(lat, lng) {
            this.map = new GMaps({
                div: '#map',
                lat: lat,
                lng: lng,
                zoom: 12,
                panControl: false,
                zoomControl: false,
                mapTypeControl: false
            });
    
            this.map.addMarker({
                lat: lat,
                lng: lng,
                draggable: true,
                dragend: function (e) {
                    var newLat = e.latLng.lat();
                    var newLng = e.latLng.lng();
    
                    that.$('#et_location_lat').val(newLat);
                    that.$('#et_location_lng').val(newLng);
                }
            });
        },
        // PO-1192
        editSample: function(t) {
            t.preventDefault();
            var i = e(t.currentTarget),
                o = i.parent(),
                a = i.html().substring(1, i.html().length - 1),
                s = o.find("input").hide().val(a);
            e("body").unbind("click"), e("body").bind("click", function(a) {
                a.target != t.currentTarget && a.target != s[0] && e.contains(a.currentTarget, s[0]) && (s.hide(), i.html('"' + s.val() + '"').show(), o.removeClass("editing"))
            }), i.hide(), o.append(s.show()).addClass("editing")
        },
        changeAddress: function(t) {
            e("#location").val(e(t.currentTarget).val())
        },
        waiting: function() {
            this.title = this.$el.find("#submit-form").val(), this.$el.find("#submit-form").val(et_globals.loading)
        },
        endWaiting: function() {
            this.$el.find("#submit-form").val(this.title)
        },
        submitForm: function(e) {
            e.preventDefault(), this.validator = this.$("form#job_form").validate({
                ignore: "",
                rules: {
                    title: "required",
                    display_name: "required",
                    content: "required",
                    user_url: {
                        required: !0,
                        url: !0
                    }
                },
                errorPlacement: function(e, t) {
                    t.is("textarea") ? e.insertAfter(t.next()) : e.insertAfter(t)
                }
            });
            var t = {},
                i = {},
                o = this.$("div#job-details"),
                a = this.$("div#company-details"),
                s = o.find("select#job_status");
            if (this.$("form#job_form").valid()) {
                a.find("input").each(function() {
                    var e = jQuery(this);
                    i[e.attr("id")] = e.val()
                }), this.model.author.set(i), o.find("input[type!=radio],textarea,select").each(function() {
                    var e = jQuery(this);
                    t[e.attr("id")] = e.val()
                }), o.find("input[type=radio]:checked").each(function() {
                    var e = jQuery(this);
                    t[e.attr("id")] = e.val()
                }), t.job_types = [{
                    slug: o.find("select#job_types").val()
                }], t.categories = [{
                    slug: o.find("select#categories").val()
                }], 0 !== s.length && (t.status = s.val()), t.raw = this.$el.find("#job_form").serialize();
                var n = new JobEngine.Views.LoadingButton({
                    el: this.$el.find("#submit-form")
                });
                this.model.set(t, {
                    silent: !0
                }).save({}, {
                    wait: !0,
                    author_sync: !0,
                    beforeSend: function() {
                        n.loading()
                    },
                    success: function(e, t) {
                        n.finish(), t.success ? (pubsub.trigger("je:job:afterEditJob", e), pubsub.trigger("je:notification", {
                            msg: t.msg,
                            notice_type: "success"
                        }), pubsub.trigger("je:job:onAuthorChanged:" + e.author.get("id"), e.author.toJSON())) : pubsub.trigger("je:notification", {
                            msg: t.msg,
                            notice_type: "error"
                        })
                    }
                })
            } else pubsub.trigger("je:notification", {
                msg: et_globals.form_valid_msg,
                notice_type: "error"
            })
        },
        switchApplyMethod: function(t) {
            var i = e(t.currentTarget).val();
            "isapplywithprofile" == i && (e("#apply_email").addClass("required email"), e("#applicant_detail").removeClass("required"), e(".applicant_detail").removeClass("error")), "ishowtoapply" == i && (e("#applicant_detail").addClass("required"), e("#apply_email").removeClass("required"), e(".email_apply").removeClass("error")), e(".apply").find(".icon").remove(), e(".apply").find(".message").remove(), e("#apply_method").val(i)
        },
        autoCompleteUrl: function(t) {
            var i = e(t.currentTarget).val();
            return 0 == i.length || void(/^(https?|ftp):\/\//i.test(i) || (i = "https://" + i, e(t.currentTarget).val(i), e(t.currentTarget).focus()))
        }
    }), JobEngine.Views.Modal_Login = JobEngine.Views.Modal_Box.extend({
        el: "#modal_login",
        events: {
            "click div.modal-close": "closeModal",
            "click a.cancel-modal": "closeModal",
            "submit form#login": "doLogin",
            "click a.forgot-pass-link": "openForgotPassword",
            "click a.register-link": "openRegister"
        },
        initialize: function() {
            JobEngine.Views.Modal_Box.prototype.initialize.apply(this, arguments), this.options = _.extend(this.options, this.defaults), this.initValidator(), this.title = this.$el.find("button#submit_login").val(), pubsub.on("je:request:auth", this.openModalAuth, this), pubsub.on("je:response:auth", this.afterLogin, this), this.bind("waiting", this.waiting, this), this.bind("endWaiting", this.endWaiting, this), this.loadingBtn = new JobEngine.Views.LoadingButton({
                el: this.$("button#submit_login1")
            })
        },
        openModalAuth: function() {
            this.openModal(), this.initValidator()
        },
        setOptions: function(e) {
            this.options = _.extend(e, this.options)
        },
        initValidator: function() {
            void 0 === this.validator && (this.validator = this.$("form#login").validate({
                rules: {
                    log_email: {
                        required: !0
                    },
                    log_pass: "required"
                }
            }))
        },
        waiting: function() {
            this.$("button#submit_login1").show(), this.$("button#submit_login").hide(), this.loadingBtn.loading()
        },
        endWaiting: function() {
            this.$("button#submit_login").show(), this.$("button#submit_login1").hide(), this.loadingBtn.finish()
        },
        doLogin: function(e) {
            e.preventDefault();
            var t = this.$(e.currentTarget),
                i = (t.closest("form"), t.attr("id")),
                o = this.options;
            this.trigger("waiting"), this.validator.form() && (JobEngine.app.auth.setUserName(t.find("input#log_email").val()), JobEngine.app.auth.setEmail(t.find("input#log_email").val()), JobEngine.app.auth.setPass(t.find("input#log_pass").val()), JobEngine.app.auth.doAuth(i, o))
        },
        afterLogin: function(t, i, o) {
            this.trigger("endWaiting"), t.status && (this.closeModal(), e("#je_jobmap").length > 0 && setTimeout(function() {
                window.location.href = "/dashboard"
            }, 100))
        },
        openForgotPassword: function(e) {
            e.preventDefault(), this.closeModal(200, function() {
                pubsub.trigger("je:request:forgot_pass")
            })
        },
        openRegister: function(e) {
            e.preventDefault(), this.closeModal(200, function() {
                pubsub.trigger("je:request:register")
            })
        }
    }), JobEngine.Views.Modal_Register = JobEngine.Views.Modal_Box.extend({
        el: "#modal-register",
        events: {
            "click div.modal-close": "closeModalRegister",
            "submit form#register": "doRegister"
        },
        initialize: function() {
            JobEngine.Views.Modal_Box.prototype.initialize.apply(this, arguments), this.options = _.extend(this.options, this.defaults), pubsub.on("je:request:register", this.openModalRegister, this), pubsub.on("je:response:auth", this.afterLogin, this)
        },
        openModalRegister: function() {
            this.openModal(), this.initValidator()
        },
        closeModalRegister: function() {
            this.closeModal(), e("#modal_login").show()
        },
        initValidator: function() {
            void 0 === this.validator && (this.validator = this.$("form#register").validate({
                rules: {
                    reg_name: {
                        required: !0,
                        usernameCheck: !0
                    },
                    reg_email: {
                        required: !0,
                        email: !0
                    },
                    reg_pass: "required",
                    reg_pass_again: {
                        required: !0,
                        equalTo: "#reg_pass"
                    }
                },
                messages: {
                    reg_name: {
                        usernameCheck: et_globals.err_invalid_username
                    }
                }
            }))
        },
        doRegister: function(t) {
            t.preventDefault();
            var i = e("#modal-register");
            if (this.validator.form()) {
                var o = this.$(t.currentTarget),
                    a = o.attr("id"),
                    s = this;
                JobEngine.app.auth.setUserName(i.find("input#reg_name").val()), JobEngine.app.auth.setEmail(i.find("input#reg_email").val()), JobEngine.app.auth.setPass(i.find("input#reg_pass").val()), JobEngine.app.auth.doAuth(a, {
                    renew_logo_nonce: !0,
                    beforeSend: function() {
                        s.loadingBtn = new JobEngine.Views.LoadingButton({
                            el: o.find("input[type=submit]")
                        }), s.loadingBtn.loading()
                    },
                    success: function(e) {
                        s.loadingBtn.finish()
                    }
                })
            }
        },
        afterLogin: function(e, t, i) {
            this.trigger("endWaiting"), e.status && this.closeModal()
        }
    }), JobEngine.Views.Modal_Forgot_Pass = JobEngine.Views.Modal_Box.extend({
        el: "#modal-forgot-pass",
        events: {
            "click div.modal-close": "closeModalForgotPass",
            "submit form#forgot_pass": "requestResetPassword"
        },
        initialize: function() {
            JobEngine.Views.Modal_Box.prototype.initialize.apply(this, arguments), this.options = _.extend(this.options, this.defaults), this.title = this.$el.find(".button > input.bg-btn-action").val(), pubsub.on("je:request:forgot_pass", this.openModalPass, this), pubsub.on("je:response:request_reset_password", this.afterResetPassword, this), pubsub.on("je:request:requestResetPassWaiting", this.waiting, this), this.bind("endWaiting", this.endWaiting, this), this.loadingBtn = new JobEngine.Views.LoadingButton({
                el: this.$(".button > input.bg-btn-action")
            })
        },
        closeModalForgotPass: function() {
            this.closeModal(), e("#modal_login").show()
        },
        openModalPass: function() {
            this.openModal(), this.initValidator()
        },
        initValidator: function() {
            void 0 === this.validator && (this.validator = this.$("form#forgot_pass").validate({
                forgot_email: {
                    required: !0,
                    email: !0
                }
            }))
        },
        waiting: function() {
            this.loadingBtn.loading()
        },
        endWaiting: function() {
            this.loadingBtn.finish()
        },
        requestResetPassword: function(e) {
            e.preventDefault();
            var t = this.$(e.currentTarget);
            this.validator.form() && (JobEngine.app.auth.setEmail(t.find("input#forgot_email").val()), JobEngine.app.auth.doRequestResetPassword())
        },
        afterResetPassword: function(t, i) {
            this.trigger("endWaiting"), t.success && (this.closeModal(), e("#modal_login").show())
        }
    }), jQuery(document).ready(function(e) {
        JobEngine.app = new JobEngine.Views.App;
        var t = jQuery("body"),
            i = jQuery(".main-header"),
            o = jQuery("#header-filter");
        jQuery("#wrapper"), jQuery(".select-style:not(.styled) select").each(function() {
            var e = jQuery(this),
                t = e.attr("title"),
                i = e.find("option:selected");
            container = e.parent(), t = i.text(), container.children("span.select").remove(), e.css({
                "z-index": 10,
                opacity: 0,
                "-khtml-appearance": "none"
            }).after('<span class="select">' + t + "</span>").change(function() {
                var e = jQuery("option:selected", this).text();
                jQuery(this).next().text(e)
            }), e.parent().addClass("styled")
        }), t.on("mouseenter", ".tooltip", function() {
            var e, t = jQuery(this);
            this.tip = this.title, t.append('<div class="tooltip-wrapper"><div class="tooltip-content">' + this.tip + '</div><div class="tooltip-btm"></div></div>'), this.title = "", this.width = t.width(), (e = t.find(".tooltip-wrapper")).css({
                width: 8 * this.tip.length + 15 + "px"
            }), t.find(".tooltip-btm").css({
                "margin-left": e.width() / 2 - 5 + "px"
            }), e.css({
                left: t.width() / 2 - e.width() / 2 + "px",
                top: -e.height() + "px"
            }).fadeIn(0)
        }).on("mouseleave", ".tooltip", function() {
            jQuery(this).find(".tooltip-wrapper").fadeOut(0, function() {
                jQuery(this).remove()
            }), this.title = this.tip
        }), o.length, e("#wpadminbar").length, i.length, o.length, jQuery(".category-lists .sym-multi").click(function() {
            var e = jQuery(this);
            e.hasClass("sym-multi-expand") ? e.removeClass("sym-multi-expand") : e.addClass("sym-multi-expand"), e.next("ul").slideToggle()
        }), jQuery(".category-lists li a").each(function() {
            var e = jQuery(this);
            e.hasClass("active") && e.parents("ul").show()
        }).focus(function() {
            var e = jQuery(this);
            e.val() === e.attr("placeholder") && (e.val(""), e.removeClass("placeholder"))
        }).blur(function() {
            var e = jQuery(this);
            ("" === e.val() || e.val() === e.attr("placeholder")) && (e.val(e.attr("placeholder")), e.addClass("placeholder"))
        }).closest("form").submit(function() {
            jQuery(this).find("[placeholder]").each(function() {
                var e = jQuery(this);
                e.val() === e.attr("placeholder") && e.val("")
            })
        }), e(".sortable").sortable({
            connectWith: ".sortable",
            axis: "y",
            cursor: "move",
            cursorAt: {
                left: 5
            },
            opacity: .7,
            stop: function(t, i) {
                var o = i.item,
                    a = o.parents(".sortable").sortable("toArray"),
                    s = new JobEngine.Views.BlockUi;
                e.ajax({
                    type: "POST",
                    url: et_globals.ajaxURL,
                    data: {
                        sidebar: o.parents(".sortable").attr("id"),
                        action: "et-sort-sidebar-widget",
                        widget: a
                    },
                    beforeSend: function() {
                        s.block(o.parents(".sortable"))
                    },
                    success: function(e) {
                        s.unblock()
                    }
                })
            },
            handle: ".sort-handle"
        }), jQuery.validator.addMethod("usernameCheck", function(e) {
            return e.match("^([a-zA-Z0-9_.]+@){0,1}([a-zA-Z0-9_.])+$")
        }), e.validator.addMethod("accept", function() {
            return !0
        })
    })
}(jQuery);
// source --> https://www.medi-karriere.ch/wp-content/themes/jobengine/resumes/js/jobseeker.js?ver=4f5f8d423f4d41ce3d4346e5fe8645c4 
! function(e) {
    JobEngine.Models.User = Backbone.Model.extend({
        defaults: {
            display_name: "",
            user_url: "",
            post_url: "",
            recent_location: ""
        },
        params: {
            type: "POST",
            dataType: "json",
            url: et_globals.ajaxURL,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8"
        },
        action: "et_user_sync",
        role: "subcriber",
        initialize: function() {},
        setDisplayName: function(e) {
            this.set({
                display_name: e
            }, {
                silent: !0
            })
        },
        getDisplayName: function() {
            return this.get("display_name")
        },
        setUrl: function(e) {
            this.set({
                user_url: e
            }, {
                silent: !0
            })
        },
        getUrl: function() {
            return this.get("user_url")
        },
        setUserName: function(e) {
            this.set({
                user_name: e
            }, {
                silent: !0
            })
        },
        getUserName: function() {
            return this.get("user_name")
        },
        setEmail: function(e) {
            this.set({
                user_email: e
            }, {
                silent: !0
            })
        },
        getEmail: function() {
            return this.get("user_email")
        },
        setPass: function(e) {
            this.set({
                user_pass: e
            }, {
                silent: !0
            })
        },
        setUserKey: function(e) {
            this.set({
                user_key: e
            }, {
                silent: !0
            })
        },
        get_logo: function() {
            return this.get("user_logo")
        },
        validate: function(e, t) {},
        changePassword: function(e) {
            var t = _.extend({
                data: {
                    action: "et_change_pass",
                    user_old_pass: this.get("user_old_pass"),
                    user_pass: this.get("user_pass"),
                    user_pass_again: this.get("user_pass_again")
                }
            }, this.params, e || {});
            return t.beforeSend = function() {
                pubsub.trigger("je:request:waiting"), e && "function" == typeof e.beforeSend && e.beforeSend()
            }, t.success = function(t, n, s) {
                pubsub.trigger("je:response:changePassword", t, n, s), e && "function" == typeof e.success && e.success(t, n, s)
            }, t.error = function(t, n, s) {
                pubsub.trigger("je:notification", {
                    msg: n,
                    notice_type: "error"
                }), e && "function" == typeof e.error && e.error(t, n, s)
            }, jQuery.ajax(t)
        },
        doAuth: function(e, t) {
            var n, s = this;
            if ("login" === e) this.unset("user_pass_again", {
                silent: !0
            }), e = "et_login";
            else {
                if ("register" !== e) return !1;
                e = "et_register"
            }
            return n = _.extend({
                data: _.extend({
                    action: e,
                    user_email: s.get("user_email"),
                    user_pass: s.get("user_pass"),
                    user_name: s.get("user_name"),
                    role: s.role
                }, s.toJSON())
            }, s.params, t || {}), t && "renew_logo_nonce" in t && t.renew_logo_nonce && (n.data.renew_logo_nonce = !0), console.log(t), t && "redirect_url" in t && "" != t.redirect_url && (n.data.redirect_url = t.redirect_url), n.beforeSend = function() {
                pubsub.trigger("je:request:waiting"), t && "function" == typeof t.beforeSend && t.beforeSend()
            }, n.success = function(n, s, r) {
                pubsub.trigger("je:response:auth", n, s, r), pubsub.trigger("je:response:auth_" + e, n, s, r), t && "function" == typeof t.success && t.success(n, s, r)
            }, n.error = function(e, n, s) {
                pubsub.trigger("je:notification", {
                    msg: n,
                    notice_type: "error"
                }), t && "function" == typeof t.error && t.error(e, n, s)
            }, jQuery.ajax(n)
        },
        doLogout: function(e) {
            var t = _.extend({
                data: {
                    action: "et_logout"
                }
            }, this.params, e || {});
            return e && "function" == typeof e.beforeSend && (t.beforeSend = e.beforeSend), t.success = function(t, n, s) {
                pubsub.trigger("je:response:logout", t, n, s), e && "function" == typeof e.success && e.success(t, n, s)
            }, jQuery.ajax(t)
        },
        doResetPassword: function(e) {
            var t = _.extend({
                data: {
                    action: "et_reset_password",
                    user_login: this.get("user_name"),
                    user_pass: this.get("user_pass"),
                    user_key: this.get("user_key")
                }
            }, this.params, e || {});
            return t.beforeSend = function() {
                pubsub.trigger("je:request:waiting"), e && "function" == typeof e.beforeSend && e.beforeSend()
            }, t.success = function(t, n, s) {
                pubsub.trigger("je:response:reset_password", t, n, s), e && "function" == typeof e.success && e.success(t, n, s)
            }, jQuery.ajax(t)
        },
        doRequestResetPassword: function(e) {
            var t = _.extend({
                data: {
                    action: "et_request_reset_password",
                    user_login: this.get("user_email")
                }
            }, this.params, e || {});
            return t.beforeSend = function() {
                pubsub.trigger("je:request:requestResetPassWaiting"), e && "function" == typeof e.beforeSend && e.beforeSend()
            }, t.success = function(t, n, s) {
                pubsub.trigger("je:response:request_reset_password", t, n, s), e && "function" == typeof e.success && e.success(t, n, s)
            }, jQuery.ajax(t)
        },
        renderListItem: function() {
            return this.itemTemplate(this.toJSON)
        },
        sync: function(e, t, n) {
            var s = _.extend({
                type: "POST",
                dataType: "json",
                url: et_globals.ajaxURL,
                contentType: "application/x-www-form-urlencoded;charset=UTF-8"
            }, n || {});
            return "read" == e && (s.type = "GET", s.action = t.action, s.data = {
                id: t.id ? t.id : "",
                login_name: t.login_name ? t.login_name : ""
            }), s.data || !t || "create" != e && "update" != e && "delete" != e || (s.action = t.action, s.data = t.toJSON()), "GET" !== s.type && (s.processData = !1), s.data = jQuery.param({
                action: s.action,
                method: e,
                content: s.data
            }), jQuery.ajax(s)
        }
    }), JobEngine.Models.JobSeeker = JobEngine.Models.User.extend({
    defaults: {
        display_name: "",
        et_location: "",
        description: "",
        et_profession_title: "",
        et_avatar: "",
        et_linkleInUrl: "",
        et_accessible_companies: "",
        et_privacy: ""
    },
    action: "et_jobseeker_sync",
    role: "jobseeker",
    
    initialize: function() {
    // Specify the exact method names in bindAll
    _.bindAll(this, 'setLinkleInProfileUrl', 'setAvatar', 'getProTitle', 'setProTitle', 
              'getBio', 'setBio', 'getLocation', 'setLocation', 'renderListItem', 'sync');
    
    // Call the parent initialize function with the current context
    JobEngine.Models.User.prototype.initialize.call(this);
}
,
    
    setLinkleInProfileUrl: function(e) {
        this.set({ et_linkleInUrl: e }, { silent: true });
    },
    
    setAvatar: function(e) {
        this.set({ et_avatar: e }, { silent: true });
    },
    
    getProTitle: function() {
        return this.get("et_profession_title");
    },
    
    setProTitle: function(e) {
        this.set({ et_profession_title: e }, { silent: true });
    },
    
    getBio: function() {
        return this.get("description");
    },
    
    setBio: function(e) {
        this.set({ description: e }, { silent: true });
    },
    
    getLocation: function() {
        return this.get("et_location");
    },
    
    setLocation: function(e) {
        this.set({ et_location: e }, { silent: true });
    },
    
    parse: function(e) {
        return e.success ? e.data : (pubsub.trigger("je:notification", {
            msg: e.msg,
            notice_type: "error"
        }), {});
    },
    
    renderListItem: function() {
        return this.itemTemplate(this.toJSON());
    },
    
    sync: function(e, t, n) {
        var s = _.extend({
            type: "POST",
            dataType: "json",
            url: et_globals.ajaxURL,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8"
        }, n || {});

        if (e === "read") {
            s.type = "GET";
            s.action = t.action;
            s.data = {
                id: t.id || "",
                login_name: t.login_name || ""
            };
        } else if (t && (e === "create" || e === "update" || e === "delete")) {
            var attrs = _.clone(t.attributes);
            if (n && n.saveData && e !== "create") {
                attrs = {};
                _.each(n.saveData, function(e, n) {
                    attrs[e] = t.attributes[e];
                });
                attrs.ID = t.attributes.ID;
                attrs.id = t.attributes.id;
                s.data = attrs;
            } else {
                s.data = t.toJSON();
            }
            s.action = t.action;
        }

        if (s.type !== "GET") {
            s.processData = false;
        }
        
        s.data = jQuery.param({
            action: s.action,
            method: e,
            content: s.data
        });

        return jQuery.ajax(s);
    }
}), e(document).ready(function() {
        "undefined" == typeof JobEngine.app.currentUser.get("ID") && e(".single-resume").length > 0 && et_resume.resumes_privacy && (JobEngine.Views.PrivacyControl = Backbone.View.extend({
            initialize: function() {
                JobEngine.app.header.modal_login.setOptions({
                    redirect_url: this.redirect_url
                }), JobEngine.app.header.modal_login.openModalAuth()
            }
        }), new JobEngine.Views.PrivacyControl)
    })
}(jQuery);