!function(){"use strict";jQuery(window).on("elementor:init",function(){var e=elementor.modules.controls.Select2.extend({cache:null,isTitlesReceived:!1,getQueryData:function(){var e=elementorCommon.helpers.cloneObject(this.model.get("autocomplete"));return _.isEmpty(e.query)&&(e.query={}),"cpt_tax"===e.object&&(e.object="tax",_.isEmpty(e.query)||_.isEmpty(e.query.post_type))&&(e.query.post_type=this.elementSettingsModel.attributes.post_type),{autocomplete:e}},getSelect2DefaultOptions:function(){var a=this;return jQuery.extend(elementor.modules.controls.Select2.prototype.getSelect2DefaultOptions.apply(this,arguments),{ajax:{transport:function(e,t,o){var n={},n=a.getQueryData(),i=a.model.get("autocomplete");return n.q=e.data.q,n.autocomplete=i,elementorCommon.ajax.addRequest("minimog_elementor_autocomplete_search",{data:n,success:t,error:o})},data:function(e){return{q:e.term,page:e.page}},cache:!0},escapeMarkup:function(e){return e},minimumInputLength:1})},getValueTitles:function(){var t=this,e={},o=t.model.get("autocomplete"),n=this.getControlValue(),i=this.model.get("autocomplete").object;e.get_titles=t.getQueryData().autocomplete,e.unique_id=""+t.cid+i,e.autocomplete=o,n&&(_.isArray(n)||(n=[n]),elementorCommon.ajax.loadObjects({action:"minimog_elementor_autocomplete_render",ids:n,data:e,before:function(){t.addControlSpinner()},success:function(e){t.isTitlesReceived=!0,t.model.set("options",e),t.render()}}))},addControlSpinner:function(){this.ui.select.prop("disabled",!0),this.$el.find(".elementor-control-title").after('<span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>')},onReady:function(){this.isTitlesReceived||this.getValueTitles()}});elementor.addControlView("autocomplete",e)})}();