(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>r});const o=window.wp.i18n;const r=function(){return{open:!1,copying:!1,async copy(e){const t=e.target.innerHTML;var r;await(r=this.$refs.creativeCode,new Promise(((e,t)=>{("object"!=typeof r||"string"!=typeof r.innerText&&"string"!=typeof r.value)&&t("Target is not a valid HTML node.");let o="";var i;"string"==typeof r.value?o=r.value:"string"==typeof r.innerText?o=r.innerText:t("Could not find valid text to copy"),e((i=o,new Promise(((e,t)=>{void 0===typeof navigator.clipboard||void 0===typeof navigator.clipboard.writeText?t("Could not find a valid clipboard library."):e(navigator.clipboard.writeText(i))}))))}))),this.copying=!0,e.target.innerText=`🎉 ${(0,o.__)("Copied!","affiliatewp-affiliate-portal")}`,await new Promise((e=>setTimeout(e,2e3))),e.target.innerHTML=t,this.copying=!1},async filter(){var e;const t=document.getElementById("filter");t.length<=0&&window.console.error("Unable to find <select> for slug"),null!==(e=!1===t.value)&&void 0!==e&&e&&window.console.error("Unable to get slug from selector value."),""!==t.value?window.location.href=`${t.dataset.baseUrl}/${t.value}`:window.location.href=`${t.dataset.baseUrl}/`}}};((window.AFFWP=window.AFFWP||{}).portal=window.AFFWP.portal||{}).creatives=t})();