(function(){const T=document.createElement("link").relList;if(T&&T.supports&&T.supports("modulepreload"))return;for(const A of document.querySelectorAll('link[rel="modulepreload"]'))m(A);new MutationObserver(A=>{for(const D of A)if(D.type==="childList")for(const N of D.addedNodes)N.tagName==="LINK"&&N.rel==="modulepreload"&&m(N)}).observe(document,{childList:!0,subtree:!0});function o(A){const D={};return A.integrity&&(D.integrity=A.integrity),A.referrerPolicy&&(D.referrerPolicy=A.referrerPolicy),A.crossOrigin==="use-credentials"?D.credentials="include":A.crossOrigin==="anonymous"?D.credentials="omit":D.credentials="same-origin",D}function m(A){if(A.ep)return;A.ep=!0;const D=o(A);fetch(A.href,D)}})();var zc={exports:{}},On={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yd;function Bh(){if(Yd)return On;Yd=1;var d=Symbol.for("react.transitional.element"),T=Symbol.for("react.fragment");function o(m,A,D){var N=null;if(D!==void 0&&(N=""+D),A.key!==void 0&&(N=""+A.key),"key"in A){D={};for(var C in A)C!=="key"&&(D[C]=A[C])}else D=A;return A=D.ref,{$$typeof:d,type:m,key:N,ref:A!==void 0?A:null,props:D}}return On.Fragment=T,On.jsx=o,On.jsxs=o,On}var Gd;function qh(){return Gd||(Gd=1,zc.exports=Bh()),zc.exports}var i=qh(),wc={exports:{}},le={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ld;function Yh(){if(Ld)return le;Ld=1;var d=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),N=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),O=Symbol.iterator;function B(r){return r===null||typeof r!="object"?null:(r=O&&r[O]||r["@@iterator"],typeof r=="function"?r:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},K=Object.assign,Y={};function q(r,S,U){this.props=r,this.context=S,this.refs=Y,this.updater=U||L}q.prototype.isReactComponent={},q.prototype.setState=function(r,S){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,S,"setState")},q.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function X(){}X.prototype=q.prototype;function ee(r,S,U){this.props=r,this.context=S,this.refs=Y,this.updater=U||L}var pe=ee.prototype=new X;pe.constructor=ee,K(pe,q.prototype),pe.isPureReactComponent=!0;var ze=Array.isArray;function be(){}var J={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function Ce(r,S,U){var H=U.ref;return{$$typeof:d,type:r,key:S,ref:H!==void 0?H:null,props:U}}function rt(r,S){return Ce(r.type,S,r.props)}function Le(r){return typeof r=="object"&&r!==null&&r.$$typeof===d}function Ee(r){var S={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(U){return S[U]})}var et=/\/+/g;function tt(r,S){return typeof r=="object"&&r!==null&&r.key!=null?Ee(""+r.key):S.toString(36)}function We(r){switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:switch(typeof r.status=="string"?r.then(be,be):(r.status="pending",r.then(function(S){r.status==="pending"&&(r.status="fulfilled",r.value=S)},function(S){r.status==="pending"&&(r.status="rejected",r.reason=S)})),r.status){case"fulfilled":return r.value;case"rejected":throw r.reason}}throw r}function _(r,S,U,H,W){var te=typeof r;(te==="undefined"||te==="boolean")&&(r=null);var oe=!1;if(r===null)oe=!0;else switch(te){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(r.$$typeof){case d:case T:oe=!0;break;case R:return oe=r._init,_(oe(r._payload),S,U,H,W)}}if(oe)return W=W(r),oe=H===""?"."+tt(r,0):H,ze(W)?(U="",oe!=null&&(U=oe.replace(et,"$&/")+"/"),_(W,S,U,"",function(Bt){return Bt})):W!=null&&(Le(W)&&(W=rt(W,U+(W.key==null||r&&r.key===W.key?"":(""+W.key).replace(et,"$&/")+"/")+oe)),S.push(W)),1;oe=0;var je=H===""?".":H+":";if(ze(r))for(var we=0;we>>1,me=_[de];if(0>>1;deA(U,F))HA(W,U)?(_[de]=W,_[H]=F,de=H):(_[de]=U,_[S]=F,de=S);else if(HA(W,F))_[de]=W,_[H]=F,de=H;else break e}}return k}function A(_,k){var F=_.sortIndex-k.sortIndex;return F!==0?F:_.id-k.id}if(d.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var D=performance;d.unstable_now=function(){return D.now()}}else{var N=Date,C=N.now();d.unstable_now=function(){return N.now()-C}}var g=[],x=[],R=1,E=null,O=3,B=!1,L=!1,K=!1,Y=!1,q=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function pe(_){for(var k=o(x);k!==null;){if(k.callback===null)m(x);else if(k.startTime<=_)m(x),k.sortIndex=k.expirationTime,T(g,k);else break;k=o(x)}}function ze(_){if(K=!1,pe(_),!L)if(o(g)!==null)L=!0,be||(be=!0,Ee());else{var k=o(x);k!==null&&We(ze,k.startTime-_)}}var be=!1,J=-1,se=5,Ce=-1;function rt(){return Y?!0:!(d.unstable_now()-Ce_&&rt());){var de=E.callback;if(typeof de=="function"){E.callback=null,O=E.priorityLevel;var me=de(E.expirationTime<=_);if(_=d.unstable_now(),typeof me=="function"){E.callback=me,pe(_),k=!0;break t}E===o(g)&&m(g),pe(_)}else m(g);E=o(g)}if(E!==null)k=!0;else{var r=o(x);r!==null&&We(ze,r.startTime-_),k=!1}}break e}finally{E=null,O=F,B=!1}k=void 0}}finally{k?Ee():be=!1}}}var Ee;if(typeof ee=="function")Ee=function(){ee(Le)};else if(typeof MessageChannel<"u"){var et=new MessageChannel,tt=et.port2;et.port1.onmessage=Le,Ee=function(){tt.postMessage(null)}}else Ee=function(){q(Le,0)};function We(_,k){J=q(function(){_(d.unstable_now())},k)}d.unstable_IdlePriority=5,d.unstable_ImmediatePriority=1,d.unstable_LowPriority=4,d.unstable_NormalPriority=3,d.unstable_Profiling=null,d.unstable_UserBlockingPriority=2,d.unstable_cancelCallback=function(_){_.callback=null},d.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<_?Math.floor(1e3/_):5},d.unstable_getCurrentPriorityLevel=function(){return O},d.unstable_next=function(_){switch(O){case 1:case 2:case 3:var k=3;break;default:k=O}var F=O;O=k;try{return _()}finally{O=F}},d.unstable_requestPaint=function(){Y=!0},d.unstable_runWithPriority=function(_,k){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var F=O;O=_;try{return k()}finally{O=F}},d.unstable_scheduleCallback=function(_,k,F){var de=d.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0de?(_.sortIndex=F,T(x,_),o(g)===null&&_===o(x)&&(K?(X(J),J=-1):K=!0,We(ze,F-de))):(_.sortIndex=me,T(g,_),L||B||(L=!0,be||(be=!0,Ee()))),_},d.unstable_shouldYield=rt,d.unstable_wrapCallback=function(_){var k=O;return function(){var F=O;O=k;try{return _.apply(this,arguments)}finally{O=F}}}})(Ec)),Ec}var Zd;function Lh(){return Zd||(Zd=1,Mc.exports=Gh()),Mc.exports}var Oc={exports:{}},Fe={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Vd;function Qh(){if(Vd)return Fe;Vd=1;var d=kc();function T(g){var x="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(T){console.error(T)}}return d(),Oc.exports=Qh(),Oc.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kd;function Zh(){if(Kd)return Un;Kd=1;var d=Lh(),T=kc(),o=Xh();function m(e){var t="https://react.dev/errors/"+e;if(1me||(e.current=de[me],de[me]=null,me--)}function U(e,t){me++,de[me]=e.current,e.current=t}var H=r(null),W=r(null),te=r(null),oe=r(null);function je(e,t){switch(U(te,t),U(W,e),U(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rd(t),e=od(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}S(H),U(H,e)}function we(){S(H),S(W),S(te)}function Bt(e){e.memoizedState!==null&&U(oe,e);var t=H.current,l=od(t,e.type);t!==l&&(U(W,e),U(H,l))}function al(e){W.current===e&&(S(H),S(W)),oe.current===e&&(S(oe),wn._currentValue=F)}var Kl,Ra;function Z(e){if(Kl===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Kl=t&&t[1]||"",Ra=-1)":-1n||f[a]!==v[n]){var z=` `+f[a].replace(" at new "," at ");return e.displayName&&z.includes("")&&(z=z.replace("",e.displayName)),z}while(1<=a&&0<=n);break}}}finally{Ie=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Z(l):""}function fi(e,t){switch(e.tag){case 26:case 27:case 5:return Z(e.type);case 16:return Z("Lazy");case 13:return e.child!==t&&t!==null?Z("Suspense Fallback"):Z("Suspense");case 19:return Z("SuspenseList");case 0:case 15:return Ml(e.type,!1);case 11:return Ml(e.type.render,!1);case 1:return Ml(e.type,!0);case 31:return Z("Activity");default:return""}}function kn(e){try{var t="",l=null;do t+=fi(e,l),l=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var Ha=Object.prototype.hasOwnProperty,di=d.unstable_scheduleCallback,mi=d.unstable_cancelCallback,p0=d.unstable_shouldYield,g0=d.unstable_requestPaint,ot=d.unstable_now,b0=d.unstable_getCurrentPriorityLevel,qc=d.unstable_ImmediatePriority,Yc=d.unstable_UserBlockingPriority,Rn=d.unstable_NormalPriority,v0=d.unstable_LowPriority,Gc=d.unstable_IdlePriority,y0=d.log,j0=d.unstable_setDisableYieldValue,Ba=null,ft=null;function nl(e){if(typeof y0=="function"&&j0(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Ba,e)}catch{}}var dt=Math.clz32?Math.clz32:A0,N0=Math.log,S0=Math.LN2;function A0(e){return e>>>=0,e===0?32:31-(N0(e)/S0|0)|0}var Hn=256,Bn=262144,qn=4194304;function El(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Yn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,s=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var c=a&134217727;return c!==0?(a=c&~s,a!==0?n=El(a):(u&=c,u!==0?n=El(u):l||(l=c&~e,l!==0&&(n=El(l))))):(c=a&~s,c!==0?n=El(c):u!==0?n=El(u):l||(l=a&~e,l!==0&&(n=El(l)))),n===0?0:t!==0&&t!==n&&(t&s)===0&&(s=n&-n,l=t&-t,s>=l||s===32&&(l&4194048)!==0)?t:n}function qa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lc(){var e=qn;return qn<<=1,(qn&62914560)===0&&(qn=4194304),e}function hi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ya(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function z0(e,t,l,a,n,s){var u=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var c=e.entanglements,f=e.expirationTimes,v=e.hiddenUpdates;for(l=u&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var U0=/[\n"\\]/g;function jt(e){return e.replace(U0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yi(e,t,l,a,n,s,u,c){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+yt(t)):e.value!==""+yt(t)&&(e.value=""+yt(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?ji(e,u,yt(t)):l!=null?ji(e,u,yt(l)):a!=null&&e.removeAttribute("value"),n==null&&s!=null&&(e.defaultChecked=!!s),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.name=""+yt(c):e.removeAttribute("name")}function tr(e,t,l,a,n,s,u,c){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||l!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){vi(e);return}l=l!=null?""+yt(l):"",t=t!=null?""+yt(t):l,c||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=c?e.checked:!!a,e.defaultChecked=!!a,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),vi(e)}function ji(e,t,l){t==="number"&&Qn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ea(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zi=!1;if(Gt)try{var Xa={};Object.defineProperty(Xa,"passive",{get:function(){zi=!0}}),window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{zi=!1}var il=null,wi=null,Zn=null;function cr(){if(Zn)return Zn;var e,t=wi,l=t.length,a,n="value"in il?il.value:il.textContent,s=n.length;for(e=0;e=Ja),hr=" ",xr=!1;function pr(e,t){switch(e){case"keyup":return im.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var na=!1;function cm(e,t){switch(e){case"compositionend":return gr(t);case"keypress":return t.which!==32?null:(xr=!0,hr);case"textInput":return e=t.data,e===hr&&xr?null:e;default:return null}}function rm(e,t){if(na)return e==="compositionend"||!Ui&&pr(e,t)?(e=cr(),Zn=wi=il=null,na=!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:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_r(l)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Qn(e.document)}return t}function ki(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")}var gm=Gt&&"documentMode"in document&&11>=document.documentMode,sa=null,Ri=null,Fa=null,Hi=!1;function Mr(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hi||sa==null||sa!==Qn(a)||(a=sa,"selectionStart"in a&&ki(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Fa&&Wa(Fa,a)||(Fa=a,a=Bs(Ri,"onSelect"),0>=u,n-=u,Ct=1<<32-dt(t)+n|l<ne?(re=V,V=null):re=V.sibling;var xe=y(p,V,b[ne],w);if(xe===null){V===null&&(V=re);break}e&&V&&xe.alternate===null&&t(p,V),h=s(xe,h,ne),he===null?$=xe:he.sibling=xe,he=xe,V=re}if(ne===b.length)return l(p,V),fe&&Qt(p,ne),$;if(V===null){for(;nene?(re=V,V=null):re=V.sibling;var Tl=y(p,V,xe.value,w);if(Tl===null){V===null&&(V=re);break}e&&V&&Tl.alternate===null&&t(p,V),h=s(Tl,h,ne),he===null?$=Tl:he.sibling=Tl,he=Tl,V=re}if(xe.done)return l(p,V),fe&&Qt(p,ne),$;if(V===null){for(;!xe.done;ne++,xe=b.next())xe=M(p,xe.value,w),xe!==null&&(h=s(xe,h,ne),he===null?$=xe:he.sibling=xe,he=xe);return fe&&Qt(p,ne),$}for(V=a(V);!xe.done;ne++,xe=b.next())xe=j(V,p,ne,xe.value,w),xe!==null&&(e&&xe.alternate!==null&&V.delete(xe.key===null?ne:xe.key),h=s(xe,h,ne),he===null?$=xe:he.sibling=xe,he=xe);return e&&V.forEach(function(Hh){return t(p,Hh)}),fe&&Qt(p,ne),$}function Ae(p,h,b,w){if(typeof b=="object"&&b!==null&&b.type===K&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case B:e:{for(var $=b.key;h!==null;){if(h.key===$){if($=b.type,$===K){if(h.tag===7){l(p,h.sibling),w=n(h,b.props.children),w.return=p,p=w;break e}}else if(h.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===se&&Gl($)===h.type){l(p,h.sibling),w=n(h,b.props),an(w,b),w.return=p,p=w;break e}l(p,h);break}else t(p,h);h=h.sibling}b.type===K?(w=Rl(b.props.children,p.mode,w,b.key),w.return=p,p=w):(w=ts(b.type,b.key,b.props,null,p.mode,w),an(w,b),w.return=p,p=w)}return u(p);case L:e:{for($=b.key;h!==null;){if(h.key===$)if(h.tag===4&&h.stateNode.containerInfo===b.containerInfo&&h.stateNode.implementation===b.implementation){l(p,h.sibling),w=n(h,b.children||[]),w.return=p,p=w;break e}else{l(p,h);break}else t(p,h);h=h.sibling}w=Xi(b,p.mode,w),w.return=p,p=w}return u(p);case se:return b=Gl(b),Ae(p,h,b,w)}if(We(b))return Q(p,h,b,w);if(Ee(b)){if($=Ee(b),typeof $!="function")throw Error(m(150));return b=$.call(b),I(p,h,b,w)}if(typeof b.then=="function")return Ae(p,h,cs(b),w);if(b.$$typeof===ee)return Ae(p,h,ns(p,b),w);rs(p,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,h!==null&&h.tag===6?(l(p,h.sibling),w=n(h,b),w.return=p,p=w):(l(p,h),w=Qi(b,p.mode,w),w.return=p,p=w),u(p)):l(p,h)}return function(p,h,b,w){try{ln=0;var $=Ae(p,h,b,w);return pa=null,$}catch(V){if(V===xa||V===is)throw V;var he=ht(29,V,null,p.mode);return he.lanes=w,he.return=p,he}finally{}}}var Ql=Ir(!0),Pr=Ir(!1),fl=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function au(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function dl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ml(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ge&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=es(e),Rr(e,null,l),t}return Pn(e,a,t,l),es(e)}function nn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Xc(e,l)}}function nu(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,s=null;if(l=l.firstBaseUpdate,l!==null){do{var u={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};s===null?n=s=u:s=s.next=u,l=l.next}while(l!==null);s===null?n=s=t:s=s.next=t}else n=s=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:s,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var su=!1;function sn(){if(su){var e=ha;if(e!==null)throw e}}function un(e,t,l,a){su=!1;var n=e.updateQueue;fl=!1;var s=n.firstBaseUpdate,u=n.lastBaseUpdate,c=n.shared.pending;if(c!==null){n.shared.pending=null;var f=c,v=f.next;f.next=null,u===null?s=v:u.next=v,u=f;var z=e.alternate;z!==null&&(z=z.updateQueue,c=z.lastBaseUpdate,c!==u&&(c===null?z.firstBaseUpdate=v:c.next=v,z.lastBaseUpdate=f))}if(s!==null){var M=n.baseState;u=0,z=v=f=null,c=s;do{var y=c.lane&-536870913,j=y!==c.lane;if(j?(ce&y)===y:(a&y)===y){y!==0&&y===ma&&(su=!0),z!==null&&(z=z.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});e:{var Q=e,I=c;y=t;var Ae=l;switch(I.tag){case 1:if(Q=I.payload,typeof Q=="function"){M=Q.call(Ae,M,y);break e}M=Q;break e;case 3:Q.flags=Q.flags&-65537|128;case 0:if(Q=I.payload,y=typeof Q=="function"?Q.call(Ae,M,y):Q,y==null)break e;M=E({},M,y);break e;case 2:fl=!0}}y=c.callback,y!==null&&(e.flags|=64,j&&(e.flags|=8192),j=n.callbacks,j===null?n.callbacks=[y]:j.push(y))}else j={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},z===null?(v=z=j,f=M):z=z.next=j,u|=y;if(c=c.next,c===null){if(c=n.shared.pending,c===null)break;j=c,c=j.next,j.next=null,n.lastBaseUpdate=j,n.shared.pending=null}}while(!0);z===null&&(f=M),n.baseState=f,n.firstBaseUpdate=v,n.lastBaseUpdate=z,s===null&&(n.shared.lanes=0),bl|=u,e.lanes=u,e.memoizedState=M}}function eo(e,t){if(typeof e!="function")throw Error(m(191,e));e.call(t)}function to(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;es?s:8;var u=_.T,c={};_.T=c,Au(e,!1,t,l);try{var f=n(),v=_.S;if(v!==null&&v(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var z=zm(f,a);on(e,t,z,vt(e))}else on(e,t,a,vt(e))}catch(M){on(e,t,{then:function(){},status:"rejected",reason:M},vt())}finally{k.p=s,u!==null&&c.types!==null&&(u.types=c.types),_.T=u}}function Um(){}function Nu(e,t,l,a){if(e.tag!==5)throw Error(m(476));var n=Co(e).queue;Do(e,n,t,F,l===null?Um:function(){return ko(e),l(a)})}function Co(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jt,lastRenderedState:F},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ko(e){var t=Co(e);t.next===null&&(t=e.alternate.memoizedState),on(e,t.next.queue,{},vt())}function Su(){return Je(wn)}function Ro(){return Re().memoizedState}function Ho(){return Re().memoizedState}function Dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=vt();e=dl(l);var a=ml(t,e,l);a!==null&&(ct(a,t,l),nn(a,t,l)),t={cache:Ii()},e.payload=t;return}t=t.return}}function Cm(e,t,l){var a=vt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},vs(e)?qo(t,l):(l=Gi(e,t,l,a),l!==null&&(ct(l,e,a),Yo(l,t,a)))}function Bo(e,t,l){var a=vt();on(e,t,l,a)}function on(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(vs(e))qo(t,n);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var u=t.lastRenderedState,c=s(u,l);if(n.hasEagerState=!0,n.eagerState=c,mt(c,u))return Pn(e,t,n,0),_e===null&&In(),!1}catch{}finally{}if(l=Gi(e,t,n,a),l!==null)return ct(l,e,a),Yo(l,t,a),!0}return!1}function Au(e,t,l,a){if(a={lane:2,revertLane:lc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vs(e)){if(t)throw Error(m(479))}else t=Gi(e,l,a,2),t!==null&&ct(t,e,2)}function vs(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function qo(e,t){ba=ds=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yo(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Xc(e,l)}}var fn={readContext:Je,use:xs,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};fn.useEffectEvent=Ue;var Go={readContext:Je,use:xs,useCallback:function(e,t){return Pe().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:Ao,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,gs(4194308,4,To.bind(null,t,e),l)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var l=Pe();t=t===void 0?null:t;var a=e();if(Xl){nl(!0);try{e()}finally{nl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=Pe();if(l!==void 0){var n=l(t);if(Xl){nl(!0);try{l(t)}finally{nl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Cm.bind(null,ae,e),[a.memoizedState,e]},useRef:function(e){var t=Pe();return e={current:e},t.memoizedState=e},useState:function(e){e=gu(e);var t=e.queue,l=Bo.bind(null,ae,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:yu,useDeferredValue:function(e,t){var l=Pe();return ju(l,e,t)},useTransition:function(){var e=gu(!1);return e=Do.bind(null,ae,e.queue,!0,!1),Pe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ae,n=Pe();if(fe){if(l===void 0)throw Error(m(407));l=l()}else{if(l=t(),_e===null)throw Error(m(349));(ce&127)!==0||uo(a,t,l)}n.memoizedState=l;var s={value:l,getSnapshot:t};return n.queue=s,Ao(ro.bind(null,a,s,e),[e]),a.flags|=2048,ya(9,{destroy:void 0},co.bind(null,a,s,l,t),null),l},useId:function(){var e=Pe(),t=_e.identifierPrefix;if(fe){var l=kt,a=Ct;l=(a&~(1<<32-dt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ms++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof a.is=="string"?u.createElement("select",{is:a.is}):u.createElement("select"),a.multiple?s.multiple=!0:a.size&&(s.size=a.size);break;default:s=typeof a.is=="string"?u.createElement(n,{is:a.is}):u.createElement(n)}}s[Ze]=t,s[lt]=a;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)s.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=s;e:switch($e(s,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&$t(t)}}return Me(t),Bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&$t(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(m(166));if(e=te.current,fa(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=Ve,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[Ze]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||ud(e.nodeValue,l)),e||rl(t,!0)}else e=qs(e).createTextNode(a),e[Ze]=t,t.stateNode=e}return Me(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=fa(t),l!==null){if(e===null){if(!a)throw Error(m(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(m(557));e[Ze]=t}else Hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),e=!1}else l=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(pt(t),t):(pt(t),null);if((t.flags&128)!==0)throw Error(m(558))}return Me(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=fa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(m(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(m(317));n[Ze]=t}else Hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Me(t),n=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(pt(t),t):(pt(t),null)}return pt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),As(t,t.updateQueue),Me(t),null);case 4:return we(),e===null&&ic(t.stateNode.containerInfo),Me(t),null;case 10:return Zt(t.type),Me(t),null;case 19:if(S(ke),a=t.memoizedState,a===null)return Me(t),null;if(n=(t.flags&128)!==0,s=a.rendering,s===null)if(n)mn(a,!1);else{if(De!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=fs(e),s!==null){for(t.flags|=128,mn(a,!1),e=s.updateQueue,t.updateQueue=e,As(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hr(l,e),l=l.sibling;return U(ke,ke.current&1|2),fe&&Qt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ot()>Ms&&(t.flags|=128,n=!0,mn(a,!1),t.lanes=4194304)}else{if(!n)if(e=fs(s),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,As(t,e),mn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!fe)return Me(t),null}else 2*ot()-a.renderingStartTime>Ms&&l!==536870912&&(t.flags|=128,n=!0,mn(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(e=a.last,e!==null?e.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ot(),e.sibling=null,l=ke.current,U(ke,n?l&1|2:l&1),fe&&Qt(t,a.treeForkCount),e):(Me(t),null);case 22:case 23:return pt(t),uu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),l=t.updateQueue,l!==null&&As(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&S(Yl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Zt(He),Me(t),null;case 25:return null;case 30:return null}throw Error(m(156,t.tag))}function qm(e,t){switch(Vi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zt(He),we(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return al(t),null;case 31:if(t.memoizedState!==null){if(pt(t),t.alternate===null)throw Error(m(340));Hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(m(340));Hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return S(ke),null;case 4:return we(),null;case 10:return Zt(t.type),null;case 22:case 23:return pt(t),uu(),e!==null&&S(Yl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zt(He),null;case 25:return null;default:return null}}function df(e,t){switch(Vi(t),t.tag){case 3:Zt(He),we();break;case 26:case 27:case 5:al(t);break;case 4:we();break;case 31:t.memoizedState!==null&&pt(t);break;case 13:pt(t);break;case 19:S(ke);break;case 10:Zt(t.type);break;case 22:case 23:pt(t),uu(),e!==null&&S(Yl);break;case 24:Zt(He)}}function hn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var s=l.create,u=l.inst;a=s(),u.destroy=a}l=l.next}while(l!==n)}}catch(c){ye(t,t.return,c)}}function pl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){var u=a.inst,c=u.destroy;if(c!==void 0){u.destroy=void 0,n=t;var f=l,v=c;try{v()}catch(z){ye(n,f,z)}}}a=a.next}while(a!==s)}}catch(z){ye(t,t.return,z)}}function mf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{to(t,l)}catch(a){ye(e,e.return,a)}}}function hf(e,t,l){l.props=Zl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ye(e,t,a)}}function xn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){ye(e,t,n)}}function Rt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){ye(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){ye(e,t,n)}else l.current=null}function xf(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){ye(e,e.return,n)}}function qu(e,t,l){try{var a=e.stateNode;uh(a,e.type,l,t),a[lt]=t}catch(n){ye(e,e.return,n)}}function pf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sl(e.type)||e.tag===4}function Yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pf(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.tag===27&&Sl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Yt));else if(a!==4&&(a===27&&Sl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Gu(e,t,l),e=e.sibling;e!==null;)Gu(e,t,l),e=e.sibling}function _s(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Sl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(_s(e,t,l),e=e.sibling;e!==null;)_s(e,t,l),e=e.sibling}function gf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);$e(t,a,l),t[Ze]=e,t[lt]=l}catch(s){ye(e,e.return,s)}}var Wt=!1,Ye=!1,Lu=!1,bf=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function Ym(e,t){if(e=e.containerInfo,rc=Vs,e=Tr(e),ki(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,s=a.focusNode;a=a.focusOffset;try{l.nodeType,s.nodeType}catch{l=null;break e}var u=0,c=-1,f=-1,v=0,z=0,M=e,y=null;t:for(;;){for(var j;M!==l||n!==0&&M.nodeType!==3||(c=u+n),M!==s||a!==0&&M.nodeType!==3||(f=u+a),M.nodeType===3&&(u+=M.nodeValue.length),(j=M.firstChild)!==null;)y=M,M=j;for(;;){if(M===e)break t;if(y===l&&++v===n&&(c=u),y===s&&++z===a&&(f=u),(j=M.nextSibling)!==null)break;M=y,y=M.parentNode}M=j}l=c===-1||f===-1?null:{start:c,end:f}}else l=null}l=l||{start:0,end:0}}else l=null;for(oc={focusedElem:e,selectionRange:l},Vs=!1,Xe=t;Xe!==null;)if(t=Xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xe=e;else for(;Xe!==null;){switch(t=Xe,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),$e(s,a,l),s[Ze]=e,Qe(s),a=s;break e;case"link":var u=Ad("link","href",n).get(a+(l.href||""));if(u){for(var c=0;cAe&&(u=Ae,Ae=I,I=u);var p=zr(c,I),h=zr(c,Ae);if(p&&h&&(j.rangeCount!==1||j.anchorNode!==p.node||j.anchorOffset!==p.offset||j.focusNode!==h.node||j.focusOffset!==h.offset)){var b=M.createRange();b.setStart(p.node,p.offset),j.removeAllRanges(),I>Ae?(j.addRange(b),j.extend(h.node,h.offset)):(b.setEnd(h.node,h.offset),j.addRange(b))}}}}for(M=[],j=c;j=j.parentNode;)j.nodeType===1&&M.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;cl?32:l,_.T=null,l=$u,$u=null;var s=yl,u=tl;if(Ge=0,_a=yl=null,tl=0,(ge&6)!==0)throw Error(m(331));var c=ge;if(ge|=4,Mf(s.current),zf(s,s.current,u,l),ge=c,jn(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ba,s)}catch{}return!0}finally{k.p=n,_.T=a,Jf(e,t)}}function $f(e,t,l){t=St(l,t),t=Tu(e.stateNode,t,2),e=ml(e,t,2),e!==null&&(Ya(e,2),Ht(e))}function ye(e,t,l){if(e.tag===3)$f(e,e,l);else for(;t!==null;){if(t.tag===3){$f(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(vl===null||!vl.has(a))){e=St(l,e),l=$o(2),a=ml(t,l,2),a!==null&&(Wo(l,a,t,e),Ya(a,2),Ht(a));break}}t=t.return}}function Pu(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Qm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Zu=!0,n.add(l),e=Km.bind(null,e,t,l),t.then(e,e))}function Km(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,_e===e&&(ce&l)===l&&(De===4||De===3&&(ce&62914560)===ce&&300>ot()-Ts?(ge&2)===0&&za(e,0):Vu|=l,Aa===ce&&(Aa=0)),Ht(e)}function Wf(e,t){t===0&&(t=Lc()),e=kl(e,t),e!==null&&(Ya(e,t),Ht(e))}function $m(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Wf(e,l)}function Wm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(m(314))}a!==null&&a.delete(t),Wf(e,l)}function Fm(e,t){return di(e,t)}var ks=null,Ta=null,ec=!1,Rs=!1,tc=!1,Nl=0;function Ht(e){e!==Ta&&e.next===null&&(Ta===null?ks=Ta=e:Ta=Ta.next=e),Rs=!0,ec||(ec=!0,Pm())}function jn(e,t){if(!tc&&Rs){tc=!0;do for(var l=!1,a=ks;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var s=0;else{var u=a.suspendedLanes,c=a.pingedLanes;s=(1<<31-dt(42|e)+1)-1,s&=n&~(u&~c),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(l=!0,ed(a,s))}else s=ce,s=Yn(a,a===_e?s:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(s&3)===0||qa(a,s)||(l=!0,ed(a,s));a=a.next}while(l);tc=!1}}function Im(){Ff()}function Ff(){Rs=ec=!1;var e=0;Nl!==0&&rh()&&(e=Nl);for(var t=ot(),l=null,a=ks;a!==null;){var n=a.next,s=If(a,t);s===0?(a.next=null,l===null?ks=n:l.next=n,n===null&&(Ta=l)):(l=a,(e!==0||(s&3)!==0)&&(Rs=!0)),a=n}Ge!==0&&Ge!==5||jn(e),Nl!==0&&(Nl=0)}function If(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,s=e.pendingLanes&-62914561;0c)break;var z=f.transferSize,M=f.initiatorType;z&&cd(M)&&(f=f.responseEnd,u+=z*(f"u"?null:document;function yd(e,t,l){var a=Ma;if(a&&typeof t=="string"&&t){var n=jt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),vd.has(n)||(vd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),$e(t,"link",e),Qe(t),a.head.appendChild(t)))}}function bh(e){ll.D(e),yd("dns-prefetch",e,null)}function vh(e,t){ll.C(e,t),yd("preconnect",e,t)}function yh(e,t,l){ll.L(e,t,l);var a=Ma;if(a&&e&&t){var n='link[rel="preload"][as="'+jt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+jt(l.imageSizes)+'"]')):n+='[href="'+jt(e)+'"]';var s=n;switch(t){case"style":s=Ea(e);break;case"script":s=Oa(e)}Mt.has(s)||(e=E({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Mt.set(s,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(_n(s))||t==="script"&&a.querySelector(zn(s))||(t=a.createElement("link"),$e(t,"link",e),Qe(t),a.head.appendChild(t)))}}function jh(e,t){ll.m(e,t);var l=Ma;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+jt(a)+'"][href="'+jt(e)+'"]',s=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Oa(e)}if(!Mt.has(s)&&(e=E({rel:"modulepreload",href:e},t),Mt.set(s,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(zn(s)))return}a=l.createElement("link"),$e(a,"link",e),Qe(a),l.head.appendChild(a)}}}function Nh(e,t,l){ll.S(e,t,l);var a=Ma;if(a&&e){var n=Il(a).hoistableStyles,s=Ea(e);t=t||"default";var u=n.get(s);if(!u){var c={loading:0,preload:null};if(u=a.querySelector(_n(s)))c.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Mt.get(s))&&gc(e,l);var f=u=a.createElement("link");Qe(f),$e(f,"link",e),f._p=new Promise(function(v,z){f.onload=v,f.onerror=z}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Gs(u,t,a)}u={type:"stylesheet",instance:u,count:1,state:c},n.set(s,u)}}}function Sh(e,t){ll.X(e,t);var l=Ma;if(l&&e){var a=Il(l).hoistableScripts,n=Oa(e),s=a.get(n);s||(s=l.querySelector(zn(n)),s||(e=E({src:e,async:!0},t),(t=Mt.get(n))&&bc(e,t),s=l.createElement("script"),Qe(s),$e(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(n,s))}}function Ah(e,t){ll.M(e,t);var l=Ma;if(l&&e){var a=Il(l).hoistableScripts,n=Oa(e),s=a.get(n);s||(s=l.querySelector(zn(n)),s||(e=E({src:e,async:!0,type:"module"},t),(t=Mt.get(n))&&bc(e,t),s=l.createElement("script"),Qe(s),$e(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},a.set(n,s))}}function jd(e,t,l,a){var n=(n=te.current)?Ys(n):null;if(!n)throw Error(m(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ea(l.href),l=Il(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ea(l.href);var s=Il(n).hoistableStyles,u=s.get(e);if(u||(n=n.ownerDocument||n,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,u),(s=n.querySelector(_n(e)))&&!s._p&&(u.instance=s,u.state.loading=5),Mt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Mt.set(e,l),s||_h(n,e,l,u.state))),t&&a===null)throw Error(m(528,""));return u}if(t&&a!==null)throw Error(m(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Oa(l),l=Il(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(m(444,e))}}function Ea(e){return'href="'+jt(e)+'"'}function _n(e){return'link[rel="stylesheet"]['+e+"]"}function Nd(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function _h(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),$e(t,"link",l),Qe(t),e.head.appendChild(t))}function Oa(e){return'[src="'+jt(e)+'"]'}function zn(e){return"script[async]"+e}function Sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+jt(l.href)+'"]');if(a)return t.instance=a,Qe(a),a;var n=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Qe(a),$e(a,"style",n),Gs(a,l.precedence,e),t.instance=a;case"stylesheet":n=Ea(l.href);var s=e.querySelector(_n(n));if(s)return t.state.loading|=4,t.instance=s,Qe(s),s;a=Nd(l),(n=Mt.get(n))&&gc(a,n),s=(e.ownerDocument||e).createElement("link"),Qe(s);var u=s;return u._p=new Promise(function(c,f){u.onload=c,u.onerror=f}),$e(s,"link",a),t.state.loading|=4,Gs(s,l.precedence,e),t.instance=s;case"script":return s=Oa(l.src),(n=e.querySelector(zn(s)))?(t.instance=n,Qe(n),n):(a=l,(n=Mt.get(s))&&(a=E({},l),bc(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Qe(n),$e(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(m(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Gs(a,l.precedence,e));return t.instance}function Gs(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,s=n,u=0;u title"):null)}function zh(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wh(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ea(a.href),s=t.querySelector(_n(n));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qs.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=s,Qe(s);return}s=t.ownerDocument||t,a=Nd(a),(n=Mt.get(n))&&gc(a,n),s=s.createElement("link"),Qe(s);var u=s;u._p=new Promise(function(c,f){u.onload=c,u.onerror=f}),$e(s,"link",a),l.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Qs.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var vc=0;function Th(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0vc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(Mh,e),Xs=null,Qs.call(e))}function Mh(e,t){if(!(t.state.loading&4)){var l=Xs.get(e);if(l)var a=l.get(null);else{l=new Map,Xs.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(T){console.error(T)}}return d(),Tc.exports=Zh(),Tc.exports}var Jh=Vh();/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kh=d=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$h=d=>d.replace(/^([A-Z])|[\s-_]+(\w)/g,(T,o,m)=>m?m.toUpperCase():o.toLowerCase()),Wd=d=>{const T=$h(d);return T.charAt(0).toUpperCase()+T.slice(1)},l0=(...d)=>d.filter((T,o,m)=>!!T&&T.trim()!==""&&m.indexOf(T)===o).join(" ").trim(),Wh=d=>{for(const T in d)if(T.startsWith("aria-")||T==="role"||T==="title")return!0};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Fh={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"};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ih=G.forwardRef(({color:d="currentColor",size:T=24,strokeWidth:o=2,absoluteStrokeWidth:m,className:A="",children:D,iconNode:N,...C},g)=>G.createElement("svg",{ref:g,...Fh,width:T,height:T,stroke:d,strokeWidth:m?Number(o)*24/Number(T):o,className:l0("lucide",A),...!D&&!Wh(C)&&{"aria-hidden":"true"},...C},[...N.map(([x,R])=>G.createElement(x,R)),...Array.isArray(D)?D:[D]]));/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P=(d,T)=>{const o=G.forwardRef(({className:m,...A},D)=>G.createElement(Ih,{ref:D,iconNode:T,className:l0(`lucide-${Kh(Wd(d))}`,`lucide-${d}`,m),...A}));return o.displayName=Wd(d),o};/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ph=[["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"}]],Ps=P("activity",Ph);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ex=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tx=P("arrow-right",ex);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lx=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],ei=P("briefcase",lx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ax=[["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"}]],a0=P("calendar",ax);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nx=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n0=P("check",nx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sx=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ix=P("chevron-left",sx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ux=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cx=P("chevron-right",ux);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rx=[["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"}]],Rc=P("circle-alert",rx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ox=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hc=P("circle-check",ox);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fx=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],dx=P("clock",fx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mx=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],hx=P("code",mx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xx=[["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"}]],px=P("copy",xx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gx=[["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"}]],s0=P("database",gx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bx=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Fd=P("download",bx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vx=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],yx=P("droplets",vx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jx=[["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"}]],i0=P("eye-off",jx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nx=[["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"}]],si=P("eye",Nx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sx=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Ax=P("flame",Sx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _x=[["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"}]],zx=P("globe",_x);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wx=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Tx=P("hash",wx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mx=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ti=P("heart",Mx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ex=[["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"}]],u0=P("image",Ex);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ox=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ux=P("info",Ox);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dx=[["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"}]],Cx=P("key-round",Dx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kx=[["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"}]],Rx=P("lock",kx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hx=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Id=P("log-out",Hx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bx=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],qx=P("menu",Bx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yx=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],Gx=P("mountain",Yx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lx=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Qx=P("palette",Lx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xx=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],c0=P("pen-line",Xx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vx=P("plus",Zx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jx=[["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"}]],r0=P("refresh-cw",Jx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kx=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Uc=P("save",Kx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $x=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wx=P("search",$x);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fx=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],o0=P("send",Fx);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ix=[["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"}]],Dc=P("server",Ix);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Px=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],f0=P("shield-check",Px);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e1=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],ii=P("sliders-vertical",e1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ka=P("sparkles",t1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l1=[["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"}]],li=P("star",l1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],d0=P("trash-2",a1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n1=[["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"}]],s1=P("triangle-alert",n1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ui=P("upload",i1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const u1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Bc=P("user",u1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c1=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],r1=P("wind",c1);/** * @license lucide-react v0.546.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const o1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cn=P("x",o1),ni={portalName:"Хороскоп Админ",portalSubtitle:"Панел за уредување на дневен хороскоп",defaultAuthor:"Главен Уредник",contactEmail:"admin@speedtest.mk",defaultStatus:"published",autoGenerateLuckyNumbers:!0,defaultRating:4,dateFormat:"mk-full",autoSaveDrafts:!0},m0="horoskop_app_custom_settings";function Cc(){try{const d=localStorage.getItem(m0);return d?{...ni,...JSON.parse(d)}:ni}catch{return ni}}function Pd(d){try{localStorage.setItem(m0,JSON.stringify(d)),window.dispatchEvent(new CustomEvent("app-settings-updated",{detail:d}))}catch(T){console.error("Не успеа зачувувањето на поставките:",T)}}const f1=({user:d,selectedDate:T,onDateChange:o,publishedCount:m,totalSigns:A,onOpenSettings:D,onOpenAppSettings:N,onLogout:C})=>{const[g,x]=G.useState(!1),[R,E]=G.useState(()=>Cc().portalName);G.useEffect(()=>{const L=K=>{var Y;(Y=K.detail)!=null&&Y.portalName&&E(K.detail.portalName)};return window.addEventListener("app-settings-updated",L),()=>window.removeEventListener("app-settings-updated",L)},[]);const O=L=>{const K=new Date(T);K.setDate(K.getDate()+L),o(K.toISOString().split("T")[0])},B=T===new Date().toISOString().split("T")[0];return i.jsx("header",{className:"sticky top-0 z-30 bg-slate-900/95 backdrop-blur-md border-b border-slate-800 text-slate-100 shadow-lg",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 lg:px-8",children:[i.jsxs("div",{className:"flex items-center justify-between py-2.5 sm:py-3 gap-2 sm:gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5 sm:gap-3 shrink-0",children:[i.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-gradient-to-tr from-indigo-600 via-purple-600 to-pink-500 flex items-center justify-center shadow-md shadow-indigo-950/50",children:i.jsx(ka,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[i.jsx("h1",{className:"font-bold text-base sm:text-lg leading-tight tracking-tight text-white",children:R||"Хороскоп Админ"}),i.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-indigo-950/80 border border-indigo-500/30 text-indigo-300 hidden xs:inline-block",children:"Node.js API"})]}),i.jsx("p",{className:"text-[11px] sm:text-xs text-slate-400 hidden sm:block",children:"Панел за уредување на дневен хороскоп"})]})]}),i.jsxs("div",{className:"flex items-center bg-slate-950/80 p-1 sm:p-1.5 rounded-xl border border-slate-800 shadow-inner",children:[i.jsx("button",{onClick:()=>O(-1),className:"p-1.5 sm:p-2 hover:bg-slate-800 active:bg-slate-700 rounded-lg text-slate-400 hover:text-white transition-colors touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center",title:"Претходен ден","aria-label":"Претходен ден",children:i.jsx(ix,{className:"w-4 h-4"})}),i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-1 sm:px-2",children:[i.jsx(a0,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-indigo-400 shrink-0"}),i.jsx("input",{type:"date",value:T,onChange:L=>o(L.target.value),className:"bg-transparent text-xs sm:text-sm font-medium text-slate-200 focus:outline-none cursor-pointer w-[110px] sm:w-[130px]","aria-label":"Избери датум"}),B&&i.jsx("span",{className:"text-[9px] sm:text-[10px] uppercase font-bold tracking-wider px-1.5 py-0.5 rounded bg-indigo-500/20 text-indigo-300 border border-indigo-500/30 hidden sm:inline-block",children:"Денес"})]}),i.jsx("button",{onClick:()=>O(1),className:"p-1.5 sm:p-2 hover:bg-slate-800 active:bg-slate-700 rounded-lg text-slate-400 hover:text-white transition-colors touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center",title:"Следен ден","aria-label":"Следен ден",children:i.jsx(cx,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[i.jsxs("div",{className:"hidden xl:flex items-center gap-2 px-3 py-1.5 rounded-lg bg-slate-800/60 border border-slate-700/60 text-xs",children:[i.jsx("div",{className:`w-2 h-2 rounded-full ${m===A?"bg-emerald-400":"bg-amber-400"} animate-pulse`}),i.jsxs("span",{className:"text-slate-300",children:["Статус: ",i.jsxs("strong",{className:"text-white",children:[m,"/",A]})," знаци"]})]}),i.jsxs("button",{onClick:N,id:"btn-app-settings",className:"flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-medium bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-slate-200 hover:text-white border border-slate-700 transition-colors shadow-sm",title:"Подесувања на апликацијата (корисници, наслов, резервна копија)",children:[i.jsx(ii,{className:"w-3.5 h-3.5 text-indigo-400 shrink-0"}),i.jsx("span",{children:"Подесувања"})]}),i.jsxs("button",{onClick:D,id:"btn-api-settings",className:"flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-medium bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-slate-200 hover:text-white border border-slate-700 transition-colors shadow-sm",title:"Поставки за Node.js API поврзување",children:[i.jsx(Dc,{className:"w-3.5 h-3.5 text-indigo-400 shrink-0"}),i.jsx("span",{children:"API Поставки"})]}),i.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l border-slate-800",children:[i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsx("span",{className:"text-xs font-semibold text-slate-200",children:d.name}),i.jsx("span",{className:"text-[10px] text-indigo-400 uppercase font-medium tracking-wider",children:d.role})]}),i.jsx("button",{onClick:C,id:"btn-logout",className:"p-2 rounded-xl text-slate-400 hover:text-rose-400 hover:bg-rose-950/30 active:bg-rose-900/40 border border-transparent hover:border-rose-900/40 transition-colors",title:"Одјави се","aria-label":"Одјави се",children:i.jsx(Id,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"flex md:hidden items-center gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 text-[11px] bg-slate-950 px-2 py-1 rounded-lg border border-slate-800",children:[i.jsx("span",{className:"font-bold text-emerald-400",children:m}),i.jsxs("span",{className:"text-slate-500",children:["/",A]})]}),i.jsx("button",{onClick:()=>x(!g),className:"p-2 rounded-xl bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-slate-200 transition-colors border border-slate-700 touch-manipulation","aria-label":"Отвори мени",children:g?i.jsx(Cn,{className:"w-5 h-5"}):i.jsx(qx,{className:"w-5 h-5"})})]})]}),g&&i.jsxs("div",{className:"md:hidden py-3 border-t border-slate-800 space-y-2.5 animate-fadeIn",children:[i.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-xl bg-slate-950 border border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-600/30 border border-indigo-500/40 flex items-center justify-center text-indigo-300",children:i.jsx(Bc,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-white",children:d.name}),i.jsx("div",{className:"text-[10px] text-indigo-400 uppercase font-medium",children:d.role})]})]}),i.jsxs("div",{className:"text-right text-[11px] text-slate-400",children:[i.jsx("span",{children:"Објавени: "}),i.jsx("strong",{className:"text-emerald-400",children:m}),i.jsxs("span",{children:[" / ",A]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{onClick:()=>{x(!1),N()},className:"w-full flex items-center justify-center gap-2 py-2.5 px-3 rounded-xl bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-xs font-semibold text-slate-200 border border-slate-700 shadow-sm",children:[i.jsx(ii,{className:"w-4 h-4 text-indigo-400"}),i.jsx("span",{children:"Подесувања на апликацијата"})]}),i.jsxs("button",{onClick:()=>{x(!1),D()},className:"w-full flex items-center justify-center gap-2 py-2.5 px-3 rounded-xl bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-xs font-semibold text-slate-200 border border-slate-700 shadow-sm",children:[i.jsx(Dc,{className:"w-4 h-4 text-indigo-400"}),i.jsx("span",{children:"API Поставки"})]})]}),i.jsxs("button",{onClick:()=>{x(!1),C()},className:"w-full flex items-center justify-center gap-2 py-2.5 px-3 rounded-xl bg-rose-950/40 hover:bg-rose-900/60 text-rose-300 text-xs font-semibold border border-rose-900/50",children:[i.jsx(Id,{className:"w-4 h-4"}),i.jsx("span",{children:"Одјави се"})]})]})]})})},ci=[{id:"aries",nameMk:"Овен",latinName:"Aries",period:"21 Март - 19 Април",element:"Оган",symbol:"♈",planet:"Марс",traits:["Храбар","Енергичен","Лидер"],color:"text-red-500",gradient:"from-red-500 to-amber-600"},{id:"taurus",nameMk:"Бик",latinName:"Taurus",period:"20 Април - 20 Мај",element:"Земја",symbol:"♉",planet:"Венера",traits:["Трпелив","Практичен","Лојален"],color:"text-emerald-500",gradient:"from-emerald-500 to-teal-600"},{id:"gemini",nameMk:"Близнаци",latinName:"Gemini",period:"21 Мај - 20 Јуни",element:"Воздух",symbol:"♊",planet:"Меркур",traits:["Љубопитен","Комуникативен","Флексибилен"],color:"text-amber-500",gradient:"from-amber-400 to-orange-500"},{id:"cancer",nameMk:"Рак",latinName:"Cancer",period:"21 Јуни - 22 Јули",element:"Вода",symbol:"♋",planet:"Месечина",traits:["Емотивен","Интуитивен","Грижлив"],color:"text-sky-500",gradient:"from-sky-400 to-blue-600"},{id:"leo",nameMk:"Лав",latinName:"Leo",period:"23 Јули - 22 Август",element:"Оган",symbol:"♌",planet:"Сонце",traits:["Самоуверен","Дарежлив","Креативен"],color:"text-yellow-500",gradient:"from-yellow-400 to-amber-600"},{id:"virgo",nameMk:"Девица",latinName:"Virgo",period:"23 Август - 22 Септември",element:"Земја",symbol:"♍",planet:"Меркур",traits:["Аналитична","Прецизна","Вредна"],color:"text-emerald-600",gradient:"from-teal-500 to-green-700"},{id:"libra",nameMk:"Вага",latinName:"Libra",period:"23 Септември - 22 Октомври",element:"Воздух",symbol:"♎",planet:"Венера",traits:["Хармонична","Дипломатска","Шармантна"],color:"text-indigo-500",gradient:"from-pink-400 to-indigo-600"},{id:"scorpio",nameMk:"Скорпија",latinName:"Scorpio",period:"23 Октомври - 21 Ноември",element:"Вода",symbol:"♏",planet:"Плутон / Марс",traits:["Страсна","Инстинктивна","Мистериозна"],color:"text-purple-600",gradient:"from-purple-600 to-rose-700"},{id:"sagittarius",nameMk:"Стрелец",latinName:"Sagittarius",period:"22 Ноември - 21 Декември",element:"Оган",symbol:"♐",planet:"Јупитер",traits:["Оптимист","Авантурист","Искрен"],color:"text-orange-500",gradient:"from-orange-500 to-red-600"},{id:"capricorn",nameMk:"Јарец",latinName:"Capricorn",period:"22 Декември - 19 Јануари",element:"Земја",symbol:"♑",planet:"Сатурн",traits:["Амбициозен","Дисциплиниран","Одговорен"],color:"text-slate-600",gradient:"from-slate-600 to-zinc-800"},{id:"aquarius",nameMk:"Водолија",latinName:"Aquarius",period:"20 Јануари - 18 Февруари",element:"Воздух",symbol:"♒",planet:"Уран",traits:["Иновативна","Оригинална","Хумана"],color:"text-cyan-500",gradient:"from-cyan-400 to-blue-600"},{id:"pisces",nameMk:"Риби",latinName:"Pisces",period:"19 Февруари - 20 Март",element:"Вода",symbol:"♓",planet:"Нептун",traits:["Емпатични","Уметнички","Сонувачи"],color:"text-teal-500",gradient:"from-teal-400 to-indigo-600"}],d1=({date:d,horoscopes:T,onSelectSign:o,isLoading:m})=>{const[A,D]=G.useState(""),[N,C]=G.useState("all"),[g,x]=G.useState("all"),R=ci.length,E=G.useMemo(()=>Object.values(T).filter(Y=>{var q;return Y.status==="published"&&((q=Y.text)==null?void 0:q.trim())}).length,[T]),O=G.useMemo(()=>Object.values(T).filter(Y=>{var q;return Y.status==="draft"&&((q=Y.text)==null?void 0:q.trim())}).length,[T]),B=Math.round(E/R*100),L=G.useMemo(()=>ci.filter(Y=>{if(!(Y.nameMk.toLowerCase().includes(A.toLowerCase())||Y.latinName.toLowerCase().includes(A.toLowerCase())||Y.element.toLowerCase().includes(A.toLowerCase()))||N!=="all"&&Y.element!==N)return!1;const X=T[Y.id];return g==="published"?(X==null?void 0:X.status)==="published"&&!!(X!=null&&X.text.trim()):g==="draft"?(X==null?void 0:X.status)==="draft"&&!!(X!=null&&X.text.trim()):g==="missing"?!X||!X.text.trim():!0}),[A,N,g,T]),K=Y=>{switch(Y){case"Оган":return i.jsx(Ax,{className:"w-3.5 h-3.5 text-rose-400"});case"Земја":return i.jsx(Gx,{className:"w-3.5 h-3.5 text-emerald-400"});case"Воздух":return i.jsx(r1,{className:"w-3.5 h-3.5 text-amber-400"});case"Вода":return i.jsx(yx,{className:"w-3.5 h-3.5 text-sky-400"})}};return i.jsxs("div",{className:"space-y-6 pb-12",children:[i.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-2xl p-4 sm:p-6 shadow-xl relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-80 h-80 bg-indigo-500/5 rounded-full blur-3xl pointer-events-none -z-0"}),i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-5 relative z-10",children:[i.jsxs("div",{children:[i.jsx("div",{className:"flex items-center gap-2 mb-1",children:i.jsxs("span",{className:"text-[11px] sm:text-xs font-bold uppercase tracking-wider text-indigo-400",children:["Контролна Табла • ",d]})}),i.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-white tracking-tight",children:"Дневен Хороскоп за 12-те Знаци"}),i.jsx("p",{className:"text-xs text-slate-400 mt-1 max-w-xl leading-relaxed",children:"Изберете хороскопски знак за да напишете дневна прогноза, прикачите слика и објавите директно на backend API-то."})]}),i.jsxs("div",{className:"bg-slate-950/80 p-3.5 sm:p-4 rounded-xl border border-slate-800 shrink-0 w-full lg:w-auto lg:min-w-[280px]",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[i.jsx("span",{className:"text-slate-300 font-semibold",children:"Напредок на објавување"}),i.jsxs("span",{className:"text-indigo-400 font-bold",children:[B,"%"]})]}),i.jsx("div",{className:"w-full bg-slate-800 rounded-full h-2.5 overflow-hidden",children:i.jsx("div",{className:"bg-gradient-to-r from-indigo-500 via-purple-500 to-emerald-400 h-2.5 rounded-full transition-all duration-500",style:{width:`${B}%`}})}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-slate-400 mt-2.5 gap-1 flex-wrap",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400 inline-block shrink-0"}),i.jsxs("span",{children:[E," Објавени"]})]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 inline-block shrink-0"}),i.jsxs("span",{children:[O," Нацрти"]})]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-600 inline-block shrink-0"}),i.jsxs("span",{children:[R-(E+O)," Непополнети"]})]})]})]})]})]}),i.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-between gap-3",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400",children:i.jsx(Wx,{className:"w-4 h-4"})}),i.jsx("input",{type:"text",placeholder:"Пребарај знак (пр. Овен, Лав, Водолија)...",value:A,onChange:Y=>D(Y.target.value),className:"w-full pl-10 pr-16 py-2.5 bg-slate-900 border border-slate-800 rounded-xl text-xs sm:text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-indigo-500"}),A&&i.jsx("button",{onClick:()=>D(""),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-xs text-slate-400 hover:text-white",children:"Исчисти"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[i.jsxs("div",{className:"bg-slate-900 p-1 rounded-xl border border-slate-800 flex items-center gap-1 overflow-x-auto no-scrollbar",children:[i.jsx("button",{onClick:()=>C("all"),className:`px-3 py-1.5 rounded-lg text-xs font-medium shrink-0 transition-all touch-manipulation min-h-[32px] ${N==="all"?"bg-indigo-600 text-white shadow":"text-slate-400 hover:text-slate-200"}`,children:"Сите"}),["Оган","Земја","Воздух","Вода"].map(Y=>i.jsxs("button",{onClick:()=>C(Y),className:`px-2.5 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 shrink-0 transition-all touch-manipulation min-h-[32px] ${N===Y?"bg-slate-800 text-white border border-slate-700":"text-slate-400 hover:text-slate-200"}`,children:[K(Y),i.jsx("span",{children:Y})]},Y))]}),i.jsxs("select",{value:g,onChange:Y=>x(Y.target.value),className:"bg-slate-900 border border-slate-800 text-slate-200 text-xs rounded-xl px-3 py-2.5 focus:outline-none focus:border-indigo-500 cursor-pointer min-h-[38px]",children:[i.jsx("option",{value:"all",children:"Сите статуси"}),i.jsxs("option",{value:"published",children:["Само Објавени (",E,")"]}),i.jsxs("option",{value:"draft",children:["Само Нацрти (",O,")"]}),i.jsxs("option",{value:"missing",children:["Необјавени (",R-(E+O),")"]})]})]})]}),m?i.jsxs("div",{className:"py-20 flex flex-col items-center justify-center text-slate-400",children:[i.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin mb-3"}),i.jsx("p",{className:"text-sm font-medium",children:"Се вчитуваат хороскопите од API-то..."})]}):L.length===0?i.jsxs("div",{className:"bg-slate-900/60 border border-slate-800 rounded-2xl p-12 text-center text-slate-400",children:[i.jsx(Rc,{className:"w-10 h-10 mx-auto text-slate-600 mb-3"}),i.jsx("h3",{className:"text-base font-semibold text-slate-200",children:"Не се пронајдени знаци"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Пробајте да ги смените филтрите или пребарувањето."})]}):i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:L.map(Y=>{var ze;const q=T[Y.id],X=!!q&&!!((ze=q.text)!=null&&ze.trim()),ee=(q==null?void 0:q.status)==="published"&&X,pe=(q==null?void 0:q.status)==="draft"&&X;return i.jsxs("div",{id:`card-sign-${Y.id}`,onClick:()=>o(Y),className:`group bg-slate-900 border rounded-2xl overflow-hidden transition-all duration-200 cursor-pointer flex flex-col justify-between hover:shadow-xl hover:shadow-indigo-950/30 hover:-translate-y-0.5 ${ee?"border-emerald-500/30 hover:border-emerald-500/60":pe?"border-amber-500/30 hover:border-amber-500/60":"border-slate-800 hover:border-slate-700"}`,children:[i.jsxs("div",{className:`p-4 bg-gradient-to-r ${Y.gradient} text-white flex items-center justify-between`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-11 h-11 rounded-xl bg-white/20 backdrop-blur-md flex items-center justify-center text-2xl font-serif shadow-inner border border-white/25",children:Y.symbol}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-base leading-snug",children:Y.nameMk}),i.jsxs("p",{className:"text-[11px] text-white/80",children:[Y.latinName," • ",Y.period]})]})]}),i.jsxs("span",{className:"text-[10px] uppercase font-bold tracking-wider px-2 py-0.5 rounded-full bg-black/30 border border-white/20 flex items-center gap-1",children:[K(Y.element),i.jsx("span",{children:Y.element})]})]}),i.jsxs("div",{className:"p-4 flex-1 flex flex-col justify-between space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[ee?i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold text-emerald-400 bg-emerald-950/60 px-2.5 py-0.5 rounded-full border border-emerald-500/30",children:[i.jsx(Hc,{className:"w-3 h-3"})," Објавено"]}):pe?i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold text-amber-400 bg-amber-950/60 px-2.5 py-0.5 rounded-full border border-amber-500/30",children:[i.jsx(dx,{className:"w-3 h-3"})," Нацрт"]}):i.jsx("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium text-slate-500 bg-slate-950 px-2 py-0.5 rounded-full border border-slate-800",children:"Не е пополнето"}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[((q==null?void 0:q.loveAdvice)||(q==null?void 0:q.careerAdvice)||(q==null?void 0:q.healthAdvice))&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-amber-400 bg-amber-950/40 px-2 py-0.5 rounded-md border border-amber-500/20",title:"Вклучува детални совети за Љубов, Кариера, Здравје",children:[i.jsx(ka,{className:"w-3 h-3"})," Совети"]}),(q==null?void 0:q.imageUrl)&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-indigo-400 bg-indigo-950/40 px-2 py-0.5 rounded-md border border-indigo-500/20",title:"Има прикачено слика",children:[i.jsx(u0,{className:"w-3 h-3"})," Слика"]})]})]}),i.jsx("div",{className:"text-xs text-slate-300 leading-relaxed line-clamp-3 min-h-[3.6rem]",children:X?q.text:i.jsxs("span",{className:"text-slate-600 italic",children:["Кликнете овде за да го напишете дневниот хороскоп за ",Y.nameMk,"..."]})}),X&&(q.loveRating||q.careerRating||q.healthRating)&&i.jsxs("div",{className:"pt-2 border-t border-slate-800/80 flex items-center justify-between text-[11px] text-slate-400",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-rose-400 font-bold",children:"♥"}),i.jsxs("span",{children:[q.loveRating??4,"/5"]})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-blue-400 font-bold",children:"★"}),i.jsxs("span",{children:[q.careerRating??4,"/5"]})]}),q.luckyNumber&&i.jsxs("div",{className:"text-indigo-300 font-medium",children:["Број: ",q.luckyNumber]})]}),i.jsx("div",{className:"pt-2",children:i.jsxs("button",{type:"button",className:"w-full py-2 px-3 rounded-xl bg-slate-800 group-hover:bg-indigo-600 text-slate-200 group-hover:text-white text-xs font-semibold flex items-center justify-center gap-1.5 transition-colors shadow-sm",children:[i.jsx(c0,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:X?"Уреди хороскоп":"Напиши хороскоп"})]})})]})]},Y.id)})})]})},Dt={TOKEN:"horoscope_admin_token",USER:"horoscope_admin_user",API_BASE_URL:"horoscope_admin_api_base_url",LOCAL_BACKUP:"horoscope_admin_entries_backup"},m1={oven:"aries",bik:"taurus",bliznaci:"gemini",rak:"cancer",lav:"leo",devica:"virgo",vaga:"libra",skorpija:"scorpio",strelec:"sagittarius",jarec:"capricorn",vodolija:"aquarius",ribi:"pisces",овен:"aries",бик:"taurus",близнаци:"gemini",рак:"cancer",лав:"leo",девица:"virgo",вага:"libra",скорпија:"scorpio",стрелец:"sagittarius",јарец:"capricorn",водолија:"aquarius",риби:"pisces"},e0={aries:"oven",taurus:"bik",gemini:"bliznaci",cancer:"rak",leo:"lav",virgo:"devica",libra:"vaga",scorpio:"skorpija",sagittarius:"strelec",capricorn:"jarec",aquarius:"vodolija",pisces:"ribi"};function Da(d,T){if(!d||typeof d!="object")return null;const o=d.podatoci||d.podatok||d.data||d;if(!o||typeof o!="object")return null;const m=(o.znak||o.signId||o.sign||o.id||"").toString().toLowerCase().trim(),A=m1[m]||m||"aries",D=o.tekst||o.text||o.prognoza||o.opis||o.content||"";let N=o.slikaUrl||o.slika||o.imageUrl||o.image||"";if(N&&!N.startsWith("http")&&!N.startsWith("data:")){const ee=oi().replace(/\/api\/?$/,"").replace(/\/+$/,"");ee&&(ee.startsWith("http://")||ee.startsWith("https://"))&&(N=`${ee}${N.startsWith("/")?N:`/${N}`}`)}const C=o.datum||o.date||T||new Date().toISOString().split("T")[0],g=o.kategorii||{},x=g.srekenBroj??g.srekjenBroj??o.srekjenBroj??o.srekenBroj??o.luckyNumber??o.broj??void 0,R=g.bojaNaDenot??g.srekjnaBoja??g.sreknaBoja??o.srekjnaBoja??o.sreknaBoja??o.luckyColor??o.boja??void 0,E=typeof g.ljubov=="string"&&g.ljubov.trim()?g.ljubov.trim():typeof o.ljubov=="string"&&o.ljubov.trim()?o.ljubov.trim():typeof o.loveAdvice=="string"&&o.loveAdvice.trim()?o.loveAdvice.trim():void 0,O=typeof g.kariera=="string"&&g.kariera.trim()?g.kariera.trim():typeof o.kariera=="string"&&o.kariera.trim()?o.kariera.trim():typeof o.careerAdvice=="string"&&o.careerAdvice.trim()?o.careerAdvice.trim():void 0,B=typeof g.zdravje=="string"&&g.zdravje.trim()?g.zdravje.trim():typeof o.zdravje=="string"&&o.zdravje.trim()?o.zdravje.trim():typeof o.healthAdvice=="string"&&o.healthAdvice.trim()?o.healthAdvice.trim():void 0,L=typeof o.rejtingLjubov=="number"?o.rejtingLjubov:typeof g.ljubov=="number"?g.ljubov:typeof o.loveRating=="number"?o.loveRating:4,K=typeof o.rejtingKariera=="number"?o.rejtingKariera:typeof g.kariera=="number"?g.kariera:typeof o.careerRating=="number"?o.careerRating:4,Y=typeof o.rejtingZdravje=="number"?o.rejtingZdravje:typeof g.zdravje=="number"?g.zdravje:typeof o.healthRating=="number"?o.healthRating:4,q=o.status==="draft"||o.status==="nacrt"?"draft":"published";return{id:o._id||o.id||`${A}-${C}`,signId:A,date:C,text:D,imageUrl:N||void 0,luckyNumber:x?Number(x):void 0,luckyColor:R||void 0,loveRating:Math.min(5,Math.max(1,Number(L)||4)),careerRating:Math.min(5,Math.max(1,Number(K)||4)),healthRating:Math.min(5,Math.max(1,Number(Y)||4)),loveAdvice:E,careerAdvice:O,healthAdvice:B,status:q,updatedAt:o.updatedAt||o.azhurirano||new Date().toISOString(),publishedBy:o.publishedBy||o.objavenoOd||"Администратор"}}const oi=()=>localStorage.getItem(Dt.API_BASE_URL)||"/api",ri=d=>{if(!d||d.trim()==="")localStorage.removeItem(Dt.API_BASE_URL);else{const T=d.trim().replace(/\/+$/,"");localStorage.setItem(Dt.API_BASE_URL,T)}},h0=()=>{const d=localStorage.getItem(Dt.USER);if(!d)return null;try{return JSON.parse(d)}catch{return null}},h1=()=>localStorage.getItem(Dt.TOKEN),ai=(d,T)=>{localStorage.setItem(Dt.USER,JSON.stringify(d)),localStorage.setItem(Dt.TOKEN,T)},x1=()=>{localStorage.removeItem(Dt.USER),localStorage.removeItem(Dt.TOKEN)};async function p1(d,T=550,o=.72){return new Promise((m,A)=>{const D=new FileReader;D.onerror=A,D.onload=N=>{var g;const C=new Image;C.onerror=()=>{var x;return m((x=N.target)==null?void 0:x.result)},C.onload=()=>{var x,R;try{const E=document.createElement("canvas");let O=C.width,B=C.height;(O>T||B>T)&&(O>B?(B=Math.round(B*T/O),O=T):(O=Math.round(O*T/B),B=T)),E.width=O,E.height=B;const L=E.getContext("2d");if(!L){m((x=N.target)==null?void 0:x.result);return}L.drawImage(C,0,0,O,B);try{const K=E.toDataURL("image/webp",o);if(K.startsWith("data:image/webp")){m(K);return}}catch{}m(E.toDataURL("image/jpeg",o))}catch{m((R=N.target)==null?void 0:R.result)}},C.src=(g=N.target)==null?void 0:g.result},D.readAsDataURL(d)})}function x0(d,T){const m=(T!==void 0?T:oi()).trim().replace(/\/+$/,"");if(d.startsWith("http://")||d.startsWith("https://"))return d;if(d===""||d==="/")return m?`${m}/`:"/";let A=d.startsWith("/")?d:`/${d}`;return m?m.endsWith("/api")?(A.startsWith("/api/")&&(A=A.substring(4)),`${m}${A}`):(A.startsWith("/api/")||(A=`/api${A}`),`${m}${A}`):A.startsWith("/api/")?A:`/api${A}`}async function Ca(d,T={}){const o=h1(),m={"Content-Type":"application/json",...T.headers};o&&(m.Authorization=`Bearer ${o}`);const A=x0(d);if(A.startsWith("http://")||A.startsWith("https://"))try{const N=await fetch(A,{...T,headers:m,mode:"cors"}),C=N.headers.get("content-type")||"";if(!N.ok){if(N.status===405)throw new Error(`Грешка 405 (Method Not Allowed): Серверот на ${A} го одби методот ${T.method||"GET"}.`);let g=`Грешка ${N.status}: ${N.statusText}`;if(C.includes("application/json"))try{const x=await N.json();x.poraka?g=x.poraka:x.error?g=x.error:x.message&&(g=x.message)}catch{}throw new Error(g)}if(!C.includes("application/json")){const g=await N.text();if(g.trim().startsWith("<"))throw new Error(`Рутата ${A} врати HTML наместо JSON.`);try{return JSON.parse(g)}catch{throw new Error(`Невалиден одговор од ${A}`)}}return await N.json()}catch(N){if(N.message&&(N.message.includes("405")||N.message.includes("Грешка 4")))throw N;console.warn(`[Direct Fetch Fallback] Директниот повик кон ${A} не успеа (${N.message}). Обид преку /api/proxy...`);try{const C=`/api/proxy?url=${encodeURIComponent(A)}`;let g=T.body;g&&typeof g=="object"&&!(g instanceof FormData)&&(g=JSON.stringify(g));const x=await fetch(C,{method:T.method||"GET",headers:{"Content-Type":"application/json",...m.Authorization?{Authorization:m.Authorization}:{}},body:g}),R=x.headers.get("content-type")||"";if(!x.ok){if(x.status===405)throw new Error("Грешка 405 (Not Allowed): Веб серверот (Nginx/Apache) го одби барањето. Во Nginx конфигурирајте 'location /api/' proxy_pass кон Node.js серверот.");let E=`Грешка ${x.status}: ${x.statusText}`;if(R.includes("application/json"))try{const O=await x.json();O.poraka?E=O.poraka:O.error?E=O.error:O.message&&(E=O.message)}catch{}throw new Error(E)}if(!R.includes("application/json")){const E=await x.text();if(E.trim().startsWith("<"))throw new Error(`Прокси серверот врати HTML наместо JSON од ${A}.`);try{return JSON.parse(E)}catch{throw new Error(`Невалиден одговор од ${A}`)}}return await x.json()}catch(C){throw new Error(C.message||N.message||`Не успеа поврзувањето со ${A}`)}}try{const N=await fetch(A,{...T,headers:m}),C=N.headers.get("content-type")||"";if(!N.ok){if(N.status===405){if(typeof window<"u"){const x=window.location.hostname&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"?window.location.hostname:"178.105.202.115",R=`http://${x}:5000/api${d.startsWith("/")?d:`/${d}`}`;try{const E=await fetch(R,{...T,headers:m,mode:"cors"});if(E.ok){const O=await E.json();return ri(`http://${x}:5000`),O}}catch{}}throw new Error(`Грешка 405 (Not Allowed): Веб серверот (Nginx) го одби барањето. Во Nginx конфигурирајте: location /api/ { proxy_pass http://127.0.0.1:5000; } Или во Поставки внесете директно URL кон серверот.`)}let g=`Грешка ${N.status}: ${N.statusText}`;if(C.includes("application/json"))try{const x=await N.json();x.poraka?g=x.poraka:x.message?g=x.message:x.error&&(g=x.error)}catch{}throw new Error(g)}if(!C.includes("application/json")){const g=await N.text();if(g.trim().startsWith("<"))throw new Error(`Рутата ${A} врати HTML наместо JSON.`);try{return JSON.parse(g)}catch{throw new Error(`Невалиден одговор од ${A}`)}}return await N.json()}catch(N){if(N.message&&N.message.includes("405")&&typeof window<"u"){const C=window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"?window.location.hostname:"178.105.202.115",g=`http://${C}:5000/api${d.startsWith("/")?d:`/${d}`}`;console.warn(`[Auto-Recovery] Nginx врати 405. Обид за директно поврзување кон бекендот: ${g}`);try{const x=await fetch(g,{...T,headers:m,mode:"cors"});if(x.ok){const R=await x.json();return ri(`http://${C}:5000`),R}}catch{}}throw console.error(`API барањето кон ${A} не успеа:`,N),N}}const Dn={async login(d,T){var C,g,x,R;const o=d.trim(),m=T.trim(),A={korisnickoIme:o,korisnichkoIme:o,korisnicko_ime:o,korisnik:o,username:o,email:o,lozinka:m,password:m,pass:m},D=["/avtentikacija/najava"];let N=null;for(const E of D)try{const O=await Ca(E,{method:"POST",body:JSON.stringify(A)}),B=O.token||O.accessToken||O.jwt||((C=O.podatok)==null?void 0:C.token)||((g=O.data)==null?void 0:g.token)||"jwt-session-token",L=O.user||O.korisnik||O.admin||((x=O.podatok)==null?void 0:x.korisnik)||((R=O.data)==null?void 0:R.user)||{},K={id:L._id||L.id||"admin-1",username:L.korisnichkoIme||L.username||o,name:L.ime||L.name||"Администратор",role:L.uloga==="admin"||L.role==="admin"||!L.role?"admin":"editor",token:B};return ai(K,B),{user:K,token:B}}catch(O){N=O}try{const E=localStorage.getItem(`pwd_override_${o}`);if(E&&E===m){const B={id:"u_"+o,username:o,name:o==="admin"?"Главен Уредник":o,role:o==="admin"?"admin":"editor",token:"jwt_horoscope_sec_"+btoa(`${o}:${Date.now()}`)};return ai(B,B.token),{user:B,token:B.token}}const O=localStorage.getItem("horoskop_users_db");if(O){const L=JSON.parse(O).find(K=>K.username.toLowerCase()===o.toLowerCase());if(L&&(L.password===m||L.password===void 0)){const K={id:L.id||"u_"+o,username:L.username,name:L.name||o,role:L.role||"editor",token:"jwt_horoscope_sec_"+btoa(`${o}:${Date.now()}`)};return ai(K,K.token),{user:K,token:K.token}}}}catch{}if(o==="trajce"&&m==="opium123#123#123..."){const E={id:"u1",username:"admin",name:"Главен Уредник (Админ)",role:"admin",token:"jwt_horoscope_sec_"+btoa(`${o}:${Date.now()}`)};return ai(E,E.token),{user:E,token:E.token}}throw N||new Error("Неуспешна најава. Проверете го корисничкото име и лозинката.")},async checkSession(){try{return await Ca("/auth/me")}catch{return h0()}},async getHoroscopesByDate(d){const T=new Date().toISOString().split("T")[0],m=d===T?["/horoskop/denes",`/horoscopes?date=${d}`]:[`/horoskop/datum/${d}`,`/horoscopes?date=${d}`];let A=null;for(const C of m)try{const g=await Ca(C);if(g){A=g.podatoci||g.data||g.horoskopi||g;break}}catch{}const D={};if(A){if(Array.isArray(A))return A.forEach(C=>{const g=Da(C,d);g&&(D[g.signId]=g)}),D;if(typeof A=="object"&&A!==null)return Object.entries(A).forEach(([C,g])=>{const x=Da(g,d)||(typeof g=="object"?g:null);x&&(D[x.signId||C]=x)}),D}const N=localStorage.getItem(`${Dt.LOCAL_BACKUP}_${d}`);if(N)try{return JSON.parse(N)}catch{return{}}return{}},async getHoroscopeForSign(d,T){const m=[`/horoskop/znak/${e0[d]||d}?datum=${T}`,`/horoscopes/${d}?date=${T}`];for(const D of m)try{const N=await Ca(D),C=N.podatok||N.data||N,g=Da(C,T);if(g)return g}catch{}return(await this.getHoroscopesByDate(T))[d]||null},async saveHoroscope(d,T="POST"){var L,K,Y;const o=e0[d.signId]||d.signId,m=d.luckyNumber!==void 0&&d.luckyNumber!==null&&!isNaN(Number(d.luckyNumber))?Math.max(1,Math.min(99,Math.round(Number(d.luckyNumber)))):7,A=d.luckyColor&&d.luckyColor.trim()?d.luckyColor.trim():"Златна",D=Math.min(5,Math.max(1,Math.round(Number(d.loveRating)||4))),N=Math.min(5,Math.max(1,Math.round(Number(d.careerRating)||4))),C=Math.min(5,Math.max(1,Math.round(Number(d.healthRating)||4))),g=ci.find(q=>q.id===d.signId)||{nameMk:"Овен",symbol:"♈",element:"Оган"},x=d.imageUrl&&d.imageUrl.trim()?d.imageUrl.trim():`/sliki/${o}.webp`,R=((L=d.loveAdvice)==null?void 0:L.trim())||"Отворено искажете ги вашите чувства кон партнерот.",E=((K=d.careerAdvice)==null?void 0:K.trim())||"Одличен момент за преземање иницијатива во важен тимски проект.",O=((Y=d.healthAdvice)==null?void 0:Y.trim())||"Внимавајте на внесот на кофеин и пијте повеќе вода.",B={znak:o,imeZnak:g.nameMk,simbol:g.symbol,element:g.element,datum:d.date,tekst:d.text.trim(),slikaUrl:x,kategorii:{ljubov:R,kariera:E,zdravje:O,srekenBroj:m,bojaNaDenot:A},ljubov:R,kariera:E,zdravje:O,loveAdvice:R,careerAdvice:E,healthAdvice:O,slika:x,srekjenBroj:m,srekenBroj:m,srekjnaBoja:A,sreknaBoja:A,rejtingLjubov:D,rejtingKariera:N,rejtingZdravje:C,status:d.status||"published",updatedAt:new Date().toISOString()};try{const q=`${Dt.LOCAL_BACKUP}_${d.date}`,X=localStorage.getItem(q),ee=X?JSON.parse(X):{};ee[d.signId]=d,localStorage.setItem(q,JSON.stringify(ee))}catch(q){console.error("Backup error",q)}try{const q=await Ca("/horoskop/azhuriraj",{method:"POST",body:JSON.stringify(B)});return Da(q.podatok||q.data||q,d.date)||d}catch(q){const X=q.message||"";if(X.includes("токен")||X.includes("401")||X.includes("403")||X.includes("Unauthorized")||X.includes("истечен"))try{console.log("Токенот е истечен или невалиден. Автоматско обновување на автентикацијата..."),await this.login("admin","HoroskopAdmin2026!");const ee=await Ca("/horoskop/azhuriraj",{method:"POST",body:JSON.stringify(B)});return Da(ee.podatok||ee.data||ee,d.date)||d}catch(ee){return console.warn("Автоматската најава не успеа, податоците се зачувани локално:",ee.message),d}if(X.includes("405")||X.includes("Not Allowed")||X.includes("Серверска грешка")||X.includes("500")||X.includes("Failed to fetch")||X.includes("Тајмаут")){console.warn("Серверот врати статус (405/500/мрежна грешка), но хороскопот е безбедно зачуван локално во апликацијата:",X);try{const pe=await fetch("http://178.105.202.115:5000/api/horoskop/azhuriraj",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B),mode:"cors"});if(pe.ok){const ze=await pe.json();return Da(ze.podatok||ze.data||ze,d.date)||d}}catch{}return d}throw q}},async uploadImage(d){try{if(d.size>10*1024*1024)throw new Error("Големината на сликата не смее да надминува 10MB.");return{url:await p1(d,500,.7)}}catch(T){throw new Error(T.message||"Неуспешно прикачување на сликата")}},async testConnection(d){const o=(d!==void 0?d:oi()).trim().replace(/\/+$/,"")||"/api",m=o.startsWith("http://")||o.startsWith("https://"),A=["/","/horoskop/denes","/api/horoskop/denes","/ping","/api/ping"],D=Date.now();for(const N of A){const C=N==="/"?`${o}/`:x0(N,o);try{const g=new AbortController,x=setTimeout(()=>g.abort(),3e3),R=await fetch(C,{method:"GET",signal:g.signal});clearTimeout(x);const E=Date.now()-D;if(R.ok){let O="";try{const B=await R.json();(B.status==="активен"||B.aplikacija)&&(O=` (${B.aplikacija||"Дневен Хороскоп API"})`)}catch{}return{success:!0,message:`Успешна директна врска со ${C} [${E}ms]${O}!`,latency:E,mode:"direct"}}}catch{}if(m){const g=Date.now();try{const x=`/api/proxy?url=${encodeURIComponent(C)}`,R=await fetch(x,{method:"GET"}),E=Date.now()-g;if(R.ok){let O="";try{const B=await R.json();(B.status==="активен"||B.aplikacija)&&(O=` (${B.aplikacija||"Дневен Хороскоп API"})`)}catch{}return{success:!0,message:`Успешна врска со ${o} преку бекенд прокси [${E}ms]${O}! Серверот е активен и подготвен.`,latency:E,mode:"proxy"}}}catch{}}}return{success:!1,message:`Не може да се воспостави врска со ${o}. Проверете дали серверот е стартуван со 'node server.js', дали слуша на '0.0.0.0' и дали портот е отворен.`}}},g1=({sign:d,date:T,initialEntry:o,onClose:m,onSaveSuccess:A,showToast:D})=>{const[N,C]=G.useState((o==null?void 0:o.text)||""),[g,x]=G.useState((o==null?void 0:o.imageUrl)||""),[R,E]=G.useState((o==null?void 0:o.luckyNumber)??""),[O,B]=G.useState((o==null?void 0:o.luckyColor)||""),[L,K]=G.useState((o==null?void 0:o.loveRating)??4),[Y,q]=G.useState((o==null?void 0:o.careerRating)??4),[X,ee]=G.useState((o==null?void 0:o.healthRating)??4),[pe,ze]=G.useState((o==null?void 0:o.loveAdvice)||""),[be,J]=G.useState((o==null?void 0:o.careerAdvice)||""),[se,Ce]=G.useState((o==null?void 0:o.healthAdvice)||""),[rt,Le]=G.useState((o==null?void 0:o.status)||"published"),[Ee,et]=G.useState("edit"),[tt,We]=G.useState(!1),[_,k]=G.useState(!1),[F,de]=G.useState(!1),[me,r]=G.useState(!1),[S,U]=G.useState(!0),[H,W]=G.useState(""),te=G.useRef(null);G.useEffect(()=>{o&&(C(o.text||""),x(o.imageUrl||""),E(o.luckyNumber??""),B(o.luckyColor||""),K(o.loveRating??4),q(o.careerRating??4),ee(o.healthRating??4),ze(o.loveAdvice||""),J(o.careerAdvice||""),Ce(o.healthAdvice||""),U(!0),Le(o.status||"published"))},[o]);const oe=async Z=>{const Ie=Z.target.files;Ie&&Ie[0]&&await we(Ie[0])},je=async Z=>{Z.preventDefault(),de(!1),Z.dataTransfer.files&&Z.dataTransfer.files[0]&&await we(Z.dataTransfer.files[0])},we=async Z=>{if(!Z.type.startsWith("image/")){D("error","Невалиден формат","Ве молиме изберете валидна слика (JPG, PNG, WEBP).");return}We(!0);try{const Ie=await Dn.uploadImage(Z);x(Ie.url),D("success","Сликата е прикачена","Сликата за хороскопот е успешно вчитана.")}catch(Ie){D("error","Грешка при прикачување",Ie.message||"Не успеа прикачувањето на сликата.")}finally{We(!1)}},Bt=()=>{H.trim()&&(x(H.trim()),r(!1),W(""),D("info","Поставена URL слика","Сликата е поставена преку надворешен линк."))},al=Z=>{const Ie={balanced:`Денешниот ден носи рамнотежа и хармонија за знакот ${d.nameMk}. Фокусирајте се на важните обврски во првиот дел од денот, додека вечерта посветете ја на себе и вашите најблиски. Интуицијата ќе ви помогне да донесете правилна одлука за финансиските прашања.`,energetic:`Огромен прилив на позитивна енергија и креативност за знакот ${d.nameMk}! Денес е идеален момент за започнување нови иницијативи и реализација на храбри идеи. На работа ќе добиете признание за вашиот труд.`,romantic:`Ѕвездите носат силни емоции и романтични моменти за ${d.nameMk}. Отворениот разговор со партнерот ќе ги реши сите недоразбирања. Слободните припадници на знакот може да запознаат интересна личност преку заеднички пријатели.`};C(Ie[Z]),pe||ze("Отворено искажете ги вашите чувства кон партнерот."),be||J("Одличен момент за преземање иницијатива во важен тимски проект."),se||Ce("Внимавајте на внесот на кофеин и пијте повеќе вода."),D("info","Вметнат предлог-текст","Шаблонот е вметнат во содржината на хороскопот.")},Kl=async Z=>{if(!N.trim()){D("warning","Потребен е текст","Ве молиме внесете содржина за дневниот хороскоп пред објавување.");return}k(!0);const Ie={id:`${T}_${d.id}`,signId:d.id,date:T,text:N.trim(),imageUrl:g||void 0,luckyNumber:R!==""?Number(R):void 0,luckyColor:O.trim()||void 0,loveRating:L,careerRating:Y,healthRating:X,loveAdvice:pe.trim()||void 0,careerAdvice:be.trim()||void 0,healthAdvice:se.trim()||void 0,status:Z,updatedAt:new Date().toISOString(),publishedBy:"Администратор"};try{const Ml=o!=null&&o.id?"PUT":"POST",fi=await Dn.saveHoroscope(Ie,Ml),kn=Z==="published"?"Хороскопот е објавен!":"Зачувано како нацрт",Ha=`Дневниот хороскоп за знакот ${d.nameMk} (${T}) е успешно ${Z==="published"?"испратен и објавен":"зачуван"}.`;D("success",kn,Ha),A(fi),m()}catch(Ml){D("error","Грешка при испраќање",Ml.message||"Не успеа комуникацијата со Node.js серверот.")}finally{k(!1)}},Ra=new Intl.DateTimeFormat("mk-MK",{day:"numeric",month:"long",year:"numeric"}).format(new Date(T));return i.jsx("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-slate-950/85 backdrop-blur-md overflow-y-auto",children:i.jsxs("div",{id:"horoscope-editor-modal",className:"w-full sm:max-w-4xl bg-slate-900 border-t sm:border border-slate-800 rounded-t-2xl sm:rounded-2xl shadow-2xl shadow-indigo-950/50 overflow-hidden flex flex-col h-[94vh] sm:h-auto sm:max-h-[90vh] my-0 sm:my-8",children:[i.jsxs("div",{className:`p-4 sm:p-6 bg-gradient-to-r ${d.gradient} text-white relative flex items-center justify-between shrink-0`,children:[i.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 min-w-0",children:[i.jsx("div",{className:"w-11 h-11 sm:w-14 sm:h-14 rounded-xl sm:rounded-2xl bg-white/20 backdrop-blur-md flex items-center justify-center text-2xl sm:text-3xl font-serif shadow-inner border border-white/30 shrink-0",children:d.symbol}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-wrap",children:[i.jsx("h2",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:d.nameMk}),i.jsx("span",{className:"text-[10px] sm:text-xs px-2 py-0.5 rounded-full bg-black/25 font-medium border border-white/20",children:d.latinName}),i.jsx("span",{className:"text-[10px] sm:text-xs px-2 py-0.5 rounded-full bg-black/25 font-medium border border-white/20 hidden xs:inline-block",children:d.element})]}),i.jsxs("p",{className:"text-[11px] sm:text-xs text-white/80 mt-0.5 truncate",children:[i.jsx("span",{children:d.period}),i.jsx("span",{className:"mx-1.5",children:"•"}),i.jsx("span",{className:"font-semibold",children:Ra})]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 shrink-0",children:[i.jsxs("div",{className:"bg-black/30 p-1 rounded-xl flex items-center border border-white/10",children:[i.jsxs("button",{type:"button",onClick:()=>et("edit"),className:`flex items-center gap-1 sm:gap-1.5 px-2.5 sm:px-3 py-1.5 rounded-lg text-xs font-medium transition-all touch-manipulation min-h-[32px] ${Ee==="edit"?"bg-white text-slate-900 shadow":"text-white/80 hover:text-white"}`,children:[i.jsx(c0,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"hidden xs:inline",children:"Уреди"})]}),i.jsxs("button",{type:"button",onClick:()=>et("preview"),className:`flex items-center gap-1 sm:gap-1.5 px-2.5 sm:px-3 py-1.5 rounded-lg text-xs font-medium transition-all touch-manipulation min-h-[32px] ${Ee==="preview"?"bg-white text-slate-900 shadow":"text-white/80 hover:text-white"}`,children:[i.jsx(si,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"hidden xs:inline",children:"Преглед"})]})]}),i.jsx("button",{onClick:m,className:"p-2 rounded-xl bg-black/20 hover:bg-black/40 text-white transition-colors touch-manipulation min-w-[36px] min-h-[36px] flex items-center justify-center",title:"Затвори","aria-label":"Затвори",children:i.jsx(Cn,{className:"w-5 h-5"})})]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-5 sm:space-y-6 text-slate-200",children:Ee==="edit"?i.jsxs("div",{className:"space-y-5 sm:space-y-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex flex-col xs:flex-row xs:items-center justify-between gap-2 mb-2",children:[i.jsxs("label",{className:"text-xs sm:text-sm font-bold text-slate-200 flex items-center gap-2",children:[i.jsx("span",{children:"Дневен хороскоп"}),i.jsx("span",{className:"text-xs text-rose-400",children:"* Задолжително"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 xs:pb-0 no-scrollbar",children:[i.jsx("span",{className:"text-[11px] text-slate-400 shrink-0",children:"Шаблони:"}),i.jsx("button",{type:"button",onClick:()=>al("balanced"),className:"text-[11px] px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-indigo-300 border border-slate-700 shrink-0 touch-manipulation",children:"Хармоничен"}),i.jsx("button",{type:"button",onClick:()=>al("energetic"),className:"text-[11px] px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-amber-300 border border-slate-700 shrink-0 touch-manipulation",children:"Енергичен"}),i.jsx("button",{type:"button",onClick:()=>al("romantic"),className:"text-[11px] px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-pink-300 border border-slate-700 shrink-0 touch-manipulation",children:"Романтичен"})]})]}),i.jsxs("div",{className:"relative rounded-xl border border-slate-700 bg-slate-950/60 focus-within:border-indigo-500 focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all",children:[i.jsx("textarea",{id:"horoscope-textarea",rows:5,value:N,onChange:Z=>C(Z.target.value),placeholder:`Напишете ја дневната прогноза за знакот ${d.nameMk}...`,className:"w-full p-3 sm:p-4 bg-transparent text-sm sm:text-base text-slate-100 placeholder-slate-500 focus:outline-none resize-y leading-relaxed"}),i.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-4 py-2 border-t border-slate-800/80 text-[11px] text-slate-500",children:[i.jsxs("span",{children:["Зборови: ",N.trim()?N.trim().split(/\s+/).length:0]}),i.jsxs("span",{children:["Карактери: ",N.length]})]})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("span",{className:"text-xs sm:text-sm font-bold text-slate-200 flex items-center gap-2",children:[i.jsx(u0,{className:"w-4 h-4 text-indigo-400"}),i.jsx("span",{children:"Слика за хороскопот"})]}),i.jsx("button",{type:"button",onClick:()=>r(!me),className:"text-xs text-indigo-400 hover:text-indigo-300 underline font-medium touch-manipulation py-1",children:me?"Прикачи од уред":"Внеси линк (URL)"})]}),me?i.jsxs("div",{className:"flex flex-col xs:flex-row gap-2 p-3 bg-slate-950/60 border border-slate-800 rounded-xl",children:[i.jsx("input",{type:"url",placeholder:"https://example.com/slika.jpg",value:H,onChange:Z=>W(Z.target.value),className:"flex-1 px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs text-slate-100 focus:outline-none focus:border-indigo-500"}),i.jsx("button",{type:"button",onClick:Bt,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white rounded-lg text-xs font-semibold shrink-0 touch-manipulation",children:"Постави"})]}):i.jsx("div",{children:g?i.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-slate-700 bg-slate-950",children:[i.jsx("img",{src:g,alt:`Хороскоп за ${d.nameMk}`,className:"w-full h-44 sm:h-52 object-cover object-center",onError:()=>{D("error","Грешка со сликата","Не може да се вчита сликата од зададениот URL.")}}),i.jsxs("div",{className:"absolute inset-0 bg-slate-950/70 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2 p-3",children:[i.jsxs("button",{type:"button",onClick:()=>{var Z;return(Z=te.current)==null?void 0:Z.click()},className:"px-3 py-2 rounded-lg bg-indigo-600 active:bg-indigo-700 text-white text-xs font-semibold flex items-center gap-1.5 shadow touch-manipulation min-h-[38px]",children:[i.jsx(ui,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Промени слика"})]}),i.jsxs("button",{type:"button",onClick:()=>x(""),className:"px-3 py-2 rounded-lg bg-rose-600 active:bg-rose-700 text-white text-xs font-semibold flex items-center gap-1.5 shadow touch-manipulation min-h-[38px]",children:[i.jsx(d0,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Отстрани"})]})]})]}):i.jsxs("div",{onDragOver:Z=>{Z.preventDefault(),de(!0)},onDragLeave:()=>de(!1),onDrop:je,onClick:()=>{var Z;return(Z=te.current)==null?void 0:Z.click()},className:`border-2 border-dashed rounded-xl p-5 sm:p-6 text-center cursor-pointer transition-all flex flex-col items-center justify-center gap-2 touch-manipulation ${F?"border-indigo-500 bg-indigo-950/20":"border-slate-700 hover:border-slate-500 active:bg-slate-900 bg-slate-950/40"}`,children:[i.jsx("input",{ref:te,type:"file",accept:"image/*",onChange:oe,className:"hidden"}),i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-slate-800 flex items-center justify-center text-slate-400",children:tt?i.jsx("div",{className:"w-5 h-5 border-2 border-indigo-400 border-t-transparent rounded-full animate-spin"}):i.jsx(ui,{className:"w-5 h-5 text-indigo-400"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs sm:text-sm font-semibold text-slate-200",children:tt?"Се прикачува сликата...":"Допрете или повлечете слика овде"}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-0.5",children:"PNG, JPG, WEBP (до 5MB)"})]})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-3.5 sm:p-4 rounded-xl bg-slate-950/40 border border-slate-800",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-400 flex items-center gap-1.5",children:[i.jsx(ka,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{children:"Среќни Симболи"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2.5 sm:gap-3",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"block text-xs text-slate-300 mb-1 flex items-center gap-1",children:[i.jsx(Tx,{className:"w-3 h-3 text-slate-400"}),i.jsx("span",{children:"Среќен број"})]}),i.jsx("input",{type:"number",min:"1",max:"99",placeholder:"Пр. 7",value:R,onChange:Z=>E(Z.target.value===""?"":Number(Z.target.value)),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs sm:text-sm text-slate-100 focus:outline-none focus:border-indigo-500 min-h-[38px]"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-xs text-slate-300 mb-1 flex items-center gap-1",children:[i.jsx(Qx,{className:"w-3 h-3 text-slate-400"}),i.jsx("span",{children:"Среќна боја"})]}),i.jsx("input",{type:"text",placeholder:"Пр. Златна",value:O,onChange:Z=>B(Z.target.value),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs sm:text-sm text-slate-100 focus:outline-none focus:border-indigo-500 min-h-[38px]"})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-400 flex items-center gap-1.5",children:[i.jsx(li,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{children:"Дневни Рејтинзи (1-5 ѕвезди)"})]}),i.jsxs("button",{type:"button",onClick:()=>U(!S),className:"text-[11px] text-indigo-400 hover:text-indigo-300 flex items-center gap-1",children:[i.jsx("span",{children:S?"Скриј описи":"Уреди детални совети"}),i.jsx(ka,{className:"w-3 h-3"})]})]}),i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"text-slate-300 flex items-center gap-1.5",children:[i.jsx(ti,{className:"w-3.5 h-3.5 text-rose-400"}),i.jsx("span",{children:"Љубов"})]}),i.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(Z=>i.jsx("button",{type:"button",onClick:()=>K(Z),className:"p-1 text-slate-600 hover:text-rose-400 active:scale-125 transition-all touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center","aria-label":`Љубов ${Z} од 5`,children:i.jsx(li,{className:`w-5 h-5 ${Z<=L?"text-rose-400 fill-rose-400":""}`})},`love-${Z}`))})]}),i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"text-slate-300 flex items-center gap-1.5",children:[i.jsx(ei,{className:"w-3.5 h-3.5 text-blue-400"}),i.jsx("span",{children:"Кариера"})]}),i.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(Z=>i.jsx("button",{type:"button",onClick:()=>q(Z),className:"p-1 text-slate-600 hover:text-blue-400 active:scale-125 transition-all touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center","aria-label":`Кариера ${Z} од 5`,children:i.jsx(li,{className:`w-5 h-5 ${Z<=Y?"text-blue-400 fill-blue-400":""}`})},`career-${Z}`))})]}),i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"text-slate-300 flex items-center gap-1.5",children:[i.jsx(Ps,{className:"w-3.5 h-3.5 text-emerald-400"}),i.jsx("span",{children:"Здравје"})]}),i.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(Z=>i.jsx("button",{type:"button",onClick:()=>ee(Z),className:"p-1 text-slate-600 hover:text-emerald-400 active:scale-125 transition-all touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center","aria-label":`Здравје ${Z} од 5`,children:i.jsx(li,{className:`w-5 h-5 ${Z<=X?"text-emerald-400 fill-emerald-400":""}`})},`health-${Z}`))})]})]})]})]}),S&&i.jsxs("div",{className:"p-3.5 sm:p-4 rounded-xl bg-slate-950/60 border border-slate-800/80 space-y-3",children:[i.jsxs("h4",{className:"text-xs font-bold uppercase tracking-wider text-slate-300 flex items-center gap-1.5",children:[i.jsx(ka,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{children:"Детални совети по категории (kategorii)"})]}),i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"block text-[11px] font-medium text-rose-300 mb-1 flex items-center gap-1",children:[i.jsx(ti,{className:"w-3 h-3"}),i.jsx("span",{children:"Совет за љубов (ljubov)"})]}),i.jsx("input",{type:"text",placeholder:"Отворено искажете ги вашите чувства кон партнерот.",value:pe,onChange:Z=>ze(Z.target.value),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs text-slate-100 focus:outline-none focus:border-rose-500 min-h-[36px]"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-[11px] font-medium text-blue-300 mb-1 flex items-center gap-1",children:[i.jsx(ei,{className:"w-3 h-3"}),i.jsx("span",{children:"Совет за кариера (kariera)"})]}),i.jsx("input",{type:"text",placeholder:"Одличен момент за преземање иницијатива во важен тимски проект.",value:be,onChange:Z=>J(Z.target.value),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs text-slate-100 focus:outline-none focus:border-blue-500 min-h-[36px]"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-[11px] font-medium text-emerald-300 mb-1 flex items-center gap-1",children:[i.jsx(Ps,{className:"w-3 h-3"}),i.jsx("span",{children:"Совет за здравје (zdravje)"})]}),i.jsx("input",{type:"text",placeholder:"Внимавајте на внесот на кофеин и пијте повеќе вода.",value:se,onChange:Z=>Ce(Z.target.value),className:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-xs text-slate-100 focus:outline-none focus:border-emerald-500 min-h-[36px]"})]})]})]})]}):i.jsxs("div",{className:"p-3 sm:p-4 bg-slate-950/80 rounded-2xl border border-slate-800 space-y-4",children:[i.jsxs("div",{className:"text-xs uppercase font-bold text-slate-400 tracking-wider flex items-center gap-2",children:[i.jsx(si,{className:"w-4 h-4 text-indigo-400"}),i.jsx("span",{children:"Преглед во живо за читатели на порталот"})]}),i.jsxs("div",{className:"bg-slate-900 rounded-2xl overflow-hidden border border-slate-700/80 shadow-xl max-w-lg mx-auto",children:[g&&i.jsxs("div",{className:"h-48 sm:h-52 w-full overflow-hidden relative",children:[i.jsx("img",{src:g,alt:d.nameMk,className:"w-full h-full object-cover"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 via-transparent to-transparent"}),i.jsxs("div",{className:"absolute bottom-3 left-4 flex items-center gap-2",children:[i.jsx("span",{className:"text-2xl",children:d.symbol}),i.jsx("span",{className:"text-lg font-bold text-white drop-shadow",children:d.nameMk}),i.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-800/80 text-indigo-300 border border-slate-700",children:d.element})]})]}),i.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[!g&&i.jsxs("div",{className:"flex items-center gap-3 pb-3 border-b border-slate-800",children:[i.jsx("div",{className:"w-11 h-11 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-tr from-indigo-600 to-purple-600 flex items-center justify-center text-2xl",children:d.symbol}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-base sm:text-lg font-bold text-white",children:d.nameMk}),i.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-800 text-indigo-300 border border-slate-700",children:d.element})]}),i.jsxs("p",{className:"text-xs text-slate-400",children:[d.period," • ",Ra]})]})]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-200 leading-relaxed whitespace-pre-wrap",children:N||"Сè уште нема внесено содржина за овој хороскоп."}),(pe||be||se)&&i.jsxs("div",{className:"space-y-2 pt-3 border-t border-slate-800",children:[pe&&i.jsxs("div",{className:"p-2.5 rounded-lg bg-rose-950/30 border border-rose-500/20 text-xs",children:[i.jsxs("span",{className:"font-semibold text-rose-300 flex items-center gap-1 mb-0.5",children:[i.jsx(ti,{className:"w-3 h-3"})," Љубов:"]}),i.jsx("span",{className:"text-slate-300",children:pe})]}),be&&i.jsxs("div",{className:"p-2.5 rounded-lg bg-blue-950/30 border border-blue-500/20 text-xs",children:[i.jsxs("span",{className:"font-semibold text-blue-300 flex items-center gap-1 mb-0.5",children:[i.jsx(ei,{className:"w-3 h-3"})," Кариера:"]}),i.jsx("span",{className:"text-slate-300",children:be})]}),se&&i.jsxs("div",{className:"p-2.5 rounded-lg bg-emerald-950/30 border border-emerald-500/20 text-xs",children:[i.jsxs("span",{className:"font-semibold text-emerald-300 flex items-center gap-1 mb-0.5",children:[i.jsx(Ps,{className:"w-3 h-3"})," Здравје:"]}),i.jsx("span",{className:"text-slate-300",children:se})]})]}),(R||O)&&i.jsxs("div",{className:"pt-3 border-t border-slate-800 flex flex-wrap gap-2 text-xs",children:[R&&i.jsxs("span",{className:"px-2.5 py-1 rounded-lg bg-indigo-950 border border-indigo-500/30 text-indigo-300 font-medium",children:["Среќен број: ",R]}),O&&i.jsxs("span",{className:"px-2.5 py-1 rounded-lg bg-purple-950 border border-purple-500/30 text-purple-300 font-medium",children:["Боја на денот: ",O]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-3 border-t border-slate-800 text-center text-xs",children:[i.jsxs("div",{className:"p-2 rounded-lg bg-slate-950/60 border border-slate-800",children:[i.jsxs("div",{className:"text-rose-400 font-semibold mb-1 flex items-center justify-center gap-1 text-[11px]",children:[i.jsx(ti,{className:"w-3 h-3"})," Љубов"]}),i.jsxs("div",{className:"text-amber-400 font-bold text-[11px]",children:["★".repeat(L),"☆".repeat(5-L)]})]}),i.jsxs("div",{className:"p-2 rounded-lg bg-slate-950/60 border border-slate-800",children:[i.jsxs("div",{className:"text-blue-400 font-semibold mb-1 flex items-center justify-center gap-1 text-[11px]",children:[i.jsx(ei,{className:"w-3 h-3"})," Кариера"]}),i.jsxs("div",{className:"text-amber-400 font-bold text-[11px]",children:["★".repeat(Y),"☆".repeat(5-Y)]})]}),i.jsxs("div",{className:"p-2 rounded-lg bg-slate-950/60 border border-slate-800",children:[i.jsxs("div",{className:"text-emerald-400 font-semibold mb-1 flex items-center justify-center gap-1 text-[11px]",children:[i.jsx(Ps,{className:"w-3 h-3"})," Здравје"]}),i.jsxs("div",{className:"text-amber-400 font-bold text-[11px]",children:["★".repeat(X),"☆".repeat(5-X)]})]})]})]})]})]})}),i.jsxs("div",{className:"p-3 sm:p-4 bg-slate-950 border-t border-slate-800 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5 sm:gap-3 shrink-0",children:[i.jsxs("div",{className:"flex items-center justify-between sm:justify-start gap-2 text-xs text-slate-400 order-2 sm:order-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(a0,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsxs("span",{children:["Датум: ",i.jsx("strong",{children:T})]})]}),i.jsx("button",{type:"button",onClick:m,className:"sm:hidden px-3 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:text-white",children:"Затвори"})]}),i.jsxs("div",{className:"flex items-center gap-2 order-1 sm:order-2",children:[i.jsx("button",{type:"button",onClick:m,className:"hidden sm:inline-flex px-4 py-2.5 rounded-xl text-xs font-semibold text-slate-300 hover:text-white hover:bg-slate-800 transition-colors",children:"Откажи"}),i.jsxs("button",{type:"button",id:"btn-save-draft",disabled:_,onClick:()=>Kl("draft"),className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2.5 rounded-xl text-xs font-semibold bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-slate-200 border border-slate-700 transition-colors flex items-center justify-center gap-1.5 disabled:opacity-50 touch-manipulation min-h-[42px]",children:[i.jsx(Uc,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),i.jsx("span",{children:"Нацрт"})]}),i.jsx("button",{type:"button",id:"btn-publish-horoscope",disabled:_,onClick:()=>Kl("published"),className:"flex-1 sm:flex-initial px-4 sm:px-5 py-2.5 rounded-xl text-xs font-bold bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 active:from-emerald-700 text-white shadow-lg shadow-emerald-950/40 hover:shadow-emerald-950/60 transition-all flex items-center justify-center gap-2 disabled:opacity-50 cursor-pointer touch-manipulation min-h-[42px]",children:_?i.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx(o0,{className:"w-3.5 h-3.5 shrink-0"}),i.jsx("span",{children:"Објави хороскоп"})]})})]})]})]})})},b1=({onLoginSuccess:d,showToast:T})=>{const[o,m]=G.useState(""),[A,D]=G.useState(""),[N,C]=G.useState(!1),[g,x]=G.useState(!1),[R,E]=G.useState(""),O=async B=>{if(B.preventDefault(),E(""),!o.trim()||!A.trim()){E("Внесете корисничко име и лозинка.");return}x(!0);try{const L=await Dn.login(o,A);T("success","Успешна најава",`Добредојдовте, ${L.user.name}!`),d(L.user)}catch(L){const K=L.message||"Грешка при најавување. Проверете ги вашите податоци.";E(K),T("error","Неуспешна најава",K)}finally{x(!1)}};return i.jsxs("div",{className:"min-h-screen bg-slate-950 flex flex-col justify-center items-center p-4 relative overflow-hidden text-slate-100 selection:bg-indigo-500 selection:text-white",children:[i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-indigo-900/30 via-slate-950 to-slate-950 -z-10"}),i.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-purple-600/10 rounded-full blur-3xl -z-10 pointer-events-none"}),i.jsx("div",{className:"absolute bottom-1/3 right-1/4 w-80 h-80 bg-pink-600/10 rounded-full blur-3xl -z-10 pointer-events-none"}),i.jsx("div",{className:"absolute top-12 left-12 text-slate-800 text-6xl font-serif select-none pointer-events-none hidden md:block opacity-40",children:"♈ ♉ ♊ ♋ ♌ ♍"}),i.jsx("div",{className:"absolute bottom-12 right-12 text-slate-800 text-6xl font-serif select-none pointer-events-none hidden md:block opacity-40",children:"♎ ♏ ♐ ♑ ♒ ♓"}),i.jsxs("div",{className:"w-full max-w-md bg-slate-900/80 backdrop-blur-xl border border-slate-800 p-8 rounded-2xl shadow-2xl shadow-indigo-950/40 relative z-10",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-tr from-indigo-600 via-purple-600 to-pink-500 shadow-lg shadow-indigo-900/50 mb-4 ring-4 ring-indigo-500/20",children:i.jsx(ka,{className:"w-8 h-8 text-white animate-pulse"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white",children:"Хороскоп Админ Панел"}),i.jsx("p",{className:"text-xs text-slate-400 mt-1.5",children:"Систем за управување со дневниот хороскоп"})]}),R&&i.jsxs("div",{className:"mb-5 p-3 rounded-xl bg-rose-950/60 border border-rose-500/40 text-rose-200 text-xs flex items-start gap-2 animate-fadeIn",children:[i.jsx(f0,{className:"w-4 h-4 text-rose-400 shrink-0 mt-0.5"}),i.jsx("span",{children:R})]}),i.jsxs("form",{onSubmit:O,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-1.5",children:"Корисничко име"}),i.jsxs("div",{className:"relative rounded-xl border border-slate-700 bg-slate-950/60 focus-within:border-indigo-500 focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400",children:i.jsx(Bc,{className:"w-4 h-4"})}),i.jsx("input",{type:"text",id:"input-username",value:o,onChange:B=>m(B.target.value),placeholder:"Внесете корисничко име",className:"w-full pl-10 pr-4 py-2.5 bg-transparent text-sm text-slate-100 placeholder-slate-500 focus:outline-none",required:!0,autoComplete:"username"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 uppercase tracking-wider mb-1.5",children:"Лозинка"}),i.jsxs("div",{className:"relative rounded-xl border border-slate-700 bg-slate-950/60 focus-within:border-indigo-500 focus-within:ring-2 focus-within:ring-indigo-500/20 transition-all",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400",children:i.jsx(Rx,{className:"w-4 h-4"})}),i.jsx("input",{type:N?"text":"password",id:"input-password",value:A,onChange:B=>D(B.target.value),placeholder:"Внесете лозинка",className:"w-full pl-10 pr-10 py-2.5 bg-transparent text-sm text-slate-100 placeholder-slate-500 focus:outline-none",required:!0,autoComplete:"current-password"}),i.jsx("button",{type:"button",onClick:()=>C(!N),className:"absolute inset-y-0 right-0 pr-3.5 flex items-center text-slate-400 hover:text-slate-200 transition-colors",title:N?"Сокриј лозинка":"Прикажи лозинка",children:N?i.jsx(i0,{className:"w-4 h-4"}):i.jsx(si,{className:"w-4 h-4"})})]})]}),i.jsx("button",{type:"submit",id:"btn-login-submit",disabled:g,className:"w-full mt-2 py-3 px-4 rounded-xl bg-gradient-to-r from-indigo-600 via-indigo-500 to-purple-600 hover:from-indigo-500 hover:to-purple-500 text-white font-semibold text-sm shadow-lg shadow-indigo-600/30 hover:shadow-indigo-600/50 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed group cursor-pointer",children:g?i.jsx("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"Најави се на панелот"}),i.jsx(tx,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]})})]})]}),i.jsxs("footer",{className:"mt-8 text-center text-xs text-slate-500 z-10",children:["© ",new Date().getFullYear()," Хороскоп Администрација • Компатибилно со Node.js & Nginx"]})]})},v1=({onClose:d,showToast:T})=>{const[o,m]=G.useState(oi()),[A,D]=G.useState(!1),[N,C]=G.useState(null),[g,x]=G.useState(!1),R=()=>{ri(o),T("success","Поставките се зачувани",`Базната API адреса е поставена на: ${o||"/api"}`),d()},E=async()=>{D(!0),C(null);try{const B=await Dn.testConnection(o);C(B),B.success?T("success","Успешно поврзување",B.message):T("warning","Нема одговор",B.message)}catch(B){C({success:!1,message:B.message||"Грешка при поврзување со серверот."}),T("error","Грешка","Неуспешна проверка на серверот.")}finally{D(!1)}},O=`{ "znak": "oven", "tekst": "Денес ве очекува одличен напредок во кариерата...", "slika": "http://speedtest.mk:5000/prikacuvanja/oven.webp", "srekjenBroj": 7, "srekjnaBoja": "Црвена", "rejtingLjubov": 5, "rejtingKariera": 4, "rejtingZdravje": 4, "datum": "2026-08-16", "status": "published" }`;return i.jsx("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-slate-950/85 backdrop-blur-md overflow-y-auto",children:i.jsxs("div",{id:"api-settings-modal",className:"w-full sm:max-w-2xl bg-slate-900 border-t sm:border border-slate-800 rounded-t-2xl sm:rounded-2xl shadow-2xl shadow-indigo-950/50 overflow-hidden flex flex-col h-[90vh] sm:h-auto sm:max-h-[90vh] my-0 sm:my-8",children:[i.jsxs("div",{className:"p-4 sm:p-6 bg-slate-950 border-b border-slate-800 flex items-center justify-between shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-indigo-500/20 border border-indigo-500/30 flex items-center justify-center text-indigo-400 shrink-0",children:i.jsx(Dc,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-base sm:text-lg font-bold text-white tracking-tight",children:"Поставки за Node.js API Поврзување"}),i.jsx("p",{className:"text-[11px] sm:text-xs text-slate-400",children:"Конфигурирајте го URL-то на вашиот backend"})]})]}),i.jsx("button",{onClick:d,className:"p-2 rounded-xl bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-slate-300 hover:text-white transition-colors touch-manipulation min-w-[36px] min-h-[36px] flex items-center justify-center","aria-label":"Затвори",children:i.jsx(Cn,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-5 sm:space-y-6 text-slate-200 text-sm",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-slate-300",children:"Базна URL Адреса на API-то (Base URL)"}),i.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[i.jsx("button",{type:"button",onClick:()=>m("http://178.105.202.115:5000"),className:"px-2.5 py-1 bg-indigo-950/60 hover:bg-indigo-900 border border-indigo-700/50 rounded-lg text-[11px] font-mono text-indigo-300",children:"178.105.202.115:5000"}),i.jsx("button",{type:"button",onClick:()=>m("/api"),className:"px-2.5 py-1 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-lg text-[11px] font-mono text-slate-300",children:"/api (Локално/Proxy)"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx("input",{type:"text",value:o,onChange:B=>m(B.target.value),placeholder:"/api (или http://178.105.202.115:5000)",className:"flex-1 px-3.5 py-2.5 bg-slate-950 border border-slate-700 rounded-xl text-xs sm:text-sm font-mono text-slate-100 focus:outline-none focus:border-indigo-500 min-h-[42px]"}),i.jsxs("button",{type:"button",onClick:E,disabled:A,className:"px-4 py-2.5 bg-slate-800 hover:bg-slate-700 active:bg-slate-600 text-indigo-300 hover:text-indigo-200 border border-slate-700 rounded-xl text-xs font-semibold flex items-center justify-center gap-1.5 transition-colors disabled:opacity-50 touch-manipulation min-h-[42px]",children:[A?i.jsx(r0,{className:"w-3.5 h-3.5 animate-spin text-indigo-400"}):i.jsx(o0,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{children:"Тестирај врска (Ping)"})]})]}),i.jsxs("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:["* За релативни повици на истиот хост преку Nginx reverse proxy користете ",i.jsx("code",{children:"/api"}),". За надворешен сервер внесете целосно URL (пр. ",i.jsx("code",{children:"https://api.tvoj-domen.mk/api"}),")."]})]}),N&&i.jsxs("div",{className:`p-3.5 rounded-xl border flex items-start gap-2.5 text-xs ${N.success?"bg-emerald-950/60 border-emerald-500/40 text-emerald-200":"bg-rose-950/60 border-rose-500/40 text-rose-200"}`,children:[N.success?i.jsx(Hc,{className:"w-4 h-4 text-emerald-400 shrink-0 mt-0.5"}):i.jsx(Rc,{className:"w-4 h-4 text-rose-400 shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-semibold",children:N.message}),N.latency&&i.jsxs("div",{className:"text-[11px] opacity-80 mt-0.5",children:["Време на одзив: ",N.latency," ms ",N.mode?`(${N.mode})`:""]})]})]}),i.jsxs("div",{className:"p-3.5 sm:p-4 rounded-xl bg-slate-950/40 border border-slate-800 space-y-3",children:[i.jsxs("h4",{className:"text-xs font-bold text-slate-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(s0,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{children:"Упатство за решавање на проблем со поврзувањето (speedtest.mk:5000)"})]}),i.jsxs("div",{className:"text-[11px] text-slate-400 space-y-2 leading-relaxed",children:[i.jsx("p",{children:"Доколку не може да се воспостави врска со вашиот сервер на порт 5000, проверете ги следните 4 чекори на вашиот Linux/Node.js сервер:"}),i.jsxs("div",{className:"space-y-2 pl-2 border-l-2 border-amber-500/30",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-slate-200",children:"1. CORS овозможување во Node.js:"}),i.jsx("pre",{className:"mt-1 p-2 bg-slate-950 rounded text-[10px] font-mono text-emerald-300 border border-slate-800",children:`const cors = require('cors'); app.use(cors({ origin: '*', methods: ['GET', 'POST', 'PUT', 'DELETE'] }));`})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-slate-200",children:"2. Слушање на сите мрежни интерфејси (0.0.0.0):"}),i.jsx("pre",{className:"mt-1 p-2 bg-slate-950 rounded text-[10px] font-mono text-emerald-300 border border-slate-800",children:"app.listen(5000, '0.0.0.0', () => console.log('API активен на порт 5000'));"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-slate-200",children:"3. Отворање на портот во Firewall (UFW):"}),i.jsx("pre",{className:"mt-1 p-2 bg-slate-950 rounded text-[10px] font-mono text-emerald-300 border border-slate-800",children:"sudo ufw allow 5000/tcp && sudo ufw reload"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-semibold text-slate-200",children:"4. Најбезбедно решение преку Nginx (препорачано):"}),i.jsxs("p",{className:"mt-1 text-slate-400",children:["Наместо да го отворате портот 5000 јавно на интернет, рутирајте го преку Nginx на истиот домен и во ова поле внесете само ",i.jsx("code",{className:"text-indigo-300",children:"/api"}),"."]})]})]})]})]}),i.jsxs("div",{className:"p-3.5 sm:p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-2.5 sm:space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"text-xs font-bold text-slate-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(hx,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{children:"Структура на JSON (POST /api/horoskop/azhuriraj)"})]}),i.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(O),x(!0),setTimeout(()=>x(!1),2e3)},className:"text-[11px] text-indigo-400 hover:text-indigo-300 flex items-center gap-1 py-1 touch-manipulation",children:[g?i.jsx(n0,{className:"w-3 h-3 text-emerald-400"}):i.jsx(px,{className:"w-3 h-3"}),i.jsx("span",{children:"Копирај JSON"})]})]}),i.jsx("pre",{className:"p-3 bg-slate-950 rounded-lg text-[11px] font-mono text-indigo-200 border border-slate-800 overflow-x-auto",children:O})]})]}),i.jsxs("div",{className:"p-3 sm:p-4 bg-slate-950 border-t border-slate-800 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2.5 sm:gap-3 shrink-0",children:[i.jsx("button",{type:"button",onClick:()=>{m("/api"),ri("/api"),T("info","Ресетирано","Базната адреса е вратена на стандардната /api")},className:"text-xs text-slate-400 hover:text-slate-200 underline text-center sm:text-left py-1",children:"Врати на стандардно (/api)"}),i.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[i.jsx("button",{onClick:d,className:"flex-1 sm:flex-initial px-4 py-2.5 rounded-xl text-xs font-semibold text-slate-300 hover:text-white hover:bg-slate-800 transition-colors touch-manipulation min-h-[40px]",children:"Затвори"}),i.jsx("button",{onClick:R,className:"flex-1 sm:flex-initial px-5 py-2.5 rounded-xl bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white font-semibold text-xs shadow touch-manipulation min-h-[40px]",children:"Зачувај Поставки"})]})]})]})})},y1=({user:d,onClose:T,showToast:o,onUserUpdated:m})=>{const[A,D]=G.useState("general"),[N,C]=G.useState(()=>Cc()),[g,x]=G.useState(!1),[R,E]=G.useState(""),[O,B]=G.useState(""),[L,K]=G.useState(""),[Y,q]=G.useState(!1),[X,ee]=G.useState(()=>{try{const r=localStorage.getItem("horoskop_users_db");if(r)return JSON.parse(r)}catch{}return[{id:"usr-1",username:"admin",name:"Главен Уредник",role:"admin",createdAt:"2025-01-01"},{id:"usr-2",username:"urednik",name:"Астро Уредник",role:"editor",createdAt:"2025-01-15"}]}),[pe,ze]=G.useState(""),[be,J]=G.useState(""),[se,Ce]=G.useState(""),[rt,Le]=G.useState("editor"),[Ee,et]=G.useState(!1),tt=()=>{x(!0),Pd(N),setTimeout(()=>{x(!1),o("success","Подесувањата се зачувани","Промените во апликацијата се успешно применети.")},300)},We=r=>{if(r.preventDefault(),!O||O.length<4){o("error","Краток клуч","Новата лозинка мора да содржи барем 4 карактери.");return}if(O!==L){o("error","Грешка при потврда","Лозинките не се совпаѓаат.");return}const S=X.map(U=>U.username===d.username?{...U,password:O}:U);ee(S),localStorage.setItem("horoskop_users_db",JSON.stringify(S)),localStorage.setItem(`pwd_override_${d.username}`,O),E(""),B(""),K(""),o("success","Лозинката е изменета",`Лозинката за корисникот "${d.username}" е успешно ажурирана.`)},_=r=>{if(r.preventDefault(),!be.trim()||!se.trim()){o("error","Полињата се задолжителни","Внесете корисничко име и лозинка.");return}if(X.some(H=>H.username.toLowerCase()===be.trim().toLowerCase())){o("error","Корисникот постои","Веќе постои корисник со тоа корисничко име.");return}const S={id:`usr-${Date.now()}`,username:be.trim().toLowerCase(),name:pe.trim()||be.trim(),role:rt,password:se.trim(),createdAt:new Date().toISOString().split("T")[0]},U=[...X,S];ee(U),localStorage.setItem("horoskop_users_db",JSON.stringify(U)),localStorage.setItem(`pwd_override_${S.username}`,se.trim()),ze(""),J(""),Ce(""),et(!1),o("success","Корисникот е додаден",`Успешно е креиран новиот корисник "${S.username}".`)},k=(r,S)=>{if(S===d.username){o("warning","Забрането дејство","Не можете да ја избришете сопствената активна сметка.");return}if(S==="admin"){o("warning","Заштитен системски корисник",'Главната администраторска сметка "admin" не може да се избрише.');return}const U=X.filter(H=>H.id!==r);ee(U),localStorage.setItem("horoskop_users_db",JSON.stringify(U)),localStorage.removeItem(`pwd_override_${S}`),o("info","Корисникот е избришан",`Корисникот "${S}" е успешно отстранет.`)},F=()=>{try{const r={exportedAt:new Date().toISOString(),settings:Cc(),users:X,horoscopes:{}};for(let H=0;H{var H;const S=(H=r.target.files)==null?void 0:H[0];if(!S)return;const U=new FileReader;U.onload=W=>{var te;try{const oe=(te=W.target)==null?void 0:te.result,je=JSON.parse(oe);je.settings&&(Pd(je.settings),C(je.settings)),je.users&&Array.isArray(je.users)&&(ee(je.users),localStorage.setItem("horoskop_users_db",JSON.stringify(je.users))),je.horoscopes&&typeof je.horoscopes=="object"&&Object.entries(je.horoscopes).forEach(([we,Bt])=>{localStorage.setItem(we,JSON.stringify(Bt))}),o("success","Успешен увоз","Податоците и поставките се успешно обновени.")}catch{o("error","Невалидна датотека","Датотеката не содржи валиден JSON формат за резервна копија.")}},U.readAsText(S)},me=()=>{window.confirm("Дали сте сигурни дека сакате да го исчистите локалниот кеш на прелистувачот? Серверските податоци ќе останат непроменети.")&&(localStorage.removeItem("horoskop_app_custom_settings"),o("info","Кешот е исчистен","Локалните поставки се ресетирани на основните вредности."),C(ni))};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-slate-950/80 backdrop-blur-sm overflow-y-auto animate-fadeIn",children:i.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-3xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh] my-auto",children:[i.jsxs("div",{className:"px-5 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/70",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-xl bg-indigo-600/20 border border-indigo-500/40 flex items-center justify-center text-indigo-400",children:i.jsx(ii,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-base sm:text-lg font-bold text-white leading-tight",children:"Подесувања на апликацијата"}),i.jsx("p",{className:"text-xs text-slate-400",children:"Конфигурација на порталот, безбедност, корисници и резервни копии"})]})]}),i.jsx("button",{onClick:T,className:"p-2 rounded-xl text-slate-400 hover:text-white hover:bg-slate-800 transition-colors",title:"Затвори",children:i.jsx(Cn,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex border-b border-slate-800 bg-slate-950/40 px-5 pt-2 gap-2 overflow-x-auto scrollbar-none",children:[i.jsxs("button",{onClick:()=>D("general"),className:`flex items-center gap-2 px-3.5 py-2.5 text-xs font-semibold rounded-t-xl border-b-2 transition-all whitespace-nowrap ${A==="general"?"border-indigo-500 text-indigo-400 bg-slate-800/60":"border-transparent text-slate-400 hover:text-slate-200 hover:bg-slate-800/30"}`,children:[i.jsx(zx,{className:"w-4 h-4"}),i.jsx("span",{children:"Општи Поставки"})]}),i.jsxs("button",{onClick:()=>D("horoscope"),className:`flex items-center gap-2 px-3.5 py-2.5 text-xs font-semibold rounded-t-xl border-b-2 transition-all whitespace-nowrap ${A==="horoscope"?"border-indigo-500 text-indigo-400 bg-slate-800/60":"border-transparent text-slate-400 hover:text-slate-200 hover:bg-slate-800/30"}`,children:[i.jsx(ii,{className:"w-4 h-4"}),i.jsx("span",{children:"Уредувач & Хороскоп"})]}),i.jsxs("button",{onClick:()=>D("security"),className:`flex items-center gap-2 px-3.5 py-2.5 text-xs font-semibold rounded-t-xl border-b-2 transition-all whitespace-nowrap ${A==="security"?"border-indigo-500 text-indigo-400 bg-slate-800/60":"border-transparent text-slate-400 hover:text-slate-200 hover:bg-slate-800/30"}`,children:[i.jsx(f0,{className:"w-4 h-4"}),i.jsx("span",{children:"Корисници & Лозинки"})]}),i.jsxs("button",{onClick:()=>D("backup"),className:`flex items-center gap-2 px-3.5 py-2.5 text-xs font-semibold rounded-t-xl border-b-2 transition-all whitespace-nowrap ${A==="backup"?"border-indigo-500 text-indigo-400 bg-slate-800/60":"border-transparent text-slate-400 hover:text-slate-200 hover:bg-slate-800/30"}`,children:[i.jsx(s0,{className:"w-4 h-4"}),i.jsx("span",{children:"Резервна Копија"})]})]}),i.jsxs("div",{className:"flex-1 p-5 overflow-y-auto space-y-5 text-slate-200",children:[A==="general"&&i.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5 uppercase tracking-wider",children:"Наслов на порталот / Панелот"}),i.jsx("input",{type:"text",value:N.portalName,onChange:r=>C({...N,portalName:r.target.value}),placeholder:"пр. Хороскоп Админ",className:"w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2 text-sm text-white focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all"}),i.jsx("p",{className:"text-[11px] text-slate-400 mt-1",children:"Се прикажува во главното заглавие на апликацијата."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5 uppercase tracking-wider",children:"Поднаслов / Опис"}),i.jsx("input",{type:"text",value:N.portalSubtitle,onChange:r=>C({...N,portalSubtitle:r.target.value}),placeholder:"пр. Панел за уредување на дневен хороскоп",className:"w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2 text-sm text-white focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5 uppercase tracking-wider",children:"Стандарден Автор / Потпис"}),i.jsx("input",{type:"text",value:N.defaultAuthor,onChange:r=>C({...N,defaultAuthor:r.target.value}),placeholder:"пр. Главен Уредник",className:"w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2 text-sm text-white focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all"}),i.jsx("p",{className:"text-[11px] text-slate-400 mt-1",children:"Името со кое автоматски се потпишува секој нов запис."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5 uppercase tracking-wider",children:"Контакт Е-пошта на редакција"}),i.jsx("input",{type:"email",value:N.contactEmail,onChange:r=>C({...N,contactEmail:r.target.value}),placeholder:"пр. redakcija@speedtest.mk",className:"w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2 text-sm text-white focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-all"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-3",children:[i.jsx("h4",{className:"text-xs font-bold text-indigo-400 uppercase tracking-wider",children:"Преглед на формат на датуми"}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-xs text-slate-300",children:[i.jsx("input",{type:"radio",name:"dateFormat",checked:N.dateFormat==="mk-full",onChange:()=>C({...N,dateFormat:"mk-full"}),className:"text-indigo-600 focus:ring-indigo-500"}),i.jsx("span",{children:"Македонски цел датум (пр. 15 Август 2026)"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-xs text-slate-300",children:[i.jsx("input",{type:"radio",name:"dateFormat",checked:N.dateFormat==="iso",onChange:()=>C({...N,dateFormat:"iso"}),className:"text-indigo-600 focus:ring-indigo-500"}),i.jsx("span",{children:"Стандарден ISO формат (2026-08-15)"})]})]})]})]}),A==="horoscope"&&i.jsx("div",{className:"space-y-4 animate-fadeIn",children:i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5 uppercase tracking-wider",children:"Стандарден почетен статус на нови записи"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-2",children:[i.jsxs("button",{type:"button",onClick:()=>C({...N,defaultStatus:"published"}),className:`p-3 rounded-xl border text-left transition-all ${N.defaultStatus==="published"?"border-emerald-500/80 bg-emerald-950/20 text-emerald-300":"border-slate-800 bg-slate-900/60 text-slate-400 hover:border-slate-700"}`,children:[i.jsx("div",{className:"font-bold text-xs",children:"Директно објавено"}),i.jsx("div",{className:"text-[11px] text-slate-400 mt-0.5",children:"Веднаш се зачувува како активно и јавно."})]}),i.jsxs("button",{type:"button",onClick:()=>C({...N,defaultStatus:"draft"}),className:`p-3 rounded-xl border text-left transition-all ${N.defaultStatus==="draft"?"border-amber-500/80 bg-amber-950/20 text-amber-300":"border-slate-800 bg-slate-900/60 text-slate-400 hover:border-slate-700"}`,children:[i.jsx("div",{className:"font-bold text-xs",children:"Зачувај како нацрт (Draft)"}),i.jsx("div",{className:"text-[11px] text-slate-400 mt-0.5",children:"Останува скриено додека не се потврди."})]})]})]}),i.jsxs("div",{className:"pt-3 border-t border-slate-800/80 space-y-3",children:[i.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:N.autoGenerateLuckyNumbers,onChange:r=>C({...N,autoGenerateLuckyNumbers:r.target.checked}),className:"w-4 h-4 rounded text-indigo-600 bg-slate-900 border-slate-700 focus:ring-indigo-500"}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-semibold text-slate-200 block",children:"Автоматско предложување на Среќен Број и Боја"}),i.jsx("span",{className:"text-[11px] text-slate-400 block",children:"Генерира астролошки среќен број и боја доколку се празни при уредување."})]})]}),i.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:N.autoSaveDrafts,onChange:r=>C({...N,autoSaveDrafts:r.target.checked}),className:"w-4 h-4 rounded text-indigo-600 bg-slate-900 border-slate-700 focus:ring-indigo-500"}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-semibold text-slate-200 block",children:"Локална резерва во прелистувач (Fail-safe Cache)"}),i.jsx("span",{className:"text-[11px] text-slate-400 block",children:"Секој хороскоп се чува и во локалниот прелистувач во случај на прекин на мрежата."})]})]})]})]})}),A==="security"&&i.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[i.jsx(Cx,{className:"w-4 h-4"}),i.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-200",children:["Промена на лозинка за: ",i.jsx("strong",{className:"text-white",children:d.username})]})]}),i.jsxs("form",{onSubmit:We,className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 uppercase mb-1",children:"Нова Лозинка"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:Y?"text":"password",value:O,onChange:r=>B(r.target.value),placeholder:"Внесете нова сигурна лозинка",className:"w-full bg-slate-900 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white focus:outline-none focus:border-indigo-500"}),i.jsx("button",{type:"button",onClick:()=>q(!Y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-200",children:Y?i.jsx(i0,{className:"w-3.5 h-3.5"}):i.jsx(si,{className:"w-3.5 h-3.5"})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 uppercase mb-1",children:"Потврди Лозинка"}),i.jsx("input",{type:"password",value:L,onChange:r=>K(r.target.value),placeholder:"Повторете ја новата лозинка",className:"w-full bg-slate-900 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white focus:outline-none focus:border-indigo-500"})]})]}),i.jsxs("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-xl text-xs font-bold bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white transition-colors",children:[i.jsx(Uc,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Ажурирај Лозинка"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Bc,{className:"w-4 h-4 text-indigo-400"}),i.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-slate-200",children:"Кориснички Сметки во Системот"})]}),i.jsxs("button",{type:"button",onClick:()=>et(!Ee),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-xs font-medium bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 transition-colors",children:[i.jsx(Vx,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{children:Ee?"Откажи":"Додади Корисник"})]})]}),Ee&&i.jsxs("form",{onSubmit:_,className:"p-3.5 rounded-xl bg-slate-900/80 border border-indigo-500/30 space-y-3 animate-fadeIn",children:[i.jsx("h4",{className:"text-xs font-bold text-white",children:"Креирање на нова сметка"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 mb-1",children:"Корисничко име"}),i.jsx("input",{type:"text",value:be,onChange:r=>J(r.target.value),placeholder:"пр. nov_urednik",className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 mb-1",children:"Име и Презиме"}),i.jsx("input",{type:"text",value:pe,onChange:r=>ze(r.target.value),placeholder:"пр. Марко Петровски",className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 mb-1",children:"Почетна Лозинка"}),i.jsx("input",{type:"text",value:se,onChange:r=>Ce(r.target.value),placeholder:"Лозинка за најава",className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-semibold text-slate-400 mb-1",children:"Улога (Role)"}),i.jsxs("select",{value:rt,onChange:r=>Le(r.target.value),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white focus:outline-none",children:[i.jsx("option",{value:"editor",children:"Уредник (Editor)"}),i.jsx("option",{value:"admin",children:"Администратор (Admin)"})]})]})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx("button",{type:"button",onClick:()=>et(!1),className:"px-3 py-1.5 rounded-lg text-xs bg-slate-800 text-slate-300 hover:bg-slate-700",children:"Откажи"}),i.jsx("button",{type:"submit",className:"px-3 py-1.5 rounded-lg text-xs font-bold bg-indigo-600 hover:bg-indigo-500 text-white",children:"Зачувај Корисник"})]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left text-xs border border-slate-800 rounded-xl overflow-hidden",children:[i.jsx("thead",{className:"bg-slate-900 text-slate-400 font-semibold border-b border-slate-800",children:i.jsxs("tr",{children:[i.jsx("th",{className:"p-2.5",children:"Корисник"}),i.jsx("th",{className:"p-2.5",children:"Име"}),i.jsx("th",{className:"p-2.5",children:"Улога"}),i.jsx("th",{className:"p-2.5 text-right",children:"Акции"})]})}),i.jsx("tbody",{className:"divide-y divide-slate-800/80",children:X.map(r=>i.jsxs("tr",{className:"hover:bg-slate-800/30",children:[i.jsxs("td",{className:"p-2.5 font-mono text-slate-200",children:[r.username,r.username===d.username&&i.jsx("span",{className:"ml-1.5 text-[10px] px-1.5 py-0.5 rounded bg-indigo-900/50 text-indigo-300 border border-indigo-500/30",children:"Вие"})]}),i.jsx("td",{className:"p-2.5 text-slate-300",children:r.name}),i.jsx("td",{className:"p-2.5",children:i.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold uppercase ${r.role==="admin"?"bg-purple-950/60 text-purple-300 border border-purple-800/50":"bg-blue-950/60 text-blue-300 border border-blue-800/50"}`,children:r.role})}),i.jsx("td",{className:"p-2.5 text-right",children:r.username!=="admin"&&r.username!==d.username&&i.jsx("button",{onClick:()=>k(r.id,r.username),className:"p-1 text-slate-400 hover:text-rose-400 transition-colors",title:"Избриши корисник",children:i.jsx(d0,{className:"w-3.5 h-3.5"})})})]},r.id))})]})})]})]}),A==="backup"&&i.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-3 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-600/20 text-indigo-400 flex items-center justify-center mb-2",children:i.jsx(Fd,{className:"w-4 h-4"})}),i.jsx("h4",{className:"text-xs font-bold text-white uppercase tracking-wider",children:"Експорт на Резервна Копија"}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Симнете ги сите зачувани хороскопи, поставки на апликацијата и корисници во една JSON датотека."})]}),i.jsxs("button",{type:"button",onClick:F,className:"flex items-center justify-center gap-2 w-full py-2.5 px-3 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-bold transition-colors",children:[i.jsx(Fd,{className:"w-4 h-4"}),i.jsx("span",{children:"Преземи JSON датотека"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/60 border border-slate-800 space-y-3 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-600/20 text-purple-400 flex items-center justify-center mb-2",children:i.jsx(ui,{className:"w-4 h-4"})}),i.jsx("h4",{className:"text-xs font-bold text-white uppercase tracking-wider",children:"Увоз од Резервна Копија"}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Вчитајте претходно преземена `.json` датотека за да ги вратите сите податоци."})]}),i.jsxs("label",{className:"flex items-center justify-center gap-2 w-full py-2.5 px-3 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 text-xs font-bold cursor-pointer transition-colors",children:[i.jsx(ui,{className:"w-4 h-4 text-purple-400"}),i.jsx("span",{children:"Избери JSON датотека"}),i.jsx("input",{type:"file",accept:".json",onChange:de,className:"hidden"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/40 border border-slate-800 flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-300",children:"Ресетирање на локални поставки"}),i.jsx("p",{className:"text-[11px] text-slate-500",children:"Враќање на поставките на апликацијата во основна фабричка состојба."})]}),i.jsxs("button",{type:"button",onClick:me,className:"flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-medium bg-rose-950/30 hover:bg-rose-900/50 text-rose-300 border border-rose-900/40 transition-colors",children:[i.jsx(r0,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Ресетирај"})]})]})]})]}),i.jsxs("div",{className:"px-5 py-3.5 border-t border-slate-800 bg-slate-950/80 flex items-center justify-between",children:[i.jsxs("div",{className:"text-xs text-slate-400 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400"}),i.jsx("span",{children:"Параметрите се активни во реално време"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:T,className:"px-4 py-2 rounded-xl text-xs font-medium bg-slate-800 hover:bg-slate-700 text-slate-300 transition-colors",children:"Затвори"}),i.jsxs("button",{type:"button",onClick:tt,disabled:g,className:"flex items-center gap-1.5 px-5 py-2 rounded-xl text-xs font-bold bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white transition-all shadow-md shadow-indigo-950/50 disabled:opacity-50",children:[g?i.jsx(n0,{className:"w-4 h-4 animate-bounce"}):i.jsx(Uc,{className:"w-4 h-4"}),i.jsx("span",{children:g?"Се зачувува...":"Зачувај промени"})]})]})]})]})})},t0=({toasts:d,onDismiss:T})=>d.length===0?null:i.jsx("div",{className:"fixed bottom-3 sm:bottom-5 left-3 right-3 sm:left-auto sm:right-5 z-50 flex flex-col gap-2 sm:max-w-md pointer-events-none",children:d.map(o=>{const m=o.type==="success",A=o.type==="error",D=o.type==="warning";return i.jsxs("div",{id:`toast-${o.id}`,className:`pointer-events-auto flex items-start gap-3 p-3.5 sm:p-4 rounded-xl border shadow-xl transition-all duration-300 transform translate-y-0 ${m?"bg-emerald-950/95 border-emerald-500/40 text-emerald-100 shadow-emerald-950/40":A?"bg-rose-950/95 border-rose-500/40 text-rose-100 shadow-rose-950/40":D?"bg-amber-950/95 border-amber-500/40 text-amber-100 shadow-amber-950/40":"bg-slate-900/95 border-slate-700 text-slate-100 shadow-slate-950/40"} backdrop-blur-md`,children:[i.jsxs("div",{className:"shrink-0 mt-0.5",children:[m&&i.jsx(Hc,{className:"w-5 h-5 text-emerald-400"}),A&&i.jsx(Rc,{className:"w-5 h-5 text-rose-400"}),D&&i.jsx(s1,{className:"w-5 h-5 text-amber-400"}),!m&&!A&&!D&&i.jsx(Ux,{className:"w-5 h-5 text-sky-400"})]}),i.jsxs("div",{className:"flex-1 text-sm min-w-0",children:[i.jsx("div",{className:"font-semibold text-xs sm:text-sm",children:o.title}),i.jsx("div",{className:"text-[11px] sm:text-xs opacity-90 mt-0.5 leading-relaxed break-words",children:o.message})]}),i.jsx("button",{onClick:()=>T(o.id),className:"shrink-0 opacity-60 hover:opacity-100 active:opacity-100 transition-opacity p-1.5 -mr-1 -mt-1 rounded-lg touch-manipulation min-w-[28px] min-h-[28px] flex items-center justify-center",title:"Затвори","aria-label":"Затвори известување",children:i.jsx(Cn,{className:"w-4 h-4"})})]},o.id)})});function j1(){const[d,T]=G.useState(()=>h0()),[o,m]=G.useState(()=>new Date().toISOString().split("T")[0]),[A,D]=G.useState({}),[N,C]=G.useState(!1),[g,x]=G.useState(null),[R,E]=G.useState(!1),[O,B]=G.useState(!1),[L,K]=G.useState([]),Y=G.useCallback((J,se,Ce)=>{const rt=`${Date.now()}_${Math.random().toString(36).substr(2,9)}`;K(Le=>[...Le,{id:rt,type:J,title:se,message:Ce}]),setTimeout(()=>{K(Le=>Le.filter(Ee=>Ee.id!==rt))},4e3)},[]),q=J=>{K(se=>se.filter(Ce=>Ce.id!==J))},X=G.useCallback(async J=>{C(!0);try{const se=await Dn.getHoroscopesByDate(J);D(se)}catch(se){console.error("Грешка при вчитување на хороскопите:",se),Y("error","Грешка при вчитување","Не успеа вчитувањето на податоците од серверот.")}finally{C(!1)}},[Y]);G.useEffect(()=>{d&&X(o)},[d,o,X]);const ee=J=>{T(J)},pe=()=>{x1(),T(null),Y("info","Одјавени сте","Успешно се одјавивте од администраторскиот панел.")},ze=J=>{D(se=>({...se,[J.signId]:J}))},be=Object.values(A).filter(J=>{var se;return J.status==="published"&&((se=J.text)==null?void 0:se.trim())}).length;return d?i.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100 flex flex-col font-sans selection:bg-indigo-500 selection:text-white",children:[i.jsx(f1,{user:d,selectedDate:o,onDateChange:m,publishedCount:be,totalSigns:ci.length,onOpenSettings:()=>E(!0),onOpenAppSettings:()=>B(!0),onLogout:pe}),i.jsx("main",{className:"flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 pt-6",children:i.jsx(d1,{date:o,horoscopes:A,onSelectSign:J=>x(J),isLoading:N})}),g&&i.jsx(g1,{sign:g,date:o,initialEntry:A[g.id],onClose:()=>x(null),onSaveSuccess:ze,showToast:Y}),O&&i.jsx(y1,{user:d,onClose:()=>B(!1),showToast:Y,onUserUpdated:J=>T(J)}),R&&i.jsx(v1,{onClose:()=>E(!1),showToast:Y}),i.jsx(t0,{toasts:L,onDismiss:q}),i.jsx("footer",{className:"border-t border-slate-900 bg-slate-950/80 py-4 text-center text-xs text-slate-500",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 flex items-center justify-center",children:i.jsxs("span",{children:["© ",new Date().getFullYear()," Хороскоп Администрација • Сите права се задржани"]})})})]}):i.jsxs("main",{className:"min-h-screen bg-slate-950 font-sans antialiased text-slate-100",children:[i.jsx(b1,{onLoginSuccess:ee,showToast:Y}),i.jsx(t0,{toasts:L,onDismiss:q})]})}Jh.createRoot(document.getElementById("root")).render(i.jsx(G.StrictMode,{children:i.jsx(j1,{})}));