(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function r(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}!function(t){"use strict";var r=function(){return r=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init()},(o=[{key:"init",value:function(){this.bindEvents()}},{key:"bindEvents",value:function(){var e=this;t("#linkcentral-start-export").on("click",function(){return e.startExport()}),t(".linkcentral-modal-close").on("click",function(){return e.closeExportModal()})}},{key:"startExport",value:function(){var e=this;t("#linkcentral-export-modal").show(),t("#linkcentral-export-progress").show(),t("#linkcentral-export-complete").hide(),t("#linkcentral-export-error").hide(),t("#linkcentral-export-status-text").text("Preparing export..."),t.ajax({url:linkcentral_export.ajax_url,type:"POST",data:{action:"linkcentral_export_data",nonce:linkcentral_export.nonce},success:function(t){t.success?(e.downloadExport(t.data.data,t.data.filename),e.showExportComplete(t.data.data.export_info)):e.showExportError(t.data)},error:function(){e.showExportError("Network error occurred during export.")}})}},{key:"downloadExport",value:function(t,e){var r=JSON.stringify(t,null,2),o=new Blob([r],{type:"application/json"}),n=URL.createObjectURL(o),l=document.createElement("a");l.href=n,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(n)}},{key:"showExportComplete",value:function(e){t("#linkcentral-export-progress").hide(),t("#linkcentral-export-complete").show();var r="\n                <p><strong>Your download will start automatically.</strong></p>\n                <ul>\n                    <li>• ".concat(e.total_links," links exported</li>\n                    <li>• ").concat(e.total_clicks," analytics records exported</li>\n                    <li>• ").concat(e.total_keywords||0," keywords exported</li>\n                    <li>• Export date: ").concat(new Date(e.export_date).toLocaleString(),"</li>\n                </ul>\n            ");t("#linkcentral-export-stats").html(r)}},{key:"showExportError",value:function(e){t("#linkcentral-export-progress").hide(),t("#linkcentral-export-error").show(),t("#linkcentral-export-error-text").text(e)}},{key:"closeExportModal",value:function(){t("#linkcentral-export-modal").hide()}}])&&e(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o}();t(document).ready(function(){"undefined"!=typeof linkcentral_export&&new r})}(jQuery)})();