(()=>{"use strict";var e={n:n=>{var o=n&&n.__esModule?()=>n.default:()=>n;return e.d(o,{a:o}),o},d:(n,o)=>{for(var t in o)e.o(o,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:o[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)};const n=window.wp.element,o=window.wp.domReady;var t=e.n(o);const a=window.wp.i18n,r=window.wp.url,d=window.wp.hooks,s=window.ReactJSXRuntime,i=()=>{var e;const[o,t]=(0,n.useState)(window.location.hash),i=(0,d.applyFilters)("dokan_admin_panel_switch_supported_keys",["refund","dashboard","withdraw","vendors","changelog","store-reviews","verifications","product-advertising","reverse-withdrawal","announcement","subscriptions","abuse-reports","dokan-seller-badge","wholesale-customer","admin-store-support","product-qa"]);(0,n.useEffect)(()=>{const e=()=>{t(window.location.hash)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);const{nonce:c,admin_url:l}=dokanAdminSwitching||{},w=null!==(e=o.replace("#/","").split("?")[0].split("/").filter(Boolean)[0])&&void 0!==e?e:"dashboard";if(!i.includes(w)||!c||!l)return null;const u=(0,r.addQueryArgs)(l,{dokan_admin_switching_nonce:c,dokan_action:"switch_admin_panel",legacy_key:w}),h=new URLSearchParams(window.location.search).get("page");return(0,s.jsxs)("span",{className:"new-dashboard-url my-8 text-sm font-medium",children:["dokan-dashboard"!==h?(0,a.sprintf)((0,a.__)("To try Dokan new %s,","dokan-lite"),w):(0,a.sprintf)((0,a.__)("If you want to go back to old %s,","dokan-lite"),w)," ",(0,s.jsx)("a",{href:u||"#",className:"text-[#7047EB] font-bold underline",children:(0,a.__)("Click Here","dokan-lite")})]})};t()(function(){const e=document.getElementById("dokan-admin-switching");e?(0,n.createRoot)(e).render((0,s.jsx)(i,{})):console.error("Admin panel switching root element not found")})})();