text: jQuery(window).on("elementor:init",function(){elementor.hooks.addAction("panel/open_editor/widget/ee-offcanvas",function(e,t,n){"ee-offcanvas.classic"===n.$el.data("element_type")&&elementor.channels.editor.off("ee:editor:offcanvas:open").on("ee:editor:offcanvas:open",function(e){var t=n.$el,o=t.data("id");window.elementor.$previewContents.find("#ee-offcanvas-"+o);window.elementorFrontend.eeOffcanvas.controller.toggle("oc"+o)})});var e=elementor.modules.controls.BaseData.extend({getSnazzyDefaultOptions:function(){var e=this.model.get("snazzy_options");return{containerCssClass:"ee-select2-container",dropdownCssClass:"ee-select2-dropdown",allowClear:!0,placeholder:this.model.get("placeholder"),dir:elementor.config.is_rtl?"rtl":"ltr",ajax:{url:"https://snazzymaps.com/"+e.endpoint+".json",dataType:"json",cache:!0,data:function(t){return{key:e.key,page:t.page||1}},processResults:function(e,t){var n=$.map(e.styles,function(e){return e.id=JSON.stringify(e),e.text=e.name,e});return t.page=t.page||1,{results:n,pagination:{more:12*t.page<e.pagination.totalItems}}}},minimumInputLength:0,minimumResultsForSearch:-1,escapeMarkup:function(e){return e},templateResult:this.formatResults,templateSelection:this.formatResultsSelection}},formatResults:function(e){return e.loading?e.text:"<div class='ee-select2-dropdown__option clearfix'><div class='ee-select2-dropdown__option__image'><img src='"+e.imageUrl+"'/></div></div>"},formatResultsSelection:function(e){return e.text},applySavedValue:function(){var e=this.getControlValue();e&&""!==e&&(e=JSON.parse(this.getControlValue()),this.setInputValue('[data-setting="'+this.model.get("name")+'"]',e.id))},getSnazzyOptions:function(){return jQuery.extend(this.getSnazzyDefaultOptions(),this.model.get("select2options"))},onReady:function(){this.ui.select.select2(this.getSnazzyOptions())},onBeforeDestroy:function(){this.ui.select.data("select2")&&this.ui.select.select2("destroy"),this.$el.remove()}}),t=elementor.modules.controls.Select2.extend({cache:null,isTitlesReceived:!1,getSelect2Placeholder:function(){return{id:"",text:"All"}},getSelect2DefaultOptions:function(){var e=this;return jQuery.extend(elementor.modules.controls.Select2.prototype.getSelect2DefaultOptions.apply(this,arguments),{ajax:{transport:function(t,n,o){var s={q:t.data.q,query_type:e.model.get("query_type"),object_type:e.model.get("object_type")};return elementorCommon.ajax.addRequest("ee_query_control_filter_autocomplete",{data:s,success:n,error:o})},data:function(e){return{q:e.term,page:e.page}},cache:!0},escapeMarkup:function(e){return e},minimumInputLength:1})},getValueTitles:function(){var e=this,t=this.getControlValue(),n=this.model.get("query_type");objectType=this.model.get("object_type"),t&&n&&(_.isArray(t)||(t=[t]),elementorCommon.ajax.loadObjects({action:"ee_query_control_value_titles",ids:t,data:{query_type:n,object_type:objectType,unique_id:""+e.cid+n},success:function(t){e.isTitlesReceived=!0,e.model.set("options",t),e.render()},before:function(){e.addSpinner()}}))},addSpinner:function(){this.ui.select.prop("disabled",!0),this.$el.find(".elementor-control-title").after('<span class="elementor-control-spinner ee-control-spinner">&nbsp;<i class="fa fa-spinner fa-spin"></i>&nbsp;</span>')},onReady:function(){setTimeout(elementor.modules.controls.Select2.prototype.onReady.bind(this)),this.isTitlesReceived||this.getValueTitles()}});elementor.addControlView("ee-query",t),elementor.addControlView("ee-snazzy",e)});