!function(e){e(document).on("xpro_elementor_select_init",function(t,n){var a="#elementor-control-default-"+n.data._cid;setTimeout(function(){var t=e(a).select2({minimumInputLength:3,ajax:{url:xpro_elementor_select_localize.ajaxurl+"?action=xpro_elementor_select_search_post&post_type="+n.data.source_type+"&source_name="+n.data.source_name+"&nonce="+xpro_elementor_select_localize.nonce,dataType:"json"},initSelection:function(t,a){a(n.multiple?{id:"",text:""}:{id:"",text:xpro_elementor_select_localize.search_text});var r=[];if(Array.isArray(n.currentID)||""===n.currentID?Array.isArray(n.currentID)&&(r=n.currentID.filter(function(e){return null!=e})):r=[n.currentID],r.length>0){var o=e("label[for='elementor-control-default-"+n.data._cid+"']");o.after('<span class="elementor-control-spinner">&nbsp;<i class="eicon-spinner eicon-animation-spin"></i>&nbsp;</span>'),e.ajax({method:"POST",url:xpro_elementor_select_localize.ajaxurl+"?action=xpro_elementor_select_get_title",data:{post_type:n.data.source_type,source_name:n.data.source_name,id:r,nonce:xpro_elementor_select_localize.nonce}}).done(function(e){if(e.success&&void 0!==e.data.results){let n="";r.forEach(function(t,a){if(void 0!==e.data.results[t]){let r=e.data.results[t];n+=`<option selected="selected" value="${t}">${r}</option>`}}),t.append(n)}o.siblings(".elementor-control-spinner").remove()})}}});setTimeout(function(){t.next().children().children().children().sortable({containment:"parent",stop:function(n,a){a.item.parent().children("[title]").each(function(){var n=e(this).attr("title"),a=e("option:contains("+n+")",t).first();a.detach(),t.append(a)}),t.change()}}),e(a).on("select2:select",function(t){var n=e(t.params.data.element);n.detach(),e(this).append(n),e(this).trigger("change")})},200)},100)})}(jQuery);