(()=>{(function(){"use strict";function r(){const n=new URLSearchParams(window.location.search);return!!(n.get("fleekdash")==="off"||document.cookie.includes("fleekdash_classic_admin=1")||n.has("tab_id"))}function f(n){try{const e=new URL(n,window.location.origin);return!e.pathname.includes("/wp-admin/")||e.searchParams.get("fleekdash")==="off"||e.searchParams.get("page")==="fleekdash"?n:(e.searchParams.set("fleekdash","off"),e.href)}catch{return n}}function s(){if(!r())return;document.querySelectorAll('a[href*="/wp-admin/"], a[href^="index.php"], a[href^="edit.php"], a[href^="post.php"], a[href^="upload.php"], a[href^="themes.php"], a[href^="plugins.php"], a[href^="users.php"], a[href^="tools.php"], a[href^="options-"]').forEach(e=>{const i=e.getAttribute("href");if(!i||i.includes("fleekdash=off")||i.includes("page=fleekdash"))return;const t=f(i);t!==i&&e.setAttribute("href",t)})}function c(){r()&&document.addEventListener("click",function(n){const e=n.target.closest("a");if(!e)return;const i=e.getAttribute("href");if(!i||!i.includes("/wp-admin/")&&!i.match(/^[a-z-]+\.php/i)||i.includes("fleekdash=off")||i.includes("page=fleekdash"))return;const t=f(i);t!==i&&e.setAttribute("href",t)},!0)}function o(){r()&&document.addEventListener("submit",function(n){const e=n.target;if(!e.action||!e.action.includes("/wp-admin/")||e.action.includes("fleekdash=off")||e.action.includes("page=fleekdash")||e.querySelector('input[name="fleekdash"]'))return;const t=document.createElement("input");t.type="hidden",t.name="fleekdash",t.value="off",e.appendChild(t)})}function u(){if(!r())return;const n=window.fetch;window.fetch=function(e,i={}){let t=typeof e=="string"?e:e.url;if(t&&(t.includes("/wp-admin/")||t.includes("/wp-json/"))&&!t.includes("fleekdash=off")&&!t.includes("page=fleekdash")){const d=t.includes("?")?"&":"?";t+=d+"fleekdash=off",typeof e=="string"?e=t:e=new Request(t,e)}return n.call(this,e,i)}}function a(){if(!r())return;s(),c(),o(),u(),new MutationObserver(function(){s()}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("hashchange",function(){s()})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})();})();
