(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,n||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}var i="#csf-modal-tablesome-shortcode",o=".csf-modal-table .csf-modal-content .csf-fields .tablesome__fields--table_id",r=".csf-modal-table .csf-modal-content .csf-fields .tablesome__fields--exclude_columns",a=function(){return e=function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),e.instance?e.instance:(e.instance=this,this)},(n=[{key:"getInstance",value:function(){return void 0===this.instance&&(this.instance=this),this.instance}},{key:"init",value:function(){this.eventListeners()}},{key:"eventListeners",value:function(){var e=this;jQuery(i).on("change",o,(function(){var t=jQuery(this).find(".csf-fieldset select[name*='table_id']").val();if(""==t)return alert(translation_strings.enter_table_id_alert),!1;e.sendRequest(t)}))}},{key:"sendRequest",value:function(e){var t=this;jQuery.get(tablesome_ajax_object.ajax_url,{action:"get_table_columns",nonce:tablesome_ajax_object.nonce,table_id:e,dataType:"JSON"},(function(e){if("failed"==e.status)return alert("Please enter the valid tablesome table id"),!1;var n=e.data,o=t.getExcludeColumnOptionsHTML(n),a=jQuery(i).find(r+" .csf-fieldset select[name='_pseudo']");a.empty().append(o),a.trigger("chosen:updated")}))}},{key:"getExcludeColumnOptionsHTML",value:function(e){return e.map((function(e){return"<option value="+e.id+">"+e.name+"</option>"})).join("")}}])&&t(e.prototype,n),a&&t(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a}();jQuery(document).on("ready",(function(){(new a).init()}))})();