@johpaz/hive-agents 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ui-2MsLx4aa.js","assets/react-CJr1g6q1.js","assets/ui-CHpVij2M.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ui-z3jxn-RC.js","assets/react-CJr1g6q1.js","assets/ui-CHpVij2M.css"])))=>i.map(i=>d[i]);
2
2
  import{a as e,i as t,n,r,t as i}from"./react-CJr1g6q1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var a=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=r(((e,t)=>{t.exports=a()})),s=r((e=>{var t=n(),r=o();function i(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var a=new Set,s={};function c(e,t){l(e,t),l(e+`Capture`,t)}function l(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return d.call(m,e)?!0:d.call(p,e)?!1:f.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),L=Symbol.iterator;function R(e){return typeof e!=`object`||!e?null:(e=L&&e[L]||e[`@@iterator`],typeof e==`function`?e:null)}var ee=Object.assign,te;function ne(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``}return`
3
3
  `+te+e}var z=!1;function re(e,t){if(!e||z)return``;z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
4
4
  `),a=r.stack.split(`
@@ -326,4 +326,4 @@ Minimum version required to store current data is: `+c+`.
326
326
  0%, 100% { transform: scaleY(1); }
327
327
  50% { transform: scaleY(0.5); }
328
328
  }
329
- `}})]}):null},WDe=(0,u.lazy)(()=>Lu(()=>import(`./ui-2MsLx4aa.js`).then(e=>({default:e.LessonCanvas})),__vite__mapDeps([0,1,2])).catch(()=>({default:()=>(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-gray-400`,children:`HiveLearn no disponible — verifica que Ollama esté corriendo.`})}))),GDe=new gu;function KDe({children:e}){let t=localStorage.getItem(`hive-auth-token`),[n,r]=(0,u.useState)(`loading`);return(0,u.useEffect)(()=>{fetch(`/api/auth/status`).then(e=>e.json()).then(e=>r(e.hasCredentials?`protected`:`open`)).catch(()=>r(`open`))},[]),n===`loading`?null:n===`open`||t?(0,A.jsx)(A.Fragment,{children:e}):(0,A.jsx)(rf,{to:`/login`,replace:!0})}var qDe=()=>{let e=ng(e=>e.fetchUser),t=Md(),n=kd(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1);return ER(!s&&a&&r),(0,u.useEffect)(()=>{let e=!1,t=`${hh()}/health`;async function n(){for(;!e;){try{if((await(await fetch(t)).json().catch(()=>({}))).status===`ok`){i(!0);return}}catch{}await new Promise(e=>setTimeout(e,1e3))}}return n(),()=>{e=!0}},[]),(0,u.useEffect)(()=>{if(!r)return;let i=new URLSearchParams(window.location.search).get(`token`);if(i){localStorage.setItem(`hive-auth-token`,i);let e=window.location.pathname+window.location.hash;window.history.replaceState({},``,e)}fetch(`/api/setup/status`).then(e=>e.json()).then(({setupMode:r})=>{c(!!r),r&&n.pathname!==`/setup`?t(`/setup`,{replace:!0}):!r&&n.pathname===`/setup`&&t(`/`,{replace:!0}),o(!0),r||localStorage.getItem(`hive-auth-token`)&&e()}).catch(()=>{o(!0),localStorage.getItem(`hive-auth-token`)&&e()})},[r]),!r||!a?(0,A.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-background/60 backdrop-blur-md`,children:[(0,A.jsx)(`div`,{className:`relative h-32 w-32 animate-bounce`,style:{animationDuration:`2000ms`},children:(0,A.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`h-full w-full`,style:{filter:`drop-shadow(0 0 15px rgba(245,158,11,0.5))`},children:[(0,A.jsx)(`ellipse`,{cx:`50`,cy:`55`,rx:`20`,ry:`15`,fill:`#F59E0B`}),(0,A.jsx)(`path`,{d:`M40 45 Q50 40 60 45`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M35 55 Q50 50 65 55`,fill:`none`,stroke:`#1F2937`,strokeWidth:`3`}),(0,A.jsx)(`path`,{d:`M40 65 Q50 60 60 65`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`68`,cy:`50`,r:`8`,fill:`#F59E0B`}),(0,A.jsx)(`circle`,{cx:`72`,cy:`48`,r:`1.5`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M70 42 Q75 35 80 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M68 42 Q65 35 60 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M30 55 L20 55`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`})]})}),(0,A.jsx)(`p`,{className:`mt-8 text-lg font-medium tracking-wide text-primary animate-pulse italic`,children:r?`Sincronizando...`:`Iniciando la colmena...`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(UDe,{}),(0,A.jsx)(HDe,{}),(0,A.jsxs)(cf,{children:[(0,A.jsx)(of,{path:`/setup`,element:(0,A.jsx)(RDe,{})}),(0,A.jsx)(of,{path:`/login`,element:(0,A.jsx)(zDe,{})}),(0,A.jsx)(of,{path:`/recover`,element:(0,A.jsx)(BDe,{})}),(0,A.jsxs)(of,{element:(0,A.jsx)(KDe,{children:(0,A.jsx)(ig,{})}),children:[(0,A.jsx)(of,{path:`/`,element:(0,A.jsx)(lB,{})}),(0,A.jsx)(of,{path:`/chat`,element:(0,A.jsx)(PDe,{})}),(0,A.jsx)(of,{path:`/agents`,element:(0,A.jsx)(yq,{})}),(0,A.jsx)(of,{path:`/agents/new`,element:(0,A.jsx)(WJ,{})}),(0,A.jsx)(of,{path:`/agents/:id`,element:(0,A.jsx)(wq,{})}),(0,A.jsx)(of,{path:`/notas`,element:(0,A.jsx)(UJ,{forcePanel:`notas`})}),(0,A.jsx)(of,{path:`/cron-jobs`,element:(0,A.jsx)(UJ,{forcePanel:`cron-jobs`})}),(0,A.jsx)(of,{path:`/settings`,element:(0,A.jsx)(UJ,{})}),(0,A.jsx)(of,{path:`/settings/:panel`,element:(0,A.jsx)(UJ,{})}),(0,A.jsx)(of,{path:`/canvas`,element:(0,A.jsx)(S7,{})}),(0,A.jsx)(of,{path:`/canvas/:sessionId`,element:(0,A.jsx)(S7,{})}),(0,A.jsx)(of,{path:`/projects`,element:(0,A.jsx)(Pwe,{})}),(0,A.jsx)(of,{path:`/bridge`,element:(0,A.jsx)(ZCe,{})}),(0,A.jsx)(of,{path:`/channels`,element:(0,A.jsx)(Ewe,{})}),(0,A.jsx)(of,{path:`/providers`,element:(0,A.jsx)(Zwe,{})}),(0,A.jsx)(of,{path:`/logs`,element:(0,A.jsx)(QCe,{})}),(0,A.jsx)(of,{path:`/hivelearn`,element:(0,A.jsx)(u.Suspense,{fallback:(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-amber-400`,children:`Cargando HiveLearn...`}),children:(0,A.jsx)(WDe,{})})}),(0,A.jsx)(of,{path:`/hivelearn/sessions`,element:(0,A.jsx)(vTe,{})}),(0,A.jsx)(of,{path:`/hivelearn/swarm`,element:(0,A.jsx)(aTe,{})}),(0,A.jsx)(of,{path:`/hivelearn/config`,element:(0,A.jsx)(fTe,{})})]}),(0,A.jsx)(of,{path:`*`,element:(0,A.jsx)(VDe,{})})]})]})};(0,l.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(()=>(0,A.jsx)(yu,{client:GDe,children:(0,A.jsxs)(il,{children:[(0,A.jsx)(Zi,{}),(0,A.jsx)(Ma,{}),(0,A.jsx)(Qee,{children:(0,A.jsx)(qDe,{})})]})}),{}));export{YC as a,c,XC as i,ew as n,jC as o,$C as r,k as s,f1 as t};
329
+ `}})]}):null},WDe=(0,u.lazy)(()=>Lu(()=>import(`./ui-z3jxn-RC.js`).then(e=>({default:e.LessonCanvas})),__vite__mapDeps([0,1,2])).catch(()=>({default:()=>(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-gray-400`,children:`HiveLearn no disponible — verifica que Ollama esté corriendo.`})}))),GDe=new gu;function KDe({children:e}){let t=localStorage.getItem(`hive-auth-token`),[n,r]=(0,u.useState)(`loading`);return(0,u.useEffect)(()=>{fetch(`/api/auth/status`).then(e=>e.json()).then(e=>r(e.hasCredentials?`protected`:`open`)).catch(()=>r(`open`))},[]),n===`loading`?null:n===`open`||t?(0,A.jsx)(A.Fragment,{children:e}):(0,A.jsx)(rf,{to:`/login`,replace:!0})}var qDe=()=>{let e=ng(e=>e.fetchUser),t=Md(),n=kd(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1);return ER(!s&&a&&r),(0,u.useEffect)(()=>{let e=!1,t=`${hh()}/health`;async function n(){for(;!e;){try{if((await(await fetch(t)).json().catch(()=>({}))).status===`ok`){i(!0);return}}catch{}await new Promise(e=>setTimeout(e,1e3))}}return n(),()=>{e=!0}},[]),(0,u.useEffect)(()=>{if(!r)return;let i=new URLSearchParams(window.location.search).get(`token`);if(i){localStorage.setItem(`hive-auth-token`,i);let e=window.location.pathname+window.location.hash;window.history.replaceState({},``,e)}fetch(`/api/setup/status`).then(e=>e.json()).then(({setupMode:r})=>{c(!!r),r&&n.pathname!==`/setup`?t(`/setup`,{replace:!0}):!r&&n.pathname===`/setup`&&t(`/`,{replace:!0}),o(!0),r||localStorage.getItem(`hive-auth-token`)&&e()}).catch(()=>{o(!0),localStorage.getItem(`hive-auth-token`)&&e()})},[r]),!r||!a?(0,A.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-background/60 backdrop-blur-md`,children:[(0,A.jsx)(`div`,{className:`relative h-32 w-32 animate-bounce`,style:{animationDuration:`2000ms`},children:(0,A.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`h-full w-full`,style:{filter:`drop-shadow(0 0 15px rgba(245,158,11,0.5))`},children:[(0,A.jsx)(`ellipse`,{cx:`50`,cy:`55`,rx:`20`,ry:`15`,fill:`#F59E0B`}),(0,A.jsx)(`path`,{d:`M40 45 Q50 40 60 45`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M35 55 Q50 50 65 55`,fill:`none`,stroke:`#1F2937`,strokeWidth:`3`}),(0,A.jsx)(`path`,{d:`M40 65 Q50 60 60 65`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`68`,cy:`50`,r:`8`,fill:`#F59E0B`}),(0,A.jsx)(`circle`,{cx:`72`,cy:`48`,r:`1.5`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M70 42 Q75 35 80 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M68 42 Q65 35 60 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M30 55 L20 55`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`})]})}),(0,A.jsx)(`p`,{className:`mt-8 text-lg font-medium tracking-wide text-primary animate-pulse italic`,children:r?`Sincronizando...`:`Iniciando la colmena...`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(UDe,{}),(0,A.jsx)(HDe,{}),(0,A.jsxs)(cf,{children:[(0,A.jsx)(of,{path:`/setup`,element:(0,A.jsx)(RDe,{})}),(0,A.jsx)(of,{path:`/login`,element:(0,A.jsx)(zDe,{})}),(0,A.jsx)(of,{path:`/recover`,element:(0,A.jsx)(BDe,{})}),(0,A.jsxs)(of,{element:(0,A.jsx)(KDe,{children:(0,A.jsx)(ig,{})}),children:[(0,A.jsx)(of,{path:`/`,element:(0,A.jsx)(lB,{})}),(0,A.jsx)(of,{path:`/chat`,element:(0,A.jsx)(PDe,{})}),(0,A.jsx)(of,{path:`/agents`,element:(0,A.jsx)(yq,{})}),(0,A.jsx)(of,{path:`/agents/new`,element:(0,A.jsx)(WJ,{})}),(0,A.jsx)(of,{path:`/agents/:id`,element:(0,A.jsx)(wq,{})}),(0,A.jsx)(of,{path:`/notas`,element:(0,A.jsx)(UJ,{forcePanel:`notas`})}),(0,A.jsx)(of,{path:`/cron-jobs`,element:(0,A.jsx)(UJ,{forcePanel:`cron-jobs`})}),(0,A.jsx)(of,{path:`/settings`,element:(0,A.jsx)(UJ,{})}),(0,A.jsx)(of,{path:`/settings/:panel`,element:(0,A.jsx)(UJ,{})}),(0,A.jsx)(of,{path:`/canvas`,element:(0,A.jsx)(S7,{})}),(0,A.jsx)(of,{path:`/canvas/:sessionId`,element:(0,A.jsx)(S7,{})}),(0,A.jsx)(of,{path:`/projects`,element:(0,A.jsx)(Pwe,{})}),(0,A.jsx)(of,{path:`/bridge`,element:(0,A.jsx)(ZCe,{})}),(0,A.jsx)(of,{path:`/channels`,element:(0,A.jsx)(Ewe,{})}),(0,A.jsx)(of,{path:`/providers`,element:(0,A.jsx)(Zwe,{})}),(0,A.jsx)(of,{path:`/logs`,element:(0,A.jsx)(QCe,{})}),(0,A.jsx)(of,{path:`/hivelearn`,element:(0,A.jsx)(u.Suspense,{fallback:(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-amber-400`,children:`Cargando HiveLearn...`}),children:(0,A.jsx)(WDe,{})})}),(0,A.jsx)(of,{path:`/hivelearn/sessions`,element:(0,A.jsx)(vTe,{})}),(0,A.jsx)(of,{path:`/hivelearn/swarm`,element:(0,A.jsx)(aTe,{})}),(0,A.jsx)(of,{path:`/hivelearn/config`,element:(0,A.jsx)(fTe,{})})]}),(0,A.jsx)(of,{path:`*`,element:(0,A.jsx)(VDe,{})})]})]})};(0,l.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(()=>(0,A.jsx)(yu,{client:GDe,children:(0,A.jsxs)(il,{children:[(0,A.jsx)(Zi,{}),(0,A.jsx)(Ma,{}),(0,A.jsx)(Qee,{children:(0,A.jsx)(qDe,{})})]})}),{}));export{YC as a,c,XC as i,ew as n,jC as o,$C as r,k as s,f1 as t};