(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,k(x);else{var t=n(l);t!==null&&A(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&A(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,ee=-1;function E(){return!(e.unstable_now()-eee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,A(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,k(x))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{se=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?oe(e):``}function ce(e){switch(e.tag){case 5:return oe(e.type);case 16:return oe(`Lazy`);case 13:return oe(`Suspense`);case 19:return oe(`SuspenseList`);case 0:case 2:case 15:return e=F(e.type,!1),e;case 11:return e=F(e.type.render,!1),e;case 1:return e=F(e.type,!0),e;default:return``}}function le(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case T:return`Portal`;case te:return`Profiler`;case E:return`StrictMode`;case k:return`Suspense`;case A:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case O:return(e.displayName||`Context`)+`.Consumer`;case D:return(e._context.displayName||`Context`)+`.Provider`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case j:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case M:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}function ue(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return le(t);case 8:return t===E?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function de(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function fe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function pe(e){var t=fe(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function me(e){e._valueTracker||=pe(e)}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=fe(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ge(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function _e(e,t){var n=t.checked;return P({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ve(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=de(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ye(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function be(e,t){ye(e,t);var n=de(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Se(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Se(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Se(e,t,n){(t!==`number`||ge(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ce=Array.isArray;function we(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ne(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Pe).forEach(function(e){Fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pe[t]=Pe[e]})});function Ie(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Pe.hasOwnProperty(e)&&Pe[e]?(``+t).trim():t+`px`}function Le(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ie(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Re=P({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function I(e,t){if(t){if(Re[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function ze(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Be=null;function Ve(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,Ue=null,We=null;function Ge(e){if(e=Li(e)){if(typeof He!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=zi(t),He(e.stateNode,e.type,t))}}function Ke(e){Ue?We?We.push(e):We=[e]:Ue=e}function qe(){if(Ue){var e=Ue,t=We;if(We=Ue=null,Ge(e),t)for(e=0;e>>=0,e===0?32:31-(Ot(e)/z|0)|0}var At=64,jt=4194304;function Mt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Mt(a))):r=Mt(s)}else o=n&~i,o===0?a!==0&&(r=Mt(a)):r=Mt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function zt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function Bt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=xn(),bn=yn=vn=null,ir=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(){for(var e=window,t=ge();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ge(e.document)}return t}function Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Nr(e){var t=jr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ar(n.ownerDocument.documentElement,n)){if(r!==null&&Mr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=kr(n,a);var o=kr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Fr=null,Ir=null,Lr=null,Rr=!1;function zr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rr||Fr==null||Fr!==ge(r)||(r=Fr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lr&&Dr(Lr,r)||(Lr=r,r=ui(Ir,`onSelect`),0Vi||(e.current=Bi[Vi],Bi[Vi]=null,Vi--)}function q(e,t){Vi++,Bi[Vi]=e.current,e.current=t}var Ui={},Wi=Hi(Ui),Gi=Hi(!1),Ki=Ui;function qi(e,t){var n=e.type.contextTypes;if(!n)return Ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ji(e){return e=e.childContextTypes,e!=null}function Yi(){K(Gi),K(Wi)}function Xi(e,t,n){if(Wi.current!==Ui)throw Error(r(168));q(Wi,t),q(Gi,n)}function Zi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ue(e)||`Unknown`,a));return P({},n,i)}function Qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ui,Ki=Wi.current,q(Wi,e),q(Gi,Gi.current),!0}function $i(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Zi(e,t,Ki),i.__reactInternalMemoizedMergedChildContext=e,K(Gi),K(Wi),q(Wi,e)):K(Gi),q(Gi,n)}var ea=null,ta=!1,na=!1;function ra(e){ea===null?ea=[e]:ea.push(e)}function ia(e){ta=!0,ra(e)}function aa(){if(!na&&ea!==null){na=!0;var e=0,t=B;try{var n=ea;for(B=1;e>=o,i-=o,pa=1<<32-Dt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),J&&ha(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),J&&ha(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return J&&ha(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),J&&ha(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===ee&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===ee){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===M&&Pa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ma(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===ee?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Ma(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case M:return l=i._init,_(e,r,l(i._payload),o)}if(Ce(i))return h(e,r,i,o);if(ie(i))return g(e,r,i,o);Na(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ia=Fa(!0),La=Fa(!1),Ra=Hi(null),za=null,Ba=null,Va=null;function Ha(){Va=Ba=za=null}function Ua(e){var t=Ra.current;K(Ra),e._currentValue=t}function Wa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ga(e,t){za=e,Va=Ba=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ns=!0),e.firstContext=null)}function Ka(e){var t=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:t,next:null},Ba===null){if(za===null)throw Error(r(308));Ba=e,za.dependencies={lanes:0,firstContext:e}}else Ba=Ba.next=e;return t}var qa=null;function Ja(e){qa===null?qa=[e]:qa.push(e)}function Ya(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ja(t)):(n.next=i.next,i.next=n),t.interleaved=n,Xa(e,r)}function Xa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Za=!1;function Qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $a(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function eo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function to(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Xa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ja(r)):(t.next=i.next,i.next=t),r.interleaved=t,Xa(e,n)}function no(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vt(e,n)}}function ro(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function io(e,t,n,r){var i=e.updateQueue;Za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=P({},d,f);break a;case 2:Za=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Yc|=o,e.lanes=o,e.memoizedState=d}}function ao(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bo.transition;bo.transition={};try{e(!1),t()}finally{B=n,bo.transition=r}}function os(){return No().memoizedState}function ss(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ls(e))us(t,n);else if(n=Ya(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),ds(n,t,r)}}function cs(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ls(e))us(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o)){var c=t.interleaved;c===null?(i.next=i,Ja(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ya(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),ds(n,t,r))}}function ls(e){var t=e.alternate;return e===X||t!==null&&t===X}function us(e,t){To=wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ds(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vt(e,n)}}var fs={readContext:Ka,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useInsertionEffect:Oo,useLayoutEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useMutableSource:Oo,useSyncExternalStore:Oo,useId:Oo,unstable_isNewReconciler:!1},ps={readContext:Ka,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:Ka,useEffect:Yo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),qo(4194308,4,$o.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return qo(4,2,e,t)},useMemo:function(e,t){var n=Mo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ss.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:Wo,useDebugValue:ts,useDeferredValue:function(e){return Mo().memoizedState=e},useTransition:function(){var e=Wo(!1),t=e[0];return e=as.bind(null,e[1]),Mo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=X,a=Mo();if(J){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Hc===null)throw Error(r(349));xo&30||zo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Yo(Vo.bind(null,i,o,e),[e]),i.flags|=2048,Go(9,Bo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Mo(),t=Hc.identifierPrefix;if(J){var n=ma,r=pa;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Eo++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ai]=t,e[ji]=i,rc(e,t,!1,!1),t.stateNode=e;a:{switch(c=ze(n,i),n){case`dialog`:G(`cancel`,e),G(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:G(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;otl&&(t.flags|=128,i=!0,oc(s,!1),t.lanes=4194304)}else{if(!i)if(e=go(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!J)return sc(t),null}else 2*R()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,oc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(sc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=R(),t.sibling=null,n=Y.current,q(Y,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Gc&1073741824&&(sc(t),t.subtreeFlags&6&&(t.flags|=8192)):sc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function lc(e,t){switch(va(t),t.tag){case 1:return Ji(t.type)&&Yi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return po(),K(Gi),K(Wi),vo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ho(t),null;case 13:if(K(Y),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Y),null;case 4:return po(),null;case 10:return Ua(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var uc=!1,dc=!1,fc=typeof WeakSet==`function`?WeakSet:Set,Z=null;function pc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}function mc(e,t,n){try{n()}catch(n){$(e,t,n)}}var hc=!1;function gc(e,t){if(vi=dn,e=jr(),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(yi={focusedElem:e,selectionRange:n},dn=!1,Z=t;Z!==null;)if(t=Z,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:gs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return h=hc,hc=!1,h}function _c(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&mc(t,n,a)}i=i.next}while(i!==r)}}function vc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function yc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function bc(e){var t=e.alternate;t!==null&&(e.alternate=null,bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ai],delete t[ji],delete t[Ni],delete t[Pi],delete t[Fi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xc(e){return e.tag===5||e.tag===3||e.tag===4}function Sc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_i));else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}function wc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(wc(e,t,n),e=e.sibling;e!==null;)wc(e,t,n),e=e.sibling}var Tc=null,Ec=!1;function Dc(e,t,n){for(n=n.child;n!==null;)Oc(e,t,n),n=n.sibling}function Oc(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount==`function`)try{Tt.onCommitFiberUnmount(wt,n)}catch{}switch(n.tag){case 5:dc||pc(n,t);case 6:var r=Tc,i=Ec;Tc=null,Dc(e,t,n),Tc=r,Ec=i,Tc!==null&&(Ec?(e=Tc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Tc.removeChild(n.stateNode));break;case 18:Tc!==null&&(Ec?(e=Tc,n=n.stateNode,e.nodeType===8?Ei(e.parentNode,n):e.nodeType===1&&Ei(e,n),un(e)):Ei(Tc,n.stateNode));break;case 4:r=Tc,i=Ec,Tc=n.stateNode.containerInfo,Ec=!0,Dc(e,t,n),Tc=r,Ec=i;break;case 0:case 11:case 14:case 15:if(!dc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&mc(n,t,o),i=i.next}while(i!==r)}Dc(e,t,n);break;case 1:if(!dc&&(pc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}Dc(e,t,n);break;case 21:Dc(e,t,n);break;case 22:n.mode&1?(dc=(r=dc)||n.memoizedState!==null,Dc(e,t,n),dc=r):Dc(e,t,n);break;default:Dc(e,t,n)}}function kc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new fc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Ac(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=R()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Rc(i/1960))-i,10e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,Q&6)throw Error(r(331));var a=Q;for(Q|=4,Z=e.current;Z!==null;){var o=Z,s=o.child;if(Z.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lR()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=jt,jt<<=1,!(jt&130023424)&&(jt=4194304)):t=1);var n=pl();e=Xa(e,t),e!==null&&(zt(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gi.current)Ns=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ns=!1,nc(e,t,n);Ns=!!(e.flags&131072)}else Ns=!1,J&&t.flags&1048576&&ga(t,la,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ec(e,t),e=t.pendingProps;var a=qi(t,Wi.current);Ga(t,n),a=Ao(null,t,i,e,a,n);var o=jo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ji(i)?(o=!0,Qi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qa(t),a.updater=vs,t.stateNode=a,a._reactInternals=t,Ss(t,i,e,n),t=Hs(null,t,i,!0,o,n)):(t.tag=0,J&&o&&_a(t),Ps(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ec(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=gs(i,e),a){case 0:t=Bs(null,t,i,e,n);break a;case 1:t=Vs(null,t,i,e,n);break a;case 11:t=Fs(null,t,i,e,n);break a;case 14:t=Is(null,t,i,gs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:gs(i,a),Bs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:gs(i,a),Vs(e,t,i,a,n);case 3:a:{if(Us(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,$a(e,t),io(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Cs(Error(r(423)),t),t=Ws(e,t,i,n,a);break a}else if(i!==a){a=Cs(Error(r(424)),t),t=Ws(e,t,i,n,a);break a}else for(ba=Di(t.stateNode.containerInfo.firstChild),ya=t,J=!0,xa=null,n=La(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),i===a){t=tc(e,t,n);break a}Ps(e,t,i,n)}t=t.child}return t;case 5:return mo(t),e===null&&Ta(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,bi(i,a)?s=null:o!==null&&bi(i,o)&&(t.flags|=32),zs(e,t),Ps(e,t,s,n),t.child;case 6:return e===null&&Ta(t),null;case 13:return qs(e,t,n);case 4:return fo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ia(t,null,i,n):Ps(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:gs(i,a),Fs(e,t,i,a,n);case 7:return Ps(e,t,t.pendingProps,n),t.child;case 8:return Ps(e,t,t.pendingProps.children,n),t.child;case 12:return Ps(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,q(Ra,i._currentValue),i._currentValue=s,o!==null)if(Er(o.value,s)){if(o.children===a.children&&!Gi.current){t=tc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=eo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Wa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ps(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ga(t,n),a=Ka(a),i=i(a),t.flags|=1,Ps(e,t,i,n),t.child;case 14:return i=t.type,a=gs(i,t.pendingProps),a=gs(i.type,a),Is(e,t,i,a,n);case 15:return Ls(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:gs(i,a),ec(e,t),t.tag=1,Ji(i)?(e=!0,Qi(t)):e=!1,Ga(t,n),bs(t,i,a),Ss(t,i,a,n),Hs(null,t,i,!0,e,n);case 19:return $s(e,t,n);case 22:return Rs(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return ht(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===ne)return 11;if(e===j)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case ee:return Zl(n.children,a,o,t);case E:s=8,a|=8;break;case te:return e=Kl(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case k:return e=Kl(13,n,t,a),e.elementType=k,e.lanes=o,e;case A:return e=Kl(19,n,t,a),e.elementType=A,e.lanes=o,e;case N:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case D:s=10;break a;case O:s=9;break a;case ne:s=11;break a;case j:s=14;break a;case M:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rt(0),this.expirationTimes=Rt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qa(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),v={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},y=c(u()),b=(0,y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,y.createElement)(`svg`,{ref:c,...v,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:_(`lucide`,i),...s},[...o.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),x=(e,t)=>{let n=(0,y.forwardRef)(({className:n,...r},i)=>(0,y.createElement)(b,{ref:i,iconNode:t,className:_(`lucide-${g(e)}`,n),...r}));return n.displayName=`${e}`,n},S=x(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),C=x(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),w=x(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),T=x(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),ee=x(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),E=x(`CalendarCheck`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m9 16 2 2 4-4`,key:`19s6y9`}]]),te=x(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),D=x(`ChartColumn`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),O=x(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ne=x(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),k=x(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),A=x(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),j=x(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=x(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),N=x(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),re=x(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ie=x(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),P=x(`Cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ae=x(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),oe=x(`CornerDownLeft`,[[`polyline`,{points:`9 10 4 15 9 20`,key:`r3jprv`}],[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}]]),se=x(`Crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),F=x(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),ce=x(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),le=x(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ue=x(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),de=x(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fe=x(`FileX`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),pe=x(`Filter`,[[`polygon`,{points:`22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3`,key:`1yg77f`}]]),me=x(`Flame`,[[`path`,{d:`M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z`,key:`96xj49`}]]),he=x(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ge=x(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),_e=x(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ve=x(`HardDrive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),ye=x(`HeartPulse`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}],[`path`,{d:`M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`1uw2ng`}]]),be=x(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),xe=x(`ImagePlus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Se=x(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ce=x(`Import`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m8 11 4 4 4-4`,key:`1dohi6`}],[`path`,{d:`M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4`,key:`1ywtjm`}]]),we=x(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Te=x(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ee=x(`Layers`,[[`path`,{d:`m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z`,key:`8b97xw`}],[`path`,{d:`m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65`,key:`dd6zsq`}],[`path`,{d:`m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65`,key:`ep9fru`}]]),De=x(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Oe=x(`LifeBuoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),ke=x(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Ae=x(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),je=x(`Lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Me=x(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),Ne=x(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Pe=x(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Fe=x(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Ie=x(`PlugZap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),Le=x(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Re=x(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),I=x(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ze=x(`Replace`,[[`path`,{d:`M14 4a2 2 0 0 1 2-2`,key:`1w2hp7`}],[`path`,{d:`M16 10a2 2 0 0 1-2-2`,key:`shjach`}],[`path`,{d:`M20 2a2 2 0 0 1 2 2`,key:`188mtx`}],[`path`,{d:`M22 8a2 2 0 0 1-2 2`,key:`ddf4tu`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a3 3 0 0 1 3-3h1`,key:`3y3t5z`}],[`rect`,{x:`2`,y:`14`,width:`8`,height:`8`,rx:`2`,key:`4rksxw`}]]),Be=x(`Rocket`,[[`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`,key:`m3kijz`}],[`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`,key:`1fmvmk`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0`,key:`1f8sc4`}],[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}]]),Ve=x(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),He=x(`Rss`,[[`path`,{d:`M4 11a9 9 0 0 1 9 9`,key:`pv89mb`}],[`path`,{d:`M4 4a16 16 0 0 1 16 16`,key:`k0647b`}],[`circle`,{cx:`5`,cy:`19`,r:`1`,key:`bfqh0e`}]]),Ue=x(`Scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),We=x(`ScrollText`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Ge=x(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Ke=x(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),qe=x(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Je=x(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ye=x(`Shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),Xe=x(`SlidersVertical`,[[`line`,{x1:`4`,x2:`4`,y1:`21`,y2:`14`,key:`1p332r`}],[`line`,{x1:`4`,x2:`4`,y1:`10`,y2:`3`,key:`gb41h5`}],[`line`,{x1:`12`,x2:`12`,y1:`21`,y2:`12`,key:`hf2csr`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`3`,key:`1kfi7u`}],[`line`,{x1:`20`,x2:`20`,y1:`21`,y2:`16`,key:`1lhrwl`}],[`line`,{x1:`20`,x2:`20`,y1:`12`,y2:`3`,key:`16vvfq`}],[`line`,{x1:`2`,x2:`6`,y1:`14`,y2:`14`,key:`1uebub`}],[`line`,{x1:`10`,x2:`14`,y1:`8`,y2:`8`,key:`1yglbp`}],[`line`,{x1:`18`,x2:`22`,y1:`16`,y2:`16`,key:`1jxqpz`}]]),Ze=x(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Qe=x(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),$e=x(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),et=x(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),tt=x(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),nt=x(`Tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),rt=x(`Timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),it=x(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),at=x(`TrendingUp`,[[`polyline`,{points:`22 7 13.5 15.5 8.5 10.5 2 17`,key:`126l90`}],[`polyline`,{points:`16 7 22 7 22 13`,key:`kwv8wd`}]]),ot=x(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),st=x(`Type`,[[`polyline`,{points:`4 7 4 4 20 4 20 7`,key:`1nosan`}],[`line`,{x1:`9`,x2:`15`,y1:`20`,y2:`20`,key:`swin9y`}],[`line`,{x1:`12`,x2:`12`,y1:`4`,y2:`20`,key:`1tx1rr`}]]),ct=x(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),lt=x(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),ut=x(`Webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),dt=x(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),ft=x(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),pt=x(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),mt=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),ht=o(((e,t)=>{t.exports=mt()})),gt=c(m(),1),_t=h(),L=ht(),R={Activity:S,BarChart3:D,CalendarClock:te,Clock:ie,Cloud:P,Database:F,Eye:de,FileX:fe,Filter:pe,Gauge:he,Globe:_e,HardDrive:ve,HeartPulse:ye,Image:Se,Import:Ce,KeyRound:Te,Layers:Ee,LayoutDashboard:De,LifeBuoy:Oe,Lightbulb:ke,Network:Ne,Replace:ze,Rss:He,Scissors:Ue,Search:Ge,Server:Ke,Settings:qe,Shield:Je,Shrink:Ye,Sliders:Xe,Sparkles:Qe,Square:$e,Tag:nt,Trash2:it,TrendingUp:at,Type:st,Wand2:lt,Webhook:ut,Wrench:dt,Zap:pt};function vt({name:e,size:t=15,className:n}){return(0,L.jsx)(R[e]??$e,{size:t,className:n})}var yt=[{slug:`pagespeed`,label:`PageSpeed`,icon:`Gauge`,description:`Run Google PageSpeed Insights audits without leaving the dashboard. Scores + CWV cached 24h.`,teaser:`pagespeed`,embedded:!0},{slug:`recommendations`,label:`Recommendations`,icon:`Lightbulb`,description:`Rule-based engine surfaces the 5 things most likely to improve your score.`,teaser:`recommendations`,embedded:!0},{slug:`rum`,label:`Real-User Monitoring`,icon:`Eye`,description:`Sample LCP / FCP / CLS / INP / TTFB from real visitors. Per-URL percentile charts.`,teaser:`rum`,embedded:!0},{slug:`images`,label:`Image Optimization`,icon:`Replace`,description:`Convert new JPEG/PNG uploads to WebP and AVIF; serve modern formats to supporting browsers.`,teaser:`webp-avif`,embedded:!0},{slug:`cloudflare-apo`,label:`Cloudflare APO`,icon:`Zap`,description:`Toggle Automatic Platform Optimization, edge cache level, and TTL. No separate dashboard.`,teaser:`cloudflare-apo`,embedded:!0},{slug:`feed-cache`,label:`Feed Caching`,icon:`Rss`,description:`Cache RSS / Atom / comment feeds so polling aggregators skip a full render. Correct feed content-type preserved; purges on new posts.`,teaser:`feed-cache`,embedded:!0},{slug:`cache-404`,label:`404 Caching`,icon:`FileX`,description:`Serve one cached 404 so bot / scanner floods on unknown URLs don't each cost a render. Short-lived, shared entry, purged on publish.`,teaser:`cache-404`,embedded:!0},{slug:`search-cache`,label:`Search Caching`,icon:`Search`,description:`Cache internal search-results pages (/?s=…) so popular repeated searches skip a full query + render. Keyed per term, short-lived, purged on publish.`,teaser:`search-cache`,embedded:!0},{slug:`rest-cache`,label:`REST API Cache`,icon:`Webhook`,description:`Cache read-only REST responses with a TTL you set per route — built for headless sites and app backends. Auth'd and write requests never cache.`,teaser:`rest-cache`,embedded:!0},{slug:`maintenance-cache`,label:`Maintenance`,icon:`Wrench`,description:`Skip caching while the site is in maintenance / coming-soon mode, and auto-purge when it goes live again.`,teaser:null,embedded:!0},{slug:`prewarm-schedule`,label:`On a Schedule`,icon:`CalendarClock`,description:`Warm target URLs ahead of posts, sales, and campaigns so the spike hits a warm cache. One-off, recurring, and auto-warm on scheduled-post publish.`,teaser:`prewarm-schedule`,embedded:!0},{slug:`predictive-warm`,label:`Auto (AI)`,icon:`TrendingUp`,description:`Proactively warm the hottest URLs — ranked by real traffic, recency, and content — so popular and about-to-be-popular pages always serve from cache.`,teaser:`predictive-warm`,embedded:!0},{slug:`brotli-compression`,label:`Brotli`,icon:`Shrink`,description:`Serve Brotli where supported — smaller than GZIP — with automatic GZIP fallback.`,teaser:`brotli`,embedded:!0},{slug:`custom-rules`,label:`Custom Cache Rules`,icon:`Filter`,description:`Bypass cache or override expiry by URL glob, post type, category, tag, or author.`,teaser:`custom-rules`,embedded:!0},{slug:`analytics`,label:`Analytics`,icon:`BarChart3`,description:`Hit-ratio trends, slowest URLs from RUM samples, recent activity timeline.`,teaser:`analytics`,embedded:!0},{slug:`critical-css`,label:`Critical CSS`,icon:`Sparkles`,description:`Inline above-the-fold styles, defer the rest. Pluggable generator endpoint.`,teaser:`critical-css`,embedded:!0},{slug:`unused-css`,label:`Unused CSS`,icon:`Scissors`,description:`Per-URL pruned stylesheet inlined; original tags stripped.`,teaser:`unused-css`,embedded:!0},{slug:`license`,label:`License`,icon:`KeyRound`,description:`Activate xSpeed Pro and manage automatic updates.`,teaser:null},{slug:`white-label`,label:`Branding`,icon:`Tag`,description:`Rebrand the dashboard chrome — name, footer credit, hide help links.`,teaser:`white-label`},{slug:`multisite`,label:`Multisite`,icon:`Network`,description:`One dashboard across every site in a WP Multisite network with network-wide purge.`,teaser:`multisite`},{slug:`ai-provider`,label:`AI Provider`,icon:`Sparkles`,description:`Connect OpenAI, Anthropic, Gemini, or OpenRouter once — every Pro AI feature shares the connection.`,teaser:null},{slug:`smart-predict`,label:`Speculation Rules`,icon:`Wand2`,description:`Predict each visitor's next page and prefetch it via Chrome's Speculation Rules API.`,teaser:null,embedded:!0},{slug:`performance-health`,label:`Performance Health`,icon:`HeartPulse`,description:`Core Web Vitals health monitor with AI anomaly detection and a 7-day regression baseline.`,teaser:null,embedded:!0},{slug:`smart-image`,label:`AI Suggestions`,icon:`Sparkles`,description:`AI-recommended format + quality settings, applied into Image Optimization in one click.`,teaser:null,embedded:!0},{slug:`adaptive-cache`,label:`Adaptive Cache`,icon:`Lightbulb`,description:`AI-tuned cache TTL based on 24-hour traffic patterns, applied into the Cache module in one click.`,teaser:null}],bt=new Set(yt.filter(e=>e.embedded).map(e=>e.slug)),xt=[{id:`cache`,label:`Cache`,icon:`Zap`,description:`Page, object and browser caching, plus preload.`,slugs:[`cache`,`preloader`,`browser-cache`,`object-cache`,`cache-coverage`,`adaptive-cache`]},{id:`performance`,label:`Optimization`,icon:`Gauge`,description:`Minify, compress, lazy-load, fonts and hints.`,slugs:[`minify`,`gzip`,`lazy`,`resource-hints`,`fonts`,`bloat`,`heartbeat`]},{id:`network`,label:`Network`,icon:`Network`,description:`CDN and Cloudflare edge delivery.`,slugs:[`cdn`,`cloudflare`]},{id:`insights`,label:`Health & insights`,icon:`HeartPulse`,description:`Speed score, diagnostics and analytics.`,slugs:[`health`,`score`]},{id:`tools`,label:`Tools`,icon:`Sliders`,description:`Database cleanup, migration and logs.`,slugs:[`database`,`migration`,`logs`]},{id:`ai-agents`,label:`AI & agents`,icon:`Sparkles`,description:`Hub, MCP access, AI provider and privacy.`,slugs:[`ai-provider`,`mcp`,`ai-privacy`]},{id:`settings`,label:`Settings`,icon:`Settings`,description:`License, branding, multisite and support.`,slugs:[`license`,`white-label`,`multisite`,`support`]}],St=xt.map(e=>e.id);function Ct(e){return xt.find(t=>t.id===e)}function wt(e){return xt.find(t=>t.slugs.includes(e))?.id}function Tt(e,t=!0){let n=new Map(e.map(e=>[e.slug,e])),r=new Set,i=[];for(let e of xt){let t=[];for(let i of e.slugs){let e=n.get(i);e&&(t.push(e),r.add(i))}t.length>0&&i.push({id:e.id,label:e.label,icon:e.icon,modules:t,leaf:e.leaf})}let a=e.filter(e=>!r.has(e.slug)&&!bt.has(e.slug));return a.length>0&&i.push({id:`other`,label:`Other`,icon:`Square`,modules:a}),i}var Et=`overview`,Dt=`xspeed`;function Ot(){return typeof window>`u`?null:window.wp?.i18n??null}function z(e,t=Dt){let n=Ot();return n?n.__(e,t):e}function kt(e,...t){let n=Ot();if(n)return n.sprintf(e,...t);let r=0;return e.replace(/%[sd]/g,()=>String(t[r++]??``))}var At={},jt=`xspeed:panels-changed`,Mt=`xspeed:tier-changed`,Nt=`xspeed:branding-changed`;function Pt(e){return At[e]}function Ft(){typeof window>`u`||window.XSpeedPro||(window.XSpeedPro={panels:At,registerPanel(e,t){At[e]=t,window.dispatchEvent(new CustomEvent(jt,{detail:{slug:e}}))},setTier(e){let t=window.XSpeedConfig;t&&(t.tier=e),window.dispatchEvent(new CustomEvent(Mt,{detail:{tier:e}}))},setBranding(e){let t=window.XSpeedConfig;t&&(t.branding=e),window.dispatchEvent(new CustomEvent(Nt,{detail:{branding:e}}))}})}function It(){let[e,t]=(0,y.useState)(0);return(0,y.useEffect)(()=>{let e=()=>t(e=>e+1);return window.addEventListener(jt,e),()=>window.removeEventListener(jt,e)},[]),e}var Lt={name:`xSpeed Cache`,footer_credit:null,hide_help_links:!1,logo_svg:null};function Rt(){let e=window.XSpeedConfig?.branding;return e?{...Lt,...e}:Lt}function zt(){let[e,t]=(0,y.useState)(Rt);return(0,y.useEffect)(()=>{let e=()=>t(Rt());return window.addEventListener(Nt,e),()=>window.removeEventListener(Nt,e)},[]),e}var Bt=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2078%2080'%20fill='currentColor'%3e%3cpath%20d='M21.3338%2039.5736L31.9365%2039.569C34.2801%2039.5679%2035.4523%2039.5676%2036.2312%2040.0567C36.913%2040.485%2037.408%2041.1552%2037.6165%2041.9329C37.8546%2042.8212%2037.508%2043.9413%2036.8171%2046.1808L32.6658%2059.6398C31.6247%2063.0143%2031.1044%2064.7012%2031.4487%2065.3027C31.745%2065.8198%2032.3041%2066.1285%2032.8995%2066.1036C33.4188%2066.0818%2034.1959%2065.3232%2035.5221%2063.8145L37.043%2062.0552L56.0558%2039.5795C62.7569%2041.0202%2067.7803%2047.2973%2067.7804%2054.4289C67.7804%2062.6374%2061.1259%2069.2919%2052.9174%2069.2919H26.3952C17.2528%2069.2918%209.84031%2061.8804%209.83984%2052.7381V39.5658H21.3416L21.3338%2039.5736Z'/%3e%3cpath%20d='M51.2251%209.83978C60.3678%209.83978%2067.7803%2017.2524%2067.7804%2026.3951V39.5658H56.3441L56.3519%2039.5565L46.974%2039.5534C44.4567%2039.5525%2043.1977%2039.5516%2042.3973%2039.022C41.6975%2038.5589%2041.2081%2037.8393%2041.0354%2037.018C40.8379%2036.0789%2041.301%2034.9082%2042.2275%2032.5675L47.3605%2019.5994C48.7246%2016.1534%2049.407%2014.4296%2049.1042%2013.7994C48.8435%2013.2582%2048.3008%2012.9083%2047.7002%2012.8956C47.0013%2012.881%2045.7161%2014.2175%2043.1469%2016.8895L21.6455%2039.5495C14.9041%2038.1394%209.83989%2031.863%209.83984%2024.7028C9.83994%2016.4945%2016.4946%209.84003%2024.7029%209.83978H51.2251Z'/%3e%3c/svg%3e`;function Vt({className:e=`w-6 h-6 rounded shrink-0`,onDark:t=!1}){let n=zt(),r=n.logo_svg?.trim(),i=n.name||`xSpeed Cache`,[a,o]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{o(!1)},[r]),r&&!a?r.startsWith(`o(!0)}):(0,L.jsx)(`img`,{src:Bt,alt:i,className:`${e} ${t?`invert`:`dark:invert`}`})}function B({activeGroup:e,onNavigate:t,onUpgrade:n,modules:r=[]}){let i=zt(),a=e=>e.reduce((e,t)=>e+ +(r.find(e=>e.slug===t)?.settings?.enabled===!0),0),o=`group w-full flex items-center gap-3 px-3 py-2 rounded-control text-[13.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40`;return(0,L.jsxs)(`aside`,{className:`w-60 shrink-0 flex flex-col text-rail-text`,style:{background:`linear-gradient(180deg, var(--rail-top), var(--rail-bottom))`},children:[(0,L.jsxs)(`div`,{className:`h-14 shrink-0 flex items-center gap-2.5 px-4 border-b`,style:{borderColor:`var(--rail-edge)`},children:[(0,L.jsx)(Vt,{className:`w-6 h-6 rounded`,onDark:!0}),(0,L.jsx)(`span`,{className:`font-display font-semibold text-[15px] text-white truncate`,children:i.name})]}),(0,L.jsxs)(`nav`,{"aria-label":z(`Primary`),className:`flex-1 overflow-y-auto p-3 space-y-1`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(Et),"aria-current":e===`overview`?`page`:void 0,className:e===`overview`?`${o} bg-primary text-on-primary shadow-primary-glow`:`${o} text-rail-text hover:text-white hover:bg-white/[.06]`,children:[(0,L.jsx)(De,{size:16,className:`shrink-0`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`flex-1 text-left truncate`,children:z(`Overview`)})]}),(0,L.jsx)(`div`,{className:`pt-2`}),xt.map(n=>{let r=e===n.id,i=a(n.slugs);return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),"aria-current":r?`page`:void 0,className:r?`${o} bg-primary text-on-primary shadow-primary-glow`:`${o} text-rail-text hover:text-white hover:bg-white/[.06]`,children:[(0,L.jsx)(vt,{name:n.icon,size:16,className:`shrink-0`}),(0,L.jsx)(`span`,{className:`flex-1 text-left truncate`,children:n.label}),i>0&&(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] tabular-nums ${r?`text-on-primary`:`text-rail-text`}`,children:i})]},n.id)})]}),(0,L.jsx)(`div`,{className:`p-3 border-t`,style:{borderColor:`var(--rail-edge)`},children:(0,L.jsxs)(`button`,{type:`button`,onClick:n,className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-control text-[13px] font-medium text-white bg-white/[.06] hover:bg-white/[.1] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/40`,children:[(0,L.jsx)(Qe,{size:15,className:`shrink-0 text-warning`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`flex-1 text-left`,children:z(`Upgrade to Pro`)}),(0,L.jsx)(w,{size:14,className:`shrink-0 opacity-70`,"aria-hidden":`true`})]})})]})}var Ht=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||``)?`⌘K`:`Ctrl K`;function Ut({crumb:e,onOpenSearch:t,onPurge:n,onPreload:r,onConnectHub:i,purging:a=!1,preloading:o=!1,hubConnected:s=!1,theme:c,onToggleTheme:l}){return(0,L.jsxs)(`header`,{className:`sticky top-0 z-30 h-14 shrink-0 flex items-center justify-between gap-3 px-4 sm:px-6 border-b border-line bg-paper`,children:[(0,L.jsxs)(`nav`,{"aria-label":z(`Breadcrumb`),className:`flex items-center gap-2 min-w-0`,children:[e.backLabel&&(0,L.jsxs)(`button`,{type:`button`,onClick:e.onBack,className:`inline-flex items-center gap-1 shrink-0 rounded-control px-2 py-1 text-[13px] text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(k,{size:15,"aria-hidden":`true`}),e.backLabel]}),e.backLabel&&(0,L.jsx)(`span`,{className:`text-faint shrink-0`,"aria-hidden":`true`,children:`/`}),(0,L.jsx)(`span`,{className:`truncate text-[14px] font-medium text-ink`,children:e.current})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":z(`Search`),"aria-keyshortcuts":`Meta+K Control+K`,className:`inline-flex items-center gap-2 rounded-control border border-line px-2.5 py-1.5 text-[12.5px] text-muted hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(Ge,{size:14,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`hidden md:inline`,children:z(`Search`)}),(0,L.jsx)(`kbd`,{className:`hidden md:inline-flex items-center h-[18px] px-1 rounded text-[10px] font-medium bg-panel text-muted`,children:Ht})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:n,disabled:a,className:`inline-flex items-center gap-2 rounded-control px-3 py-1.5 text-[13px] font-medium bg-primary text-on-primary shadow-primary-glow hover:bg-primary-hover transition-colors disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1`,children:[(0,L.jsx)(I,{size:14,className:a?`xspeed-anim-spin animate-spin`:``,"aria-hidden":`true`}),z(`Purge all`)]}),(0,L.jsxs)(`button`,{type:`button`,onClick:r,disabled:o,className:`inline-flex items-center gap-2 rounded-control px-3 py-1.5 text-[13px] font-medium border border-line-strong text-ink hover:bg-panel transition-colors disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(Be,{size:14,className:o?`animate-pulse`:``,"aria-hidden":`true`}),z(`Preload`)]}),(0,L.jsxs)(`button`,{type:`button`,onClick:i,className:`hidden sm:inline-flex items-center gap-1.5 rounded-pill px-3 py-1.5 text-[12.5px] text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(P,{size:14,"aria-hidden":`true`}),z(s?`Hub connected`:`Connect Hub`),s&&(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`})]}),(0,L.jsx)(`button`,{type:`button`,onClick:l,"aria-label":z(c===`dark`?`Switch to light mode`:`Switch to dark mode`),className:`inline-flex items-center justify-center w-8 h-8 rounded-control text-ink-soft hover:text-ink hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:c===`dark`?(0,L.jsx)(tt,{size:16,"aria-hidden":`true`}):(0,L.jsx)(Me,{size:16,"aria-hidden":`true`})})]})]})}function Wt(e){if(e.locked)return`locked`;let t=e.settings?.enabled;return typeof t==`boolean`?t?`on`:`off`:null}function Gt({state:e}){return e===`locked`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-pill px-2 py-0.5 text-[11px] font-medium bg-primary-tint text-primary`,children:[(0,L.jsx)(je,{size:11,"aria-hidden":`true`}),` `,z(`Pro`)]}):e===`on`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-[11px] font-medium bg-success-tint text-success`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),` `,z(`On`)]}):e===`off`?(0,L.jsx)(`span`,{className:`rounded-pill px-2 py-0.5 text-[11px] font-medium bg-panel text-muted`,children:z(`Off`)}):null}function Kt({groupId:e,modules:t,onOpen:n}){let r=Ct(e);if(!r)return null;let i=r.slugs.map(e=>{if(e===`logs`)return{slug:e,label:z(`Logs`),description:z(`Recent cache and settings activity.`),icon:`Activity`,state:null};let n=t.find(t=>t.slug===e);return n?{slug:e,label:n.label??e,description:n.description??``,icon:n.icon??`Square`,state:Wt(n)}:null}).filter(e=>e!==null),a=i.filter(e=>e.state!==null).length,o=i.filter(e=>e.state===`on`).length;return(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:r.label}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-3 flex-wrap`,children:[(0,L.jsx)(`h1`,{className:`font-display text-[22px] font-semibold text-ink`,children:r.description??r.label}),a>0&&(0,L.jsxs)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:[o,` `,z(`of`),` `,a,` `,z(`on`)]})]}),(0,L.jsx)(`div`,{className:`mt-5 grid gap-4 grid-cols-[repeat(auto-fill,minmax(260px,1fr))]`,children:i.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>n(e.slug),className:`text-left rounded-card border border-line bg-paper p-4 transition-all hover:border-line-strong hover:-translate-y-0.5 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`inline-flex items-center justify-center w-9 h-9 rounded-control bg-panel text-ink-soft`,children:e.icon===`Activity`?(0,L.jsx)(S,{size:17}):(0,L.jsx)(vt,{name:e.icon,size:17})}),(0,L.jsx)(Gt,{state:e.state})]}),(0,L.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold text-ink`,children:e.label}),e.description&&(0,L.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-soft line-clamp-2`,children:e.description})]},e.slug))})]})}function qt(e){if(e.locked)return`locked`;let t=e.settings?.enabled;return typeof t==`boolean`?t?`on`:`off`:null}function Jt({state:e}){return e===`locked`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-primary-tint text-primary`,children:[(0,L.jsx)(je,{size:12,"aria-hidden":`true`}),` `,z(`Pro`)]}):e===`on`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-success-tint text-success`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),` `,z(`On`)]}):e===`off`?(0,L.jsx)(`span`,{className:`rounded-pill px-2.5 py-0.5 text-[12px] font-medium bg-panel text-muted`,children:z(`Off`)}):null}function Yt({module:e,eyebrow:t}){return(0,L.jsxs)(`div`,{children:[t&&(0,L.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:t}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 flex-wrap`,children:[(0,L.jsx)(`h1`,{className:`font-display text-[22px] font-semibold text-ink`,children:e.label}),(0,L.jsx)(Jt,{state:qt(e)})]}),e.description&&(0,L.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-soft max-w-2xl`,children:e.description})]})}var Xt=window.XSpeedConfig;async function V(e,t={}){let n=await fetch(`${Xt.restUrl}${e}`,{...t,headers:{"Content-Type":`application/json`,"X-WP-Nonce":Xt.nonce,...t.headers||{}},credentials:`same-origin`});if(!n.ok)throw Error(`HTTP ${n.status}`);return n.json()}var H={request:(e,t={})=>V(e,t),getStatus:()=>V(`/status`),getSettings:()=>V(`/settings`),getModules:()=>V(`/modules`),getBranding:()=>V(`/branding`),updateSettings:e=>V(`/settings`,{method:`POST`,body:JSON.stringify(e)}),toggleCache:e=>V(`/cache/toggle`,{method:`POST`,body:JSON.stringify({enabled:e})}),purge:()=>V(`/cache/purge`,{method:`POST`}),preload:()=>V(`/preloader/start`,{method:`POST`}),getRecommendations:()=>V(`/recommendations`),applyRecommendation:e=>V(`/recommendations/apply`,{method:`POST`,body:JSON.stringify({id:e})}),getProAudit:()=>V(`/audit/pro`),getActivity:()=>V(`/activity`),mobileEqualityProbe:()=>V(`/cache/mobile-probe`,{method:`POST`}),dismissMobileReview:()=>V(`/cache/mobile-review-dismiss`,{method:`POST`}),onboardingApply:e=>V(`/onboarding/apply`,{method:`POST`,body:JSON.stringify(e)}),onboardingComplete:()=>V(`/onboarding/complete`,{method:`POST`}),getModuleSettings:e=>V(`/${e}/`),updateModuleSettings:(e,t)=>V(`/${e}/`,{method:`POST`,body:JSON.stringify(t)})};function Zt(e){return Math.round(Number(e??0)).toLocaleString()}function Qt(e){let t=Number(e??0),n=t<=1?t*100:t;return`${Math.round(n)}%`}function $t(e){let t=Math.max(0,Math.floor(Date.now()/1e3)-Number(e||0));if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}function en(e){let t=Number(e??0);if(t<=0)return`0 KB`;let n=[`B`,`KB`,`MB`,`GB`,`TB`],r=Math.min(n.length-1,Math.floor(Math.log(t)/Math.log(1024))),i=t/1024**r;return`${r>=2?Math.round(i*10)/10:Math.round(i)} ${n[r]}`}function tn(e){switch(e){case`success`:return`bg-success`;case`warn`:return`bg-warning`;case`error`:return`bg-danger`;default:return`bg-line-strong`}}function nn(){let[e,t]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!0;return H.getActivity().then(n=>{e&&t(n.activity??[])}).catch(()=>{e&&t([])}),()=>{e=!1}},[]),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[12px] font-medium uppercase tracking-wide text-muted`,children:z(`Tools`)}),(0,L.jsx)(`h1`,{className:`mt-1 font-display text-[22px] font-semibold text-ink`,children:z(`Logs`)}),(0,L.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-soft`,children:z(`Recent cache and settings activity on this site.`)}),(0,L.jsx)(`div`,{className:`mt-5 rounded-card border border-line bg-paper overflow-hidden`,children:e===null?(0,L.jsxs)(`div`,{className:`p-4 space-y-2`,"aria-busy":`true`,children:[(0,L.jsx)(`span`,{className:`block h-4 rounded bg-panel animate-pulse`}),(0,L.jsx)(`span`,{className:`block h-4 w-2/3 rounded bg-panel animate-pulse`})]}):e.length===0?(0,L.jsx)(`div`,{className:`p-8 text-center text-[13px] text-muted`,children:z(`No activity recorded yet.`)}):(0,L.jsx)(`ul`,{className:`divide-y divide-line`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2.5`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${tn(e.severity)}`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13.5px] text-ink`,children:e.message}),(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted tabular-nums font-mono`,children:$t(e.ts)})]},`${e.ts}-${t}`))})})]})}function rn(){return(0,L.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center gap-5 px-6`,role:`status`,"aria-label":z(`Loading`),children:[(0,L.jsx)(Vt,{className:`w-12 h-12 rounded-card shrink-0 motion-safe:animate-pulse`}),(0,L.jsxs)(`div`,{className:`w-full max-w-[220px] space-y-2.5`,children:[(0,L.jsx)(`div`,{className:`h-3 rounded bg-line motion-safe:animate-pulse mx-auto w-1/2`}),(0,L.jsx)(`div`,{className:`h-2.5 rounded bg-panel motion-safe:animate-pulse w-full`}),(0,L.jsx)(`div`,{className:`h-2.5 rounded bg-panel motion-safe:animate-pulse w-5/6 mx-auto`})]}),(0,L.jsx)(`span`,{className:`sr-only`,children:z(`Loading…`)})]})}function an({message:e}){return(0,L.jsx)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 bg-neutral-900 dark:bg-neutral-50 text-white dark:text-neutral-900 text-[13px] px-4 py-2 rounded shadow-sm z-50`,children:e})}function on({checked:e,onChange:t,size:n=`md`,label:r=`Toggle`}){let i=n===`lg`?{track:`w-11 h-6`,dot:`w-5 h-5`,tx:`translate-x-[22px]`,off:`translate-x-0.5`}:{track:`w-9 h-5`,dot:`w-4 h-4`,tx:`translate-x-[18px]`,off:`translate-x-0.5`};return(0,L.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e?`true`:`false`,"aria-label":r,title:r,onClick:()=>t(!e),className:`relative inline-flex shrink-0 ${i.track} items-center rounded-full transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 ${e?`bg-primary`:`bg-line-strong`}`,children:(0,L.jsx)(`span`,{className:`inline-block ${i.dot} transform rounded-full bg-white shadow-sm transition-transform duration-150 ${e?i.tx:i.off}`})})}function sn(e){if(!e.module)return`#`;let t=`#${e.module}`;e.subtab&&(t+=`/${e.subtab}`);let n=[];return e.focus&&n.push(`focus=${encodeURIComponent(e.focus)}`),e.suggest!==void 0&&e.suggest!==null&&n.push(`suggest=${encodeURIComponent(String(e.suggest))}`),n.length>0&&(t+=`?${n.join(`&`)}`),t}function cn(e){let[t=``,n=``]=(e||``).replace(/^#/,``).split(`?`),[r=``,i=``]=t.split(`/`),a={module:r};i&&(a.subtab=i);for(let e of n.split(`&`)){if(!e)continue;let t=e.indexOf(`=`);if(t<0)continue;let n=e.slice(0,t),r=decodeURIComponent(e.slice(t+1));n===`focus`&&r&&(a.focus=r),n===`suggest`&&r!==``&&(a.suggest=r)}return a}function ln(e){if(!e)return null;let t=e.indexOf(`:`);return t<=0||t===e.length-1?null:{module:e.slice(0,t),field:e.slice(t+1)}}var un={info:{border:`border-line`,bg:`bg-info-tint`,iconColor:`text-info`,titleColor:`text-on-tint`,bodyColor:`text-ink-soft`,preBorder:`border-line`,preBg:`bg-paper`,preText:`text-ink`,copyBtnBorder:`border-line-strong`,copyBtnBg:`bg-paper`,copyBtnText:`text-primary`,copyBtnHover:`hover:bg-panel`,Icon:we},warn:{border:`border-amber-200 dark:border-amber-900/60`,bg:`bg-amber-50 dark:bg-amber-950/40`,iconColor:`text-amber-600 dark:text-amber-400`,titleColor:`text-amber-900 dark:text-amber-200`,bodyColor:`text-amber-800/90 dark:text-amber-200/80`,preBorder:`border-amber-200 dark:border-amber-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-amber-300 dark:border-amber-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-amber-800 dark:text-amber-200`,copyBtnHover:`hover:bg-amber-100 dark:hover:bg-amber-900/40`,Icon:ot},danger:{border:`border-red-200 dark:border-red-900/60`,bg:`bg-red-50 dark:bg-red-950/40`,iconColor:`text-red-600 dark:text-red-400`,titleColor:`text-red-900 dark:text-red-200`,bodyColor:`text-red-800/90 dark:text-red-200/80`,preBorder:`border-red-200 dark:border-red-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-red-300 dark:border-red-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-red-800 dark:text-red-200`,copyBtnHover:`hover:bg-red-100 dark:hover:bg-red-900/40`,Icon:M},success:{border:`border-emerald-200 dark:border-emerald-900/60`,bg:`bg-emerald-50 dark:bg-emerald-950/40`,iconColor:`text-emerald-600 dark:text-emerald-400`,titleColor:`text-emerald-900 dark:text-emerald-200`,bodyColor:`text-emerald-800/90 dark:text-emerald-200/80`,preBorder:`border-emerald-200 dark:border-emerald-900/60`,preBg:`bg-white dark:bg-neutral-900`,preText:`text-neutral-800 dark:text-neutral-200`,copyBtnBorder:`border-emerald-300 dark:border-emerald-800`,copyBtnBg:`bg-white dark:bg-neutral-900`,copyBtnText:`text-emerald-800 dark:text-emerald-200`,copyBtnHover:`hover:bg-emerald-100 dark:hover:bg-emerald-900/40`,Icon:N}};function U({tone:e,title:t,body:n,snippet:r,action:i}){let a=un[e],[o,s]=(0,y.useState)(!1);return(0,L.jsx)(`div`,{className:`border ${a.border} ${a.bg} rounded-lg p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,L.jsx)(a.Icon,{size:16,className:`${a.iconColor} shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`font-medium ${a.titleColor} text-[13px]`,children:t}),n&&(0,L.jsx)(`p`,{className:`text-[12px] ${a.bodyColor} mt-1`,children:n}),r&&(0,L.jsxs)(`div`,{className:`mt-3 relative`,children:[(0,L.jsx)(`pre`,{className:`text-[11px] font-mono ${a.preBg} border ${a.preBorder} rounded p-3 overflow-x-auto whitespace-pre ${a.preText}`,children:r}),(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{r&&(await navigator.clipboard.writeText(r),s(!0),setTimeout(()=>s(!1),1500))},className:`absolute top-2 right-2 flex items-center gap-1 text-[11px] px-2 py-1 rounded border ${a.copyBtnBorder} ${a.copyBtnBg} ${a.copyBtnText} ${a.copyBtnHover} transition-colors`,children:[o?(0,L.jsx)(O,{size:11}):(0,L.jsx)(ae,{size:11}),o?`Copied`:`Copy`]})]}),i&&(0,L.jsxs)(`a`,{href:sn(i),className:`mt-3 inline-flex items-center gap-1.5 text-[12px] px-2.5 py-1 rounded border ${a.copyBtnBorder} ${a.copyBtnBg} ${a.copyBtnText} ${a.copyBtnHover} transition-colors`,children:[i.label,(0,L.jsx)(C,{size:12})]})]})]})})}function dn(){return window.wp?.media}function fn({value:e,onChange:t,label:n}){let r=dn(),i=()=>{if(!r)return;let e=r({title:n,button:{text:`Use this image`},library:{type:`image`},multiple:!1});e.on(`select`,()=>{let n=e.state().get(`selection`).first();n&&t(n.toJSON().url)}),e.open()};return r?(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`img`,{src:e,alt:n,className:`w-8 h-8 rounded object-contain border border-neutral-200 dark:border-neutral-700 bg-white`}),(0,L.jsx)(`button`,{type:`button`,onClick:i,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors`,children:`Change`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":`Remove ${n}`,className:`text-neutral-400 hover:text-red-600 dark:hover:text-red-400 transition-colors`,children:(0,L.jsx)(ft,{size:14})})]}):(0,L.jsxs)(`button`,{type:`button`,onClick:i,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors inline-flex items-center gap-1.5`,children:[(0,L.jsx)(xe,{size:13}),`Select image`]})}):(0,L.jsx)(`input`,{type:`url`,value:e??``,onChange:e=>t(e.target.value),className:`w-56`,"aria-label":n,placeholder:`https://…`})}function pn({title:e,body:t}){let[n,r]=(0,y.useState)(null),i=(0,y.useRef)(null),a=(0,y.useRef)(null),o=(0,y.useId)(),s=n!==null,c=()=>{let e=i.current;if(!e)return;let t=e.getBoundingClientRect();r({top:t.bottom+6,left:t.left})};return(0,y.useEffect)(()=>{if(!s)return;let e=e=>{!a.current?.contains(e.target)&&!i.current?.contains(e.target)&&r(null)},t=e=>{e.key===`Escape`&&r(null)},n=()=>r(null);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[s]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{ref:i,type:`button`,onClick:()=>s?r(null):c(),"aria-expanded":s,"aria-label":e?`Info: ${e}`:`More information`,className:`inline-flex items-center justify-center text-neutral-400 hover:text-accent dark:hover:text-primary transition-colors align-middle`,children:(0,L.jsx)(we,{size:14})}),s&&typeof document<`u`&&(0,gt.createPortal)((0,L.jsxs)(`div`,{ref:a,role:`dialog`,"aria-labelledby":e?o:void 0,style:{position:`fixed`,top:n.top,left:n.left,zIndex:60},className:`w-[min(20rem,calc(100vw-2rem))] rounded-md bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 shadow-md p-3`,children:[e&&(0,L.jsx)(`div`,{id:o,className:`text-[12px] font-medium text-neutral-900 dark:text-neutral-50 mb-1`,children:e}),(0,L.jsx)(`p`,{className:`text-[12px] leading-relaxed text-neutral-600 dark:text-neutral-400`,children:t})]}),document.getElementById(`xspeed-app`)??document.body)]})}var mn={ok:`bg-success`,warn:`bg-warning`,fail:`bg-danger`,info:`bg-line-strong`};function hn({tone:e,label:t,labelAfter:n,detail:r,trailing:i,first:a=!1}){return(0,L.jsxs)(`div`,{className:`flex items-start gap-3 px-4 sm:px-5 py-3.5 ${a?``:`border-t border-line`}`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full mt-1.5 shrink-0 ${mn[e]}`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-[13px] font-medium text-ink`,children:[(0,L.jsx)(`span`,{children:t}),n]}),r!=null&&r!==``&&(0,L.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:r})]}),i&&(0,L.jsx)(`div`,{className:`shrink-0`,children:i})]})}function gn({content:e,tone:t=`neutral`}){let[n,r]=(0,y.useState)(!1);return(0,L.jsxs)(`div`,{className:`relative rounded ${t===`amber`?`bg-white dark:bg-neutral-900 border border-amber-200 dark:border-amber-900/60`:t===`blue`?`bg-primary-tint border border-line`:`bg-neutral-50 dark:bg-neutral-950 border border-neutral-200 dark:border-neutral-800`}`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),window.setTimeout(()=>r(!1),1800)}catch{}},className:`absolute top-2 right-2 inline-flex items-center gap-1 text-[11px] px-2 py-1 rounded border border-neutral-300 dark:border-neutral-700 bg-white/90 dark:bg-neutral-800/90 text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-700 transition-colors`,"aria-label":n?`Snippet copied`:`Copy snippet`,children:[n?(0,L.jsx)(O,{size:12}):(0,L.jsx)(ae,{size:12}),n?`Copied`:`Copy`]}),(0,L.jsx)(`pre`,{className:`text-[11px] font-mono p-3 pr-16 overflow-x-auto whitespace-pre text-neutral-800 dark:text-neutral-200`,children:e})]})}function _n(e){if(!e)return`Never`;let t=Math.floor(Date.now()/1e3)-e;return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}var vn={info:`bg-neutral-300 dark:bg-neutral-600`,warn:`bg-amber-500`,error:`bg-red-500`,success:`bg-emerald-500`};function yn({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null);if((0,y.useEffect)(()=>{H.getModuleSettings(`health`).then(n).catch(e=>i(e instanceof Error?e.message:`Failed to load`))},[]),r)return(0,L.jsx)(`div`,{className:`text-[12px] text-red-600 dark:text-red-400`,children:r});if(!t)return(0,L.jsx)(`div`,{className:`text-[13px] text-neutral-500 dark:text-neutral-400`,children:`Loading…`});let{checks:a,stats:o,buckets:s,activity:c}=t;return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(bn,{stats:o,buckets:s}),(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:a.map((e,t)=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(hn,{first:t===0,tone:e.tone,label:e.label,detail:e.detail,labelAfter:e.id===`static_rewrite_nginx`?(0,L.jsx)(pn,{title:`Good to know`,body:`You added this snippet to your nginx config yourself, so it's yours to manage — xSpeed never touches it. If you ever need to uninstall xSpeed, just remove this snippet from your nginx config first to keep everything tidy and your server running happily.`}):void 0}),e.snippet&&(0,L.jsx)(`div`,{className:`px-4 pb-4 pt-1 border-b border-neutral-200 dark:border-neutral-800 last:border-b-0`,children:(0,L.jsx)(gn,{content:e.snippet})})]},e.id))}),(0,L.jsx)(Sn,{activity:c})]})}function bn({stats:e,buckets:t}){let n=e.hits_24h+e.misses_24h,r=n>0?Math.round(e.hit_ratio*100):0;return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:`Hit ratio · 24h`}),(0,L.jsx)(S,{size:14,className:`text-neutral-400 dark:text-neutral-500`})]}),(0,L.jsxs)(`div`,{className:`flex items-baseline gap-3 mb-3`,children:[(0,L.jsx)(`div`,{className:`text-[28px] font-semibold text-neutral-900 dark:text-neutral-50 leading-none`,children:n>0?`${r}%`:`—`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:n>0?`${e.hits_24h} hits · ${e.misses_24h} misses`:`No traffic captured in the last 24h yet.`})]}),(0,L.jsx)(xn,{buckets:t})]})}function xn({buckets:e}){if(!e.length)return(0,L.jsx)(`div`,{className:`h-8`});let t=Math.max(1,...e.map(e=>e.hits+e.misses)),n=480/Math.max(e.length-1,1),r=e.map((e,r)=>{let i=32-(e.hits+e.misses)/t*28-2;return`${(r*n).toFixed(1)},${i.toFixed(1)}`}).join(` `);return(0,L.jsx)(`svg`,{viewBox:`0 0 480 32`,preserveAspectRatio:`none`,className:`w-full h-8 text-accent`,role:`img`,"aria-label":`24-hour cache request volume`,children:(0,L.jsx)(`polyline`,{points:r,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Sn({activity:e}){return e.length===0?(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-5 text-center text-[13px] text-neutral-500 dark:text-neutral-400`,children:`No activity yet.`}):(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`px-4 sm:px-5 py-3 border-b border-neutral-200 dark:border-neutral-800`,children:[(0,L.jsx)(`div`,{className:`font-medium text-[13px] text-neutral-900 dark:text-neutral-50`,children:`Recent activity`}),(0,L.jsxs)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:[`Most recent `,e.length,` event`,e.length===1?``:`s`,` captured by the cache engine.`]})]}),(0,L.jsx)(`ul`,{className:`divide-y divide-neutral-200 dark:divide-neutral-800`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`px-4 sm:px-5 py-3 flex items-start gap-3`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full mt-2 shrink-0 ${vn[e.severity]}`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`div`,{className:`text-[13px] text-neutral-700 dark:text-neutral-300 min-w-0 truncate`,children:e.message}),(0,L.jsx)(`div`,{className:`text-[11px] text-neutral-500 dark:text-neutral-400 shrink-0`,children:_n(e.ts)})]})]},`${e.ts}-${t}`))})]})}var Cn=52,wn=2*Math.PI*Cn;function Tn({percent:e,label:t}){let n=Math.max(0,Math.min(100,Math.round(e))),[r,i]=(0,y.useState)(!1);(0,y.useEffect)(()=>{let e=window.requestAnimationFrame(()=>i(!0));return()=>window.cancelAnimationFrame(e)},[]);let a=r?wn*(1-n/100):wn;return(0,L.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,role:`img`,"aria-label":`${t}: ${n}%`,children:[(0,L.jsxs)(`svg`,{width:`128`,height:`128`,viewBox:`0 0 128 128`,children:[(0,L.jsx)(`circle`,{cx:`64`,cy:`64`,r:Cn,fill:`none`,stroke:`var(--panel)`,strokeWidth:`10`}),(0,L.jsx)(`circle`,{cx:`64`,cy:`64`,r:Cn,fill:`none`,stroke:`var(--primary)`,strokeWidth:`10`,strokeLinecap:`round`,strokeDasharray:wn,strokeDashoffset:a,transform:`rotate(-90 64 64)`,style:{transition:`stroke-dashoffset 900ms ease-out`}})]}),(0,L.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center`,children:[(0,L.jsxs)(`span`,{className:`font-display text-[26px] font-semibold text-ink tabular-nums`,children:[n,`%`]}),(0,L.jsx)(`span`,{className:`text-[11px] text-muted`,children:t})]})]})}function En({getModule:e}){let t=window.XSpeedConfig?.bootstrap,n=t?.status?.stats,r=t?.settings?.cache_enabled===!0,i=parseInt(Qt(n?.hit_ratio),10)||0,a=t=>e?.(t)?.settings?.enabled===!0,o=[r,a(`object-cache`),a(`browser-cache`),a(`preloader`)],s=Math.round(o.filter(Boolean).length/o.length*100),c=(n?.hits_24h??0)+(n?.misses_24h??0),l=[{label:z(`Cache coverage`),value:`${s}%`,hint:z(`of cache features on`)},{label:z(`Cached pages`),value:Zt(n?.cached_pages),hint:z(`served without PHP`)},{label:z(`Cache size`),value:en(n?.cache_size),hint:z(`on disk`)},{label:z(`Requests (24h)`),value:Zt(c),hint:z(`hits + misses`)}];return(0,L.jsx)(`section`,{className:`rounded-card border border-line bg-paper p-5`,"aria-label":z(`Health summary`),children:(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-6`,children:[(0,L.jsx)(Tn,{percent:i,label:z(`Hit ratio`)}),(0,L.jsx)(`div`,{className:`flex-1 grid grid-cols-2 lg:grid-cols-4 gap-4 w-full`,children:l.map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[12px] text-ink-soft`,children:e.label}),(0,L.jsx)(`p`,{className:`mt-0.5 font-display text-[20px] font-semibold text-ink tabular-nums`,children:e.value}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted`,children:e.hint})]},e.label))})]})})}function Dn({items:e,value:t,onChange:n,idBase:r}){let i=(0,y.useId)(),a=r??i;function o(r){let i=e.findIndex(e=>e.key===t);if(i===-1)return;let a=e[(i+r+e.length)%e.length];n(a.key)}return(0,L.jsx)(`div`,{role:`tablist`,className:`flex items-center gap-1 border-b border-neutral-200 dark:border-neutral-800`,onKeyDown:e=>{e.key===`ArrowRight`?(e.preventDefault(),o(1)):e.key===`ArrowLeft`&&(e.preventDefault(),o(-1))},children:e.map(e=>{let r=e.key===t;return(0,L.jsx)(`button`,{id:On(a,e.key),role:`tab`,type:`button`,"aria-selected":r,"aria-controls":kn(a,e.key),tabIndex:r?0:-1,onClick:()=>n(e.key),className:`text-[12px] px-3 py-1.5 -mb-px border-b-2 transition-colors ${r?`border-accent text-neutral-900 dark:text-neutral-50 font-medium`:`border-transparent text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200`} ${e.locked?`opacity-70`:``}`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.label,e.locked&&(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block w-[10px] h-[10px] rounded-[2px] bg-amber-400/80`,title:`Pro`})]})},e.key)})})}function On(e,t){return`xspeed-tab-${e}-${t}`}function kn(e,t){return`xspeed-tabpanel-${e}-${t}`}function An(){return typeof window>`u`?`free`:window.XSpeedConfig?.tier??`free`}function jn(){if(typeof window>`u`)return`not_installed`;let e=window.XSpeedConfig;return e?.proState?e.proState:Nn()?`active`:`not_installed`}function Mn(){let[e,t]=(0,y.useState)(An);return(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(An());return window.addEventListener(Mt,e),()=>window.removeEventListener(Mt,e)},[]),e}function Nn(){let e=An();return e===`pro`||e===`trial`}function Pn(){let[e,t]=(0,y.useState)(jn);return(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(jn());return window.addEventListener(Mt,e),()=>window.removeEventListener(Mt,e)},[]),e}var Fn=`https://xspeedcache.com/pricing/`,In=`admin.php?page=xspeed#/settings/license`,Ln={"critical-css":{id:`critical-css`,icon:`Sparkles`,title:`Critical CSS`,body:`Inline above-the-fold styles and defer the rest. Cuts first paint on theme-heavy pages by 30-60%.`},"unused-css":{id:`unused-css`,icon:`Scissors`,title:`Remove Unused CSS`,body:`Per-URL pruned stylesheet inlined; original tags stripped. Pairs with Critical CSS.`},"webp-avif":{id:`webp-avif`,icon:`Replace`,title:`Auto WebP / AVIF on upload`,body:`New JPEG/PNG uploads get .webp + .avif siblings; browsers that support modern formats get them automatically.`},"cloudflare-apo":{id:`cloudflare-apo`,icon:`Zap`,title:`Cloudflare APO + edge cache`,body:`Toggle Automatic Platform Optimization right from here, set edge cache TTL, no separate dashboard.`},"feed-cache":{id:`feed-cache`,icon:`Rss`,title:`Feed caching`,body:`Cache RSS / Atom / comment feeds so aggregators polling your feed skip a full render — with the correct feed content-type preserved and auto-purge on new posts.`},"cache-404":{id:`cache-404`,icon:`FileX`,title:`404 caching`,body:`Serve one short-lived cached 404 so bot and scanner floods on nonexistent URLs don't each trigger a full render. Shared entry, correct 404 status, purged when you publish.`},"search-cache":{id:`search-cache`,icon:`Search`,title:`Search caching`,body:`Cache internal search-results pages (/?s=…) so popular repeated searches skip a full query + render. Keyed per term, short-lived, and purged when you publish new content.`},"rest-cache":{id:`rest-cache`,icon:`Webhook`,title:`REST API per-route cache`,body:`Cache read-only REST responses with a TTL you set per route — ideal for headless front-ends and app backends. Authenticated and write requests are never cached.`},"prewarm-schedule":{id:`prewarm-schedule`,icon:`CalendarClock`,title:`Scheduled prewarming`,body:`Warm target URLs ahead of a post going live, a sale, or a campaign so the traffic spike hits a warm cache. One-off, recurring, and auto-warm when a scheduled post publishes.`},"predictive-warm":{id:`predictive-warm`,icon:`TrendingUp`,title:`Predictive warming`,body:`Proactively warm the pages most likely to be visited next — ranked by real traffic, recency, and content — so your hottest URLs are always served from cache, not a cold render.`},brotli:{id:`brotli`,icon:`Shrink`,title:`Brotli compression`,body:`Serve Brotli where the browser and server support it — typically 15-25% smaller than GZIP — with automatic GZIP fallback.`},rum:{id:`rum`,icon:`Eye`,title:`Real-User Monitoring`,body:`See actual LCP / CLS / INP from your visitors’ browsers, not synthetic Lighthouse. Per-URL percentiles.`},pagespeed:{id:`pagespeed`,icon:`Gauge`,title:`PageSpeed Insights, in-dashboard`,body:`Run Google PSI on any URL without leaving xSpeed. Scores + Core Web Vitals + cached for 24h.`},recommendations:{id:`recommendations`,icon:`Lightbulb`,title:`Smart recommendations`,body:`Pro audits your current settings + server state and surfaces the 5 things most likely to move your score.`},analytics:{id:`analytics`,icon:`BarChart3`,title:`Per-URL cache analytics`,body:`Slowest pages, hit-ratio chart, recent activity timeline. Powered by the RUM data you’re already collecting.`},migration:{id:`migration`,icon:`Import`,title:`One-click migration`,body:`Import settings from WP Rocket, W3 Total Cache, or WP Super Cache. No manual reconfiguration.`},"white-label":{id:`white-label`,icon:`Tag`,title:`White-label dashboard`,body:`Rebrand the plugin name, footer credit, and help links for client work.`},multisite:{id:`multisite`,icon:`Network`,title:`Multisite network view`,body:`One dashboard across every site in your network with per-site cache state and network-wide purge.`},"custom-rules":{id:`custom-rules`,icon:`Filter`,title:`Pattern-based cache rules`,body:`Bypass cache or override expiry by URL glob, post type, category, tag, or author — beyond per-post settings.`}};function Rn({icon:e,title:t,description:n,teaser:r}){let i=r?Ln[r]:null,a=Pn()===`unlicensed`,o={card:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-primary bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`};return(0,L.jsx)(`div`,{className:`border rounded-card p-4 sm:p-5 ${o.card}`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border flex items-center justify-center ${o.iconWrap}`,children:(0,L.jsx)(vt,{name:e,size:17})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,L.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:t}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-1.5 py-0.5 ${o.badge}`,children:[a?(0,L.jsx)(Te,{size:9}):(0,L.jsx)(je,{size:9}),(0,L.jsx)(`span`,{children:z(a?`License`:`Pro`)})]})]}),n&&(0,L.jsx)(`p`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:n}),i&&(0,L.jsx)(`p`,{className:`text-[12px] text-muted mt-2 leading-relaxed`,children:i.body}),a?(0,L.jsxs)(`a`,{href:In,className:`inline-flex items-center gap-1.5 mt-3 px-3 py-1.5 rounded-md text-[12px] font-medium transition-colors ${o.cta}`,children:[z(`Activate your license`),(0,L.jsx)(C,{size:12})]}):(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-3 px-3 py-1.5 rounded-md text-[12px] font-medium transition-colors ${o.cta}`,children:[z(`Upgrade to Pro`),(0,L.jsx)(C,{size:12})]})]})]})})}function W({panel:e,slug:t,getModule:n,onSaved:r,title:i,description:a,icon:o}){It();let s=Mn(),c=yt.find(e=>e.slug===t),l=(0,L.jsx)(Rn,{icon:o??c?.icon??`Sparkles`,title:i??c?.label??t,description:a??c?.description,teaser:c?.teaser??void 0});if(s!==`pro`&&s!==`trial`)return l;let u=n?.(t);if(!u)return l;let d=e?Pt(e):void 0;return d?(0,L.jsx)(d,{module:u,onSaved:r}):e?l:(0,L.jsx)(Ci,{module:u,onSaved:r})}var zn={"ai-provider":{id:`ai-provider`,title:`One AI connection, every AI feature`,subtitle:`Connect OpenAI, Anthropic, Gemini, or OpenRouter once — every Pro AI feature shares the same key, no per-feature setup.`,icon:`Sparkles`,mock:{kind:`toggles`,rows:[{label:`OpenAI`,on:!0,stat:`connected`},{label:`Anthropic`,on:!1,stat:`available`},{label:`Google Gemini`,on:!1,stat:`available`},{label:`OpenRouter`,on:!1,stat:`available`}]},points:[{icon:`Sparkles`,text:`Connect one provider; Speculation Rules, AI Suggestions, and Adaptive Cache all use it.`},{icon:`Lock`,text:`Your key stays on your server — stored in wp-config or the database, never shipped to us.`},{icon:`Check`,text:`Swap providers any time without reconfiguring each feature.`}]},"adaptive-cache":{id:`adaptive-cache`,title:`Cache TTL that tunes itself`,subtitle:`xSpeed reads your last 24 hours of traffic and recommends the cache lifetime that balances freshness against hit-rate — applied in one click.`,icon:`Lightbulb`,mock:{kind:`chart`,headline:`+18%`,headlineNote:`projected hit-rate at the suggested TTL`,bars:[{label:`Now`,value:71},{label:`Suggested`,value:89}]},points:[{icon:`Lightbulb`,text:`AI-tuned TTL from real 24-hour traffic patterns — no more guessing a number.`},{icon:`Check`,text:`Review the recommendation, then apply it into the Cache module in one click.`}]},"coverage-what":{id:`coverage-what`,title:`Cache more than HTML pages`,subtitle:`Page Cache serves anonymous HTML. Pro extends that to the requests that quietly cost you the most renders.`,icon:`Layers`,mock:{kind:`toggles`,rows:[{label:`404 Caching`,on:!0,stat:`3,180 bot hits absorbed`},{label:`Search Caching`,on:!0,stat:`/?s= results cached`}]},points:[{icon:`FileX`,text:`Serve one shared cached 404 so scanner floods stop costing a render each.`},{icon:`Search`,text:`Cache internal search pages (/?s=…), keyed per term, purged on publish.`},{icon:`ShieldCheck`,text:`Correct status codes preserved; auto-purge when you publish new content.`}]},"coverage-beyond":{id:`coverage-beyond`,title:`Cache feeds & API responses`,subtitle:`Aggregators and headless front-ends hammer endpoints Page Cache never touches. Pro caches those too.`,icon:`Rss`,mock:{kind:`toggles`,rows:[{label:`Feed Caching (RSS / Atom)`,on:!0,stat:`content-type preserved`},{label:`REST API Cache`,on:!0,stat:`per-route TTL`}]},points:[{icon:`Rss`,text:`Cache RSS / Atom / comment feeds so polling aggregators skip a full render.`},{icon:`Webhook`,text:`Cache read-only REST routes with a TTL you set — built for headless sites.`},{icon:`Lock`,text:`Authenticated and write requests are never cached.`}]},"coverage-rules":{id:`coverage-rules`,title:`Bypass & override by rule`,subtitle:`Go past per-post toggles: shape caching with patterns, and stand down cleanly during maintenance.`,icon:`Filter`,mock:{kind:`code`,code:[`BYPASS /cart/* (never cache)`,`BYPASS post_type=product when logged in`,`EXPIRE /blog/* override → 12h`,`MAINT. coming-soon mode → skip + auto-purge on go-live`]},points:[{icon:`Filter`,text:`Bypass or override expiry by URL glob, post type, category, tag, or author.`},{icon:`Wrench`,text:`Skip caching in maintenance / coming-soon mode, auto-purge when live again.`}]},"media-formats":{id:`media-formats`,title:`Modern image formats, automatically`,subtitle:`Every new upload gets lighter WebP + AVIF siblings, served to the browsers that support them.`,icon:`Replace`,mock:{kind:`formats`,badges:[`JPEG`,`WebP`,`AVIF`],headline:`−62%`,headlineNote:`typical transfer saved vs original JPEG`},points:[{icon:`Replace`,text:`New JPEG/PNG uploads get .webp + .avif siblings generated automatically.`},{icon:`Zap`,text:`Browsers that support modern formats get them; others fall back cleanly.`}]},"media-smart":{id:`media-smart`,title:`AI-tuned image settings`,subtitle:`Let xSpeed recommend the format and quality for each image, then apply it into Image Optimization in one click.`,icon:`Sparkles`,mock:{kind:`toggles`,rows:[{label:`hero.jpg → AVIF @ 72`,on:!0,stat:`−240 KB`},{label:`logo.png → WebP lossless`,on:!0,stat:`−31 KB`}]},points:[{icon:`Sparkles`,text:`AI recommends the best format + quality per image, not a blanket setting.`},{icon:`Check`,text:`Review the suggestions, then apply them all with one click.`}]},"compression-brotli":{id:`compression-brotli`,title:`Brotli compression`,subtitle:`Smaller than GZIP where the browser supports it — with automatic GZIP fallback everywhere else.`,icon:`Shrink`,mock:{kind:`chart`,headline:`−21%`,headlineNote:`smaller responses vs GZIP (typical)`,bars:[{label:`None`,value:100},{label:`GZIP`,value:34},{label:`Brotli`,value:27}]},points:[{icon:`Shrink`,text:`Serve Brotli where the browser and server support it — typically 15–25% smaller.`},{icon:`ShieldCheck`,text:`Automatic GZIP fallback, so nothing breaks on older clients.`}]},"cssjs-critical":{id:`cssjs-critical`,title:`Inline critical CSS, defer the rest`,subtitle:`Send only the styles the first screen needs up front so the page paints without waiting on the full stylesheet.`,icon:`Sparkles`,mock:{kind:`chart`,headline:`−48%`,headlineNote:`render-blocking CSS on first paint`,bars:[{label:`Before`,value:100},{label:`Critical`,value:52}]},points:[{icon:`Sparkles`,text:`Inline above-the-fold CSS and defer the rest — cuts first paint 30–60%.`},{icon:`Gauge`,text:`Pluggable generator endpoint; regenerates when your theme changes.`}]},"cssjs-unused":{id:`cssjs-unused`,title:`Strip the CSS a page never uses`,subtitle:`Most themes ship one giant stylesheet for the whole site. Pro serves each URL only the rules it actually needs.`,icon:`Scissors`,mock:{kind:`chart`,headline:`−71%`,headlineNote:`stylesheet bytes on a typical post`,bars:[{label:`Full CSS`,value:100},{label:`Pruned`,value:29}]},points:[{icon:`Scissors`,text:`Per-URL pruned stylesheet inlined; original tags stripped.`},{icon:`Sparkles`,text:`Pairs with Critical CSS for the smallest possible first paint.`}]},"health-pagespeed":{id:`health-pagespeed`,title:`Real scores, in your dashboard`,subtitle:`Run Google PageSpeed on any URL and watch Core Web Vitals from real visitors — without leaving xSpeed.`,icon:`Gauge`,mock:{kind:`chart`,headline:`98`,headlineNote:`PageSpeed score · mobile`,bars:[{label:`LCP`,value:92},{label:`CLS`,value:99},{label:`INP`,value:95}]},points:[{icon:`Gauge`,text:`Run Google PSI on any URL — scores + Core Web Vitals, cached 24h.`},{icon:`Eye`,text:`Real-User Monitoring: LCP / CLS / INP from actual visitors, per-URL percentiles.`},{icon:`HeartPulse`,text:`Performance Health flags regressions against a 7-day baseline.`}]},"hints-speculation":{id:`hints-speculation`,title:`Prefetch the next page, before the click`,subtitle:`xSpeed predicts where each visitor is headed and quietly prefetches it via Chrome’s Speculation Rules API — so the next page feels instant.`,icon:`Wand2`,mock:{kind:`toggles`,rows:[{label:`Prefetch on hover / viewport`,on:!0,stat:`eager`},{label:`Prerender top predicted page`,on:!0,stat:`moderate`}]},points:[{icon:`Wand2`,text:`Predict each visitor’s next page and prefetch it via Speculation Rules.`},{icon:`Zap`,text:`The next navigation feels instant — the page is already there.`}]},"network-cloudflare":{id:`network-cloudflare`,title:`Drive Cloudflare from here`,subtitle:`Toggle Automatic Platform Optimization and edge cache without a second dashboard.`,icon:`Zap`,mock:{kind:`toggles`,rows:[{label:`Automatic Platform Optimization`,on:!0,stat:`edge HTML cache`},{label:`Edge cache TTL`,on:!0,stat:`4 hours`}]},points:[{icon:`Zap`,text:`Toggle APO, set edge cache level and TTL from inside xSpeed.`},{icon:`RefreshCw`,text:`Edge purge stays in sync with your local cache purges.`}]},"preloader-scheduled":{id:`preloader-scheduled`,title:`Warm the cache before the traffic`,subtitle:`Schedule warm-ups around launches, sales, and scheduled posts so the spike hits a warm cache — never a cold render.`,icon:`CalendarClock`,mock:{kind:`toggles`,rows:[{label:`Nightly full-site warm`,on:!0,stat:`02:00`},{label:`On scheduled-post publish`,on:!0,stat:`auto`},{label:`One-off: /black-friday`,on:!0,stat:`Fri 08:00`}]},points:[{icon:`CalendarClock`,text:`Warm target URLs ahead of a post, sale, or campaign going live.`},{icon:`RefreshCw`,text:`One-off, recurring, and auto-warm when a scheduled post publishes.`}]},"preloader-predictive":{id:`preloader-predictive`,title:`Keep the hottest pages always warm`,subtitle:`Let xSpeed rank your URLs by real traffic, recency, and content, and warm the ones most likely to be hit next.`,icon:`TrendingUp`,mock:{kind:`toggles`,rows:[{label:`/pricing`,on:!0,stat:`rank #1 · warm`},{label:`/blog/new-release`,on:!0,stat:`rank #2 · warm`},{label:`/features`,on:!0,stat:`rank #3 · warm`}]},points:[{icon:`TrendingUp`,text:`Proactively warm the pages most likely to be visited next.`},{icon:`BarChart3`,text:`Ranked by real traffic, recency, and content — no manual list to maintain.`}]},"health-visitors":{id:`health-visitors`,title:`Measure real visitors, not lab tests`,subtitle:`A lightweight beacon samples Core Web Vitals from your actual visitors’ browsers — the numbers Google ranks on.`,icon:`Eye`,mock:{kind:`chart`,headline:`p75`,headlineNote:`real-user Core Web Vitals`,bars:[{label:`LCP`,value:88},{label:`CLS`,value:96},{label:`INP`,value:91}]},points:[{icon:`Eye`,text:`Sample LCP / FCP / CLS / INP / TTFB from real visitors, per-URL percentiles.`},{icon:`BarChart3`,text:`See which pages actually feel slow — powered by the data you already collect.`}]}};function Bn(e){return zn[e]}function Vn({id:e}){let t=Bn(e),n=Pn()===`unlicensed`;if(!t)return null;let r={frame:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-primary bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`,accent:`text-primary`,check:`text-primary`};return(0,L.jsxs)(`div`,{className:`border rounded-card overflow-hidden ${r.frame}`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-3 p-4 sm:p-5 pb-3`,children:[(0,L.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border flex items-center justify-center ${r.iconWrap}`,children:(0,L.jsx)(vt,{name:t.icon,size:17})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,L.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:t.title}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-1.5 py-0.5 ${r.badge}`,children:[n?(0,L.jsx)(Te,{size:9}):(0,L.jsx)(je,{size:9}),(0,L.jsx)(`span`,{children:z(n?`License`:`Pro`)})]})]}),(0,L.jsx)(`p`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:t.subtitle})]})]}),(0,L.jsx)(`div`,{className:`px-4 sm:px-5`,children:(0,L.jsx)(Hn,{mock:t.mock,accent:r.accent})}),(0,L.jsxs)(`div`,{className:`p-4 sm:p-5 pt-4`,children:[(0,L.jsx)(`ul`,{className:`space-y-2`,children:t.points.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,L.jsx)(O,{size:15,className:`shrink-0 mt-0.5 ${r.check}`,strokeWidth:2.5}),(0,L.jsx)(`span`,{className:`text-[12px] text-ink-soft leading-relaxed`,children:e.text})]},t))}),n?(0,L.jsxs)(`a`,{href:In,className:`inline-flex items-center gap-1.5 mt-4 px-3.5 py-2 rounded-md text-[12px] font-medium transition-colors ${r.cta}`,children:[z(`Activate your license`),(0,L.jsx)(C,{size:12})]}):(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-4 px-3.5 py-2 rounded-md text-[12px] font-medium transition-colors ${r.cta}`,children:[z(`Upgrade to Pro`),(0,L.jsx)(C,{size:12})]})]})]})}function Hn({mock:e,accent:t}){return(0,L.jsxs)(`div`,{className:`relative rounded-card border border-line bg-panel p-3.5 overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1 rounded-full bg-paper border border-line px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-faint`,children:[(0,L.jsx)(je,{size:8}),z(`Preview`)]}),(0,L.jsxs)(`div`,{"aria-hidden":`true`,className:`select-none`,children:[e.kind===`toggles`&&(0,L.jsx)(Un,{mock:e,accent:t}),e.kind===`chart`&&(0,L.jsx)(Wn,{mock:e,accent:t}),e.kind===`code`&&(0,L.jsx)(Gn,{mock:e}),e.kind===`formats`&&(0,L.jsx)(Kn,{mock:e,accent:t})]})]})}function Un({mock:e,accent:t}){return(0,L.jsx)(`div`,{className:`space-y-2`,children:(e.rows??[]).map((e,n)=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md bg-paper border border-line px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`relative inline-flex shrink-0 w-9 h-5 items-center rounded-full ${e.on?`bg-primary`:`bg-line-strong`}`,children:(0,L.jsx)(`span`,{className:`inline-block w-4 h-4 rounded-full bg-white shadow-sm transform ${e.on?`translate-x-[18px]`:`translate-x-0.5`}`})}),(0,L.jsx)(`span`,{className:`text-[12px] font-medium text-ink flex-1 min-w-0 truncate`,children:e.label}),e.stat&&(0,L.jsx)(`span`,{className:`text-[11px] font-medium tabular-nums ${t}`,children:e.stat})]},n))})}function Wn({mock:e,accent:t}){let n=e.bars??[];return(0,L.jsxs)(`div`,{className:`flex items-end gap-4`,children:[e.headline&&(0,L.jsxs)(`div`,{className:`shrink-0`,children:[(0,L.jsx)(`div`,{className:`text-[26px] font-bold leading-none tabular-nums ${t}`,children:e.headline}),e.headlineNote&&(0,L.jsx)(`div`,{className:`text-[10px] text-muted mt-1 max-w-[130px] leading-snug`,children:e.headlineNote})]}),(0,L.jsx)(`div`,{className:`flex-1 flex items-end justify-around gap-2 h-[64px]`,children:n.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1 flex-1 h-full justify-end`,children:[(0,L.jsx)(`div`,{className:`w-full rounded-t ${t===n.length-1?`bg-primary`:`bg-line-strong`}`,style:{height:`${Math.max(6,e.value)}%`}}),(0,L.jsx)(`span`,{className:`text-[9px] text-muted truncate max-w-full`,children:e.label})]},t))})]})}function Gn({mock:e}){return(0,L.jsx)(`div`,{className:`font-mono text-[11px] leading-relaxed text-ink-soft space-y-0.5 overflow-x-auto`,children:(e.code??[]).map((e,t)=>(0,L.jsx)(`div`,{className:`whitespace-pre`,children:e},t))})}function Kn({mock:e,accent:t}){let n=e.badges??[];return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:n.map((e,t)=>{let r=t===n.length-1;return(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`rounded-md border px-2 py-1 text-[11px] font-semibold ${r?`border-primary/40 bg-primary/10 text-primary`:`border-line bg-paper text-muted`}`,children:e}),!r&&(0,L.jsx)(`span`,{className:`text-faint text-[11px]`,children:`→`})]},t)})}),e.headline&&(0,L.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,L.jsx)(`div`,{className:`text-[22px] font-bold leading-none tabular-nums ${t}`,children:e.headline}),e.headlineNote&&(0,L.jsx)(`div`,{className:`text-[10px] text-muted mt-1 max-w-[130px] leading-snug`,children:e.headlineNote})]})]})}function qn({demo:e,children:t}){return Nn()?(0,L.jsx)(L.Fragment,{children:t}):(0,L.jsx)(Vn,{id:e})}var Jn=[{key:`lcp`,label:`LCP`,unit:`ms`},{key:`tbt`,label:`TBT`,unit:`ms`},{key:`cls`,label:`CLS`,unit:`raw`},{key:`ttfb`,label:`TTFB`,unit:`ms`}];function Yn(e,t,n){let r=n[e];return t==null||!r?`unknown`:t<=r.good?`good`:t<=r.poor?`needs-improvement`:`poor`}var Xn={good:`border-emerald-200 dark:border-emerald-900/60 bg-emerald-50 dark:bg-emerald-950/40 text-emerald-800 dark:text-emerald-200`,"needs-improvement":`border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 text-amber-800 dark:text-amber-200`,poor:`border-red-200 dark:border-red-900/60 bg-red-50 dark:bg-red-950/40 text-red-800 dark:text-red-200`,unknown:`border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-900 text-neutral-500 dark:text-neutral-400`};function Zn(e){return e===null?`text-neutral-400 dark:text-neutral-500`:e>=90?`text-emerald-600 dark:text-emerald-400`:e>=50?`text-amber-600 dark:text-amber-400`:`text-red-600 dark:text-red-400`}function Qn(e,t){return e==null?`—`:t===`raw`?e.toFixed(3):`${Math.round(e)} ms`}function $n(e){let t=Math.floor(Date.now()/1e3)-e;return t<60?z(`just now`):t<3600?`${Math.floor(t/60)}m ${z(`ago`)}`:t<86400?`${Math.floor(t/3600)}h ${z(`ago`)}`:`${Math.floor(t/86400)}d ${z(`ago`)}`}function er({module:e,onSaved:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(null),d=e.settings?.enabled===!0,f=(0,y.useCallback)(async()=>{try{r(await H.request(`/score/history`))}catch{r({runs:[],latest:null,thresholds:{}})}},[]);(0,y.useEffect)(()=>{f()},[f]);let p=(0,y.useCallback)(async()=>{try{if(!(await H.request(`/score/status`)).pending){s(!1),await f();return}u.current=window.setTimeout(()=>void p(),6e3)}catch(e){s(!1),l(e instanceof Error?e.message:z(`Could not check the test status.`))}},[f]);(0,y.useEffect)(()=>()=>{u.current&&window.clearTimeout(u.current)},[]);let m=async()=>{a(!0),l(null);try{let e=await H.request(`/score/run`,{method:`POST`,body:JSON.stringify({})});e.pending?(s(!0),u.current=window.setTimeout(()=>void p(),6e3)):(await f(),!e.ok&&e.error&&l(e.error))}catch(e){l(e instanceof Error?e.message:z(`The test could not be started.`))}finally{a(!1)}},h=n?.latest??null,g=n?.thresholds??{};return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(he,{size:18,className:`text-accent shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:z(`External score`)}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:h?`${h.provider===`gtmetrix`?`GTmetrix`:`PageSpeed Insights`} · ${$n(h.ts)}`:z(`No audit run yet.`)})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:m,disabled:!d||i||o,title:d?void 0:z(`Turn on external scores below first.`),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-50`,children:[(i||o)&&(0,L.jsx)(I,{size:13,className:`animate-spin`}),z(o?`Running…`:`Test now`)]})]}),!d&&(0,L.jsx)(`p`,{className:`mt-3 text-[12px] text-neutral-500 dark:text-neutral-400`,children:z(`External scores are off. Turning them on lets you run an audit from here — nothing is sent anywhere until you press Test.`)}),c&&(0,L.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 text-[12px] text-red-700 dark:text-red-300`,children:[(0,L.jsx)(ot,{size:13,className:`mt-0.5 shrink-0`}),(0,L.jsx)(`span`,{children:c})]}),h&&(0,L.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-5`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[34px] font-semibold leading-none ${Zn(h.score)}`,children:h.score===null?`—`:h.score}),(0,L.jsxs)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 mt-1`,children:[z(`Performance`),h.strategy?` · ${h.strategy}`:``]})]}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Jn.map(e=>{let t=h.metrics?.[e.key]??null,n=Yn(e.key,t,g);return(0,L.jsxs)(`div`,{className:`rounded border px-2.5 py-1.5 ${Xn[n]}`,title:n===`unknown`?z(`Not reported by this provider.`):n,children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider opacity-80`,children:e.label}),(0,L.jsx)(`div`,{className:`text-[13px] font-medium tabular-nums`,children:Qn(t,e.unit)})]},e.key)})})]}),h?.issues&&h.issues.length>0&&(0,L.jsx)(`ul`,{className:`mt-4 space-y-1`,children:h.issues.slice(0,3).map(e=>(0,L.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3 text-[12px] text-neutral-700 dark:text-neutral-300`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),(0,L.jsxs)(`span`,{className:`tabular-nums text-neutral-500 dark:text-neutral-400 shrink-0`,children:[`−`,Math.round(e.savings_ms),` ms`]})]},e.id))})]}),n&&n.runs.length>1&&(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsx)(`div`,{className:`text-[12px] font-medium text-neutral-900 dark:text-neutral-50 mb-2`,children:z(`Run history`)}),(0,L.jsx)(`ul`,{className:`space-y-1`,children:n.runs.slice(0,10).map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-baseline gap-3 text-[12px] border-t border-neutral-100 dark:border-neutral-800 first:border-t-0 pt-1.5 first:pt-0`,children:[(0,L.jsx)(`span`,{className:`w-16 shrink-0 text-[11px] text-neutral-500 dark:text-neutral-400`,children:$n(e.ts)}),(0,L.jsx)(`span`,{className:`w-10 shrink-0 tabular-nums font-medium ${Zn(e.score)}`,children:e.ok?e.score??`—`:`—`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-neutral-600 dark:text-neutral-400`,children:e.ok?e.url:e.error}),e.ok&&e.url&&(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`shrink-0 text-neutral-400 dark:text-neutral-500 hover:text-neutral-600 dark:hover:text-neutral-300`,"aria-label":z(`Open the tested page`),children:(0,L.jsx)(le,{size:11})})]},`${e.ts}-${t}`))})]}),(0,L.jsx)(Ci,{module:e,onSaved:t})]})}var tr=[{key:`cache`,label:`Overview`},{key:`visitors`,label:`Visitors`,locked:!0},{key:`pagespeed`,label:`PageSpeed`}],nr=`cache`,rr=new Set(tr.map(e=>e.key));function ir({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),o=a===`pro`||a===`trial`,s=tr.map(e=>({...e,locked:e.locked&&!o})),c=n&&rr.has(n)?n:nr,l=i?.(`score`);return(0,y.useEffect)(()=>{n&&!rr.has(n)&&r?.(nr)},[n,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(En,{getModule:i}),(0,L.jsx)(W,{panel:`RecommendationsPanel`,slug:`recommendations`,getModule:i,onSaved:t}),(0,L.jsx)(Dn,{items:s,value:c,onChange:e=>r?.(e),idBase:`health`}),c===`cache`&&(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(yn,{module:e}),(0,L.jsx)(W,{panel:`AnalyticsPanel`,slug:`analytics`,getModule:i,onSaved:t})]}),c===`visitors`&&(0,L.jsx)(qn,{demo:`health-visitors`,children:(0,L.jsx)(`div`,{className:`space-y-5`,children:(0,L.jsx)(W,{panel:`RumPanel`,slug:`rum`,getModule:i,onSaved:t})})}),c===`pagespeed`&&(0,L.jsxs)(`div`,{className:`space-y-5`,children:[l&&(0,L.jsx)(er,{module:l,onSaved:t}),(0,L.jsx)(W,{panel:`PageSpeedPanel`,slug:`pagespeed`,getModule:i,onSaved:t}),(0,L.jsx)(W,{panel:`PerformanceHealthPanel`,slug:`performance-health`,getModule:i,onSaved:t})]})]})}function ar({state:e}){let[t,n]=(0,y.useState)(null),r=(0,y.useRef)(`saving`);if((e===`saving`||e===`saved`)&&(r.current=e),(0,y.useEffect)(()=>{if(typeof document>`u`)return;let e=document.getElementById(`xspeed-toast-host`);if(!e){let t=document.getElementById(`xspeed-app`);if(!t)return;e=document.createElement(`div`),e.id=`xspeed-toast-host`,t.appendChild(e)}n(e)},[]),!t)return null;let i=e!==`idle`,a=e===`saved`||e===`idle`&&r.current===`saved`;return(0,gt.createPortal)((0,L.jsx)(`div`,{"aria-hidden":!i,className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-50 pointer-events-none transition-opacity duration-150 ${i?`opacity-100`:`opacity-0`}`,children:(0,L.jsx)(`div`,{className:`flex items-center gap-2 px-4 py-2 rounded-full border shadow-md text-[12px] font-medium ${a?`bg-emerald-50 dark:bg-emerald-950/60 border-emerald-200 dark:border-emerald-800 text-emerald-700 dark:text-emerald-300`:`bg-white dark:bg-neutral-900 border-neutral-200 dark:border-neutral-700 text-neutral-600 dark:text-neutral-300`}`,children:a?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(O,{size:14,className:`text-emerald-600 dark:text-emerald-400`}),(0,L.jsx)(`span`,{children:z(`Settings saved`)})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ae,{size:13,className:`animate-spin text-neutral-400 dark:text-neutral-500`}),(0,L.jsx)(`span`,{children:z(`Saving changes…`)})]})})}),t)}var or=1500;function sr({saving:e}){let[t,n]=(0,y.useState)(`idle`),r=(0,y.useRef)(`idle`),i=(0,y.useRef)(!1),a=(0,y.useRef)(null);return(0,y.useEffect)(()=>{r.current=t},[t]),(0,y.useEffect)(()=>{if(e){r.current!==`saved`&&(a.current&&=(window.clearTimeout(a.current),null),n(`saving`)),i.current=!0;return}i.current&&(i.current=!1,n(`saved`),a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{n(`idle`),a.current=null},or))},[e]),(0,y.useEffect)(()=>()=>{a.current&&window.clearTimeout(a.current)},[]),(0,L.jsx)(ar,{state:t})}function cr(e,t,n){let r={...t},i=!1,a=new Set([...Object.keys(t),...Object.keys(n),...Object.keys(e)]);for(let o of a)lr(n[o],e[o])?Object.prototype.hasOwnProperty.call(t,o)?r[o]=t[o]:r[o]=n[o]:(r[o]=n[o],i=!0);return{next:r,dirty:i}}function lr(e,t){if(e===t)return!0;if(e===null||t===null||e===void 0||t===void 0||typeof e!=`object`||typeof t!=`object`)return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}var ur=4e3;function dr({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(null),p=(0,y.useRef)(!0),m=(0,y.useRef)(JSON.stringify(e.settings)),h=(0,y.useRef)(n);(0,y.useEffect)(()=>{h.current=n},[n]),(0,y.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await H.request(`/preloader/status`);e||a(t)}catch{}};t();let n=window.setInterval(()=>{i?.running&&t()},ur);return()=>{e=!0,window.clearInterval(n)}},[i?.running]),(0,y.useEffect)(()=>{if(p.current){p.current=!1;return}if(JSON.stringify(n)!==m.current)return f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(async()=>{s(!0);let i=n;try{let{next:n,dirty:a}=cr(i,await H.updateModuleSettings(e.slug,i),h.current);r(n),m.current=a?``:JSON.stringify(n),t?.(n)}catch(e){l(e instanceof Error?e.message:`Save failed`)}finally{s(!1)}},600),()=>{f.current&&window.clearTimeout(f.current)}},[n,e.slug]);let g=(e,t)=>r(n=>({...n,[e]:t})),_=(0,y.useMemo)(()=>Object.entries(e.schema),[e.schema]);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(fr,{state:i,enabled:!!n.enabled,percent:i&&i.total>0?Math.round(i.processed/i.total*100):0,actioning:u,onStart:async()=>{d(`start`),l(null);try{a(await H.request(`/preloader/start`,{method:`POST`}))}catch(e){l(e instanceof Error?e.message:`Failed to start`)}finally{d(null)}},onStop:async()=>{d(`stop`);try{a(await H.request(`/preloader/stop`,{method:`POST`}))}catch(e){l(e instanceof Error?e.message:`Failed to stop`)}finally{d(null)}}}),c&&(0,L.jsx)(U,{tone:`danger`,title:`Preloader error`,body:c}),(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:_.map(([e,t],r)=>(0,L.jsx)(pr,{fieldKey:e,spec:t,value:n[e],onChange:t=>g(e,t),first:r===0},e))}),(0,L.jsx)(sr,{saving:o})]})}function fr({state:e,enabled:t,percent:n,actioning:r,onStart:i,onStop:a}){let o=!!e?.running,s=!!(e&&(e.total>0||e.finished_at>0));return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 mb-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${o?`bg-accent animate-pulse`:t?`bg-emerald-500`:`bg-neutral-300 dark:bg-neutral-600`}`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:o?`Crawling…`:t?`Ready`:`Disabled`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:e?s?`${e.processed} / ${e.total} URLs warmed${e.errors.length>0?` · ${e.errors.length} error${e.errors.length===1?``:`s`}`:``}`:t?`No crawl yet. Hit "Start now" to warm the cache.`:`Enable below, then start a crawl.`:`Loading…`})]})]}),(0,L.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:o?(0,L.jsxs)(`button`,{type:`button`,onClick:a,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,L.jsx)($e,{size:13}),`Stop`]}):(0,L.jsxs)(`button`,{type:`button`,onClick:i,disabled:!t||r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r===`start`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Fe,{size:13}),`Start now`]})})]}),(o||s)&&e&&e.total>0&&(0,L.jsxs)(`div`,{className:`mt-3`,children:[(0,L.jsx)(`div`,{className:`h-1.5 w-full bg-neutral-100 dark:bg-neutral-800 rounded-full overflow-hidden`,children:(0,L.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${n}%`}})}),e.last_url&&(0,L.jsxs)(`div`,{className:`mt-2 text-[11px] text-neutral-500 dark:text-neutral-400 font-mono truncate`,children:[`Last: `,e.last_url]})]})]})}function pr({fieldKey:e,spec:t,value:n,onChange:r,first:i}){let a=t.label??e;return(0,L.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex items-center justify-between gap-3 sm:gap-4 ${i?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a}),t.description&&(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description})]}),(0,L.jsx)(`div`,{className:`shrink-0`,children:mr(t,n,r,a)})]})}function mr(e,t,n,r){switch(e.type){case`bool`:return(0,L.jsx)(on,{checked:!!t,onChange:n,label:r});case`int`:return(0,L.jsx)(`input`,{type:`number`,min:e.min,max:e.max,value:t==null?``:Number(t),onChange:e=>n(Number(e.target.value)),className:`w-20 text-right`,"aria-label":r});case`enum`:return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`}`,children:a},r)})});case`string`:case`url`:return(0,L.jsx)(`input`,{type:e.type===`url`?`url`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-56`,"aria-label":r});default:return null}}var hr=Object.fromEntries(yt.map(e=>[e.slug,e.label]));function gr(e,t){let{module:n,getModule:r,isPro:i,subtab:a}=t,o=(0,y.useMemo)(()=>e.map(e=>{let t;return t=e.self?n.tab_label??n.label??e.slug:r?.(e.slug)?.label??hr[e.slug]??e.slug,{key:e.key,label:t,locked:!!e.pro&&!i}}),[e,n,r,i]);return{items:o,active:a&&o.some(e=>e.key===a)?a:e[0]?.key??``}}var _r=[{key:`manual`,slug:`preloader`,self:!0},{key:`scheduled`,slug:`prewarm-schedule`,panel:`PrewarmSchedulePanel`,pro:!0},{key:`predictive`,slug:`predictive-warm`,panel:`PredictiveWarmPanel`,pro:!0}];function vr({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),{items:o,active:s}=gr(_r,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(_r[0].key)},[n,o,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`preloader`}),s===`manual`&&(0,L.jsx)(dr,{module:e,onSaved:t}),s===`scheduled`&&(0,L.jsx)(qn,{demo:`preloader-scheduled`,children:(0,L.jsx)(W,{panel:`PrewarmSchedulePanel`,slug:`prewarm-schedule`,getModule:i,onSaved:t})}),s===`predictive`&&(0,L.jsx)(qn,{demo:`preloader-predictive`,children:(0,L.jsx)(W,{panel:`PredictiveWarmPanel`,slug:`predictive-warm`,getModule:i,onSaved:t})})]})}function yr({title:e,body:t,confirmLabel:n,cancelLabel:r=`Cancel`,busy:i=!1,onConfirm:a,onCancel:o}){return(0,L.jsx)(`div`,{role:`alertdialog`,"aria-labelledby":`xspeed-inline-confirm-title`,className:`border border-red-200 dark:border-red-900/60 bg-red-50 dark:bg-red-950/40 rounded-lg p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,L.jsx)(ot,{size:16,className:`text-red-600 dark:text-red-400 shrink-0 mt-0.5`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{id:`xspeed-inline-confirm-title`,className:`font-medium text-red-900 dark:text-red-200 text-[13px]`,children:e}),t&&(0,L.jsx)(`p`,{className:`text-[12px] text-red-800/90 dark:text-red-200/80 mt-1`,children:t}),(0,L.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:a,disabled:i,style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid !border-red-600 dark:!border-red-500 bg-red-600 dark:bg-red-500 text-white hover:bg-red-700 hover:!border-red-700 dark:hover:bg-red-600 transition-colors disabled:opacity-50`,children:[i&&(0,L.jsx)(Ae,{size:12,className:`animate-spin`}),n]}),(0,L.jsx)(`button`,{type:`button`,onClick:o,disabled:i,style:{height:32,boxSizing:`border-box`},className:`flex items-center gap-1.5 whitespace-nowrap text-[12px] px-3 rounded-md !border !border-solid !border-red-300 dark:!border-red-800 bg-white dark:bg-neutral-900 text-red-800 dark:text-red-200 hover:bg-red-100 dark:hover:bg-red-900/40 transition-colors disabled:opacity-50`,children:r})]})]})]})})}function br({id:e}){if(Mn()!==`free`)return null;let t=Ln[e];return t?(0,L.jsxs)(`div`,{className:`relative overflow-hidden border border-line bg-primary-tint rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`absolute top-3 right-3 flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium text-warning`,children:[(0,L.jsx)(se,{size:11}),(0,L.jsx)(`span`,{children:z(`Pro`)})]}),(0,L.jsxs)(`div`,{className:`flex items-start gap-3 pr-12`,children:[(0,L.jsx)(`span`,{className:`shrink-0 mt-0.5 text-warning`,children:(0,L.jsx)(vt,{name:t.icon,size:18})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[14px] font-medium text-ink`,children:t.title}),(0,L.jsx)(`p`,{className:`text-[12px] text-ink-soft mt-1 leading-relaxed`,children:t.body}),(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 mt-2.5 text-[12px] font-medium text-primary hover:text-primary-hover transition-colors`,children:[t.cta??z(`Learn more about Pro`),(0,L.jsx)(C,{size:12})]})]})]})]}):(typeof console<`u`&&console.warn(`[xSpeed] Unknown ProTeaser id: "${String(e)}"`),null)}function xr({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)({}),[c,l]=(0,y.useState)({}),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(!1),[v,b]=(0,y.useState)(!1),x=(0,y.useRef)(null),S=(0,y.useRef)(!0),C=(0,y.useRef)(JSON.stringify(e.settings)),w=(0,y.useRef)(n);(0,y.useEffect)(()=>{w.current=n},[n]);let T=async()=>{d(`scan`),p(null);try{let e=await H.request(`/database/scan`);a(e.scan),s(e.labels)}catch(e){p(e instanceof Error?e.message:`Scan failed`)}finally{d(null)}};(0,y.useEffect)(()=>{T()},[]),(0,y.useEffect)(()=>{if(S.current){S.current=!1;return}if(JSON.stringify(n)!==C.current)return x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(async()=>{b(!0);let i=n;try{let{next:n,dirty:a}=cr(i,await H.updateModuleSettings(e.slug,i),w.current);r(n),C.current=a?``:JSON.stringify(n),t?.(n)}catch(e){p(e instanceof Error?e.message:`Save failed`)}finally{b(!1)}},600),()=>{x.current&&window.clearTimeout(x.current)}},[n,e.slug]);let ee=(e,t)=>r(n=>({...n,[e]:t})),E=(0,y.useMemo)(()=>Object.keys(c).filter(e=>c[e]&&(i?.[e]?.count??0)>0),[c,i]),te=(0,y.useMemo)(()=>E.reduce((e,t)=>e+(i?.[t]?.count??0),0),[E,i]),D=e=>l(t=>({...t,[e]:!t[e]})),O=()=>{if(!i)return;let e={};Object.entries(i).forEach(([t,n])=>{n.count>0&&(e[t]=!0)}),l(e)},ne=()=>l({}),k=async()=>{if(E.length!==0){_(!1),d(`clean`),p(null),h(null);try{let e=await H.request(`/database/clean`,{method:`POST`,body:JSON.stringify({types:E})});a(e.scan);let t=Object.values(e.cleaned).reduce((e,t)=>e+t,0);h(`Removed ${t.toLocaleString()} row${t===1?``:`s`}.`),l({})}catch(e){p(e instanceof Error?e.message:`Cleanup failed`)}finally{d(null)}}},A=async()=>{d(`optimize`),p(null),h(null);try{let e=await H.request(`/database/optimize`,{method:`POST`}),t=Object.keys(e.optimized).length;h(`Optimized ${t} table${t===1?``:`s`}.`)}catch(e){p(e instanceof Error?e.message:`Optimize failed`)}finally{d(null)}},j=(0,y.useMemo)(()=>Object.entries(e.schema),[e.schema]),M=i?Object.entries(i):[],N=M.reduce((e,[,t])=>e+t.count,0);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 mb-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(F,{size:18,className:`text-primary shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`Database bloat`}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:i?N===0?`Nothing to clean — your database is tidy.`:`${N.toLocaleString()} row${N===1?``:`s`} across ${M.filter(([,e])=>e.count>0).length} categor${M.filter(([,e])=>e.count>0).length===1?`y`:`ies`}`:`Scanning…`})]})]}),(0,L.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,L.jsxs)(`button`,{type:`button`,onClick:T,disabled:u!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:u===`scan`?`animate-spin`:``}),`Rescan`]})})]}),M.length>0&&(0,L.jsx)(`div`,{className:`border border-line rounded overflow-hidden`,children:M.map(([e,t],n)=>{let r=!!c[e],i=t.count===0;return(0,L.jsxs)(`label`,{className:`flex items-center justify-between gap-3 px-3 py-2.5 cursor-pointer ${n===0?``:`border-t border-line`} ${i?`opacity-50 cursor-not-allowed`:`hover:bg-panel/40`}`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:r,disabled:i,onChange:()=>D(e),className:`accent-primary`}),(0,L.jsx)(`span`,{className:`text-[13px] text-ink truncate`,children:o[e]??t.label})]}),(0,L.jsx)(`span`,{className:`text-[12px] tabular-nums text-muted shrink-0`,children:t.count.toLocaleString()})]},e)})}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 mt-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:O,className:`text-primary hover:underline`,disabled:!i||N===0,children:`Select all`}),(0,L.jsx)(`span`,{className:`text-line-strong`,children:`·`}),(0,L.jsx)(`button`,{type:`button`,onClick:ne,className:`text-muted hover:underline`,disabled:E.length===0,children:`Clear`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:A,disabled:u!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,L.jsx)(pt,{size:13,className:u===`optimize`?`animate-pulse`:``}),`Optimize tables`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>_(!0),disabled:u!==null||E.length===0,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[u===`clean`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(it,{size:13}),`Clean selected`,te>0?` (${te.toLocaleString()})`:``]})]})]}),g&&(0,L.jsx)(`div`,{className:`mt-3`,children:(0,L.jsx)(yr,{title:`Permanently delete ${te.toLocaleString()} row${te===1?``:`s`}?`,body:`This removes the selected rows from your database. It can't be undone — take a backup first if you're unsure.`,confirmLabel:`Delete rows`,busy:u===`clean`,onConfirm:k,onCancel:()=>_(!1)})}),u===`clean`&&(0,L.jsx)(`div`,{className:`mt-3 h-1.5 rounded-pill bg-panel overflow-hidden`,role:`progressbar`,"aria-label":`Cleaning`,children:(0,L.jsx)(`div`,{className:`h-full w-full rounded-pill xspeed-anim-sweep`,style:{backgroundImage:`linear-gradient(90deg, var(--primary) 0%, #5BD6CE 50%, var(--primary) 100%)`}})})]}),f&&(0,L.jsx)(U,{tone:`danger`,title:`Database error`,body:f}),m&&!f&&(0,L.jsx)(U,{tone:`success`,title:`Done`,body:m}),j.length>0&&(0,L.jsx)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:j.map(([e,t],r)=>(0,L.jsx)(Sr,{fieldKey:e,spec:t,value:n[e],labels:o,onChange:t=>ee(e,t),first:r===0},e))}),(0,L.jsx)(sr,{saving:v}),(0,L.jsx)(br,{id:`migration`})]})}function Sr({fieldKey:e,spec:t,value:n,labels:r,onChange:i,first:a}){let o=t.label??e,s=e===`included_types`;return(0,L.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 ${a?``:`border-t border-line`}`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 sm:gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:o}),t.description&&(0,L.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:t.description})]}),!s&&(0,L.jsx)(`div`,{className:`shrink-0`,children:wr(t,n,i,o)})]}),s&&Object.keys(r).length>0&&(0,L.jsx)(Cr,{value:Array.isArray(n)?n:[],labels:r,onChange:i})]})}function Cr({value:e,labels:t,onChange:n}){let r=t=>{n(e.includes(t)?e.filter(e=>e!==t):[...e,t])};return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-3`,children:Object.entries(t).map(([t,n])=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(t),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${e.includes(t)?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:n},t))})}function wr(e,t,n,r){switch(e.type){case`bool`:return(0,L.jsx)(on,{checked:!!t,onChange:n,label:r});case`enum`:return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:a},r)})});default:return null}}function Tr(e,t,n){return e.dependsOn?Er(e.dependsOn,t,n,new Set):!0}function Er(e,t,n,r){if(`all`in e)return e.all.every(e=>Er(e,t,n,r));if(`any`in e)return e.any.some(e=>Er(e,t,n,r));if(r.has(e.field))return!0;let i=n[e.field];if(i?.dependsOn){let a=new Set(r);if(a.add(e.field),!Er(i.dependsOn,t,n,a))return!1}let a=t[e.field];return Object.prototype.hasOwnProperty.call(e,`value`)?a===e.value:!!a}function Dr(e,t,n){return(0,y.useMemo)(()=>Object.entries(e).filter(([r,i])=>Tr(i,t,e)&&(n?n(r,i):!0)),[e,t])}function Or({module:e,onSaved:t,getModule:n}){let[r,i]=(0,y.useState)(e.settings),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(null),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),h=(0,y.useRef)(null),g=(0,y.useRef)(!0),_=(0,y.useRef)(JSON.stringify(e.settings)),v=(0,y.useRef)(r);(0,y.useEffect)(()=>{v.current=r},[r]),(0,y.useEffect)(()=>{if(g.current){g.current=!1;return}if(JSON.stringify(r)!==_.current)return h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(async()=>{m(!0);let n=r;try{let{next:r,dirty:a}=cr(n,await H.updateModuleSettings(e.slug,n),v.current);i(r),_.current=a?``:JSON.stringify(r),t?.(r)}catch(e){u(e instanceof Error?e.message:`Save failed`)}finally{m(!1)}},600),()=>{h.current&&window.clearTimeout(h.current)}},[r,e.slug]);let b=(e,t)=>i(n=>({...n,[e]:t})),x=async(e,t,n=`POST`,r)=>{c(e),u(null),f(null);try{let i=await H.request(t,{method:n,body:r?JSON.stringify(r):void 0});t===`/cloudflare/verify`&&o(i),i.ok?f(`Cloudflare: ${kr(e)} succeeded.`):u(i.body?.message||`Cloudflare API returned HTTP ${i.status}.`)}catch(e){u(e instanceof Error?e.message:`Request failed`)}finally{c(null)}},S=String(r.auth_method??`token`),C=Dr(e.schema,r,e=>!(S===`token`&&(e===`email`||e===`api_key`)||S===`key`&&e===`api_token`));return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[a?.ok?(0,L.jsx)(N,{size:18,className:`text-emerald-500 shrink-0`}):a?(0,L.jsx)(M,{size:18,className:`text-rose-500 shrink-0`}):(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-neutral-300 dark:bg-neutral-600 shrink-0 ml-2`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a?.ok?`Connected: ${a.body.result?.name??`zone`}`:a?`Verification failed`:`Not verified yet`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:a?.ok?`Plan: ${a.body.result?.plan?.name??`unknown`}`:`Fill in credentials below, then click Verify.`})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>x(`verify`,`/cloudflare/verify`),disabled:s!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:s===`verify`?`animate-spin`:``}),`Verify`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>x(`purge`,`/cloudflare/purge`),disabled:s!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[s===`purge`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(it,{size:13}),`Purge Cloudflare`]})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>x(`devon`,`/cloudflare/dev-mode`,`POST`,{on:!0}),disabled:s!==null,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:`Dev mode: ON`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>x(`devoff`,`/cloudflare/dev-mode`,`POST`,{on:!1}),disabled:s!==null,className:`text-[12px] px-2.5 py-1 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:`Dev mode: OFF`})]})]}),l&&(0,L.jsx)(U,{tone:`danger`,title:`Cloudflare error`,body:l}),d&&!l&&(0,L.jsx)(U,{tone:`success`,title:`Done`,body:d}),(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:C.map(([e,t],n)=>(0,L.jsx)(Ar,{fieldKey:e,spec:t,value:r[e],onChange:t=>b(e,t),first:n===0},e))}),(0,L.jsx)(sr,{saving:p}),(0,L.jsxs)(`div`,{className:`pt-2`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:`Automatic Platform Optimization`}),(0,L.jsx)(qn,{demo:`network-cloudflare`,children:(0,L.jsx)(W,{panel:`CloudflareApoPanel`,slug:`cloudflare-apo`,getModule:n,onSaved:t})})]})]})}function kr(e){switch(e){case`verify`:return`verify`;case`purge`:return`purge`;case`devon`:return`dev mode on`;case`devoff`:return`dev mode off`;default:return`action`}}function Ar({fieldKey:e,spec:t,value:n,onChange:r,first:i}){let a=t.label??e,o=e===`api_token`||e===`api_key`;return(0,L.jsxs)(`div`,{"data-field-anchor":`cloudflare:${e}`,className:`xspeed-field px-4 sm:px-5 py-4 flex items-start justify-between gap-3 sm:gap-4 ${i?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a}),t.description&&(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description})]}),(0,L.jsx)(`div`,{className:`shrink-0`,children:jr(t,n,r,a,o)})]})}function jr(e,t,n,r,i){switch(e.type){case`bool`:return(0,L.jsx)(on,{checked:!!t,onChange:n,label:r});case`enum`:return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`}`,children:a},r)})});case`string`:return(0,L.jsx)(`input`,{type:i?`password`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-64`,autoComplete:`off`,"aria-label":r});default:return null}}function Mr({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(null),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(!1),[v,b]=(0,y.useState)(!1),[x,S]=(0,y.useState)(!1),C=(0,y.useRef)(null),w=(0,y.useRef)(!0),T=(0,y.useRef)(JSON.stringify(e.settings)),ee=(0,y.useRef)(n);(0,y.useEffect)(()=>{ee.current=n},[n]);let E=async()=>{l(`detect`),d(null);try{let[e,t]=await Promise.all([H.request(`/object-cache/detect`),H.request(`/object-cache/snippet`)]);a(e),s(t.snippet)}catch(e){d(e instanceof Error?e.message:`Detection failed`)}finally{l(null)}};(0,y.useEffect)(()=>{E()},[]),(0,y.useEffect)(()=>{if(w.current){w.current=!1;return}if(JSON.stringify(n)!==T.current)return C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(async()=>{S(!0);let i=n;try{let{next:n,dirty:a}=cr(i,await H.updateModuleSettings(e.slug,i),ee.current);r(n),T.current=a?``:JSON.stringify(n),t?.(n),s((await H.request(`/object-cache/snippet`)).snippet)}catch(e){d(e instanceof Error?e.message:`Save failed`)}finally{S(!1)}},600),()=>{C.current&&window.clearTimeout(C.current)}},[n,e.slug]);let te=(e,t)=>r(n=>({...n,[e]:t})),D=async()=>{l(`flush`),d(null),p(null);try{p((await H.request(`/object-cache/flush`,{method:`POST`})).ok?`Object cache flushed.`:`Flush returned false — cache backend may not be active.`)}catch(e){d(e instanceof Error?e.message:`Flush failed`)}finally{l(null)}},O=async()=>{l(`test`),d(null),p(null),h(null);try{let e=await H.request(`/object-cache/test-connection`,{method:`POST`,body:JSON.stringify(n)});h(e),e.ok||d(e.message)}catch(e){d(e instanceof Error?e.message:`Connection test failed`)}finally{l(null)}},ne=async()=>{l(`enable`),d(null),p(null),_(!1);try{let e=await H.request(`/object-cache/enable`,{method:`POST`,body:JSON.stringify(n)});h(e.test??null),e.ok?(p(e.message),a(e.detect)):(d(e.message),e.steps.drop_in&&!e.steps.wp_config&&_(!0)),await E()}catch(e){d(e instanceof Error?e.message:`Enable failed`)}finally{l(null)}},k=async()=>{l(`disable`),d(null),p(null);try{p((await H.request(`/object-cache/disable`,{method:`POST`})).message),h(null),_(!1),await E()}catch(e){d(e instanceof Error?e.message:`Disable failed`)}finally{l(null)}},A=async()=>{try{await navigator.clipboard.writeText(o),b(!0),window.setTimeout(()=>b(!1),1500)}catch{d(`Clipboard write blocked — select + copy the snippet manually.`)}},j=String(n.backend??`redis`),re=(0,y.useMemo)(()=>Object.entries(e.schema),[e.schema]).filter(([e])=>!(j===`redis`&&(e===`memcached_host`||e===`memcached_port`)||j===`memcached`&&(e===`redis_host`||e===`redis_port`||e===`redis_user`||e===`redis_password`||e===`redis_database`))),ie=i?i.wp_cache_active?{tone:`ok`,label:`Active: ${i.drop_in_label||i.backend}`,sub:`Backend: ${i.backend}`}:{tone:`warn`,label:`No persistent object cache`,sub:`WordPress is using its built-in in-memory cache (resets every request).`}:null;return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[ie?.tone===`ok`?(0,L.jsx)(N,{size:18,className:`text-emerald-500 shrink-0`}):ie?.tone===`warn`?(0,L.jsx)(M,{size:18,className:`text-amber-500 shrink-0`}):(0,L.jsx)(Ke,{size:18,className:`text-neutral-400 shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:ie?ie.label:`Detecting…`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:ie?.sub??``})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:E,disabled:c!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:c===`detect`?`animate-spin`:``}),`Re-detect`]}),i?.drop_in_installed&&(0,L.jsxs)(`button`,{type:`button`,onClick:D,disabled:c!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[c===`flush`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(it,{size:13}),`Flush`]})]})]}),i&&(()=>{let e=j===`redis`?!!i.class_available.Redis:!!(i.class_available.Memcached||i.class_available.Memcache);return(0,L.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-[12px]`,children:[(0,L.jsxs)(`span`,{className:`px-2 py-0.5 rounded border border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300 whitespace-nowrap`,children:[j===`redis`?`Redis`:`Memcached`,` ready`]}),(0,L.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400`,children:e?`Native ${j===`redis`?`phpredis`:`memcached`} extension detected — fastest path.`:`xSpeed uses its built-in client — no extension to install.`})]})})()]}),u&&(0,L.jsx)(U,{tone:`danger`,title:`Error`,body:u}),f&&!u&&(0,L.jsx)(U,{tone:`success`,title:`Done`,body:f}),(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50 flex items-center gap-2`,children:[(0,L.jsx)(pt,{size:15,className:`text-accent`}),`One-click setup`]}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:i?.drop_in_installed?`Object cache is installed. Disable to remove the drop-in and clean wp-config.php.`:`Test the ${j} connection, then enable — xSpeed writes the drop-in and wp-config.php for you. No manual steps.`}),m&&(0,L.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 text-[12px] px-2 py-1 rounded ${m.ok?`bg-emerald-50 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-300`:`bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300`}`,children:[m.ok?(0,L.jsx)(N,{size:13}):(0,L.jsx)(M,{size:13}),m.message,m.latency_ms!=null&&m.ok?` (${m.latency_ms} ms)`:``]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:O,"data-field-anchor":`object-cache:connection_test`,disabled:c!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[c===`test`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Le,{size:13}),`Test connection`]}),i?.drop_in_installed?(0,L.jsxs)(`button`,{type:`button`,onClick:k,disabled:c!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-red-300 dark:border-red-800 text-red-700 dark:text-red-300 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50`,children:[c===`disable`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Re,{size:13}),`Disable`]}):(0,L.jsxs)(`button`,{type:`button`,onClick:ne,disabled:c!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[c===`enable`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Re,{size:13}),`Enable object cache`]})]})]})}),(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:re.map(([e,t],r)=>(0,L.jsx)(Nr,{fieldKey:e,spec:t,value:n[e],onChange:t=>te(e,t),first:r===0},e))}),g&&(0,L.jsxs)(`div`,{className:`border border-amber-200 dark:border-amber-800 bg-amber-50/40 dark:bg-amber-900/10 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Manual step needed — wp-config.php isn’t writable`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:`The drop-in was installed, but xSpeed couldn’t edit wp-config.php automatically. Paste this above the “That’s all, stop editing!” comment to finish.`})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:A,disabled:!o,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[v?(0,L.jsx)(N,{size:13,className:`text-emerald-500`}):(0,L.jsx)(ae,{size:13}),v?`Copied`:`Copy`]})]}),(0,L.jsx)(`pre`,{className:`text-[11px] leading-relaxed font-mono whitespace-pre-wrap break-all bg-neutral-50 dark:bg-neutral-950 text-neutral-700 dark:text-neutral-300 border border-neutral-200 dark:border-neutral-800 rounded p-3 max-h-72 overflow-auto`,children:o||`// Adjust the settings above to generate a snippet.`})]}),(0,L.jsx)(sr,{saving:x})]})}function Nr({fieldKey:e,spec:t,value:n,onChange:r,first:i}){let a=t.label??e,o=e===`redis_password`;return(0,L.jsxs)(`div`,{className:`px-4 sm:px-5 py-4 flex items-start justify-between gap-3 sm:gap-4 ${i?``:`border-t border-neutral-200 dark:border-neutral-800`}`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:a}),t.description&&(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:t.description})]}),(0,L.jsx)(`div`,{className:`shrink-0`,children:Pr(t,n,r,a,o)})]})}function Pr(e,t,n,r,i){switch(e.type){case`bool`:return(0,L.jsx)(on,{checked:!!t,onChange:n,label:r});case`int`:return(0,L.jsx)(`input`,{type:`number`,min:e.min,max:e.max,value:t==null?``:Number(t),onChange:e=>n(Number(e.target.value)),className:`w-24 text-right`,"aria-label":r});case`enum`:return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??r;return(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-accent border-accent text-white`:`border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`}`,children:a},r)})});case`string`:return(0,L.jsx)(`input`,{type:i?`password`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-56`,autoComplete:`off`,"aria-label":r});default:return null}}var Fr=`xspeed_migration_applied_${typeof window<`u`?window.location.host:``}`;function Ir(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(Fr),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Lr(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Fr,JSON.stringify(e))}catch{}}var Rr={cache:`Page Cache`,minify:`Minify`,lazy:`Lazy Load`,preloader:`Preloader`,"browser-cache":`Browser Cache`,"object-cache":`Object Cache`},zr={cache_enabled:`Enable caching`,cache_expiry:`Cache lifetime (hours)`,mobile_separate:`Separate mobile cache`,excluded_urls:`Excluded URLs`,excluded_cookies:`Excluded cookies`,bypass_user_agents:`Bypass user agents`,ignored_query_params:`Ignored query params`,minify_html:`Minify HTML`,minify_css:`Minify CSS`,minify_js:`Minify JS`,lazy_images:`Lazy-load images`,lazy_iframes:`Lazy-load iframes`,lazy_videos:`Lazy-load videos`,enabled:`Enabled`,schedule:`Schedule`};function Br(e){return zr[e]??e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Vr(e){return typeof e==`boolean`?e?`On`:`Off`:Array.isArray(e)?e.length?`${e.length} item${e.length===1?``:`s`}: ${e.join(`, `)}`:`—`:e==null||e===``?`—`:String(e)}function Hr({patch:e,title:t}){return(0,L.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-[11px] font-medium text-muted uppercase tracking-wider`,children:t}),Object.entries(e).map(([e,t])=>(0,L.jsxs)(`div`,{className:`rounded-card overflow-hidden bg-panel`,children:[(0,L.jsx)(`div`,{className:`px-4 pt-2.5 pb-1.5 text-[12px] font-semibold text-ink`,children:Rr[e]??Br(e)}),Object.entries(t).map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-4 py-2`,children:[(0,L.jsx)(`span`,{className:`text-[12px] text-muted shrink-0`,children:Br(e)}),(0,L.jsx)(`span`,{className:`text-[12px] text-ink text-right truncate`,title:Vr(t),children:Vr(t)})]},e))]},e))]})}function Ur(e){let t=Mn(),n=t===`pro`||t===`trial`,[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)([]),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(null),[b,x]=(0,y.useState)({}),[S,w]=(0,y.useState)(null),[T,ee]=(0,y.useState)(()=>Ir()),[E,te]=(0,y.useState)(null);(0,y.useEffect)(()=>{Lr(T)},[T]);let[D,O]=(0,y.useState)(``),[ne,k]=(0,y.useState)(null),[A,j]=(0,y.useState)(null),[M,re]=(0,y.useState)(null),[ie,P]=(0,y.useState)(null),[ae,oe]=(0,y.useState)(!1),F=async()=>{c({source:`*`,op:`status`}),m(null);try{i((await H.request(`/migration/status`)).sources)}catch(e){m(e instanceof Error?e.message:`Status check failed`)}finally{c(null)}},le=async()=>{try{v((await H.request(`/migration-pro/profiles`)).profiles)}catch{v([])}};(0,y.useEffect)(()=>{F(),n&&le()},[n]);let fe=async e=>{c({source:e,op:`preview`}),m(null);try{let t=await H.request(`/migration/preview`,{method:`POST`,body:JSON.stringify({source:e})});o(n=>({...n,[e]:t.patch}))}catch(e){m(e instanceof Error?e.message:`Preview failed`)}finally{c(null)}},pe=e=>{e.active?g(e):me(e.id)},me=async e=>{g(null),c({source:e,op:`apply`}),m(null),f(null);try{let t=await H.request(`/migration/apply`,{method:`POST`,body:JSON.stringify({source:e})});u(t=>[...t,e]);let n=t.source_label||`the source plugin`;f({title:`Imported settings from ${n}`,body:t.deactivated?`Your ${n} settings are now active in xSpeed, and ${n} has been deactivated so the two caching plugins don't conflict. Review the imported values in the panels and re-enable anything you want to tweak.`:`Your ${n} settings are now active in xSpeed. Review the imported values in the panels. (${n} was already inactive, so nothing was changed there.)`}),F()}catch(e){m(e instanceof Error?e.message:`Apply failed`)}finally{c(null)}},he=async e=>{if(b[e]){x(t=>{let n={...t};return delete n[e],n});return}w({id:e,op:`preview`}),m(null);try{let t=await H.request(`/migration-pro/profiles/preview`,{method:`POST`,body:JSON.stringify({profile:e})});x(n=>({...n,[e]:t.patch}))}catch(e){m(e instanceof Error?e.message:`Preview failed`)}finally{w(null)}},ge=e=>te(e),_e=async e=>{te(null),w({id:e,op:`apply`}),m(null);try{await H.request(`/migration-pro/profiles/apply`,{method:`POST`,body:JSON.stringify({profile:e})}),ee(t=>t.includes(e)?t:[...t,e])}catch(e){m(e instanceof Error?e.message:`Apply failed`)}finally{w(null)}},ve=async()=>{j(`export`),m(null),re(null);try{let e=await H.request(`/migration-pro/profile/export`),t=JSON.stringify(e.profile,null,2),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`xspeed-profile.json`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),re(`Profile exported — saved as xspeed-profile.json.`)}catch(e){m(e instanceof Error?e.message:`Export failed`)}finally{j(null)}},ye=e=>{let t=e instanceof Error?e.message:``;return/422|format|profile|parse|json/i.test(t)||!t?`That doesn’t look like an xSpeed profile. Paste the JSON from an exported profile, or choose a .json file.`:t},be=async()=>{if(D.trim()){j(`preview`),P(null),re(null),k(null);try{k((await H.request(`/migration-pro/profile/import/preview`,{method:`POST`,body:JSON.stringify({profile:D.trim()})})).patch)}catch(e){P(ye(e))}finally{j(null)}}},xe=()=>{D.trim()&&(P(null),oe(!0))},Se=async()=>{oe(!1),j(`apply`),P(null),re(null);try{let e=await H.request(`/migration-pro/profile/import/apply`,{method:`POST`,body:JSON.stringify({profile:D.trim()})}),t=Object.keys(e.results).length;re(`Imported — applied settings to ${t} module${t===1?``:`s`}.`),k(null),O(``)}catch(e){P(ye(e))}finally{j(null)}},we=e=>{let t=new FileReader;t.onload=()=>O(String(t.result??``)),t.readAsText(e)};return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(Ce,{size:18,className:`text-primary shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`Migrate from another plugin`}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Read settings from a detected caching plugin and apply the equivalent xSpeed configuration.`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:F,disabled:s!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:s?.op===`status`?`animate-spin`:``}),`Re-scan`]})]})}),p&&(0,L.jsx)(U,{tone:`danger`,title:`Migration error`,body:p}),d&&(0,L.jsx)(U,{tone:`success`,title:d.title,body:d.body}),r?.map(e=>{let t=l.includes(e.id)||e.imported,n=a[e.id],r=e.mapped_count,i=`${r} ${r===1?`setting`:`settings`}`,o=t?`Imported${e.active?``:` · plugin deactivated`}`:e.detected?`Detected — imports ${i}`:`Not installed (or settings not present)`;return(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${t||e.detected?`bg-success`:`bg-line-strong`}`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:e.label}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:o})]})]}),(0,L.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:t?(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 text-success font-medium`,children:[(0,L.jsx)(N,{size:14}),`Imported`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>fe(e.id),disabled:!e.detected||s!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[s?.source===e.id&&s?.op===`preview`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(de,{size:13}),`Preview`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>pe(e),disabled:!e.detected||s!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[s?.source===e.id&&s?.op===`apply`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(C,{size:13}),`Import`]})]})})]}),h?.id===e.id&&(0,L.jsx)(`div`,{className:`mt-4`,children:(0,L.jsx)(yr,{title:`${e.label} will be deactivated after import`,body:(0,L.jsxs)(L.Fragment,{children:[`xSpeed will import `,e.label,`’s `,i,`, then deactivate`,` `,e.label,` — two page-caching plugins can’t run together (they double-cache and fight over the cache drop-in, breaking caching for both). Your `,e.label,` settings stay saved in its own options, so you can reactivate it anytime to switch back.`]}),confirmLabel:`Import & switch to xSpeed`,cancelLabel:`Cancel`,busy:s?.source===e.id&&s?.op===`apply`,onConfirm:()=>me(e.id),onCancel:()=>g(null)})}),n&&(0,L.jsx)(Hr,{patch:n,title:`Translation preview`})]},e.id)}),(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(lt,{size:18,className:`text-primary shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:`One-click cache profiles`}),!n&&(0,L.jsx)(se,{size:12,className:`text-warning shrink-0`})]}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Apply a curated, best-practice xSpeed setup for your site type — no manual tuning.`})]})]}),n?_===null?(0,L.jsx)(`div`,{className:`mt-4 text-[12px] text-muted text-center py-4`,children:`Loading…`}):_.length===0?(0,L.jsx)(`div`,{className:`mt-4 text-[12px] text-muted text-center py-4`,children:`No profiles available.`}):(0,L.jsx)(`div`,{className:`mt-4 space-y-3`,children:_.map(e=>{let t=T.includes(e.id),n=b[e.id],r=!!n,i=E?.id===e.id;return(0,L.jsxs)(`div`,{className:`border border-line rounded-card p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:e.label}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:e.description})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>he(e.id),disabled:S!==null,"aria-expanded":r?`true`:`false`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40`,children:[S?.id===e.id&&S?.op===`preview`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):r?(0,L.jsx)(ue,{size:13}):(0,L.jsx)(de,{size:13}),r?`Hide preview`:`Preview`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>ge(e),disabled:S!==null||t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[S?.id===e.id&&S?.op===`apply`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):t?(0,L.jsx)(N,{size:13}):(0,L.jsx)(C,{size:13}),t?`Applied`:`Apply`]})]})]}),n&&(0,L.jsx)(Hr,{patch:n,title:`Will set`}),i&&(0,L.jsx)(`div`,{className:`mt-4`,children:(0,L.jsx)(yr,{title:`Apply the "${e.label}" profile?`,body:(0,L.jsxs)(L.Fragment,{children:[`This overwrites your site-wide cache settings (cache lifetime, exclusions, minify & lazy options) with the `,e.label,` preset. Your existing safety exclusions are kept. You can re-tune anything afterward in each panel.`]}),confirmLabel:`Apply profile`,cancelLabel:`Cancel`,busy:S?.id===e.id&&S?.op===`apply`,onConfirm:()=>_e(e.id),onCancel:()=>te(null)})})]},e.id)})}):(0,L.jsx)(`div`,{className:`mt-4 rounded-card border border-dashed border-line-strong px-4 py-3 text-[12px] text-muted`,children:`Curated one-click profiles (Blog, WooCommerce, Membership, LMS, News) and portable save\xA0&\xA0share are a Pro feature. Activate Pro to unlock them here.`})]}),n&&(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(ce,{size:18,className:`text-primary shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`Save & share your config`}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Export this site’s xSpeed settings as a portable profile, then import it on another site.`})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:ve,disabled:A!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 shrink-0`,children:[A===`export`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(ce,{size:13}),`Export profile`]})]}),(0,L.jsxs)(`div`,{className:`mt-3 text-[11px] text-muted leading-snug`,children:[`For your security, API keys, tokens, and other secrets are `,(0,L.jsx)(`strong`,{children:`excluded`}),` from the exported file — re-enter them manually on the destination site after importing.`]}),M&&!ie&&(0,L.jsx)(`div`,{className:`mt-3`,children:(0,L.jsx)(U,{tone:`success`,title:`Done`,body:M})}),(0,L.jsxs)(`div`,{className:`mt-5`,children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted mb-1`,children:`Import a profile`}),(0,L.jsx)(`textarea`,{rows:4,value:D,onChange:e=>{O(e.target.value),k(null)},placeholder:`Paste an xSpeed profile JSON here, or choose a .json file below.`,className:`w-full font-mono text-[11px]`,"aria-label":`Profile JSON to import`}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors cursor-pointer`,children:[(0,L.jsx)(ct,{size:13}),`Choose file`,(0,L.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&we(t)}})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:be,disabled:A!==null||!D.trim(),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-40`,children:[A===`preview`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(de,{size:13}),`Preview`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:xe,disabled:A!==null||!D.trim(),className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[A===`apply`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(C,{size:13}),`Import & apply`]})]}),ie&&(0,L.jsx)(`div`,{className:`mt-3`,children:(0,L.jsx)(U,{tone:`danger`,title:`Import error`,body:ie})}),ae&&(0,L.jsx)(`div`,{className:`mt-3`,children:(0,L.jsx)(yr,{title:`Apply this imported profile?`,body:(0,L.jsx)(L.Fragment,{children:`This overwrites your site-wide xSpeed settings with the values in the imported profile (cache lifetime, exclusions, minify & lazy options, …). Secrets aren’t included — re-enter them after. You can re-tune anything afterward in each panel.`}),confirmLabel:`Import & apply`,cancelLabel:`Cancel`,busy:A===`apply`,onConfirm:Se,onCancel:()=>oe(!1)})}),ne&&(0,L.jsx)(Hr,{patch:ne,title:`Will import`})]})]})]})}function Wr({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),l=zt(),u=String(e.settings.support_url??`https://wpdeveloper.com/support`),d=async()=>{i(!0),o(null);try{n(await H.request(`/support/snapshot`))}catch(e){o(e instanceof Error?e.message:`Snapshot failed`)}finally{i(!1)}};return(0,y.useEffect)(()=>{d()},[]),(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(Oe,{size:18,className:`text-accent shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Help & Support`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:`Open a ticket with your system snapshot already attached so we can help faster.`})]})]}),!l.hide_help_links&&(0,L.jsxs)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors`,children:[(0,L.jsx)(le,{size:13}),`Open ticket`]})]})}),a&&(0,L.jsx)(U,{tone:`danger`,title:`Support snapshot error`,body:a}),(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`System snapshot`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:`Paste this into your support ticket. License key is masked — first 4 + last 4 only.`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:d,disabled:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:r?`animate-spin`:``}),`Refresh`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{if(t)try{await navigator.clipboard.writeText(t.markdown),c(!0),window.setTimeout(()=>c(!1),1500)}catch{o(`Clipboard blocked. Select the text below and copy manually.`)}},disabled:!t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors disabled:opacity-50`,children:[s?(0,L.jsx)(N,{size:13,className:`text-emerald-500`}):(0,L.jsx)(ae,{size:13}),s?`Copied`:`Copy markdown`]})]})]}),t?(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2 text-[12px]`,children:Object.entries(t.snapshot).map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex justify-between gap-3 border-b border-neutral-100 dark:border-neutral-800 pb-1`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400 font-mono`,children:e}),(0,L.jsx)(`span`,{className:`text-neutral-900 dark:text-neutral-100 text-right truncate font-mono`,children:Array.isArray(t)?t.join(`, `):typeof t==`boolean`?t?`yes`:`no`:String(t)})]},e))}):(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 italic`,children:`Loading snapshot…`})]}),(()=>{let e=l.footer_credit?.trim();return e?(0,L.jsx)(`div`,{className:`text-[11px] text-neutral-400 dark:text-neutral-500 text-center pt-1`,children:e}):l.hide_help_links?null:(0,L.jsxs)(`div`,{className:`text-[11px] text-neutral-400 dark:text-neutral-500 text-center pt-1`,children:[`Built by`,` `,(0,L.jsx)(`a`,{href:`https://wpdeveloper.com`,target:`_blank`,rel:`noopener noreferrer`,className:`hover:text-accent`,children:`WPDeveloper`})]})})()]})}function Gr(e){let t=Math.max(0,Math.floor(Date.now()/1e3)-e);return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Kr(){let[e,t]=(0,y.useState)(!1),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),c=async()=>{a(!0);try{r(await H.request(`/mcp/activity?limit=50`))}catch{r({entries:[],summary:{total:0,failed:0,last_ts:0,top_tool:``}})}finally{a(!1)}};(0,y.useEffect)(()=>{e&&n===null&&c()},[e]);let l=async()=>{a(!0);try{r(await H.request(`/mcp/activity/clear`,{method:`POST`}))}finally{a(!1),s(!1)}},u=n?.summary,d=n?.entries??[];return(0,L.jsxs)(`div`,{className:`mt-4 rounded-card border border-line`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e=>!e),"aria-expanded":e,className:`flex w-full items-center gap-2 px-3 py-2.5 text-left`,children:[e?(0,L.jsx)(ne,{size:14,className:`text-faint`}):(0,L.jsx)(A,{size:14,className:`text-faint`}),(0,L.jsx)(We,{size:14,className:`text-muted`}),(0,L.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:`Activity log`}),u&&u.total>0&&(0,L.jsxs)(`span`,{className:`text-[11px] text-faint`,children:[u.total,` call`,u.total===1?``:`s`,u.failed>0&&(0,L.jsxs)(`span`,{className:`text-danger`,children:[` · `,u.failed,` failed`]})]}),(0,L.jsx)(`span`,{className:`ml-auto text-[11px] text-faint`,children:`what the AI did`})]}),e&&(0,L.jsxs)(`div`,{className:`border-t border-line px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,L.jsx)(`p`,{className:`text-[11px] text-muted`,children:`Every tool call an assistant dispatched to this site, newest first.`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:c,disabled:i,"aria-label":`Refresh activity log`,className:`rounded border border-line p-1.5 text-muted hover:bg-panel disabled:opacity-40`,children:(0,L.jsx)(I,{size:12,className:i?`animate-spin`:``})}),d.length>0&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>o?l():s(!0),onBlur:()=>s(!1),disabled:i,className:`rounded border px-2 py-1 text-[11px] disabled:opacity-40 ${o?`border-danger text-danger`:`border-line text-muted hover:bg-panel`}`,children:o?`Confirm clear`:`Clear`})]})]}),d.length===0?(0,L.jsx)(`p`,{className:`py-4 text-center text-[12px] text-faint`,children:n===null?`Loading…`:`No tool calls recorded yet.`}):(0,L.jsx)(`ul`,{className:`space-y-1`,children:d.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md bg-panel/50 px-2.5 py-1.5`,children:[e.ok?(0,L.jsx)(N,{size:13,className:`mt-0.5 shrink-0 text-success`,"aria-label":`succeeded`}):(0,L.jsx)(re,{size:13,className:`mt-0.5 shrink-0 text-danger`,"aria-label":`failed`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`code`,{className:`text-[12px] font-medium text-ink`,children:e.tool}),e.scope===`read`?(0,L.jsx)(de,{size:11,className:`text-faint`,"aria-label":`read-only call`}):(0,L.jsx)(Pe,{size:11,className:`text-warning`,"aria-label":`write call`})]}),e.args!==``&&(0,L.jsx)(`div`,{className:`truncate text-[11px] text-muted`,children:e.args}),e.error!==``&&(0,L.jsx)(`div`,{className:`text-[11px] text-danger`,children:e.error})]}),(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] tabular-nums text-faint`,children:Gr(e.ts)})]},`${e.ts}-${e.tool}-${t}`))})]})]})}function qr({active:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(!1),p=async()=>{i(`load`),o(null);try{n(await H.request(`/mcp/hub`))}catch(e){o(e instanceof Error?e.message:`Failed to load xSpeed Hub status.`)}finally{i(null),u(!0)}},m=async(e=!1)=>{try{let t=e?{headers:{"X-XSpeed-Reconcile":`1`}}:{};n(await H.request(`/mcp/hub`,t))}catch{}};(0,y.useEffect)(()=>{e&&!l&&r!==`load`&&p()},[e]),(0,y.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e&&l&&m(!0)};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[e,l]);let h=async()=>{i(`token`),o(null);try{n(await H.request(`/mcp/hub/token`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Could not generate a token.`)}finally{i(null)}},g=async()=>{c(!1),i(`disconnect`),o(null);try{n(await H.request(`/mcp/hub/disconnect`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Disconnect failed.`)}finally{i(null)}};if(!l)return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-faint py-6`,children:[(0,L.jsx)(I,{size:13,className:`animate-spin`}),` Loading xSpeed Hub…`]});let _=!!t?.attached,v=(()=>{let e=t?.attach_url;if(!e||typeof window>`u`)return e;try{let t=new URL(e),n=new URL(window.location.href);return n.searchParams.set(`xspeed_connected`,`1`),t.searchParams.set(`return_url`,n.toString()),t.toString()}catch{return e}})(),b=!!t?.site_token;return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(ee,{size:18,className:`text-primary shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`xSpeed Hub`}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Control caching on all your sites from one AI connection.`})]})]}),_&&(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-success shrink-0`,children:[(0,L.jsx)(N,{size:14}),`Connected`]})]}),_&&(0,L.jsxs)(`div`,{className:`rounded-md border border-line bg-success-tint px-3 py-2.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`text-[12px] text-ink-soft`,children:[`This site is managed at xSpeed Hub`,t?.account_email?(0,L.jsxs)(L.Fragment,{children:[` — signed in as `,(0,L.jsx)(`strong`,{children:t.account_email})]}):``,`.`]}),(0,L.jsxs)(`a`,{href:t?.hub_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors shrink-0`,children:[(0,L.jsx)(le,{size:13}),` Go to dashboard`]})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2 text-[12px]`,children:[[`1`,`Connect this site`,`One click — sign in and approve`],[`2`,`Connect AI once`,`Add one connection from your xSpeed Hub dashboard`],[`3`,`Control every site`,`“Purge cache on acme” — done`]].map(([e,t,n])=>(0,L.jsxs)(`div`,{className:`rounded-md border border-line bg-panel px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium text-ink`,children:[(0,L.jsx)(`span`,{className:`inline-flex h-4 w-4 items-center justify-center rounded-full bg-primary text-on-primary text-[10px]`,children:e}),t]}),(0,L.jsx)(`div`,{className:`text-muted mt-0.5`,children:n})]},e))}),a&&(0,L.jsx)(U,{tone:`danger`,title:`xSpeed Hub error`,body:a}),!_&&(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors`,children:[(0,L.jsx)(Qe,{size:13}),` Connect via xSpeed Hub`]}),(0,L.jsx)(`p`,{className:`text-[12px] text-muted`,children:`One click — sign in to your account and approve. No token to copy.`})]}),!_&&(0,L.jsxs)(`div`,{className:`border-t border-line pt-3`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{b||h(),f(e=>!e)},className:`flex items-center gap-1.5 text-[12px] text-muted hover:text-ink`,children:[(0,L.jsx)(Te,{size:12}),`Can't redirect? Add with a token instead`]}),d&&(0,L.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[`Paste this site's URL + token into the`,` `,(0,L.jsxs)(`a`,{href:t?.add_site_url,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline inline-flex items-center gap-0.5`,children:[`Add site form `,(0,L.jsx)(le,{size:11})]}),` `,`on xspeedcache.com.`]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:`Site URL`}),(0,L.jsx)(gn,{content:t?.site_url??``})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:`Token`}),(0,L.jsx)(gn,{content:t?.site_token??``,tone:`blue`})]}),(0,L.jsx)(`p`,{className:`text-[12px] text-muted`,children:`Same token as your MCP connection — treat it like a password.`})]})]}),_&&(0,L.jsx)(`div`,{className:`border-t border-line pt-3`,children:s?(0,L.jsx)(yr,{title:`Disconnect this site from xSpeed Hub?`,body:`This clears the hub link on this site. To fully cut off the hub's access, also Rotate the token above so its stored copy stops working.`,confirmLabel:`Disconnect`,busy:r===`disconnect`,onConfirm:g,onCancel:()=>c(!1)}):(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(!0),disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-danger hover:bg-danger-tint transition-colors disabled:opacity-50`,children:[(0,L.jsx)(Re,{size:13}),` Disconnect from Hub`]})})]})}var Jr=!1;function Yr({module:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(`cli`),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(null),h=async()=>{i(`load`),o(null);try{n(await H.request(`/mcp/connection`))}catch(e){o(e instanceof Error?e.message:`Failed to load MCP status.`)}finally{i(null)}};(0,y.useEffect)(()=>{h()},[]);let g=async()=>{i(`connect`),o(null);try{n(await H.request(`/mcp/connect`,{method:`POST`,body:JSON.stringify({read_only:s})}))}catch(e){o(e instanceof Error?e.message:`Could not connect to xSpeed MCP.`)}finally{i(null)}},_=async()=>{m(null),i(`rotate`),o(null);try{n(await H.request(`/mcp/rotate`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Token rotation failed.`)}finally{i(null)}},v=async()=>{m(null),i(`disconnect`),o(null);try{n(await H.request(`/mcp/disconnect`,{method:`POST`}))}catch(e){o(e instanceof Error?e.message:`Disconnect failed.`)}finally{i(null)}},b=!!t?.connected;return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[b?(0,L.jsx)(N,{size:18,className:`text-success shrink-0`}):(0,L.jsx)(Re,{size:18,className:`text-faint shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-ink`,children:[b?`Connected`:`Not connected`,Jr]}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Control this site's cache from Claude and other MCP-compatible AI agents.`})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:h,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[(0,L.jsx)(I,{size:13,className:r===`load`?`animate-spin`:``}),`Refresh`]}),b?(0,L.jsxs)(L.Fragment,{children:[Jr,(0,L.jsxs)(`button`,{type:`button`,onClick:()=>m(`rotate`),disabled:r!==null||p!==null,title:`Mint a fresh token and invalidate the current one`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-ink-soft hover:bg-panel transition-colors disabled:opacity-50`,children:[r===`rotate`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Ve,{size:13}),`Rotate`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>m(`disconnect`),disabled:r!==null||p!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-line text-danger hover:bg-danger-tint transition-colors disabled:opacity-50`,children:[r===`disconnect`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Re,{size:13}),`Disconnect`]})]}):(0,L.jsxs)(`button`,{type:`button`,onClick:g,disabled:r!==null,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-primary text-on-primary hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r===`connect`?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Qe,{size:13}),`Connect`]})]})]}),Jr]}),p===`rotate`&&(0,L.jsx)(yr,{title:`Rotate the MCP token?`,body:`A fresh token is minted and the current one is invalidated immediately. Any AI agent using the old token stops working until you paste the new one.`,confirmLabel:`Rotate token`,busy:r===`rotate`,onConfirm:_,onCancel:()=>m(null)}),p===`disconnect`&&(0,L.jsx)(yr,{title:`Disconnect MCP?`,body:`This revokes the token and every OAuth grant immediately — any AI agent using this site stops working until you reconnect.`,confirmLabel:`Disconnect`,busy:r===`disconnect`,onConfirm:v,onCancel:()=>m(null)}),a&&(0,L.jsx)(U,{tone:`danger`,title:`MCP error`,body:a}),t&&(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5 space-y-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`Add this MCP server to your AI client`}),(0,L.jsxs)(`div`,{className:`text-[12px] text-muted mt-0.5`,children:[`Pick the format your client uses. The token travels in an`,` `,(0,L.jsx)(`code`,{className:`font-mono text-[11px]`,children:`Authorization`}),` header, so it never lands in a URL or server log.`]})]}),(0,L.jsx)(`div`,{className:`flex items-center gap-1 border-b border-line`,children:[[`cli`,`Claude Code (CLI)`],[`json`,`JSON config`],[`prompt`,`AI prompt`],[`oauth`,`Remote (OAuth)`]].map(([e,t])=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`flex items-center gap-1.5 text-[12px] px-3 py-1.5 -mb-px border-b-2 transition-colors ${l===e?`border-primary text-ink font-medium`:`border-transparent text-muted hover:text-ink`}`,children:t},e))}),!b&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel px-3 py-2 text-[12px] text-muted`,children:[(0,L.jsx)(Qe,{size:14,className:`mt-0.5 shrink-0 text-primary`}),(0,L.jsxs)(`span`,{children:[`Click `,(0,L.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Connect`}),` `,`above to mint this site's token, then copy your connection config here.`]})]}),l===`cli`&&b&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Run this once in your terminal — it registers xSpeed with Claude Code:`}),(0,L.jsx)(gn,{content:t.config.cli,tone:`blue`})]}),l===`json`&&b&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Add this to your client's MCP config (e.g. Claude Desktop's config file):`}),(0,L.jsx)(gn,{content:t.config.json,tone:`blue`})]}),l===`prompt`&&b&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-line bg-warning-tint px-3 py-2 text-[12px] text-warning`,children:[(0,L.jsx)(ot,{size:14,className:`mt-0.5 shrink-0`}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{className:`font-semibold`,children:`Not recommended.`}),` This pastes your token into a chat, so the AI provider may see and store it. Prefer the`,` `,(0,L.jsx)(`strong`,{className:`font-medium`,children:`Claude Code (CLI)`}),`,`,` `,(0,L.jsx)(`strong`,{className:`font-medium`,children:`JSON config`}),`, or`,` `,(0,L.jsx)(`strong`,{className:`font-medium`,children:`Remote (OAuth)`}),` methods, which keep the token out of the conversation.`]})]}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`Paste this to your AI agent so it knows what it's connected to and how to act:`}),(0,L.jsx)(gn,{content:t.ai_prompt})]}),l===`oauth`&&b&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-[12px] text-muted`,children:`For clients that connect by URL only (e.g. claude.ai connectors). Paste just the server URL — no token field:`}),(0,L.jsx)(gn,{content:t.mcp_endpoint,tone:`blue`}),(0,L.jsxs)(`div`,{className:`flex items-start gap-2 text-[12px] text-muted pt-1`,children:[(0,L.jsx)(`span`,{className:`text-primary shrink-0`,children:`•`}),(0,L.jsxs)(`span`,{children:[`No token needed. Your client opens a browser page where you`,` `,(0,L.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`approve access`}),` `,`(you must be signed in here as an administrator). Approval grants the same`,` `,t.read_only?`read-only`:`read & write`,` access as the token above.`]})]})]}),b&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 text-[12px] text-muted pt-1`,children:[(0,L.jsx)(`span`,{className:`text-warning shrink-0`,children:`•`}),(0,L.jsxs)(`span`,{children:[`Treat the token like a password — it lets an AI control this site.`,` `,(0,L.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Rotate`}),` `,`if it may have leaked;`,` `,(0,L.jsx)(`strong`,{className:`font-medium text-ink-soft`,children:`Disconnect`}),` `,`to revoke entirely.`,t.scopes.length>0&&(0,L.jsxs)(L.Fragment,{children:[` Granted scopes: `,t.scopes.join(`, `),`.`]})]})]})]}),b&&t&&t.tools.length>0&&(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),"aria-expanded":d?`true`:`false`,className:`flex w-full items-center gap-2 text-left focus:outline-none`,children:[d?(0,L.jsx)(ne,{size:16,className:`shrink-0 text-muted`}):(0,L.jsx)(A,{size:16,className:`shrink-0 text-muted`}),(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:`Tools your AI agent can call`}),(0,L.jsxs)(`span`,{className:`text-[12px] text-faint`,children:[`(`,t.tools.length,`)`]})]}),d&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`text-[12px] text-muted mt-2`,children:t.read_only?(0,L.jsxs)(L.Fragment,{children:[`This is a `,(0,L.jsx)(`strong`,{className:`font-medium`,children:`read-only`}),` connection, so the`,` `,(0,L.jsx)(`span`,{className:`text-warning`,children:`write`}),` tools below are refused.`]}):(0,L.jsx)(L.Fragment,{children:`Each tool maps to an xSpeed action. Write tools can change this site.`})}),(0,L.jsx)(`ul`,{className:`mt-3 divide-y divide-line`,children:t.tools.map(e=>(0,L.jsxs)(`li`,{className:`flex items-start gap-3 py-2`,children:[(0,L.jsx)(`code`,{className:`font-mono text-[11px] text-ink shrink-0 mt-0.5`,children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 mt-0.5 text-[10px] font-medium px-1.5 py-0.5 rounded ${e.write?`bg-warning-tint text-warning`:`bg-panel text-muted`}`,children:e.write?`write`:`read`}),(0,L.jsx)(`span`,{className:`text-[12px] text-muted`,children:e.description})]},e.name))})]})]}),!b&&t!==null&&(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsx)(`div`,{className:`font-medium text-ink`,children:`What your AI agent can do`}),(0,L.jsxs)(`div`,{className:`text-[12px] text-muted mt-1`,children:[`Once connected, your AI can read cache status & stats, purge the cache, toggle caching on or off, and read or change module settings — all scoped to this site.`,Jr,` `,`Rotate or disconnect any time to revoke access.`]})]}),(0,L.jsx)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:(0,L.jsx)(qr,{active:!0})}),(0,L.jsx)(Kr,{})]})}var Xr=[{key:`gzip`,slug:`gzip`,self:!0},{key:`brotli`,slug:`brotli-compression`,pro:!0}];function Zr({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),{items:o,active:s}=gr(Xr,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(Xr[0].key)},[n,o,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`compression`}),s===`gzip`&&(0,L.jsx)(Ci,{module:e,onSaved:t}),s===`brotli`&&(0,L.jsx)(qn,{demo:`compression-brotli`,children:(0,L.jsx)(W,{slug:`brotli-compression`,getModule:i,onSaved:t})})]})}var Qr=[{key:`minify`,slug:`minify`,self:!0},{key:`critical`,slug:`critical-css`,panel:`CriticalCssPanel`,pro:!0},{key:`unused`,slug:`unused-css`,panel:`UnusedCssPanel`,pro:!0}];function $r({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),{items:o,active:s}=gr(Qr,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(Qr[0].key)},[n,o,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`cssjs`}),s===`minify`&&(0,L.jsx)(Ci,{module:e,onSaved:t}),s===`critical`&&(0,L.jsx)(qn,{demo:`cssjs-critical`,children:(0,L.jsx)(W,{panel:`CriticalCssPanel`,slug:`critical-css`,getModule:i,onSaved:t})}),s===`unused`&&(0,L.jsx)(qn,{demo:`cssjs-unused`,children:(0,L.jsx)(W,{panel:`UnusedCssPanel`,slug:`unused-css`,getModule:i,onSaved:t})})]})}var ei=[{key:`lazy`,slug:`lazy`,self:!0},{key:`images`,slug:`images`,panel:`ImagesPanel`,pro:!0},{key:`smart`,slug:`smart-image`,panel:`SmartImagePanel`,pro:!0}];function ti({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),{items:o,active:s}=gr(ei,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(ei[0].key)},[n,o,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`media`}),s===`lazy`&&(0,L.jsx)(Ci,{module:e,onSaved:t}),s===`images`&&(0,L.jsx)(qn,{demo:`media-formats`,children:(0,L.jsx)(W,{panel:`ImagesPanel`,slug:`images`,getModule:i,onSaved:t})}),s===`smart`&&(0,L.jsx)(qn,{demo:`media-smart`,children:(0,L.jsx)(W,{panel:`SmartImagePanel`,slug:`smart-image`,getModule:i,onSaved:t})})]})}var ni=[{key:`hints`,slug:`resource-hints`,self:!0},{key:`speculation`,slug:`smart-predict`,panel:`SmartPredictPanel`,pro:!0}];function ri({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){let a=Mn(),{items:o,active:s}=gr(ni,{module:e,getModule:i,isPro:a===`pro`||a===`trial`,subtab:n});return(0,y.useEffect)(()=>{n&&!o.some(e=>e.key===n)&&r?.(ni[0].key)},[n,o,r]),(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`resource-hints`}),s===`hints`&&(0,L.jsx)(Ci,{module:e,onSaved:t}),s===`speculation`&&(0,L.jsx)(qn,{demo:`hints-speculation`,children:(0,L.jsx)(W,{panel:`SmartPredictPanel`,slug:`smart-predict`,getModule:i,onSaved:t})})]})}var G=[{key:`coverage`,label:`What to cache`,locked:!0},{key:`beyond`,label:`Feeds & API`,locked:!0},{key:`rules`,label:`Rules & bypass`,locked:!0}],ii=`coverage`,ai=new Set(G.map(e=>e.key));function oi({getModule:e,onSaved:t,subtab:n,onSubtabChange:r}){let i=Mn(),a=i===`pro`||i===`trial`,o=G.map(e=>({...e,locked:e.locked&&!a})),s=n&&ai.has(n)?n:ii;return(0,y.useEffect)(()=>{n&&!ai.has(n)&&r?.(ii)},[n,r]),(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(Dn,{items:o,value:s,onChange:e=>r?.(e),idBase:`cache-extras`}),s===`coverage`&&(a?(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(W,{slug:`cache-404`,getModule:e,onSaved:t}),(0,L.jsx)(W,{slug:`search-cache`,getModule:e,onSaved:t})]}):(0,L.jsx)(Vn,{id:`coverage-what`})),s===`beyond`&&(a?(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(W,{slug:`feed-cache`,getModule:e,onSaved:t}),(0,L.jsx)(W,{panel:`RestCachePanel`,slug:`rest-cache`,getModule:e,onSaved:t})]}):(0,L.jsx)(Vn,{id:`coverage-beyond`})),s===`rules`&&(a?(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(W,{panel:`CustomRulesPanel`,slug:`custom-rules`,getModule:e,onSaved:t}),(0,L.jsx)(W,{panel:`MaintenanceCachePanel`,slug:`maintenance-cache`,getModule:e,onSaved:t})]}):(0,L.jsx)(Vn,{id:`coverage-rules`}))]})}function si({onSaved:e,subtab:t,onSubtabChange:n,getModule:r}){return(0,L.jsx)(oi,{getModule:e=>r?.(e),subtab:t,onSubtabChange:n,onSaved:e})}var ci={HealthPanel:ir,PreloaderHost:vr,DatabaseCleanerPanel:xr,CloudflarePanel:Or,ObjectCachePanel:Mr,MigrationPanel:Ur,SupportPanel:Wr,McpPanel:Yr,CompressionPanel:Zr,CssJsPanel:$r,MediaPanel:ti,ResourceHintsPanel:ri,CacheCoveragePanel:si,ScorePanel:er};function li({module:e}){let t=yt.find(t=>t.slug===e.slug),n=t?.teaser?Ln[t.teaser]:null,r=Pn()===`unlicensed`;if(Bn(e.slug))return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(Vn,{id:e.slug}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted text-center px-4`,children:z(r?`Activating your license unlocks this module + every other locked row in the sidebar. Your current settings stay unchanged.`:`Pro unlocks this module + every other locked row in the sidebar. Your current Free settings stay unchanged.`)})]});let i={card:`border-line bg-primary-tint`,iconWrap:`bg-paper border-line text-primary`,badge:`text-primary bg-paper border-line`,cta:`bg-primary hover:bg-primary-hover text-on-primary`,link:`text-primary`};return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(`div`,{className:`relative overflow-hidden border rounded-card p-6 sm:p-8 ${i.card}`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,L.jsx)(`div`,{className:`shrink-0 w-12 h-12 rounded-full border flex items-center justify-center ${i.iconWrap}`,children:(0,L.jsx)(vt,{name:e.icon,size:22})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-2 mb-1`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border rounded-full px-2 py-0.5 ${i.badge}`,children:[r?(0,L.jsx)(Te,{size:10}):(0,L.jsx)(je,{size:10}),(0,L.jsx)(`span`,{children:z(r?`Pro — license needed`:`Pro feature`)})]})}),(0,L.jsx)(`h2`,{className:`text-[18px] font-semibold text-ink`,children:e.label}),e.description&&(0,L.jsx)(`p`,{className:`text-[13px] text-ink-soft mt-2 leading-relaxed`,children:e.description}),r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`text-[13px] text-ink-soft mt-3 leading-relaxed`,children:z(`xSpeed Pro is installed — activate your license to unlock this module and every other Pro feature.`)}),(0,L.jsxs)(`a`,{href:In,className:`inline-flex items-center gap-1.5 mt-4 px-4 py-2 rounded-md text-[13px] font-medium transition-colors ${i.cta}`,children:[z(`Activate your license`),(0,L.jsx)(C,{size:13})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 mt-4 px-4 py-2 rounded-md text-[13px] font-medium transition-colors ${i.cta}`,children:[z(`Upgrade to Pro`),(0,L.jsx)(C,{size:13})]}),(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 ml-3 text-[12px] hover:underline ${i.link}`,children:[z(`Compare plans`),(0,L.jsx)(le,{size:11})]})]})]})]})}),n&&(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card p-4 sm:p-5`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted font-medium mb-2`,children:z(`What this adds`)}),(0,L.jsx)(`p`,{className:`text-[13px] text-ink-soft leading-relaxed`,children:n.body})]}),(0,L.jsx)(`div`,{className:`text-[12px] text-muted text-center px-4`,children:z(r?`Activating your license unlocks this module + every other locked row in the sidebar. Your current settings stay unchanged.`:`Pro unlocks this module + every other locked row in the sidebar. Your current Free settings stay unchanged.`)})]})}var ui=null,di=new Set;function fi(){for(let e of di)e(ui)}function pi(e){ui=e,fi()}function mi(){return ui}function hi(e,t){e&&t&&(ui?.module!==e||ui?.field!==t)||(ui=null,fi())}function gi(e){return di.add(e),()=>{di.delete(e)}}function _i(e,t){switch(t){case`bool`:case`boolean`:return e===`1`||e===`true`?!0:e===`0`||e===`false`?!1:void 0;case`int`:return/^-?\d+$/.test(e.trim())?parseInt(e,10):void 0;case`list`:return e.split(`,`).map(e=>e.trim()).filter(Boolean);default:return e}}function vi(e,t){let n=_i(e,t);return n===void 0?e:typeof n==`boolean`?n?`On`:`Off`:Array.isArray(n)?n.join(`, `):String(n)}function yi(e,t,n,r,i){let[a,o]=(0,y.useState)(()=>mi());if((0,y.useEffect)(()=>gi(o),[]),!a||a.module!==e||a.field!==t)return null;let s=_i(a.value,n.type);if(s===void 0||!bi(s,n)||JSON.stringify(s)===JSON.stringify(r))return null;let c=vi(a.value,n.type);return c.trim()===``?null:{display:c,value:s,apply:()=>{i(s),hi(e,t)},dismiss:()=>hi(e,t)}}function bi(e,t){if(t.type===`int`)return!(typeof e!=`number`||t.min!==void 0&&et.max);if(t.type===`enum`){let n=Array.isArray(t.options)?t.options:[];return n.length>0&&n.includes(String(e))}if(t.type===`list`)return Array.isArray(e)&&e.length>0;if(t.type===`url`){let t=String(e??``).trim();return t!==``&&/^https?:\/\//i.test(t)}return!0}function xi({strip:e}){return(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 rounded border border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 px-2.5 py-1.5`,children:[(0,L.jsx)(ke,{size:13,className:`text-amber-600 dark:text-amber-400 shrink-0`}),(0,L.jsxs)(`span`,{className:`text-[12px] text-amber-900 dark:text-amber-200`,children:[z(`Recommended:`),` `,(0,L.jsx)(`span`,{className:`font-medium`,children:e.display})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:e.apply,className:`ml-auto inline-flex items-center gap-1 text-[12px] px-2 py-1 rounded bg-accent text-white hover:bg-primary-hover transition-colors`,children:[(0,L.jsx)(O,{size:12}),z(`Apply`)]}),(0,L.jsx)(`button`,{type:`button`,onClick:e.dismiss,className:`text-[12px] text-amber-800 dark:text-amber-300 hover:underline`,children:z(`Dismiss`)})]})}function Si({module:e,onSaved:t,subtab:n,onSubtabChange:r,getModule:i}){if(It(),e.locked)return(0,L.jsx)(li,{module:e});if(e.custom_panel){let a={onSaved:t,subtab:n,onSubtabChange:r,getModule:i},o=ci[e.custom_panel];if(o)return(0,L.jsx)(o,{module:e,...a});let s=Pt(e.custom_panel);if(s)return(0,L.jsx)(s,{module:e,...a})}return(0,L.jsx)(Ci,{module:e,onSaved:t})}function Ci({module:e,onSaved:t}){let[n,r]=(0,y.useState)(e.settings),[i,a]=(0,y.useState)(`idle`),[o,s]=(0,y.useState)(null),c=(0,y.useRef)(!0),l=(0,y.useRef)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(JSON.stringify(e.settings)),f=(0,y.useRef)(`idle`);(0,y.useEffect)(()=>{f.current=i},[i]);let p=(0,y.useRef)(n);(0,y.useEffect)(()=>{p.current=n},[n]),(0,y.useEffect)(()=>{r(e.settings),d.current=JSON.stringify(e.settings),c.current=!0,a(`idle`),s(null)},[e.slug]),(0,y.useEffect)(()=>{if(c.current){c.current=!1;return}if(JSON.stringify(n)!==d.current)return l.current&&window.clearTimeout(l.current),l.current=window.setTimeout(async()=>{f.current!==`saved`&&a(`saving`),s(null);let i=n;try{let n=await H.updateModuleSettings(e.slug,i),{next:o,dirty:s}=cr(i,n,p.current);r(o),d.current=s?``:JSON.stringify(o),a(`saved`),u.current&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(`idle`),1500),t?.(n)}catch(e){s(e instanceof Error?e.message:`Save failed`),a(`idle`)}},600),()=>{l.current&&window.clearTimeout(l.current)}},[n,e.slug]);let m=Dr(e.schema,n),h=(e,t)=>r(n=>({...n,[e]:t})),g=e.notices??[];return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(ar,{state:i}),g.map((e,t)=>(0,L.jsx)(U,{tone:e.tone,title:e.title,body:e.body,snippet:e.snippet,action:e.action},t)),(0,L.jsx)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:m.map(([t,r],i)=>(0,L.jsx)(wi,{moduleSlug:e.slug,fieldKey:t,spec:r,value:n[t],onChange:e=>h(t,e),first:i===0},t))}),o&&(0,L.jsx)(`div`,{className:`text-[12px] text-danger`,children:o})]})}function wi({moduleSlug:e,fieldKey:t,spec:n,value:r,onChange:i,first:a}){let o=n.label??Ei(t),s=`${e}:${t}`,c=yi(e,t,n,r,i),l=n.description,u=n.type===`int`&&(n.min!==void 0||n.max!==void 0)?`Range: ${n.min??`-∞`} – ${n.max??`∞`}`:null,d=n.type===`list`,f=a?``:`border-t border-line`;return d?(0,L.jsxs)(`div`,{"data-field-anchor":s,className:`xspeed-field px-4 sm:px-5 py-4 ${f}`,children:[(0,L.jsxs)(`div`,{className:`mb-1.5`,children:[(0,L.jsxs)(`div`,{className:`font-medium text-ink inline-flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{children:o}),n.info&&(0,L.jsx)(pn,{title:n.info_title,body:n.info})]}),l&&(0,L.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:l})]}),Ti(n,r,i,o),c&&(0,L.jsx)(xi,{strip:c})]}):(0,L.jsxs)(`div`,{"data-field-anchor":s,className:`xspeed-field px-4 sm:px-5 py-4 ${f}`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 sm:gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 max-w-[70%] pr-2`,children:[(0,L.jsxs)(`div`,{className:`font-medium text-ink inline-flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{children:o}),n.info&&(0,L.jsx)(pn,{title:n.info_title,body:n.info})]}),l&&(0,L.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:l}),!l&&u&&(0,L.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:u})]}),(0,L.jsx)(`div`,{className:`shrink-0`,children:Ti(n,r,i,o)})]}),c&&(0,L.jsx)(xi,{strip:c})]})}function Ti(e,t,n,r){switch(e.type){case`bool`:return(0,L.jsx)(on,{checked:!!t,onChange:e=>n(e),label:r});case`int`:return(0,L.jsx)(`input`,{type:`number`,value:t==null?``:Number(t),min:e.min,max:e.max,onChange:e=>n(Number(e.target.value)),className:`w-24 text-right rounded-control border border-line bg-paper px-2.5 py-1.5 text-[13px] text-ink focus:outline-none focus:ring-2 focus:ring-primary`,"aria-label":r});case`enum`:return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e.options??[]).map(r=>{let i=t===r,a=e.option_labels?.[r]??Ei(r);return(0,L.jsx)(`button`,{type:`button`,onClick:()=>n(r),className:`text-[12px] px-2.5 py-1 rounded border transition-colors ${i?`bg-primary border-primary text-on-primary`:`border-line text-ink-soft hover:bg-panel`}`,children:a},r)})});case`string`:case`url`:return(0,L.jsx)(`input`,{type:e.type===`url`?`url`:`text`,value:t==null?``:String(t),onChange:e=>n(e.target.value),className:`w-56 rounded-control border border-line bg-paper px-2.5 py-1.5 text-[13px] text-ink focus:outline-none focus:ring-2 focus:ring-primary`,"aria-label":r});case`media`:return(0,L.jsx)(fn,{value:t==null?``:String(t),onChange:e=>n(e),label:r});case`list`:return(0,L.jsx)(`textarea`,{value:Array.isArray(t)?t.map(String).join(` `):``,rows:5,onChange:e=>{let t=e.target.value.split(` `).map(e=>e.trim()).filter(Boolean);n(Array.from(new Set(t)))},className:`w-full rounded-control border border-line bg-paper px-3 py-2 font-mono text-[12px] text-ink focus:outline-none focus:ring-2 focus:ring-primary`,"aria-label":r});default:return null}}function Ei(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Di({probe:e,onOpenHealth:t}){let n=!!e&&!e.active&&!e.pending&&!e.inconclusive,r=e?.snippet?`xspeed:rewrite_alert:${Oi(e.snippet)}`:`xspeed:rewrite_alert:apache`,[i,a]=(0,y.useState)(!1);if((0,y.useEffect)(()=>{if(n)try{a(window.localStorage.getItem(r)===`1`)}catch{a(!1)}},[n,r]),!n||i)return null;let o=()=>{try{window.localStorage.setItem(r,`1`)}catch{}a(!0)},s=e.topology??(e.server_type===`nginx`?`nginx-host`:`htaccess`),c=s===`nginx-container`&&e.behind_proxy===!0,l,u;if(c)l=`Static rewrite may not be available on this host`,u=`Your cache still works on every request — xSpeed's PHP drop-in is serving cached HTML, so nothing is broken. But this site sits behind a reverse proxy or CDN, which usually means a managed/containerized host where the nginx that serves requests isn't one you can edit. The extra-fast server-level rewrite (5–15ms static hits) needs that nginx, so it likely can't be enabled here — and that's also why the cache HIT log stays empty (nginx never serves the static file, so there's nothing to log). If you DO control the request-terminating nginx, use the snippet in the "Server config" panel below.`;else switch(s){case`nginx-host`:l=`nginx detected — configure for max cache speed`,u=`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. To shave additional latency, copy the snippet from the "Server config" panel below into your nginx vhost (typically /etc/nginx/sites-enabled/) and reload nginx so cached pages skip PHP entirely.`;break;case`nginx-container`:l=`Containerized nginx detected — paste into your container config`,u=`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. For the full server-level rewrite, copy the snippet from the "Server config" panel below into your container's nginx config (typically docker/nginx.conf next to your docker-compose.yml). The host nginx in front of your container only proxies traffic; pasting there has no effect.`;break;default:l=`Server config missing — cache running on PHP fallback`,u=`Your cache works on every request — xSpeed's PHP drop-in is serving cached HTML. To engage the faster server-level rewrite, toggle Cache off and on to reinstall the .htaccess block, and confirm AllowOverride is enabled for your site.`}return(0,L.jsxs)(`div`,{className:`border border-amber-300 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/30 rounded-lg p-4 sm:p-5 relative`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Dismiss banner`,className:`absolute top-2 right-2 p-1 rounded text-amber-700/70 hover:text-amber-900 dark:text-amber-300/70 dark:hover:text-amber-100 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:(0,L.jsx)(ft,{size:14})}),(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-6`,children:[(0,L.jsx)(pt,{size:16,className:`shrink-0 mt-0.5 text-amber-600 dark:text-amber-400`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`font-medium text-amber-900 dark:text-amber-100 text-[13px]`,children:l}),(0,L.jsx)(`p`,{className:`text-[12px] text-amber-800/90 dark:text-amber-200/80 mt-1`,children:u}),(0,L.jsx)(`div`,{className:`mt-3 flex items-center gap-3`,children:(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300`,children:`View in Health →`})})]})]})]})}function Oi(e){let t=5381;for(let n=0;n>>0).toString(36)}function ki({mobile:e,onOpenCacheSettings:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null);if(!(e&&(e.blocking||e.needs_review))||n)return null;let c=!e.blocking&&e.needs_review;return(0,L.jsxs)(`div`,{className:`border border-amber-300 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/30 rounded-lg p-4 sm:p-5 relative`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:async()=>{r(!0);try{await H.dismissMobileReview()}catch{}},"aria-label":`Dismiss banner`,className:`absolute top-2 right-2 p-1 rounded text-amber-700/70 hover:text-amber-900 dark:text-amber-300/70 dark:hover:text-amber-100 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:(0,L.jsx)(ft,{size:14})}),(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-6`,children:[(0,L.jsx)(Ze,{size:16,className:`shrink-0 mt-0.5 text-amber-600 dark:text-amber-400`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`font-medium text-amber-900 dark:text-amber-100 text-[13px]`,children:c?`Separate Mobile Cache was left off after import`:`Separate Mobile Cache is disabling faster static serving`}),(0,L.jsx)(`p`,{className:`text-[12px] text-amber-800/90 dark:text-amber-200/80 mt-1`,children:c?(0,L.jsxs)(L.Fragment,{children:[`Your previous plugin had Separate Mobile Cache on, but xSpeed kept it `,(0,L.jsx)(`strong`,{children:`off`}),` so it can use the device-blind server-level rewrite (5–15ms static hits) instead of the slower PHP path (~85ms). Most sites serve the same HTML to every device and don’t need it. Only turn it on if your site serves device-specific pages — not sure? Check whether your desktop and mobile pages actually differ.`]}):(0,L.jsx)(L.Fragment,{children:`Separate Mobile Cache is on, so xSpeed can’t use the device-blind server-level rewrite (5–15ms static hits) and falls back to the slower PHP path (~85ms). If your site serves the same HTML to every device, turn it off for much faster cache hits. Not sure? Check whether your desktop and mobile pages actually differ.`})}),o&&o.checked&&(0,L.jsx)(`div`,{className:`mt-2.5 text-[12px] rounded-md px-2.5 py-2 `+(o.identical?`bg-emerald-100/70 dark:bg-emerald-950/40 text-emerald-900 dark:text-emerald-200`:`bg-amber-100/70 dark:bg-amber-900/40 text-amber-900 dark:text-amber-100`),children:o.identical?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(O,{size:13,className:`shrink-0`}),c?`Desktop and mobile HTML are identical — leaving Separate Mobile Cache off is correct; nothing to change.`:`Desktop and mobile HTML are identical — you can safely turn Separate Mobile Cache off to regain the fast static path.`]}):(0,L.jsxs)(L.Fragment,{children:[`Desktop and mobile HTML differ`,o.desktop_bytes&&o.mobile_bytes?` (${o.desktop_bytes.toLocaleString()} vs ${o.mobile_bytes.toLocaleString()} bytes)`:``,` `,`— your site serves device-specific pages, so`,` `,c?`you should turn Separate Mobile Cache on.`:`keeping Separate Mobile Cache on is correct.`]})}),o&&!o.checked&&(0,L.jsxs)(`div`,{className:`mt-2.5 text-[12px] text-amber-800/80 dark:text-amber-200/70`,children:[`Couldn’t complete the check`,o.reason?` (${o.reason})`:``,`. Try again shortly.`]}),(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{a(!0);try{s(await H.mobileEqualityProbe())}catch{s({identical:!1,checked:!1,reason:`probe failed`})}finally{a(!1)}},disabled:i,className:`inline-flex items-center gap-1.5 text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300 disabled:opacity-60 disabled:no-underline`,children:[i&&(0,L.jsx)(Ae,{size:12,className:`animate-spin`}),i?`Checking…`:`Check now`]}),(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`text-[12px] font-medium text-amber-900 dark:text-amber-100 underline underline-offset-2 hover:text-amber-700 dark:hover:text-amber-300`,children:`Open Cache settings →`})]})]})]})]})}var Ai=`xspeed:nginx_server_block:expanded`,ji=`cache:nginx_snippet`;function Mi({snippet:e,topology:t,focus:n}){let[r,i]=(0,y.useState)(()=>{try{return window.localStorage.getItem(Ai)===`1`}catch{return!1}});(0,y.useEffect)(()=>{n===`cache:nginx_snippet`&&i(!0)},[n]);let a=()=>{i(e=>{let t=!e;try{window.localStorage.setItem(Ai,t?`1`:`0`)}catch{}return t})};if(!e)return null;let o=t===`nginx-container`?`your container's nginx config (typically docker/nginx.conf next to your docker-compose.yml)`:`your nginx vhost (typically /etc/nginx/sites-enabled/)`,s=e.split(` `).length;return(0,L.jsxs)(`section`,{"data-field-anchor":ji,className:`xspeed-field border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 p-4 sm:p-5`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:a,"aria-expanded":r?`true`:`false`,"aria-label":r?`Collapse server config`:`Expand server config`,className:`shrink-0 mt-0.5 text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors focus:outline-none`,children:r?(0,L.jsx)(ne,{size:16}):(0,L.jsx)(A,{size:16})}),(0,L.jsx)(Ke,{size:16,className:`shrink-0 mt-0.5 text-neutral-500 dark:text-neutral-400`}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5 text-[13px] font-semibold text-neutral-900 dark:text-neutral-50`,children:[(0,L.jsxs)(`span`,{children:[`Server config `,(0,L.jsxs)(`span`,{className:`text-neutral-400 dark:text-neutral-500 font-normal`,children:[`· `,s,` lines`]})]}),(0,L.jsx)(pn,{title:`Good to know`,body:`You added this snippet to your nginx config yourself, so it's yours to manage — xSpeed never touches it. If you ever need to uninstall xSpeed, just remove this snippet from your nginx config first to keep everything tidy and your server running happily.`})]}),(0,L.jsxs)(`p`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 mt-0.5`,children:[`Paste this once into `,o,`, above the `,(0,L.jsx)(`code`,{className:`text-[11px]`,children:`location /`}),` block, then reload nginx.`]})]})]}),r&&(0,L.jsx)(`div`,{className:`px-4 pb-4 sm:px-5 sm:pb-5`,children:(0,L.jsx)(gn,{content:e,tone:`neutral`})})]})}function Ni({label:e,value:t,icon:n,onClick:r,expanded:i,hint:a}){let o=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:e}),r?(0,L.jsx)(ne,{size:14,className:`text-neutral-400 dark:text-neutral-500 transition-transform ${i?`rotate-180`:``}`}):n&&(0,L.jsx)(n,{size:14,className:`text-neutral-400 dark:text-neutral-500`})]}),(0,L.jsx)(`div`,{className:`text-[22px] font-semibold text-neutral-900 dark:text-neutral-50 leading-none`,children:t})]}),s=`border bg-white dark:bg-neutral-900 rounded-lg p-5 text-left w-full transition-colors`;return r?(0,L.jsx)(`button`,{type:`button`,onClick:r,"aria-expanded":i??!1,"aria-label":a?`${e} — ${a}`:e,className:`${s} cursor-pointer hover:border-neutral-300 dark:hover:border-neutral-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${i?`border-accent dark:border-accent`:`border-neutral-200 dark:border-neutral-800`}`,children:o}):(0,L.jsx)(`div`,{className:`${s} border-neutral-200 dark:border-neutral-800`,children:o})}function Pi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function Fi(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h`:`${Math.floor(e/86400)}d`}function Ii({title:e,busy:t,onRefresh:n,children:r}){return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,L.jsx)(`div`,{className:`text-[12px] font-medium text-neutral-900 dark:text-neutral-50`,children:e}),(0,L.jsx)(`button`,{type:`button`,onClick:n,disabled:t,"aria-label":z(`Refresh`),className:`text-neutral-400 dark:text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300 disabled:opacity-40`,children:(0,L.jsx)(I,{size:13,className:t?`animate-spin`:``})})]}),r]})}function Li({text:e}){return(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 py-2`,children:e})}function Ri(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async(e=!1)=>{r(!0);try{t(await H.request(`/cache/inventory?limit=50${e?`&fresh=1`:``}`))}catch{t({entries:[],total:0,capped:!1})}finally{r(!1)}};return(0,y.useEffect)(()=>{i()},[]),(0,L.jsx)(Ii,{title:z(`Cached pages`),busy:n,onRefresh:()=>void i(!0),children:e?e.entries.length===0?(0,L.jsx)(Li,{text:z(`Nothing cached yet. Visit a page as a logged-out visitor to warm the cache.`)}):(0,L.jsxs)(L.Fragment,{children:[e.capped&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 mb-3 text-[11px] text-amber-700 dark:text-amber-400`,children:[(0,L.jsx)(ot,{size:12,className:`mt-0.5 shrink-0`}),(0,L.jsx)(`span`,{children:z(`This cache is large enough that the scan stopped early — the list below is a recent sample, not every page.`)})]}),(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400`,children:[(0,L.jsx)(`th`,{className:`text-left font-medium pb-2`,children:z(`Page`)}),(0,L.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:z(`Size`)}),(0,L.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:z(`Age`)}),(0,L.jsx)(`th`,{className:`text-right font-medium pb-2 whitespace-nowrap`,children:z(`Stored`)})]})}),(0,L.jsx)(`tbody`,{children:e.entries.map(e=>(0,L.jsxs)(`tr`,{className:`border-t border-neutral-100 dark:border-neutral-800`,children:[(0,L.jsx)(`td`,{className:`py-1.5 pr-3 max-w-0`,children:e.url?(0,L.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-neutral-800 dark:text-neutral-200 hover:underline inline-flex items-center gap-1 truncate max-w-full`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.url}),(0,L.jsx)(le,{size:10,className:`shrink-0 opacity-60`})]}):(0,L.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400 font-mono text-[11px]`,title:e.key,children:z(`Address not recorded`)})}),(0,L.jsx)(`td`,{className:`py-1.5 text-right tabular-nums text-neutral-600 dark:text-neutral-400 whitespace-nowrap`,children:Pi(e.bytes)}),(0,L.jsx)(`td`,{className:`py-1.5 pl-3 text-right tabular-nums text-neutral-600 dark:text-neutral-400 whitespace-nowrap`,children:Fi(e.age)}),(0,L.jsx)(`td`,{className:`py-1.5 pl-3 text-right text-[11px] text-neutral-500 dark:text-neutral-400 whitespace-nowrap`,children:e.stored_in.join(` + `)})]},e.url??e.key))})]})}),(0,L.jsxs)(`div`,{className:`mt-2 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[z(`Showing`),` `,e.entries.length,` `,z(`of`),` `,e.total]})]}):(0,L.jsx)(Li,{text:z(`Loading…`)})})}function zi(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async()=>{r(!0);try{t(await H.request(`/cache/size`))}catch{t(null)}finally{r(!1)}};(0,y.useEffect)(()=>{i()},[]);let a=e?.buckets.filter(e=>e.files>0)??[],o=a.reduce((e,t)=>Math.max(e,t.bytes),0);return(0,L.jsx)(Ii,{title:z(`Where the cache size goes`),busy:n,onRefresh:()=>void i(),children:e?a.length===0?(0,L.jsx)(Li,{text:z(`Nothing on disk yet.`)}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`space-y-2`,children:a.map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between text-[12px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-700 dark:text-neutral-300`,children:e.label}),(0,L.jsxs)(`span`,{className:`tabular-nums text-neutral-600 dark:text-neutral-400`,children:[Pi(e.bytes),(0,L.jsxs)(`span`,{className:`text-neutral-400 dark:text-neutral-500`,children:[` · `,e.files]})]})]}),(0,L.jsx)(`div`,{className:`mt-1 h-1.5 rounded-full bg-neutral-100 dark:bg-neutral-800 overflow-hidden`,children:(0,L.jsx)(`div`,{className:`h-full rounded-full bg-accent`,style:{width:o>0?`${Math.max(2,e.bytes/o*100)}%`:`0%`}})})]},e.key))}),e.compressed_bytes>0&&(0,L.jsxs)(`div`,{className:`mt-3 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[z(`Precompressed copies on disk:`),` `,Pi(e.compressed_bytes),`.`,` `,z(`Pages without one are compressed by the server when requested.`)]})]}):(0,L.jsx)(Li,{text:z(`Loading…`)})})}function Bi(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),i=async()=>{r(!0);try{t(await H.request(`/cache/purge-log?limit=25`))}catch{t({events:[],last_purge:0})}finally{r(!1)}};(0,y.useEffect)(()=>{i()},[]);let a=Math.floor(Date.now()/1e3);return(0,L.jsx)(Ii,{title:z(`Purge history`),busy:n,onRefresh:()=>void i(),children:e?e.events.length===0?(0,L.jsx)(Li,{text:z(`No purges recorded yet.`)}):(0,L.jsx)(`ul`,{className:`space-y-1.5`,children:e.events.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-baseline gap-3 text-[12px] border-t border-neutral-100 dark:border-neutral-800 first:border-t-0 pt-1.5 first:pt-0`,children:[(0,L.jsx)(`span`,{className:`tabular-nums text-[11px] text-neutral-500 dark:text-neutral-400 w-12 shrink-0`,children:Fi(Math.max(0,a-e.ts))}),(0,L.jsx)(`span`,{className:`text-neutral-700 dark:text-neutral-300`,children:e.message})]},`${e.ts}-${t}`))}):(0,L.jsx)(Li,{text:z(`Loading…`)})})}function Vi({which:e}){return e===`pages`?(0,L.jsx)(Ri,{}):e===`size`?(0,L.jsx)(zi,{}):e===`purge`?(0,L.jsx)(Bi,{}):null}function Hi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function K(e){return(e.hits_24h??0)+(e.misses_24h??0)===0?`—`:`${Math.round((e.hit_ratio??0)*100)}%`}function q(e){if(!e)return`Never`;let t=Math.floor(Date.now()/1e3)-e;return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Ui({settings:e,stats:t,onToggle:n,onPurge:r}){let[i,a]=(0,y.useState)(null),o=e=>a(t=>t===e?null:e);return(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{"data-field-anchor":`cache:cache_enabled`,className:`xspeed-field border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${e.cache_enabled?`bg-emerald-500`:`bg-neutral-300 dark:bg-neutral-600`}`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:`Enable Cache`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:e.cache_enabled?`Active — serving cached HTML`:`Inactive`})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-3 shrink-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-700 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors`,children:[(0,L.jsx)(it,{size:13}),`Purge`]}),(0,L.jsx)(on,{checked:e.cache_enabled,onChange:n,size:`lg`,label:`Enable Cache`})]})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4`,children:[(0,L.jsx)(Ni,{label:`Cached Pages`,value:String(t.cached_pages),onClick:()=>o(`pages`),expanded:i===`pages`,hint:z(`show which pages are cached`)}),(0,L.jsx)(Ni,{label:`Cache Size`,value:Hi(t.cache_size),onClick:()=>o(`size`),expanded:i===`size`,hint:z(`show what is taking the space`)}),(0,L.jsx)(Ni,{label:`Last Purge`,value:q(t.last_purge),onClick:()=>o(`purge`),expanded:i===`purge`,hint:z(`show what cleared the cache and why`)}),(0,L.jsx)(Ni,{label:`Hit Ratio · 24h`,value:K(t),onClick:()=>{document.querySelector(`[data-xspeed-anchor="hit-trend"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})},hint:z(`jump to the hit-ratio trend`)})]}),i&&(0,L.jsx)(Vi,{which:i})]})}function Wi(e){let t=e/1e3;return t<60?`${t.toFixed(1)}s`:t<3600?`${(t/60).toFixed(1)} ${z(`min`)}`:`${(t/3600).toFixed(1)} ${z(`hrs`)}`}function Gi({stats:e}){let[t,n]=(0,y.useState)(void 0),[r,i]=(0,y.useState)([]);if((0,y.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([H.request(`/cache/benchmark/history`),H.request(`/stats/hit-daily?days=30`)]),r=e.runs.filter(e=>e.cache_enabled&&e.savings_ms!=null&&e.savings_ms>0);n(r.length?r[r.length-1].savings_ms:null),i(t.days)}catch{n(null)}})()},[]),t===void 0)return null;let a=e.hits_24h??0;if(t===null||a===0)return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex items-center gap-3`,children:[(0,L.jsx)(rt,{size:18,className:`text-neutral-400 dark:text-neutral-500 shrink-0`}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:z(t===null?`Run the benchmark once and this card shows how much combined wait time the cache saves your visitors.`:`Serving cached pages… impact numbers appear once today’s hits accumulate.`)})]});let o=e=>r.slice(-e).reduce((e,t)=>e+(t.hits??0),0),s=[{label:z(`last 24h`),hits:a},{label:z(`7 days`),hits:o(7)},{label:z(`30 days`),hits:o(30)}];return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,L.jsx)(pt,{size:16,className:`text-accent shrink-0`}),(0,L.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider font-medium text-neutral-500 dark:text-neutral-400`,children:z(`Real visitor impact`)})]}),(0,L.jsxs)(`div`,{className:`text-neutral-900 dark:text-neutral-50`,children:[z(`xSpeed served`),` `,(0,L.jsx)(`span`,{className:`font-semibold tabular-nums`,children:a.toLocaleString()}),` `,z(`cached pages in 24h — saving your visitors`),` `,(0,L.jsx)(`span`,{className:`font-semibold text-emerald-600 dark:text-emerald-400 tabular-nums`,children:Wi(a*t)}),` `,z(`of combined wait time`),` `,(0,L.jsxs)(`span`,{className:`text-neutral-500 dark:text-neutral-400 text-[13px]`,children:[`(`,Math.round(t),`ms `,z(`faster per page`),`)`]})]}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-1 mt-2 text-[12px] text-neutral-500 dark:text-neutral-400`,children:s.slice(1).map(e=>e.hits>0?(0,L.jsxs)(`span`,{children:[e.label,`:`,` `,(0,L.jsx)(`span`,{className:`tabular-nums text-neutral-700 dark:text-neutral-300 font-medium`,children:Wi(e.hits*t)}),` `,z(`saved across`),` `,e.hits.toLocaleString(),` `,z(`hits`)]},e.label):null)})]})}function Ki(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=(0,y.useCallback)(async()=>{try{t((await H.request(`/recommendations`)).recommendations)}catch{t([])}},[]);(0,y.useEffect)(()=>{c()},[c]);let l=e?.[0];return e===null?null:l?(0,L.jsx)(`div`,{className:`border border-amber-200 dark:border-amber-900/60 bg-amber-50 dark:bg-amber-950/40 rounded-lg p-4 sm:p-5`,children:(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4`,children:[(0,L.jsx)(ke,{size:18,className:`text-amber-600 dark:text-amber-300 shrink-0 hidden sm:block`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`text-[11px] uppercase tracking-wider font-medium text-amber-700 dark:text-amber-300 mb-0.5`,children:[z(`Next best action`),e.length>1&&(0,L.jsxs)(`span`,{className:`normal-case tracking-normal font-normal`,children:[` `,`· `,e.length-1,` `,z(`more after this`)]})]}),(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:l.title}),(0,L.jsx)(`div`,{className:`text-[12px] text-amber-900/80 dark:text-amber-200/80 mt-0.5`,children:l.detail}),o&&(0,L.jsx)(`div`,{className:`text-[12px] text-red-700 dark:text-red-300 mt-1`,children:o})]}),(0,L.jsx)(`div`,{className:`shrink-0`,children:l.action.type===`apply`?(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{if(l){r(!0),s(null);try{let e=await H.request(`/recommendations/apply`,{method:`POST`,body:JSON.stringify({id:l.id})});a(!0),setTimeout(()=>{a(!1),t(e.recommendations)},1600)}catch(e){s(e instanceof Error?e.message:z(`Could not apply the fix.`))}finally{r(!1)}}},disabled:n||i,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-60`,children:[n?(0,L.jsx)(I,{size:13,className:`animate-spin`}):i?(0,L.jsx)(O,{size:13}):null,i?z(`Applied`):l.action.label]}):(0,L.jsxs)(`a`,{href:l.action.module?sn({module:l.action.module,subtab:l.action.subtab,focus:l.action.focus,suggest:l.action.suggest}):`#`,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 text-amber-800 dark:text-amber-200 hover:bg-amber-100 dark:hover:bg-amber-900/40 transition-colors`,children:[l.action.label,` `,(0,L.jsx)(C,{size:13})]})})]})}):(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 flex items-center gap-3`,children:[(0,L.jsx)(N,{size:18,className:`text-emerald-500 shrink-0`}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:z(`No recommendations right now`)}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:z(`Every deterministic check passes — your configuration looks healthy.`)})]})]})}function qi({compact:e=!1}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null);return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 mb-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(pt,{size:18,className:`text-accent shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:z(`Cache impact benchmark`)}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:z(`Compare your homepage with and without cache.`)})]})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{i(!0),o(null);try{n(await H.request(`/cache/benchmark`))}catch(e){o(e instanceof Error?e.message:z(`Benchmark failed`))}finally{i(!1)}},disabled:r,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded bg-accent text-white hover:bg-primary-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,children:[r?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(pt,{size:13}),z(t?`Re-run`:`Run benchmark`)]})]}),a&&(0,L.jsxs)(`div`,{className:`text-[13px] text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900/60 rounded p-2.5 flex items-start gap-2 mb-3`,children:[(0,L.jsx)(M,{size:14,className:`shrink-0 mt-0.5`}),a]}),t&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,L.jsx)(Ji,{label:z(`Without cache`),tone:`warn`,ms:t.without_cache.time_ms,bytes:t.without_cache.bytes}),(0,L.jsx)(Ji,{label:z(`With cache`),tone:`ok`,ms:t.with_cache.time_ms,bytes:t.with_cache.bytes})]}),t.savings_pct!==null&&t.savings_ms!==null&&(0,L.jsx)(`div`,{className:`mt-3 text-center text-[13px]`,children:t.savings_pct>5?(0,L.jsxs)(`span`,{className:`text-emerald-700 dark:text-emerald-300 font-medium`,children:[`⚡ `,z(`Cache is`),` `,(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[t.savings_pct.toFixed(0),`%`]}),` `,z(`faster`),` `,`(`,t.savings_ms.toFixed(0),` ms `,z(`saved per request`),`)`]}):(0,L.jsx)(`span`,{className:`text-neutral-500 dark:text-neutral-400`,children:z(`Negligible difference — page is cheap to render or cache is cold.`)})}),!t.cache_enabled&&(0,L.jsx)(`div`,{className:`mt-3 text-[12px] text-amber-700 dark:text-amber-300 text-center`,children:z(`Cache is disabled — both runs hit the same uncached path. Enable Cache to see a real difference.`)}),!e&&(0,L.jsx)(`div`,{className:`mt-3 text-[11px] text-neutral-400 text-center font-mono truncate`,children:t.url})]}),!t&&!r&&!a&&(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400 text-center py-3`,children:z(`Click "Run benchmark" to compare load times.`)})]})}function Ji({label:e,tone:t,ms:n,bytes:r}){return(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full ${t===`ok`?`bg-emerald-500`:`bg-amber-500`}`}),(0,L.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium`,children:e})]}),(0,L.jsxs)(`div`,{className:`text-2xl font-semibold tabular-nums ${t===`ok`?`text-emerald-600 dark:text-emerald-400`:`text-amber-600 dark:text-amber-400`}`,children:[Math.round(n),(0,L.jsx)(`span`,{className:`text-[13px] font-normal text-neutral-500 dark:text-neutral-400 ml-1`,children:`ms`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 text-[11px] text-neutral-500 dark:text-neutral-400`,children:[(0,L.jsx)(ie,{size:11}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(n),` ms`]}),(0,L.jsx)(`span`,{className:`text-neutral-300 dark:text-neutral-700`,children:`·`}),(0,L.jsx)(F,{size:11}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[(r/1024).toFixed(1),` KB`]})]})]})}function Yi(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)([]),[o,s]=(0,y.useState)(30),[c,l]=(0,y.useState)(!1),u=async()=>{l(!0);try{let[e,n]=await Promise.all([H.request(`/stats/hit-daily?days=30`),H.request(`/cache/benchmark/history`)]);t(e.days),r(n.runs),a(e.changes.length?e.changes:n.changes)}catch{t([]),r([])}finally{l(!1)}};(0,y.useEffect)(()=>{u()},[]);let d=(e??[]).slice(-o),f=d.length>=2,p=(n??[]).length>=2;return(0,L.jsxs)(`div`,{"data-xspeed-anchor":`hit-trend`,className:`border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 rounded-lg p-4 sm:p-5 scroll-mt-6`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 mb-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(at,{size:18,className:`text-accent shrink-0`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`font-medium text-neutral-900 dark:text-neutral-50`,children:z(`Trends`)}),(0,L.jsx)(`div`,{className:`text-[12px] text-neutral-500 dark:text-neutral-400`,children:z(`Hit ratio and benchmark history, with your settings changes marked.`)})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`flex rounded border border-neutral-200 dark:border-neutral-700 overflow-hidden text-[12px]`,children:[7,30].map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>s(e),className:o===e?`px-2.5 py-1 bg-accent text-white`:`px-2.5 py-1 text-neutral-600 dark:text-neutral-300 hover:bg-neutral-50 dark:hover:bg-neutral-800`,children:[e,`d`]},e))}),(0,L.jsx)(`button`,{type:`button`,onClick:u,disabled:c,"aria-label":z(`Refresh trends`),className:`p-1.5 rounded border border-neutral-200 dark:border-neutral-700 text-neutral-500 dark:text-neutral-400 hover:bg-neutral-50 dark:hover:bg-neutral-800 disabled:opacity-40`,children:(0,L.jsx)(I,{size:13,className:c?`animate-spin`:``})})]})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,L.jsxs)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:[z(`Hit ratio`),` · `,o,`d`]}),f?(0,L.jsx)(ta,{rows:d,changes:i}):(0,L.jsx)(ra,{text:z(`Trends appear after a couple of days of traffic. The daily series is being collected now.`)})]}),(0,L.jsxs)(`div`,{className:`border border-neutral-200 dark:border-neutral-800 rounded p-3`,children:[(0,L.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-2`,children:z(`Benchmark: cached vs uncached (ms)`)}),p?(0,L.jsx)(na,{rows:n??[],changes:i}):(0,L.jsx)(ra,{text:z(`Run the benchmark at least twice to see a trend.`)})]})]}),i.length>0&&(0,L.jsxs)(`div`,{className:`mt-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-neutral-500 dark:text-neutral-400 font-medium mb-1.5`,children:[(0,L.jsx)(be,{size:11}),` `,z(`Recent changes`)]}),(0,L.jsx)(`ul`,{className:`space-y-0.5`,children:i.slice(0,5).map(e=>(0,L.jsxs)(`li`,{className:`text-[12px] text-neutral-600 dark:text-neutral-300 truncate`,children:[(0,L.jsx)(`span`,{className:`text-neutral-400 dark:text-neutral-500 tabular-nums mr-2`,children:new Date(e.ts*1e3).toLocaleDateString()}),e.message]},`${e.ts}-${e.message}`))})]})]})}var Xi=280,Zi=80,Qi=4;function $i(e,t){return t<=1?Qi:Qi+e*(Xi-2*Qi)/(t-1)}function ea({changes:e,t0:t,t1:n}){return n<=t?null:(0,L.jsx)(L.Fragment,{children:e.filter(e=>e.ts>=t&&e.ts<=n).map(e=>{let r=Qi+(e.ts-t)/(n-t)*(Xi-2*Qi);return(0,L.jsx)(`line`,{x1:r,x2:r,y1:Qi,y2:Zi-Qi,className:`stroke-amber-500/70`,strokeWidth:`1`,strokeDasharray:`2 3`,children:(0,L.jsx)(`title`,{children:e.message})},`${e.ts}-${e.message}`)})})}function ta({rows:e,changes:t}){let n=e=>Zi-Qi-e*(Zi-2*Qi),r=e.map((t,r)=>`${$i(r,e.length)},${n(t.ratio)}`).join(` `),i=n(1),a=n(.8),o=Date.parse(e[0]?.date??``)/1e3,s=Date.parse(e[e.length-1]?.date??``)/1e3+86399,c=e[e.length-1];return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 ${Xi} ${Zi}`,className:`w-full h-20`,role:`img`,"aria-label":z(`Hit ratio trend`),children:[(0,L.jsx)(`rect`,{x:Qi,y:i,width:Xi-2*Qi,height:a-i,className:`fill-emerald-500/10`}),(0,L.jsx)(`line`,{x1:Qi,x2:Xi-Qi,y1:a,y2:a,className:`stroke-emerald-500/40`,strokeWidth:`1`,strokeDasharray:`3 3`}),Number.isFinite(o)&&Number.isFinite(s)&&(0,L.jsx)(ea,{changes:t,t0:o,t1:s}),(0,L.jsx)(`polyline`,{points:r,fill:`none`,className:`stroke-accent`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),e.map((t,r)=>(0,L.jsx)(`circle`,{cx:$i(r,e.length),cy:n(t.ratio),r:`2`,className:`fill-accent`,children:(0,L.jsx)(`title`,{children:`${t.date} — ${(t.ratio*100).toFixed(1)}% (${t.hits} hits / ${t.misses} misses)`})},t.date))]}),c&&(0,L.jsxs)(`div`,{className:`mt-1 text-[12px] text-neutral-500 dark:text-neutral-400`,children:[z(`Latest`),`:`,` `,(0,L.jsxs)(`span`,{className:c.ratio>=.8?`text-emerald-600 dark:text-emerald-400 font-medium`:`text-amber-600 dark:text-amber-400 font-medium`,children:[(c.ratio*100).toFixed(1),`%`]}),` `,`· `,z(`target ≥80%`)]})]})}function na({rows:e,changes:t}){let n=Math.max(...e.map(e=>e.uncached_ms),1),r=e=>Zi-Qi-e/n*(Zi-2*Qi),i=t=>e.map((n,i)=>`${$i(i,e.length)},${r(t(n))}`).join(` `),a=e[0]?.ts??0,o=e[e.length-1]?.ts??0,s=e[e.length-1];return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 ${Xi} ${Zi}`,className:`w-full h-20`,role:`img`,"aria-label":z(`Benchmark trend`),children:[o>a&&(0,L.jsx)(ea,{changes:t,t0:a,t1:o}),(0,L.jsx)(`polyline`,{points:i(e=>e.uncached_ms),fill:`none`,className:`stroke-amber-500`,strokeWidth:`1.5`,strokeDasharray:`4 3`}),(0,L.jsx)(`polyline`,{points:i(e=>e.cached_ms),fill:`none`,className:`stroke-emerald-500`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),e.map((t,n)=>(0,L.jsx)(`circle`,{cx:$i(n,e.length),cy:r(t.cached_ms),r:`2`,className:`fill-emerald-500`,children:(0,L.jsx)(`title`,{children:`${new Date(t.ts*1e3).toLocaleString()} — ${Math.round(t.cached_ms)}ms cached vs ${Math.round(t.uncached_ms)}ms uncached`})},t.ts))]}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center gap-3 text-[12px] text-neutral-500 dark:text-neutral-400`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(`span`,{className:`inline-block w-3 h-0.5 bg-emerald-500 rounded`}),` `,z(`cached`)]}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(`span`,{className:`inline-block w-3 h-0.5 bg-amber-500 rounded`}),` `,z(`uncached`)]}),s?.savings_ms!=null&&(0,L.jsxs)(`span`,{className:`ml-auto tabular-nums`,children:[`−`,Math.round(s.savings_ms),`ms`]})]})]})}function ra({text:e}){return(0,L.jsx)(`div`,{className:`h-20 flex items-center justify-center text-center text-[12px] text-neutral-400 dark:text-neutral-500 px-4`,children:e})}function ia(){let e=Mn(),[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(!1);return e===`free`?(0,L.jsxs)(`div`,{className:`border border-line bg-primary-tint rounded-card p-4 sm:p-5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(`span`,{className:`shrink-0 w-9 h-9 rounded-full bg-paper border border-line flex items-center justify-center text-warning`,children:(0,L.jsx)(Qe,{size:18})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:z(`What would Pro do for your site?`)}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium text-warning`,children:[(0,L.jsx)(se,{size:10}),z(`Pro`)]})]}),(0,L.jsx)(`div`,{className:`text-[12px] text-ink-soft mt-0.5`,children:z(`Scans your current settings + 24h cache stats and shows exactly which Pro features would help.`)})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[r&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`flex items-center gap-1 text-[12px] text-ink-soft hover:text-ink transition-colors`,children:[(0,L.jsx)(j,{size:13,className:`transition-transform ${s?``:`rotate-180`}`}),z(s?`Hide`:`Show`)]}),(0,L.jsxs)(`button`,{type:`button`,onClick:async()=>{n(!0),o(null);try{i(await H.request(`/audit/pro`)),c(!0)}catch(e){o(e instanceof Error?e.message:z(`Audit failed`))}finally{n(!1)}},disabled:t,className:`flex items-center gap-1.5 text-[13px] px-3 py-1.5 rounded-md bg-primary hover:bg-primary-hover text-on-primary font-medium transition-colors disabled:opacity-50`,children:[t?(0,L.jsx)(I,{size:13,className:`animate-spin`}):(0,L.jsx)(Qe,{size:13}),z(r?`Re-run`:`Run Pro audit`)]})]})]}),a&&(0,L.jsx)(`div`,{className:`mt-3 text-[12px] text-danger`,children:a}),r&&s&&(0,L.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[r.suggestions.map(e=>(0,L.jsx)(oa,{suggestion:e},`${e.id}-${e.severity}`)),(0,L.jsx)(`div`,{className:`text-center pt-2`,children:(0,L.jsxs)(`a`,{href:`https://xspeedcache.com/pricing/`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 px-4 py-2 rounded-md bg-primary hover:bg-primary-hover text-on-primary text-[13px] font-medium transition-colors`,children:[z(`Upgrade to Pro`),(0,L.jsx)(C,{size:13})]})})]})]}):null}var aa={high:{dot:`bg-danger`,chip:`bg-danger-tint text-danger border-line`,label:`High`},med:{dot:`bg-warning`,chip:`bg-warning-tint text-warning border-line`,label:`Medium`},low:{dot:`bg-info`,chip:`bg-info-tint text-info border-line`,label:`Low`}};function oa({suggestion:e}){let t=Ln[e.id],n=aa[e.severity];return(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-md p-3 sm:p-4 flex items-start gap-3`,children:[(0,L.jsx)(`span`,{className:`shrink-0 w-2 h-2 rounded-full mt-2.5 ${n.dot}`,"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`shrink-0 text-warning mt-0.5`,children:t&&(0,L.jsx)(vt,{name:t.icon,size:16})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:t?.title??e.id}),(0,L.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded border ${n.chip}`,children:n.label}),e.fact&&(0,L.jsx)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded bg-panel text-ink-soft`,children:e.fact})]}),(0,L.jsx)(`p`,{className:`text-[12px] text-ink-soft mt-1 leading-relaxed`,children:e.reason})]})]})}function sa(){let e=Pn()===`unlicensed`,t=Object.values(Ln);return(0,L.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-6`,children:[(0,L.jsxs)(`section`,{className:`relative overflow-hidden rounded-card border border-line bg-primary-tint p-6 sm:p-8`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider font-medium border border-line bg-paper text-primary rounded-full px-2 py-0.5`,children:[e?(0,L.jsx)(Te,{size:10}):(0,L.jsx)(je,{size:10}),(0,L.jsx)(`span`,{children:z(e?`Pro — license needed`:`xSpeed Pro`)})]}),(0,L.jsx)(`h1`,{className:`mt-3 font-display text-[26px] font-semibold text-ink`,children:z(`Everything in Free, plus the heavy lifting.`)}),(0,L.jsx)(`p`,{className:`mt-2 max-w-2xl text-[14px] leading-relaxed text-ink-soft`,children:z(e?`xSpeed Pro is installed — activate your license to unlock every feature below. Your current settings stay exactly as they are.`:`Pro layers deeper optimization, real-user insight, and automation on top of the cache you already run. Nothing you have set up changes.`)}),(0,L.jsx)(`div`,{className:`mt-5`,children:e?(0,L.jsxs)(`a`,{href:In,className:`inline-flex items-center gap-1.5 px-5 py-2.5 rounded-control text-[14px] font-medium bg-primary hover:bg-primary-hover text-on-primary shadow-primary-glow transition-colors`,children:[z(`Activate your license`),(0,L.jsx)(C,{size:15})]}):(0,L.jsxs)(`a`,{href:Fn,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 px-5 py-2.5 rounded-control text-[14px] font-medium bg-primary hover:bg-primary-hover text-on-primary shadow-primary-glow transition-colors`,children:[z(`Upgrade to Pro`),(0,L.jsx)(C,{size:15})]})})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:t.map(e=>(0,L.jsx)(`div`,{className:`rounded-card border border-line bg-paper p-4`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`shrink-0 w-9 h-9 rounded-full border border-line bg-primary-tint text-primary flex items-center justify-center`,children:(0,L.jsx)(vt,{name:e.icon,size:17})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-[14px] font-semibold text-ink`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-1 text-[12px] leading-relaxed text-ink-soft`,children:e.body})]})]})},e.id))}),(0,L.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 text-[12px] text-muted`,children:[(0,L.jsx)(O,{size:13,className:`text-success`}),(0,L.jsx)(`span`,{children:z(`Your Free tier keeps working exactly as it does today.`)})]})]})}function ca({settings:e,stats:t,rewriteProbe:n}){let r=e.cache_enabled,i=Qt(t.hit_ratio),a=parseInt(i,10)||0,o=(()=>{if(!r)return z(`Turn on the page cache to start serving pages instantly.`);let e=Zt(t.cached_pages);if(n?.active){let t=n.server_type===`nginx`?`nginx`:z(`your web server`);return`${z(`Serving from`)} ${t}, ${z(`bypassing PHP`)} · ${e} ${z(`pages cached`)}`}return`${z(`Serving from the PHP cache`)} · ${e} ${z(`pages cached`)}`})();return(0,L.jsxs)(`section`,{className:`rounded-card border border-line bg-paper p-5 flex flex-col`,"aria-label":z(`Cache status`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(`span`,{className:`inline-flex items-center justify-center w-6 h-6 rounded-full ${r?`bg-success-tint text-success xspeed-anim-boltpulse`:`bg-panel text-faint`}`,"aria-hidden":`true`,children:(0,L.jsx)(pt,{size:14})}),(0,L.jsx)(`h2`,{className:`font-display text-[18px] font-semibold text-ink`,children:z(r?`Cache active`:`Cache inactive`)})]}),(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-soft`,children:o}),(0,L.jsxs)(`div`,{className:`mt-auto pt-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[12px] mb-1.5`,children:[(0,L.jsx)(`span`,{className:`text-ink-soft`,children:z(`Cache warmth`)}),(0,L.jsx)(`span`,{className:`font-mono tabular-nums text-ink`,children:i})]}),(0,L.jsx)(`div`,{className:`h-2 rounded-pill bg-panel overflow-hidden`,role:`progressbar`,"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":z(`Cache warmth`),children:(0,L.jsx)(`div`,{className:`h-full rounded-pill ${r?`xspeed-anim-sweep`:``}`,style:{width:`${a}%`,backgroundImage:r?`linear-gradient(90deg, var(--primary) 0%, #5BD6CE 50%, var(--primary) 100%)`:`var(--line-strong)`,backgroundColor:r?void 0:`var(--line-strong)`}})}),(0,L.jsxs)(`p`,{className:`mt-2 text-[12px] text-muted`,children:[z(`Last purged`),` `,t.last_purge?$t(t.last_purge):z(`never`)]})]})]})}function la({onNavigate:e}){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(!0),a=(e=!1)=>H.request(`/mcp/hub`,e?{headers:{"X-XSpeed-Reconcile":`1`}}:{}).then(e=>n(e)).catch(()=>void 0);(0,y.useEffect)(()=>{let e=!0;return H.request(`/mcp/hub`).then(t=>{e&&n(t)}).catch(()=>{e&&n(null)}).finally(()=>{e&&i(!1)}),()=>{e=!1}},[]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&a(!0)};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`focus`,e)}},[]);let o=`rounded-card border border-line bg-paper p-5 flex flex-col`,s=`inline-flex items-center gap-2 rounded border border-line-strong px-3 py-1.5 text-[13px] font-medium text-ink-soft hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`;if(r)return(0,L.jsxs)(`section`,{className:o,"aria-busy":`true`,"aria-label":z(`xSpeed Hub`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(P,{size:18,className:`text-muted`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`h-4 w-28 rounded bg-panel animate-pulse`})]}),(0,L.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,L.jsx)(`span`,{className:`block h-3 w-full rounded bg-panel animate-pulse`}),(0,L.jsx)(`span`,{className:`block h-3 w-2/3 rounded bg-panel animate-pulse`})]})]});let c=t?.attached===!0;return(0,L.jsxs)(`section`,{className:o,"aria-label":z(`xSpeed Hub`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(P,{size:18,className:`text-ink-soft`,"aria-hidden":`true`}),(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-ink`,children:z(`xSpeed Hub`)}),c&&(0,L.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1.5 text-[12px] text-success`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-success`,"aria-hidden":`true`}),z(`Connected`)]})]}),c?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-soft`,children:t?.account_email?`${z(`Connected as`)} ${t.account_email}. ${z(`Control caching remotely and from AI agents.`)}`:z(`Control caching remotely, drive it from AI agents, and manage your sites in one place.`)}),(0,L.jsx)(`div`,{className:`mt-auto pt-4`,children:(0,L.jsxs)(`a`,{href:t?.hub_url,target:`_blank`,rel:`noopener noreferrer`,className:s,children:[z(`Open Hub dashboard`),(0,L.jsx)(le,{size:14})]})})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`mt-1.5 text-[13px] leading-relaxed text-ink-soft`,children:z(`Connect to control caching remotely, drive it from AI agents, and manage all your sites in one place.`)}),(0,L.jsxs)(`div`,{className:`mt-auto pt-4 flex flex-wrap items-center gap-3`,children:[t?.attach_url?(0,L.jsxs)(`a`,{href:t.attach_url,target:`_blank`,rel:`noopener noreferrer`,className:s,children:[z(`Connect to Hub`),(0,L.jsx)(le,{size:14})]}):(0,L.jsx)(`button`,{type:`button`,onClick:()=>e(`mcp`),className:s,children:z(`Connect to Hub`)}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>e(`mcp`),className:`text-[13px] text-ink-soft hover:text-ink underline underline-offset-2`,children:z(`More options`)})]})]})]})}function ua({stats:e}){let[t,n]=(0,y.useState)(void 0);(0,y.useEffect)(()=>{let e=!0;return H.request(`/cache/benchmark/history?limit=1`).then(t=>{e&&n(t.runs&&t.runs.length>0?t.runs[0].savings_ms??null:null)}).catch(()=>{e&&n(null)}),()=>{e=!1}},[]);let r=t==null||t<=0?`—`:t>=950?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)} ms`,i=[{label:z(`Hit ratio`),value:Qt(e.hit_ratio),hint:z(`last 24 hours`)},{label:z(`Cached pages`),value:Zt(e.cached_pages),hint:z(`served without PHP`)},{label:z(`Cache size`),value:en(e.cache_size),hint:z(`on disk`)},{label:z(`Avg saved`),value:r,hint:z(`per page load`)}];return(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`,"aria-label":z(`Key metrics`),children:i.map(e=>(0,L.jsxs)(`div`,{className:`rounded-card border border-line bg-paper p-4`,children:[(0,L.jsx)(`p`,{className:`text-[13px] text-ink-soft`,children:e.label}),(0,L.jsx)(`p`,{className:`mt-1 font-display text-[24px] font-semibold text-ink tabular-nums`,children:e.value}),(0,L.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted`,children:e.hint})]},e.label))})}var da=`https://calendly.com/xspeed-cache/book-expert-setup`;function fa({settings:e,stats:t,rewriteProbe:n,showToast:r}){let i=Mn(),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(!0),[d,f]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=!0,t=[H.getRecommendations().then(t=>{e&&o(t.recommendations??[])}).catch(()=>{e&&o([])})];return i===`free`&&t.push(H.getProAudit().then(t=>{e&&c(t.suggestions??[])}).catch(()=>void 0)),Promise.all(t).finally(()=>{e&&u(!1)}),()=>{e=!1}},[i]);let p=e=>e.action.module?sn({module:e.action.module,subtab:e.action.subtab,focus:e.action.focus,suggest:e.action.suggest}):`#`,m=async e=>{let{action:t}=e;if(t.type===`apply`){if(d)return;f(e.id);try{o((await H.applyRecommendation(e.id)).recommendations??[]),r(z(`Applied`))}catch{r(z(`Could not apply that fix`))}finally{f(null)}}},h=(t.hits_24h??0)+(t.misses_24h??0)>=50&&(t.hit_ratio??0)<.5,g=n?n.active===!1:!1,_=!e.cache_enabled||g||h,v=a&&a.length>0||s.length>0||_;return(0,L.jsxs)(`section`,{className:`rounded-card border border-line bg-info-tint p-4 sm:p-5`,"aria-label":z(`Recommended for your site`),children:[(0,L.jsxs)(`h2`,{className:`flex items-center gap-1.5 text-[14px] font-semibold text-on-tint mb-3`,children:[(0,L.jsx)(pt,{size:15,className:`text-primary`,"aria-hidden":`true`}),z(`Recommended for your site`)]}),l?(0,L.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,L.jsx)(`span`,{className:`block h-10 rounded-lg bg-paper animate-pulse`}),(0,L.jsx)(`span`,{className:`block h-10 w-5/6 rounded-lg bg-paper animate-pulse`})]}):v?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(a??[]).map(e=>(0,L.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-line bg-paper px-3 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`text-[13px] font-medium text-ink`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-ink-soft`,children:e.detail})]}),e.action.type===`link`?(0,L.jsxs)(`a`,{href:p(e),className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(C,{size:13}),e.action.label]}):(0,L.jsxs)(`button`,{type:`button`,onClick:()=>m(e),disabled:d===e.id,className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:[(0,L.jsx)(lt,{size:13,className:d===e.id?`animate-pulse`:``}),e.action.label]})]},e.id)),s.length>0&&(0,L.jsxs)(`div`,{className:`pt-1`,children:[(0,L.jsx)(`p`,{className:`px-1 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted`,children:z(`Also worth a look`)}),(0,L.jsx)(`div`,{className:`space-y-1.5`,children:s.map(e=>(0,L.jsxs)(`div`,{className:`flex items-start gap-2.5 px-1`,children:[(0,L.jsx)(`span`,{className:`mt-1.5 w-1.5 h-1.5 rounded-full shrink-0 ${e.severity===`high`||e.severity===`med`?`bg-warning`:`bg-line-strong`}`,"aria-hidden":`true`}),(0,L.jsxs)(`p`,{className:`text-[12px] leading-relaxed text-ink-soft`,children:[e.reason,e.fact&&(0,L.jsxs)(`span`,{className:`ml-1.5 text-muted`,children:[`· `,e.fact]})]})]},e.id))})]}),_&&(0,L.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-line bg-paper px-3 py-2.5`,children:[(0,L.jsx)(E,{size:16,className:`mt-0.5 shrink-0 text-ink-soft`,"aria-hidden":`true`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`text-[13px] font-medium text-ink`,children:z(`Want a hand?`)}),(0,L.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-ink-soft`,children:z(`Book a free setup review with our team.`)})]}),(0,L.jsx)(`a`,{href:da,target:`_blank`,rel:`noopener noreferrer`,className:`shrink-0 inline-flex items-center gap-1.5 rounded border border-line-strong px-2.5 py-1 text-[12px] font-medium text-ink-soft hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,children:z(`Book`)})]})]}):(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-[13px] text-ink-soft`,children:[(0,L.jsx)(N,{size:15,className:`text-success`,"aria-hidden":`true`}),z(`You're all set — no recommendations right now.`)]})]})}var pa=3,ma=[`cache`,`performance`,`network`,`tools`];function ha(e){if(e.locked)return`locked`;let t=e.settings?.enabled;return typeof t==`boolean`?t?`on`:`off`:null}function ga({state:e}){return e===`locked`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-ink-soft`,children:[(0,L.jsx)(je,{size:11,"aria-hidden":`true`}),z(`Pro`)]}):e===`on`?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] text-success`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-success`,"aria-hidden":`true`}),z(`On`)]}):e===`off`?(0,L.jsx)(`span`,{className:`text-[11px] text-muted`,children:z(`Off`)}):null}function _a({modules:e,onNavigate:t}){let[n,r]=(0,y.useState)(!1),i=Tt(e),a=n?i:ma.map(e=>i.find(t=>t.id===e)).filter(e=>!!e),o=e.length;return(0,L.jsxs)(`section`,{"aria-label":z(`Your setup`),children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,L.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:z(`Your setup`)}),o>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`inline-flex items-center gap-1 text-[12px] text-ink-soft hover:text-ink underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded`,"aria-expanded":n,children:[n?z(`Show less`):`${z(`Browse all`)} ${o} ${z(`features`)}`,!n&&(0,L.jsx)(C,{size:12,"aria-hidden":`true`})]})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-5 gap-y-5`,children:a.map(e=>{let r=n?e.modules:e.modules.slice(0,pa);return r.length===0?null:(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5 px-1`,children:[(0,L.jsx)(vt,{name:e.icon,size:13,className:`text-muted`}),(0,L.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted`,children:e.label})]}),(0,L.jsx)(`div`,{className:`rounded-card border border-line bg-paper divide-y divide-line overflow-hidden`,children:r.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.slug),className:`w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-panel transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,children:[(0,L.jsx)(vt,{name:e.icon,size:15,className:`shrink-0 text-ink-soft`}),(0,L.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink-soft`,children:e.label}),(0,L.jsx)(ga,{state:ha(e)})]},e.slug))})]},e.id)})})]})}var va=6;function ya(e){switch(e){case`success`:return`bg-success`;case`warn`:return`bg-warning`;case`error`:return`bg-red-500`;default:return`bg-line-strong`}}function ba(){let[e,t]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!0;return H.getActivity().then(n=>{e&&t(n.activity??[])}).catch(()=>{e&&t([])}),()=>{e=!1}},[]),!e||e.length===0?null:(0,L.jsxs)(`section`,{"aria-label":z(`Recent activity`),children:[(0,L.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink mb-3`,children:z(`Recent activity`)}),(0,L.jsx)(`ul`,{className:`rounded-card border border-line bg-paper divide-y divide-line`,children:e.slice(0,va).map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${ya(e.severity)}`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink-soft`,children:e.message}),(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted tabular-nums`,children:$t(e.ts)})]},`${e.ts}-${t}`))})]})}var J=`https://xspeedcache.com/docs/`,xa=`https://wpdeveloper.com/support/`,Sa=`https://wordpress.org/support/plugin/xspeed/reviews/#new-post`;function Ca(){let e=`inline-flex items-center gap-2 text-ink-soft hover:text-ink transition-colors`;return(0,L.jsxs)(`section`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2 pt-2 text-[13px]`,"aria-label":z(`Help and resources`),children:[(0,L.jsxs)(`a`,{href:J,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,L.jsx)(T,{size:14,"aria-hidden":`true`}),z(`Documentation`)]}),(0,L.jsxs)(`a`,{href:xa,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,L.jsx)(Oe,{size:14,"aria-hidden":`true`}),z(`Help and support`)]}),(0,L.jsxs)(`a`,{href:Sa,target:`_blank`,rel:`noopener noreferrer`,className:e,children:[(0,L.jsx)(et,{size:14,"aria-hidden":`true`}),z(`Review us on WordPress.org`)]})]})}function wa({settings:e,stats:t,rewriteProbe:n,modules:r,onNavigate:i,showToast:a}){return(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,L.jsx)(ca,{settings:e,stats:t,rewriteProbe:n}),(0,L.jsx)(la,{onNavigate:i})]}),(0,L.jsx)(ua,{stats:t}),(0,L.jsx)(fa,{settings:e,stats:t,rewriteProbe:n,showToast:a}),(0,L.jsx)(_a,{modules:r,onNavigate:i}),(0,L.jsx)(ba,{}),(0,L.jsx)(Ca,{})]})}var Ta={"critical-css":{host:`minify`,subtab:`critical`},"unused-css":{host:`minify`,subtab:`unused`},"brotli-compression":{host:`gzip`,subtab:`brotli`},images:{host:`lazy`,subtab:`images`},"smart-image":{host:`lazy`,subtab:`smart`},"smart-predict":{host:`resource-hints`,subtab:`speculation`},"prewarm-schedule":{host:`preloader`,subtab:`scheduled`},"predictive-warm":{host:`preloader`,subtab:`predictive`},"cloudflare-apo":{host:`cloudflare`},analytics:{host:`health`,subtab:`cache`},rum:{host:`health`,subtab:`visitors`},pagespeed:{host:`health`,subtab:`pagespeed`},"performance-health":{host:`health`,subtab:`pagespeed`},recommendations:{host:`health`},"cache-404":{host:`cache-coverage`,subtab:`coverage`},"search-cache":{host:`cache-coverage`,subtab:`coverage`},"feed-cache":{host:`cache-coverage`,subtab:`beyond`},"rest-cache":{host:`cache-coverage`,subtab:`beyond`},"custom-rules":{host:`cache-coverage`,subtab:`rules`},"maintenance-cache":{host:`cache-coverage`,subtab:`rules`}};function Ea(e){return Ta[e]??null}var Da=(0,y.createContext)(``);function Oa({query:e,children:t}){return(0,L.jsx)(Da.Provider,{value:e,children:t})}function ka(e,t){let n=new Map(e.map(e=>[e.slug,e])),r=(e,t)=>{let r={displayLabel:e.label??e.slug,displayDescription:e.description,...t?.fieldKey?{fieldModuleSlug:e.slug}:{},...t},i=Ea(e.slug);if(!i)return{module:e,isChild:!1,...r};let a=n.get(i.host);return a?{module:a,subtab:i.subtab,parentLabel:a.label,isChild:!0,...r}:{module:e,isChild:!1,...r}},i=t.trim().toLowerCase();if(!i)return e.filter(e=>!Ea(e.slug)).map(e=>({module:e,isChild:!1,displayLabel:e.label??e.slug,displayDescription:e.description}));let a=new Set,o=e=>{if(!e)return;let t=`${e.module.slug}::${e.subtab??``}`;a.has(t)||(a.add(t),s.push(e))},s=[];for(let t of e){let e=(t.label??``).toLowerCase().includes(i),n=(t.description??``).toLowerCase().includes(i),a=(t.tab_label??``).toLowerCase().includes(i);if(e||n||a){o(r(t));continue}let s=t.schema??{},c=null;for(let[e,n]of Object.entries(s)){let a=(n.label??e).toString();if(`${a} ${(n.description??``).toString()} ${n.option_labels?Object.values(n.option_labels).join(` `):``} ${e}`.toLowerCase().includes(i)){c=r(t,{fieldKey:e,fieldLabel:a});break}}c&&o(c)}return s}function Aa(e){let[t,n]=(0,y.useState)(``);return{query:t,setQuery:n,results:(0,y.useMemo)(()=>ka(e,t),[e,t])}}var ja=new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`,`PRE`,`CODE`,`KBD`,`SVG`,`STYLE`,`SCRIPT`]),Ma=`xspeed-search`;function Na(){return typeof CSS<`u`&&!!CSS.highlights&&typeof globalThis.Highlight==`function`}function Pa(e,t){let n=t.trim();if(!n)return[];let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=new RegExp(r,`gi`),a=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(t){if(!t.nodeValue||!t.nodeValue.trim())return NodeFilter.FILTER_REJECT;let n=t.parentNode;for(;n&&n!==e;){if(n instanceof Element&&ja.has(n.tagName))return NodeFilter.FILTER_REJECT;n=n.parentNode}return NodeFilter.FILTER_ACCEPT}}),s=o.nextNode();for(;s;){let e=s.nodeValue??``;i.lastIndex=0;let t;for(;(t=i.exec(e))!==null;){let e=document.createRange();e.setStart(s,t.index),e.setEnd(s,t.index+t[0].length),a.push(e),t[0].length===0&&i.lastIndex++}s=o.nextNode()}return a}function Fa({query:e,children:t}){let n=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=n.current;if(!t||!Na())return;let r=CSS.highlights,i=globalThis.Highlight,a=0,o=()=>{let n=Pa(t,e);if(n.length===0){r.delete(Ma);return}r.set(Ma,new i(...n))};o();let s=new MutationObserver(()=>{cancelAnimationFrame(a),a=requestAnimationFrame(o)});return s.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{s.disconnect(),cancelAnimationFrame(a),r.delete(Ma)}},[e]),(0,L.jsx)(`div`,{ref:n,className:`contents`,children:t})}function Ia(e,t){if(!e)return e;let n=t.trim();if(!n)return e;let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`(${r})`,`gi`),a=e.split(i);return a.length===1?e:(0,L.jsx)(L.Fragment,{children:a.map((e,t)=>t%2==1?(0,L.jsx)(`mark`,{className:`bg-warning-tint text-inherit rounded-sm`,children:e},t):(0,L.jsx)(y.Fragment,{children:e},t))})}function La({open:e,onClose:t,modules:n,onSelectResult:r,onPurge:i,onPreload:a}){let{query:o,setQuery:s,results:c}=Aa(n),[l,u]=(0,y.useState)(0),d=(0,y.useRef)(null),f=(0,y.useRef)(null),p=(0,y.useRef)(null),m=(0,y.useRef)(null),h=(0,y.useMemo)(()=>[{id:`purge`,label:z(`Purge all`),icon:I,run:i},{id:`preload`,label:z(`Preload`),icon:Be,run:a}],[i,a]),g=(0,y.useMemo)(()=>{let e=o.trim().toLowerCase();return[...h.filter(t=>!e||t.label.toLowerCase().includes(e)).map(e=>({kind:`command`,command:e})),...c.slice(0,40).map(e=>({kind:`result`,result:e}))]},[h,c,o]);if((0,y.useEffect)(()=>{if(e){m.current=document.activeElement??null,s(``),u(0);let e=window.requestAnimationFrame(()=>d.current?.focus());return()=>window.cancelAnimationFrame(e)}m.current?.focus?.()},[e]),(0,y.useEffect)(()=>{u(e=>Math.min(e,Math.max(0,g.length-1)))},[g.length]),(0,y.useEffect)(()=>{e&&f.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[l,e]),(0,y.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),!e)return null;let _=e=>{e.kind===`command`?e.command.run():r(e.result),t()},v=e=>{if(e.key===`Escape`)e.preventDefault(),t();else if(e.key===`ArrowDown`)e.preventDefault(),u(e=>g.length?(e+1)%g.length:0);else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>g.length?(e-1+g.length)%g.length:0);else if(e.key===`Enter`){e.preventDefault();let t=g[l];t&&_(t)}else e.key===`Tab`&&e.preventDefault()},b=e=>`xspeed-cmdk-opt-${e}`;return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-start justify-center px-4 pt-[12vh]`,onMouseDown:e=>{p.current&&!p.current.contains(e.target)&&t()},children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/40`,"aria-hidden":`true`}),(0,L.jsxs)(`div`,{ref:p,role:`dialog`,"aria-modal":`true`,"aria-label":z(`Command palette`),className:`relative w-full max-w-xl rounded-card border border-line bg-paper shadow-xl overflow-hidden`,onKeyDown:v,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3 border-b border-line`,children:[(0,L.jsx)(Ge,{size:18,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,L.jsx)(`input`,{ref:d,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`xspeed-cmdk-list`,"aria-activedescendant":g.length?b(l):void 0,"aria-label":z(`Search settings, modules, actions`),value:o,onChange:e=>{s(e.target.value),u(0)},placeholder:z(`Search settings, modules, actions…`),className:`w-full bg-transparent py-0.5 text-[15px] text-ink placeholder-muted focus:outline-none`}),(0,L.jsx)(`kbd`,{className:`shrink-0 hidden sm:inline-flex items-center h-[20px] px-1.5 rounded text-[10px] font-medium bg-panel text-muted`,children:`esc`})]}),g.length===0?(0,L.jsx)(`div`,{className:`px-4 py-8 text-center text-[13px] text-muted`,children:z(`No matches`)}):(0,L.jsx)(`ul`,{ref:f,id:`xspeed-cmdk-list`,role:`listbox`,"aria-label":z(`Results`),className:`max-h-[52vh] overflow-y-auto py-1.5`,children:g.map((e,t)=>{let n=t===l,r=`flex items-center gap-3 px-4 py-2 cursor-pointer ${n?`bg-primary-tint`:``}`;if(e.kind===`command`){let i=e.command.icon;return(0,L.jsxs)(`li`,{id:b(t),role:`option`,"aria-selected":n,className:r,onMouseEnter:()=>u(t),onMouseDown:t=>{t.preventDefault(),_(e)},children:[(0,L.jsx)(`span`,{className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-control bg-panel text-ink-soft`,children:(0,L.jsx)(i,{size:14,"aria-hidden":`true`})}),(0,L.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink`,children:Ia(e.command.label,o)}),(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:z(`Action`)}),n&&(0,L.jsx)(oe,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]},`cmd-${e.command.id}`)}let i=e.result,a=i.parentLabel??Ct(wt(i.module.slug)??``)?.label??``;return(0,L.jsxs)(`li`,{id:b(t),role:`option`,"aria-selected":n,className:r,onMouseEnter:()=>u(t),onMouseDown:t=>{t.preventDefault(),_(e)},children:[(0,L.jsx)(`span`,{className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-control bg-panel text-ink-soft`,children:(0,L.jsx)(vt,{name:i.module.icon,size:14})}),(0,L.jsxs)(`span`,{className:`flex-1 min-w-0 truncate text-[13px] text-ink`,children:[Ia(i.displayLabel,o),i.fieldLabel&&(0,L.jsxs)(`span`,{className:`text-muted`,children:[` · `,Ia(i.fieldLabel,o)]})]}),a&&(0,L.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:a}),n&&(0,L.jsx)(oe,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]},`res-${i.module.slug}:${i.subtab??``}:${i.fieldKey??``}`)})})]})]})}var Ra=null,za=0,Ba=`xspeed-field-blink`,Va=40;function Ha(e,t){if(Ra!==e)return;let n=document.querySelector(`[data-field-anchor="${Wa(e)}"]`);if(n&&n.offsetParent!==null){Ra=null,n.scrollIntoView({block:`center`,behavior:`smooth`}),n.classList.remove(Ba),n.offsetWidth,n.classList.add(Ba);let e=()=>n.classList.remove(Ba);n.addEventListener(`animationend`,e,{once:!0}),window.setTimeout(e,1500);return}tHa(e,t+1)):Ra=null}function Ua(e,t){if(typeof window>`u`)return;let n=`${e}:${t}`;Ra=n,window.cancelAnimationFrame(za),za=window.requestAnimationFrame(()=>Ha(n,0))}function Wa(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`)}function Ga(e){if(e.view===`overview`)return`#/overview`;if(e.view===`pro`)return`#/pro`;if(e.view===`group`)return`#/${e.group}`;let t=`#/${e.group}/${e.module}`;return e.subtab&&(t+=`/${e.subtab}`),t}function Ka(e){if(!e)return{};let t=new URLSearchParams(e);return{focus:t.get(`focus`)||void 0,suggest:t.get(`suggest`)??void 0}}function qa(e){return e.module===`lazy`&&e.subtab===`fonts`?{...e,group:wt(`fonts`)??e.group,module:`fonts`,subtab:``}:e}function Ja(e){let t=(e||``).replace(/^#/,``),n=t.indexOf(`?`),r=n===-1?t:t.slice(0,n),{focus:i,suggest:a}=Ka(n===-1?``:t.slice(n+1));if(r.startsWith(`/`)){let e=r.slice(1).split(`/`).filter(Boolean);return e.length===0||e[0]===`overview`?{view:`overview`,focus:i,suggest:a}:e[0]===`pro`?{view:`pro`,focus:i,suggest:a}:St.includes(e[0])?e.length===1?{view:`group`,group:e[0],focus:i,suggest:a}:qa({view:`module`,group:e[0],module:e[1],subtab:e[2]||``,focus:i,suggest:a}):{view:`overview`,focus:i,suggest:a}}let o=cn(e),s=o.module;if(!s||s===`overview`)return{view:`overview`,focus:o.focus,suggest:o.suggest,legacy:!0};let c=wt(s);return c?qa({view:`module`,group:c,module:s,subtab:o.subtab??``,focus:o.focus,suggest:o.suggest,legacy:!0}):{view:`overview`,focus:o.focus,suggest:o.suggest,legacy:!0}}function Ya(e,t){if(t!==`free`)return e;let n=new Set(e.map(e=>e.slug)),r=yt.filter(e=>!n.has(e.slug)&&!e.embedded).map(e=>({slug:e.slug,tier:`pro`,version:`0.0.0`,label:e.label,icon:e.icon,description:e.description,settings:{},schema:{},locked:!0}));return[...e,...r]}var Xa=`xspeed-theme`,Za=`xspeed_theme`;function Qa(e){document.cookie=`${Za}=${e}; path=/; max-age=31536000; SameSite=Lax`}function $a(){let[e,t]=(0,y.useState)(()=>localStorage.getItem(Xa)===`dark`?`dark`:`light`);return(0,y.useEffect)(()=>{let t=document.getElementById(`xspeed-app`);t&&(t.classList.toggle(`dark`,e===`dark`),document.body.classList.toggle(`xspeed-dark`,e===`dark`),localStorage.setItem(Xa,e),Qa(e))},[e]),{theme:e,toggle:()=>t(e=>e===`dark`?`light`:`dark`)}}function eo(){let e=Mn(),[t,n]=(0,y.useState)({}),[r,i]=(0,y.useState)(()=>window.XSpeedConfig?.bootstrap?.modules??[]);(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{H.getModules().then(i).catch(()=>void 0)};return window.addEventListener(`xspeed:tier-changed`,e),()=>window.removeEventListener(`xspeed:tier-changed`,e)},[]);let a=(0,y.useMemo)(()=>Ya(r,e).map(e=>t[e.slug]?{...e,settings:t[e.slug]}:e),[e,t,r]),o=(0,y.useCallback)((e,t)=>{n(n=>({...n,[e]:t})),e===`white-label`&&H.getBranding().then(e=>{window.XSpeedPro?.setBranding?.(e)}).catch(()=>void 0)},[]),s=(0,y.useCallback)((e,t)=>{let n=ln(e);n&&(Ua(n.module,n.field),pi(t===void 0?null:{module:n.module,field:n.field,value:t}))},[]),[c,l]=(0,y.useState)(()=>Ja(window.location.hash));(0,y.useEffect)(()=>{let e=Ja(window.location.hash);if(e.legacy){let t=Ga(e);window.location.hash!==t&&history.replaceState(null,``,t)}s(e.focus,e.suggest)},[]),(0,y.useEffect)(()=>{let e=Ga(c);typeof window<`u`&&window.location.hash!==e&&history.replaceState(null,``,e)},[c]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=Ja(window.location.hash);l(e),s(e.focus,e.suggest)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[s]);let u=(0,y.useCallback)(e=>{l(e===`overview`?{view:`overview`}:{view:`group`,group:e})},[]),d=(0,y.useCallback)((e,t=``)=>{let n=wt(e);n&&l({view:`module`,group:n,module:e,subtab:t})},[]),f=(0,y.useCallback)(()=>l({view:`pro`}),[]),p=c.view===`overview`?Et:c.group??`overview`,m=c.view===`module`?c.module??null:null,h=c.view===`module`?c.subtab??``:``,g=(0,y.useMemo)(()=>m?a.find(e=>e.slug===m)??null:null,[a,m]),_=(0,y.useRef)(null);(0,y.useEffect)(()=>{_.current?.scrollTo({top:0})},[c]);let v=window.XSpeedConfig?.bootstrap,[b,x]=(0,y.useState)(v?.settings??null),[S,C]=(0,y.useState)(v?.status?.stats??null),[w,T]=(0,y.useState)(v?.status?.rewrite_probe??null),[ee,E]=(0,y.useState)(v?.status?.mobile_separate??null),[te,D]=(0,y.useState)(v?.status?.nginx_server_block??null),[O,ne]=(0,y.useState)(null),[k,A]=(0,y.useState)(!1),[j,M]=(0,y.useState)(!1),[N,re]=(0,y.useState)(!1),{theme:ie,toggle:P}=$a(),[ae,oe]=(0,y.useState)(!1),se=(0,y.useCallback)(e=>{d(e.module.slug,e.subtab??``),e.fieldKey&&Ua(e.fieldModuleSlug??e.module.slug,e.fieldKey)},[d]);(0,y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),e.stopPropagation(),oe(e=>!e))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[]);let F=(0,y.useCallback)(e=>{ne(e),setTimeout(()=>ne(null),2e3)},[]);(0,y.useEffect)(()=>{H.request(`/mcp/hub`).then(e=>re(e?.attached===!0)).catch(()=>void 0)},[]),(0,y.useEffect)(()=>{b&&S||Promise.all([H.getSettings(),H.getStatus()]).then(([e,t])=>{x(e),C(t.stats),T(t.rewrite_probe??null),E(t.mobile_separate??null),D(t.nginx_server_block??null)}).catch(()=>F(z(`Failed to load`)))},[]);let ce=(0,y.useCallback)(async e=>{if(!b)return;let t=b;x({...b,cache_enabled:e});try{let t=await H.toggleCache(e);x(e=>e&&{...e,cache_enabled:t.enabled}),C(t.stats),D(t.install_state.nginx_server_block??null),e&&!t.install_state.wp_cache_constant&&t.install_state.manual_snippet?F(`Cache enabled. Add to wp-config.php: ${t.install_state.manual_snippet}`):e&&t.install_state.nginx_snippet?F(`Cache enabled. nginx detected — re-run the setup wizard to copy the server-block snippet for max speed.`):F(z(e?`Cache enabled`:`Cache disabled`))}catch{x(t),F(z(e?`Failed to enable cache`:`Failed to disable cache`))}},[b,F]),le=(0,y.useCallback)(async()=>{if(!k){A(!0);try{C((await H.purge()).stats),F(z(`Cache purged`))}catch{F(z(`Purge failed`))}finally{A(!1)}}},[k,F]),ue=(0,y.useCallback)(async()=>{if(!j){M(!0);try{await H.preload(),F(z(`Preload started`))}catch{F(z(`Preload could not start`))}finally{M(!1)}}},[j,F]),de=(0,y.useCallback)(async()=>{try{let e=await H.getStatus();C(e.stats),T(e.rewrite_probe??null),E(e.mobile_separate??null),D(e.nginx_server_block??null)}catch{}},[]),fe=(0,y.useCallback)(()=>d(`mcp`),[d]),pe=(0,y.useMemo)(()=>{if(c.view===`overview`)return{current:z(`Overview`)};if(c.view===`group`)return{current:Ct(c.group??``)?.label??``};let e=Ct(c.group??``),t=c.module===`logs`?z(`Logs`):g?.label??c.module??``;return{backLabel:e?.label,onBack:()=>u(c.group??`overview`),current:t}},[c,g,u]),me=(0,L.jsx)(B,{activeGroup:p,onNavigate:u,onUpgrade:f,modules:a}),he=(0,L.jsx)(Ut,{crumb:pe,onOpenSearch:()=>oe(!0),onPurge:le,onPreload:ue,onConnectHub:fe,purging:k,preloading:j,hubConnected:N,theme:ie,onToggleTheme:P});if(!b||!S)return(0,L.jsxs)(Oa,{query:``,children:[me,(0,L.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[he,(0,L.jsx)(`main`,{className:`flex-1 flex bg-canvas`,children:(0,L.jsx)(rn,{})})]})]});let ge=c.view===`module`&&c.module!==`logs`&&!g;return(0,L.jsxs)(Oa,{query:``,children:[me,(0,L.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[he,(0,L.jsx)(`main`,{ref:_,className:`flex-1 overflow-auto bg-canvas`,children:(0,L.jsx)(Fa,{query:``,children:(0,L.jsxs)(`div`,{className:`px-4 sm:px-6 lg:px-8 py-5 sm:py-6`,children:[c.view===`overview`&&(0,L.jsx)(wa,{settings:b,stats:S,rewriteProbe:w,modules:a,onNavigate:d,showToast:F}),c.view===`pro`&&(0,L.jsx)(sa,{}),(c.view===`group`||ge)&&(0,L.jsx)(Kt,{groupId:c.group??`cache`,modules:a,onOpen:d}),c.view===`module`&&c.module===`logs`&&(0,L.jsx)(nn,{}),c.view===`module`&&g&&(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsx)(Yt,{module:g,eyebrow:Ct(c.group??``)?.label}),g.slug===`cache`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Di,{probe:w,onOpenHealth:()=>d(`health`)}),(0,L.jsx)(ki,{mobile:ee,onOpenCacheSettings:()=>d(`cache`)}),(0,L.jsx)(Gi,{stats:S}),(0,L.jsx)(Ki,{}),(0,L.jsx)(Ui,{settings:b,stats:S,onToggle:ce,onPurge:le}),(0,L.jsx)(Mi,{snippet:te,topology:w?.topology,focus:c.focus}),(0,L.jsx)(ia,{}),(0,L.jsx)(qi,{}),(0,L.jsx)(Yi,{})]}),(0,L.jsx)(Si,{module:g,subtab:h,onSubtabChange:e=>l(t=>t.view===`module`?{...t,subtab:e}:t),getModule:e=>a.find(t=>t.slug===e),onSaved:e=>{o(g.slug,e),de()}})]})]})})})]}),O&&(0,L.jsx)(an,{message:O}),(0,L.jsx)(`div`,{id:`xspeed-toast-host`}),(0,L.jsx)(La,{open:ae,onClose:()=>oe(!1),modules:a,onSelectResult:se,onPurge:le,onPreload:ue})]})}var to=[{id:`review`,label:`Environment`},{id:`configure`,label:`Configure`},{id:`done`,label:`Summary`},{id:`connect`,label:`Connect`}];function no(){return typeof window>`u`?!1:!!window.XSpeedConfig?.bootstrap?.hub?.attached}function ro({current:e,showConnect:t=!no()}){let n=t||e===`connect`?to:to.filter(e=>e.id!==`connect`).map(e=>e.id===`done`?{...e,label:`Done`}:e),r=n.findIndex(t=>t.id===e);return(0,L.jsx)(`div`,{className:`flex items-center justify-center gap-2 sm:gap-3 py-4 sm:py-5 border-b border-line`,children:n.map((e,t)=>{let i=t(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-line motion-safe:animate-pulse shrink-0`}),(0,L.jsx)(`div`,{className:`h-3 rounded bg-line motion-safe:animate-pulse`,style:{width:`${80-t*12}%`}})]},t))})})]})}var lo=typeof window<`u`?window.XSpeedConfig?.bootstrap?.hub??null:null,uo=lo,fo=lo!=null,po=!1,mo=!1,ho=new Set;function Y(e){uo=e,fo=!0,ho.forEach(e=>e())}function go(e){return ho.add(e),()=>ho.delete(e)}function _o({active:e=!0,initial:t}={}){let n=(0,y.useSyncExternalStore)(go,()=>uo),r=(0,y.useSyncExternalStore)(go,()=>fo),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),c=(0,y.useCallback)(async()=>{if(!po){po=!0,a(`load`),s(null);try{Y(await H.request(`/mcp/hub`))}catch(e){s(e instanceof Error?e.message:`Failed to load xSpeed Hub status.`)}finally{po=!1,a(null)}}},[]),l=(0,y.useCallback)(async(e=!1)=>{try{let t=e?{headers:{"X-XSpeed-Reconcile":`1`}}:{};Y(await H.request(`/mcp/hub`,t))}catch{}},[]),u=(0,y.useCallback)(async()=>{a(`token`),s(null);try{Y(await H.request(`/mcp/hub/token`,{method:`POST`}))}catch(e){s(e instanceof Error?e.message:`Could not generate a token.`)}finally{a(null)}},[]),d=(0,y.useCallback)(async()=>{a(`disconnect`),s(null);try{Y(await H.request(`/mcp/hub/disconnect`,{method:`POST`}))}catch(e){s(e instanceof Error?e.message:`Disconnect failed.`)}finally{a(null)}},[]);return(0,y.useEffect)(()=>{if(!(mo||!e)){if(mo=!0,t!=null&&!fo){Y(t);return}c()}},[e]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=new URL(window.location.href);e.searchParams.get(`xspeed_connected`)===`1`&&(l(!0),e.searchParams.delete(`xspeed_connected`),e.searchParams.delete(`xspeed_hub_nonce`),e.searchParams.delete(`xspeed_hub_email`),window.history.replaceState(null,``,e.toString()))},[]),(0,y.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e&&r&&l(!0)};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[e,r,l]),{status:n,connectUrl:(()=>{let e=n?.attach_url;if(!e||typeof window>`u`)return e;try{let t=new URL(e),n=new URL(window.location.href);return n.searchParams.set(`xspeed_connected`,`1`),t.searchParams.set(`return_url`,n.toString()),t.toString()}catch{return e}})(),busy:i,error:o,loaded:r,attached:!!n?.attached,hasToken:!!n?.site_token,load:c,reload:l,generateToken:u,disconnect:d,setError:s}}function vo({initialHub:e,onNext:t,onSkip:n}){let{status:r,connectUrl:i,error:a,attached:o,hasToken:s,busy:c,loaded:l,generateToken:u}=_o({active:!0,initial:e}),[d,f]=(0,y.useState)(!1);return!l&&!o?(0,L.jsx)(co,{step:`connect`,rows:3}):o?(0,L.jsx)(io,{step:`connect`,hero:(0,L.jsx)(ao,{icon:O,title:z(`Connected to xSpeed Hub`),subtitle:r?.account_email?kt(z(`Connected as %s. Your caching is ready to manage from anywhere.`),r.account_email):z(`Your caching is ready to manage from anywhere.`)}),footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-[12px] text-faint`,children:z(`You're all set`)}),(0,L.jsxs)(oo,{onClick:t,children:[z(`Go to Dashboard`),(0,L.jsx)(C,{size:14})]})]}),children:(0,L.jsxs)(`div`,{className:`rounded-card border border-line bg-success-tint px-4 py-3.5`,children:[(0,L.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-success mb-2.5`,children:z(`Now unlocked`)}),(0,L.jsx)(`ul`,{className:`space-y-2`,children:[z(`One AI connection controls the cache on every site you connect`),z(`Purge, benchmark, preload and tune settings by asking your AI`),z(`Manage this site from the central xSpeed Hub dashboard`)].map(e=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2 text-[12.5px] text-ink-soft`,children:[(0,L.jsx)(O,{size:14,className:`text-success mt-0.5 shrink-0`}),e]},e))})]})}):(0,L.jsxs)(io,{step:`connect`,hero:(0,L.jsx)(ao,{logo:(0,L.jsx)(Vt,{className:`w-11 h-11 rounded-card`}),title:z(`Run your site just by asking`),subtitle:z(`Connect this site to your free xSpeed Hub — then manage caching here and on every other site straight from ChatGPT, Claude, or any AI assistant. Free, forever.`)}),footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(so,{onClick:n,children:z(`I'll connect later`)}),(0,L.jsxs)(oo,{onClick:t,children:[z(`Go to Dashboard`),(0,L.jsx)(C,{size:14})]})]}),children:[a&&(0,L.jsx)(U,{tone:`danger`,title:z(`xSpeed Hub error`),body:a}),(0,L.jsxs)(`div`,{className:`rounded-card bg-panel border border-line px-5 sm:px-8 py-5 sm:py-6`,children:[(0,L.jsx)(`p`,{className:`text-[13px] font-medium text-ink mb-4`,children:z(`Your Hub is home base for all your sites. Once connected, you can:`)}),(0,L.jsxs)(`ul`,{className:`space-y-3.5`,children:[(0,L.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(pt,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,L.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:z(`Just say what you want`)}),` — `,(0,L.jsx)(`em`,{className:`not-italic text-ink`,children:z(`“clear the cache on my store,” “warm up the homepage,” “how fast is my blog?”`)}),` — `,z(`and it happens.`)]})]}),(0,L.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(_e,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,L.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:z(`Run every site from one place`)}),` — `,z(`no logging into each dashboard separately.`)]})]}),(0,L.jsxs)(`li`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(ge,{size:16,className:`text-primary mt-0.5 shrink-0`}),(0,L.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-ink-soft`,children:[(0,L.jsx)(`span`,{className:`font-medium text-ink`,children:z(`Get more over time`)}),` — `,z(`new Hub features arrive automatically, free.`)]})]})]}),(0,L.jsx)(`p`,{className:`text-[13px] mt-4`,children:(0,L.jsx)(`a`,{href:`${r?.hub_url??`https://xspeedcache.com`}`,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline`,children:z(`See everything it does.`)})})]}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 pt-2`,children:[(0,L.jsxs)(`a`,{href:i,className:`inline-flex items-center justify-center gap-2 px-8 py-3 rounded-md text-[14px] font-semibold bg-primary text-on-primary hover:bg-primary-hover transition-colors shadow-sm`,children:[(0,L.jsx)(Qe,{size:16}),z(`Connect to xSpeed Hub`)]}),(0,L.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:[z(`Free forever`),z(`Under a minute`),z(`No card, no catch`)].map(e=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11.5px] text-muted`,children:[(0,L.jsx)(O,{size:13,className:`text-success`}),e]},e))})]}),(0,L.jsxs)(`div`,{className:`border-t border-line pt-3 text-center`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{s||u(),f(e=>!e)},className:`inline-flex items-center gap-1.5 text-[11.5px] text-faint hover:text-ink-soft transition-colors`,children:[c===`token`?(0,L.jsx)(I,{size:12,className:`animate-spin`}):(0,L.jsx)(Te,{size:12}),z(`No redirect? Connect with a token instead.`)]}),d&&(0,L.jsxs)(`div`,{className:`mt-3 space-y-2 text-left`,children:[(0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[z(`Paste this site’s URL + token into the`),` `,(0,L.jsxs)(`a`,{href:r?.add_site_url,target:`_blank`,rel:`noreferrer`,className:`text-primary hover:underline inline-flex items-center gap-0.5`,children:[z(`Add site form`),` `,(0,L.jsx)(le,{size:11})]}),` `,z(`on your xSpeed Hub account.`)]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:z(`Site URL`)}),(0,L.jsx)(gn,{content:r?.site_url??``})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[11px] font-medium text-muted mb-1`,children:z(`Token`)}),(0,L.jsx)(gn,{content:r?.site_token??``,tone:`blue`})]})]})]})]})}var yo={apache:`Apache`,litespeed:`LiteSpeed`,nginx:`nginx`,iis:`IIS`,unknown:`Unknown`};function bo({env:e,onNext:t}){let n=zt(),r=!!n.logo_svg?.trim(),i=e.conflicts.length>0,a=e.wp.ok?`ok`:`fail`,o=e.php.modern?`ok`:e.php.ok?`warn`:`fail`,s=e.cache_dir.writable?`ok`:`fail`,c=e.permalinks_ok?`ok`:`warn`,l=i?`warn`:`ok`,u=e.server.gzip_mode===`auto`?`GZIP can be auto-configured via .htaccess.`:`GZIP requires a manual server-config snippet (we'll show it).`;return(0,L.jsx)(io,{step:`review`,hero:(0,L.jsx)(ao,{icon:Be,logo:r?(0,L.jsx)(Vt,{className:`w-8 h-8 rounded`}):void 0,title:`Let's review your setup`,subtitle:`A quick 30-second check of your environment before we turn on a sensible caching profile.`}),footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{}),(0,L.jsxs)(oo,{onClick:t,children:[`Get Started`,(0,L.jsx)(C,{size:14})]})]}),children:(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:[(0,L.jsx)(hn,{first:!0,tone:a,label:`WordPress ${e.wp.version}`,detail:e.wp.ok?`Meets the 6.0+ minimum.`:`Upgrade to 6.0 or higher.`}),(0,L.jsx)(hn,{tone:o,label:`PHP ${e.php.version}`,detail:e.php.modern?`Modern PHP — full speed.`:e.php.ok?`Works, but 8.1+ is recommended for best performance.`:`Upgrade to PHP 7.4 or higher.`}),(0,L.jsx)(hn,{tone:`info`,label:`Server: ${yo[e.server.type]}`,detail:u}),(0,L.jsx)(hn,{tone:s,label:`Cache directory writable`,detail:e.cache_dir.writable?e.cache_dir.path:`Cannot write to ${e.cache_dir.path}. Adjust file permissions before continuing.`}),(0,L.jsx)(hn,{tone:c,label:`Permalinks`,detail:e.permalinks_ok?`Pretty permalinks active.`:`Set permalinks to anything other than "Plain" — required for page caching.`}),(0,L.jsx)(hn,{tone:l,label:`Caching plugin conflicts`,detail:i?`Detected: ${e.conflicts.join(`, `)}. Deactivate before enabling ${n.name} cache to avoid double-caching.`:`No other caching plugins detected.`})]})})}var xo=[{value:12,label:`12 hours`},{value:24,label:`24 hours`},{value:168,label:`7 days`},{value:720,label:`30 days`}],X=[{id:`conservative`,label:`Conservative`,description:`Page cache + GZIP only. No minify, no lazy-load, no browser cache headers. Safest on themes with finicky CSS / JS.`,icon:Je,choices:{cache_enabled:!0,minify_html:!1,minify_css:!1,minify_js:!1,defer_js:!1,gzip_enabled:!0,lazy_images:!1,browser_cache:!1,cache_expiry:12}},{id:`balanced`,label:`Balanced`,description:`Cache + GZIP + safe minify (HTML/CSS only) + lazy images + browser cache headers + LCP image preload & font preconnect. Recommended for most sites.`,icon:pt,choices:{cache_enabled:!0,minify_html:!0,minify_css:!0,minify_js:!1,defer_js:!1,gzip_enabled:!0,lazy_images:!0,browser_cache:!0,resource_hints:!0,cache_expiry:24}},{id:`aggressive`,label:`Aggressive`,description:`Everything Balanced does, plus JS minify + defer non-critical JS, and a 7-day cache lifetime. Test after enabling — some themes break.`,icon:me,choices:{cache_enabled:!0,minify_html:!0,minify_css:!0,minify_js:!0,defer_js:!0,gzip_enabled:!0,lazy_images:!0,browser_cache:!0,resource_hints:!0,cache_expiry:168}}];function So(e){let t=e;return X.find(e=>Object.entries(e.choices).every(([e,n])=>t[e]===n))?.id??`custom`}function Co({env:e,initial:t,onApply:n,onSkip:r,busy:i}){let[a,o]=(0,y.useState)(t),s=(e,t)=>o(n=>({...n,[e]:t})),c=e=>o(t=>({...t,...e.choices})),l=(0,y.useMemo)(()=>So(a),[a]);return(0,L.jsxs)(io,{step:`configure`,hero:(0,L.jsx)(ao,{icon:qe,title:`Pick a starting point`,subtitle:`Choose a preset to fill the toggles below — or skip and configure each one yourself. You can change everything later.`}),footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(so,{onClick:r,children:`Skip — I'll configure manually`}),(0,L.jsxs)(oo,{onClick:()=>n(a),disabled:i,children:[i?`Applying…`:`Apply & Continue`,!i&&(0,L.jsx)(C,{size:14})]})]}),children:[(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2.5`,children:X.map(e=>{let t=e.icon,n=l===e.id;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(e),className:`text-left rounded-card p-3.5 border transition-colors ${n?`border-primary bg-primary-tint`:`border-line bg-paper hover:border-line-strong`}`,"aria-pressed":n,children:[(0,L.jsx)(t,{size:16,className:n?`text-primary`:`text-muted`}),(0,L.jsx)(`div`,{className:`text-[13px] font-medium mt-1.5 ${n?`text-primary`:`text-ink`}`,children:e.label}),(0,L.jsx)(`div`,{className:`text-[11px] text-muted mt-0.5 leading-snug`,children:e.description})]},e.id)})}),(0,L.jsxs)(`div`,{className:`border border-line bg-paper rounded-card overflow-hidden`,children:[(0,L.jsx)(wo,{first:!0,label:`Enable Page Cache`,hint:`Serve static HTML to non-logged-in visitors. The single biggest speed win.`,checked:a.cache_enabled,onChange:e=>s(`cache_enabled`,e)}),(0,L.jsx)(wo,{label:`Minify HTML`,hint:`Strip whitespace and comments from HTML output.`,checked:a.minify_html,onChange:e=>s(`minify_html`,e)}),(0,L.jsx)(wo,{label:`Minify CSS`,hint:`Compress and rewrite enqueued local stylesheets.`,checked:a.minify_css,onChange:e=>s(`minify_css`,e)}),(0,L.jsx)(wo,{label:`Minify JS`,hint:`Compress enqueued local scripts. Higher conflict risk than HTML/CSS — turn off if scripts break.`,checked:a.minify_js,onChange:e=>s(`minify_js`,e)}),(0,L.jsx)(wo,{label:`Defer JavaScript`,hint:`Add defer to enqueued