(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.wp.i18n,t=window.dokan.components,o=window.wp.element,n=window.React,a=e=>{const r=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase()))(e);return r.charAt(0).toUpperCase()+r.slice(1)},s=(...e)=>e.filter((e,r,t)=>Boolean(e)&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim(),i=e=>{for(const r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0};var d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const l=(0,n.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:c,...u},p)=>(0,n.createElement)("svg",{ref:p,...d,width:r,height:r,stroke:e,strokeWidth:o?24*Number(t)/Number(r):t,className:s("lucide",a),...!l&&!i(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,r])=>(0,n.createElement)(e,r)),...Array.isArray(l)?l:[l]])),c=((e,r)=>{const t=(0,n.forwardRef)(({className:t,...o},i)=>{return(0,n.createElement)(l,{ref:i,iconNode:r,className:s(`lucide-${d=a(e),d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,t),...o});var d});return t.displayName=a(e),t})("crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]),u=window.ReactJSXRuntime,p=({searchParams:e,setSearchParams:n})=>{const[a,s]=(0,o.useState)(null),i=(0,o.useRef)(!0),d=[{label:(0,r.__)("Subscribed","dokan"),value:"yes"},{label:(0,r.__)("Non-subscribed","dokan"),value:"no"}];return(0,o.useEffect)(()=>{if("undefined"==typeof window)return;const r=e.get("subscription_enabled");r&&s(d.find(e=>e.value===r))},[]),(0,o.useEffect)(()=>{i.current?i.current=!1:n(a&&a?.value?e=>(e.set("subscription_enabled",a.value),e):e=>(e.delete("subscription_enabled"),e))},[a]),(0,u.jsx)(t.Select,{selectedTitle:(0,r.__)("Subscription","dokan"),value:a,onChange:s,options:d,icon:(0,u.jsx)(c,{size:"16",className:"text-gray-500"}),placeholder:(0,r.__)("Search by Subscription","dokan"),menuPortalTarget:document.querySelector("body")})},w=window.wp.hooks,b=window.wp.domReady;e.n(b)()(function(){(0,w.addFilter)("dokan_admin_vendors_list_filters","dokanVendor",e=>(e.push({id:"subscription_enabled",label:(0,r.__)("Subscription","dokan"),field:p}),e)),(0,w.addFilter)("dokan_admin_vendors_before_request","dokanVendor",(e,r)=>(r.get("subscription_enabled")&&(e.subscription_enabled=r.get("subscription_enabled")),e),10),(0,w.addFilter)("dokan_vendors_show_filters","dokanVendor",(e,r)=>!!r.get("subscription_enabled")||e,10)})})();