!function(o){"use strict";var i={init:function(){this.Basic.init()},Basic:{init:function(){this.doctorFilterWidget()},doctorFilterWidget:function(){var i=o("#wpddb-doctor-filter-form");i.length&&(o("#wpddb_doctor_category").on("change",function(){var n=o(this).val();o("#wpddb_clinic_id").prop("disabled",!0).html('<option value="">Loading...</option>'),o("#wpddb_doctor_id").prop("disabled",!0).html('<option value="">Select Doctor</option>'),n&&(i.addClass("loading"),o.ajax({url:wpddbPublicParams.ajaxUrl,method:"POST",data:{action:"wpddb_get_clinics_by_category",category_id:n,_ajax_nonce:wpddbPublicParams.wpddb_wpnonce},success:function(n){if(n.success){var d=['<option value="">Select Clinic</option>'];n.data.forEach(function(o){d.push('<option value="'.concat(o.id,'">').concat(o.name,"</option>"))}),i.removeClass("loading"),o("#wpddb_clinic_id").html(d.join("")).prop("disabled",!1)}else i.removeClass("loading"),o("#wpddb_clinic_id").html('<option value="">No Clinics Found</option>')},error:function(){i.removeClass("loading")}}))}),o("#wpddb_clinic_id").on("change",function(){var n=o(this).val(),d=o("#wpddb_doctor_category").val();n&&d&&(o("#wpddb_doctor_id").prop("disabled",!0).html('<option value="">Loading...</option>'),i.addClass("loading"),o.ajax({url:wpddbPublicParams.ajaxUrl,method:"POST",data:{action:"wpddb_get_doctors_by_clinic",clinic_id:n,category_id:d,_ajax_nonce:wpddbPublicParams.wpddb_wpnonce},success:function(n){if(n.success){var d=['<option value="">Select Doctor</option>'];n.data.forEach(function(o){d.push('<option value="'.concat(o.id,'">').concat(o.name,"</option>"))}),i.removeClass("loading"),o("#wpddb_doctor_id").html(d.join("")).prop("disabled",!1)}else i.removeClass("loading"),o("#wpddb_doctor_id").html('<option value="">No Doctors Found</option>')},error:function(){i.removeClass("loading")}}))}))}},GlobalFun:{}};o(window).on("load resize",function(){o(window).on("elementor/frontend/init",function(){elementorFrontend.isEditMode()&&elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){i.init()})})}),o(document).ready(function(){i.init()})}(jQuery);