(()=>{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})(t)}function t(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function n(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}var o="#csf-modal-tablesome-shortcode",i=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(o).on("change",".csf-modal-table .csf-modal-content .csf-fields .tablesome__fields--table_id",(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,i=t.getExcludeColumnOptionsHTML(n),r=jQuery(o).find(".csf-modal-table .csf-modal-content .csf-fields .tablesome__fields--exclude_columns .csf-fieldset select[name='_pseudo']");r.empty().append(i),r.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),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();jQuery(document).on("ready",(function(){(new i).init()}))})();