Files
soft_usite/public/orchestrator/assets/index-YAZk1p08.js
T
Lizandro GuarnizoandClaude Opus 5 926bbde9fb feat(umind): que el cliente conecte su propia cuenta de IA
El modelo soportaba una config de IA por espacio desde hace varias fases, pero
no había forma de cargarla: ni el cliente desde el portal, ni el staff por él.
Quedaba como una columna que solo se podía llenar tocando la base a mano.

Ahora hay una pantalla — "Tu IA", desde la lista de agentes — donde se conecta
una cuenta de OpenAI, Anthropic, Gemini, Groq, DeepSeek, Qwen u Ollama. Con el
botón "Probar", que manda una consulta real: una clave vencida se descubre ahí
y no cuando un cliente escribe y no le contestan.

El aislamiento es la parte delicada, y va en tres capas:

Las configs globales son del staff. Un cliente puede usarlas —le aparecen en el
selector— pero no editarlas ni borrarlas; el acceso corta antes de mirar
permisos, así que ni siquiera se le confirma que existen. Sin eso, cualquiera
podría cambiarle el proveedor de IA a todos los demás o dejarlos sin servicio.

El tenant sale del alcance ya validado, nunca del body. Si viniera del cuerpo
de la petición, bastaría con cambiar el número para colgarle una config a otro
cliente, y con ella una clave que no es suya.

El tenant no se puede mover en una edición, por lo mismo al revés: sería
regalarle la propia.

La clave se guarda cifrada y no vuelve nunca al navegador — ni al dueño. Solo
sus últimos cuatro caracteres, que alcanzan para reconocer cuál cargó.

Borrar está bloqueado si hay agentes usándola: si no, quedarían apuntando a
algo inexistente y cayendo al proveedor global sin que nadie se entere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 23:08:43 -05:00

27 lines
163 KiB
JavaScript

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();/**
* @vue/shared v3.5.41
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function so(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _e={},an=[],kt=()=>{},yr=()=>!1,fs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ps=e=>e.startsWith("onUpdate:"),Fe=Object.assign,oo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qi=Object.prototype.hasOwnProperty,ge=(e,t)=>Qi.call(e,t),Z=Array.isArray,un=e=>qn(e)==="[object Map]",_n=e=>qn(e)==="[object Set]",So=e=>qn(e)==="[object Date]",re=e=>typeof e=="function",Oe=e=>typeof e=="string",pt=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",wr=e=>(xe(e)||re(e))&&re(e.then)&&re(e.catch),Cr=Object.prototype.toString,qn=e=>Cr.call(e),Yi=e=>qn(e).slice(8,-1),kr=e=>qn(e)==="[object Object]",ro=e=>Oe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,In=so(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ms=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Xi=/-\w/g,Xe=ms(e=>e.replace(Xi,t=>t.slice(1).toUpperCase())),Zi=/\B([A-Z])/g,sn=ms(e=>e.replace(Zi,"-$1").toLowerCase()),hs=ms(e=>e.charAt(0).toUpperCase()+e.slice(1)),Is=ms(e=>e?`on${hs(e)}`:""),Ct=(e,t)=>!Object.is(e,t),es=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Er=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},vs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ao;const gs=()=>Ao||(Ao=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function nn(e){if(Z(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Oe(s)?sl(s):nn(s);if(o)for(const r in o)t[r]=o[r]}return t}else if(Oe(e)||xe(e))return e}const el=/;(?![^(]*\))/g,tl=/:([^]+)/,nl=/\/\*[^]*?\*\//g;function sl(e){const t={};return e.replace(nl,"").split(el).forEach(n=>{if(n){const s=n.split(tl);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ee(e){let t="";if(Oe(e))t=e;else if(Z(e))for(let n=0;n<e.length;n++){const s=Ee(e[n]);s&&(t+=s+" ")}else if(xe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ol="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",rl=so(ol);function Sr(e){return!!e||e===""}function il(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Wt(e[s],t[s]);return n}function Wt(e,t){if(e===t)return!0;let n=So(e),s=So(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=pt(e),s=pt(t),n||s)return e===t;if(n=Z(e),s=Z(t),n||s)return n&&s?il(e,t):!1;if(n=xe(e),s=xe(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,r=Object.keys(t).length;if(o!==r)return!1;for(const i in e){const a=e.hasOwnProperty(i),u=t.hasOwnProperty(i);if(a&&!u||!a&&u||!Wt(e[i],t[i]))return!1}}return String(e)===String(t)}function io(e,t){return e.findIndex(n=>Wt(n,t))}const Ar=e=>!!(e&&e.__v_isRef===!0),R=e=>Oe(e)?e:e==null?"":Z(e)||xe(e)&&(e.toString===Cr||!re(e.toString))?Ar(e)?R(e.value):JSON.stringify(e,Ir,2):String(e),Ir=(e,t)=>Ar(t)?Ir(e,t.value):un(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],r)=>(n[$s(s,r)+" =>"]=o,n),{})}:_n(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>$s(n))}:pt(t)?$s(t):xe(t)&&!Z(t)&&!kr(t)?String(t):t,$s=(e,t="")=>{var n;return pt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.41
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ue;class ll{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ue&&(Ue.active?(this.parent=Ue,this.index=(Ue.scopes||(Ue.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Ue;try{return Ue=this,t()}finally{Ue=n}}}on(){++this._on===1&&(this.prevScope=Ue,Ue=this)}off(){if(this._on>0&&--this._on===0){if(Ue===this)Ue=this.prevScope;else{let t=Ue;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function al(){return Ue}let ye;const Rs=new WeakSet;class $r{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ue&&(Ue.active?Ue.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Rs.has(this)&&(Rs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Io(this),Or(this);const t=ye,n=dt;ye=this,dt=!0;try{return this.fn()}finally{Tr(this),ye=t,dt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)uo(t);this.deps=this.depsTail=void 0,Io(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Rs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Hs(this)&&this.run()}get dirty(){return Hs(this)}}let Rr=0,$n,Rn;function Pr(e,t=!1){if(e.flags|=8,t){e.next=Rn,Rn=e;return}e.next=$n,$n=e}function lo(){Rr++}function ao(){if(--Rr>0)return;if(Rn){let t=Rn;for(Rn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$n;){let t=$n;for($n=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Or(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Tr(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),uo(s),ul(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function Hs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Dr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Dr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Dn)||(e.globalVersion=Dn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Hs(e))))return;e.flags|=2;const t=e.dep,n=ye,s=dt;ye=e,dt=!0;try{Or(e);const o=e.fn(e._value);(t.version===0||Ct(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ye=n,dt=s,Tr(e),e.flags&=-3}}function uo(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)uo(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ul(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let dt=!0;const Nr=[];function jt(){Nr.push(dt),dt=!1}function Ut(){const e=Nr.pop();dt=e===void 0?!0:e}function Io(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ye;ye=void 0;try{t()}finally{ye=n}}}let Dn=0;class cl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class co{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ye||!dt||ye===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ye)n=this.activeLink=new cl(ye,this),ye.deps?(n.prevDep=ye.depsTail,ye.depsTail.nextDep=n,ye.depsTail=n):ye.deps=ye.depsTail=n,Mr(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ye.depsTail,n.nextDep=void 0,ye.depsTail.nextDep=n,ye.depsTail=n,ye.deps===n&&(ye.deps=s)}return n}trigger(t){this.version++,Dn++,this.notify(t)}notify(t){lo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ao()}}}function Mr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Mr(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Bs=new WeakMap,en=Symbol(""),Gs=Symbol(""),Nn=Symbol("");function He(e,t,n){if(dt&&ye){let s=Bs.get(e);s||Bs.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new co),o.map=s,o.key=n),o.track()}}function Tt(e,t,n,s,o,r){const i=Bs.get(e);if(!i){Dn++;return}const a=u=>{u&&u.trigger()};if(lo(),t==="clear")i.forEach(a);else{const u=Z(e),d=u&&ro(n);if(u&&n==="length"){const c=Number(s);i.forEach((p,h)=>{(h==="length"||h===Nn||!pt(h)&&h>=c)&&a(p)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(Nn)),t){case"add":u?d&&a(i.get("length")):(a(i.get(en)),un(e)&&a(i.get(Gs)));break;case"delete":u||(a(i.get(en)),un(e)&&a(i.get(Gs)));break;case"set":un(e)&&a(i.get(en));break}}ao()}function on(e){const t=ve(e);return t===e?t:(He(t,"iterate",Nn),at(e)?t:t.map(mt))}function bs(e){return He(e=ve(e),"iterate",Nn),e}function yt(e,t){return Lt(e)?mn(tn(e)?mt(t):t):mt(t)}const dl={__proto__:null,[Symbol.iterator](){return Ps(this,Symbol.iterator,e=>yt(this,e))},concat(...e){return on(this).concat(...e.map(t=>Z(t)?on(t):t))},entries(){return Ps(this,"entries",e=>(e[1]=yt(this,e[1]),e))},every(e,t){return At(this,"every",e,t,void 0,arguments)},filter(e,t){return At(this,"filter",e,t,n=>n.map(s=>yt(this,s)),arguments)},find(e,t){return At(this,"find",e,t,n=>yt(this,n),arguments)},findIndex(e,t){return At(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return At(this,"findLast",e,t,n=>yt(this,n),arguments)},findLastIndex(e,t){return At(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return At(this,"forEach",e,t,void 0,arguments)},includes(...e){return Os(this,"includes",e)},indexOf(...e){return Os(this,"indexOf",e)},join(e){return on(this).join(e)},lastIndexOf(...e){return Os(this,"lastIndexOf",e)},map(e,t){return At(this,"map",e,t,void 0,arguments)},pop(){return wn(this,"pop")},push(...e){return wn(this,"push",e)},reduce(e,...t){return $o(this,"reduce",e,t)},reduceRight(e,...t){return $o(this,"reduceRight",e,t)},shift(){return wn(this,"shift")},some(e,t){return At(this,"some",e,t,void 0,arguments)},splice(...e){return wn(this,"splice",e)},toReversed(){return on(this).toReversed()},toSorted(e){return on(this).toSorted(e)},toSpliced(...e){return on(this).toSpliced(...e)},unshift(...e){return wn(this,"unshift",e)},values(){return Ps(this,"values",e=>yt(this,e))}};function Ps(e,t,n){const s=bs(e),o=s[t]();return s!==e&&!at(e)&&(o._next=o.next,o.next=()=>{const r=o._next();return r.done||(r.value=n(r.value)),r}),o}const fl=Array.prototype;function At(e,t,n,s,o,r){const i=bs(e),a=i!==e&&!at(e),u=i[t];if(u!==fl[t]){const p=u.apply(e,r);return a?mt(p):p}let d=n;i!==e&&(a?d=function(p,h){return n.call(this,yt(e,p),h,e)}:n.length>2&&(d=function(p,h){return n.call(this,p,h,e)}));const c=u.call(i,d,s);return a&&o?o(c):c}function $o(e,t,n,s){const o=bs(e),r=o!==e&&!at(e);let i=n,a=!1;o!==e&&(r?(a=s.length===0,i=function(d,c,p){return a&&(a=!1,d=yt(e,d)),n.call(this,d,yt(e,c),p,e)}):n.length>3&&(i=function(d,c,p){return n.call(this,d,c,p,e)}));const u=o[t](i,...s);return a?yt(e,u):u}function Os(e,t,n){const s=ve(e);He(s,"iterate",Nn);const o=s[t](...n);return(o===-1||o===!1)&&mo(n[0])?(n[0]=ve(n[0]),s[t](...n)):o}function wn(e,t,n=[]){jt(),lo();const s=ve(e)[t].apply(e,n);return ao(),Ut(),s}const pl=so("__proto__,__v_isRef,__isVue"),Vr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(pt));function ml(e){pt(e)||(e=String(e));const t=ve(this);return He(t,"has",e),t.hasOwnProperty(e)}class jr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(o?r?kl:qr:r?Fr:Lr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const i=Z(t);if(!o){let u;if(i&&(u=dl[n]))return u;if(n==="hasOwnProperty")return ml}const a=Reflect.get(t,n,Ge(t)?t:s);if((pt(n)?Vr.has(n):pl(n))||(o||He(t,"get",n),r))return a;if(Ge(a)){const u=i&&ro(n)?a:a.value;return o&&xe(u)?Ws(u):u}return xe(a)?o?Ws(a):xs(a):a}}class Ur extends jr{constructor(t=!1){super(!1,t)}set(t,n,s,o){let r=t[n];const i=Z(t)&&ro(n);if(!this._isShallow){const d=Lt(r);if(!at(s)&&!Lt(s)&&(r=ve(r),s=ve(s)),!i&&Ge(r)&&!Ge(s))return d||(r.value=s),!0}const a=i?Number(n)<t.length:ge(t,n),u=Reflect.set(t,n,s,Ge(t)?t:o);return t===ve(o)&&u&&(a?Ct(s,r)&&Tt(t,"set",n,s):Tt(t,"add",n,s)),u}deleteProperty(t,n){const s=ge(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Tt(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!pt(n)||!Vr.has(n))&&He(t,"has",n),s}ownKeys(t){return He(t,"iterate",Z(t)?"length":en),Reflect.ownKeys(t)}}class hl extends jr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const vl=new Ur,gl=new hl,bl=new Ur(!0);const Ks=e=>e,zn=e=>Reflect.getPrototypeOf(e);function xl(e,t,n){return function(...s){const o=this.__v_raw,r=ve(o),i=un(r),a=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=o[e](...s),c=n?Ks:t?mn:mt;return!t&&He(r,"iterate",u?Gs:en),Fe(Object.create(d),{next(){const{value:p,done:h}=d.next();return h?{value:p,done:h}:{value:a?[c(p[0]),c(p[1])]:c(p),done:h}}})}}function Jn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _l(e,t){const n={get(o){const r=this.__v_raw,i=ve(r),a=ve(o);e||(Ct(o,a)&&He(i,"get",o),He(i,"get",a));const{has:u}=zn(i),d=t?Ks:e?mn:mt;if(u.call(i,o))return d(r.get(o));if(u.call(i,a))return d(r.get(a));r!==i&&r.get(o)},get size(){const o=this.__v_raw;return!e&&He(ve(o),"iterate",en),o.size},has(o){const r=this.__v_raw,i=ve(r),a=ve(o);return e||(Ct(o,a)&&He(i,"has",o),He(i,"has",a)),o===a?r.has(o):r.has(o)||r.has(a)},forEach(o,r){const i=this,a=i.__v_raw,u=ve(a),d=t?Ks:e?mn:mt;return!e&&He(u,"iterate",en),a.forEach((c,p)=>o.call(r,d(c),d(p),i))}};return Fe(n,e?{add:Jn("add"),set:Jn("set"),delete:Jn("delete"),clear:Jn("clear")}:{add(o){const r=ve(this),i=zn(r),a=ve(o),u=!t&&!at(o)&&!Lt(o)?a:o;return i.has.call(r,u)||Ct(o,u)&&i.has.call(r,o)||Ct(a,u)&&i.has.call(r,a)||(r.add(u),Tt(r,"add",u,u)),this},set(o,r){!t&&!at(r)&&!Lt(r)&&(r=ve(r));const i=ve(this),{has:a,get:u}=zn(i);let d=a.call(i,o);d||(o=ve(o),d=a.call(i,o));const c=u.call(i,o);return i.set(o,r),d?Ct(r,c)&&Tt(i,"set",o,r):Tt(i,"add",o,r),this},delete(o){const r=ve(this),{has:i,get:a}=zn(r);let u=i.call(r,o);u||(o=ve(o),u=i.call(r,o)),a&&a.call(r,o);const d=r.delete(o);return u&&Tt(r,"delete",o,void 0),d},clear(){const o=ve(this),r=o.size!==0,i=o.clear();return r&&Tt(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=xl(o,e,t)}),n}function fo(e,t){const n=_l(e,t);return(s,o,r)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(ge(n,o)&&o in s?n:s,o,r)}const yl={get:fo(!1,!1)},wl={get:fo(!1,!0)},Cl={get:fo(!0,!1)};const Lr=new WeakMap,Fr=new WeakMap,qr=new WeakMap,kl=new WeakMap;function El(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xs(e){return Lt(e)?e:po(e,!1,vl,yl,Lr)}function Hr(e){return po(e,!1,bl,wl,Fr)}function Ws(e){return po(e,!0,gl,Cl,qr)}function po(e,t,n,s,o){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=o.get(e);if(r)return r;const i=El(Yi(e));if(i===0)return e;const a=new Proxy(e,i===2?s:n);return o.set(e,a),a}function tn(e){return Lt(e)?tn(e.__v_raw):!!(e&&e.__v_isReactive)}function Lt(e){return!!(e&&e.__v_isReadonly)}function at(e){return!!(e&&e.__v_isShallow)}function mo(e){return e?!!e.__v_raw:!1}function ve(e){const t=e&&e.__v_raw;return t?ve(t):e}function Sl(e){return!ge(e,"__v_skip")&&Object.isExtensible(e)&&Er(e,"__v_skip",!0),e}const mt=e=>xe(e)?xs(e):e,mn=e=>xe(e)?Ws(e):e;function Ge(e){return e?e.__v_isRef===!0:!1}function G(e){return Br(e,!1)}function Al(e){return Br(e,!0)}function Br(e,t){return Ge(e)?e:new Il(e,t)}class Il{constructor(t,n){this.dep=new co,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ve(t),this._value=n?t:mt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||at(t)||Lt(t);t=s?t:ve(t),Ct(t,n)&&(this._rawValue=t,this._value=s?t:mt(t),this.dep.trigger())}}function je(e){return Ge(e)?e.value:e}const $l={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ge(o)&&!Ge(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Gr(e){return tn(e)?e:new Proxy(e,$l)}class Rl{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new co(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Dn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ye!==this)return Pr(this,!0),!0}get value(){const t=this.dep.track();return Dr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Pl(e,t,n=!1){let s,o;return re(e)?s=e:(s=e.get,o=e.set),new Rl(s,o,n)}const Qn={},os=new WeakMap;let Xt;function Ol(e,t=!1,n=Xt){if(n){let s=os.get(n);s||os.set(n,s=[]),s.push(e)}}function Tl(e,t,n=_e){const{immediate:s,deep:o,once:r,scheduler:i,augmentJob:a,call:u}=n,d=k=>o?k:at(k)||o===!1||o===0?Dt(k,1):Dt(k);let c,p,h,_,N=!1,P=!1;if(Ge(e)?(p=()=>e.value,N=at(e)):tn(e)?(p=()=>d(e),N=!0):Z(e)?(P=!0,N=e.some(k=>tn(k)||at(k)),p=()=>e.map(k=>{if(Ge(k))return k.value;if(tn(k))return d(k);if(re(k))return u?u(k,2):k()})):re(e)?t?p=u?()=>u(e,2):e:p=()=>{if(h){jt();try{h()}finally{Ut()}}const k=Xt;Xt=c;try{return u?u(e,3,[_]):e(_)}finally{Xt=k}}:p=kt,t&&o){const k=p,x=o===!0?1/0:o;p=()=>Dt(k(),x)}const W=al(),H=()=>{c.stop(),W&&W.active&&oo(W.effects,c)};if(r&&t){const k=t;t=(...x)=>{const O=k(...x);return H(),O}}let D=P?new Array(e.length).fill(Qn):Qn;const B=k=>{if(!(!(c.flags&1)||!c.dirty&&!k))if(t){const x=c.run();if(k||o||N||(P?x.some((O,U)=>Ct(O,D[U])):Ct(x,D))){h&&h();const O=Xt;Xt=c;try{const U=[x,D===Qn?void 0:P&&D[0]===Qn?[]:D,_];D=x,u?u(t,3,U):t(...U)}finally{Xt=O}}}else c.run()};return a&&a(B),c=new $r(p),c.scheduler=i?()=>i(B,!1):B,_=k=>Ol(k,!1,c),h=c.onStop=()=>{const k=os.get(c);if(k){if(u)u(k,4);else for(const x of k)x();os.delete(c)}},t?s?B(!0):D=c.run():i?i(B.bind(null,!0),!0):c.run(),H.pause=c.pause.bind(c),H.resume=c.resume.bind(c),H.stop=H,H}function Dt(e,t=1/0,n){if(t<=0||!xe(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ge(e))Dt(e.value,t,n);else if(Z(e))for(let s=0;s<e.length;s++)Dt(e[s],t,n);else if(_n(e)||un(e))e.forEach(s=>{Dt(s,t,n)});else if(kr(e)){for(const s in e)Dt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Dt(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.41
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Hn(e,t,n,s){try{return s?e(...s):e()}catch(o){_s(o,t,n)}}function ht(e,t,n,s){if(re(e)){const o=Hn(e,t,n,s);return o&&wr(o)&&o.catch(r=>{_s(r,t,n)}),o}if(Z(e)){const o=[];for(let r=0;r<e.length;r++)o.push(ht(e[r],t,n,s));return o}}function _s(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||_e;if(t){let a=t.parent;const u=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,u,d)===!1)return}a=a.parent}if(r){jt(),Hn(r,null,10,[e,u,d]),Ut();return}}Dl(e,n,o,s,i)}function Dl(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Qe=[];let _t=-1;const cn=[];let Gt=null,rn=0;const Kr=Promise.resolve();let rs=null;function ho(e){const t=rs||Kr;return e?t.then(this?e.bind(this):e):t}function Nl(e){let t=_t+1,n=Qe.length;for(;t<n;){const s=t+n>>>1,o=Qe[s],r=Mn(o);r<e||r===e&&o.flags&2?t=s+1:n=s}return t}function vo(e){if(!(e.flags&1)){const t=Mn(e),n=Qe[Qe.length-1];!n||!(e.flags&2)&&t>=Mn(n)?Qe.push(e):Qe.splice(Nl(t),0,e),e.flags|=1,Wr()}}function Wr(){rs||(rs=Kr.then(Jr))}function Ml(e){if(!Z(e))Gt&&e.id===-1?Gt.splice(rn+1,0,e):e.flags&1||(cn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)cn.push(e[t]);Wr()}function Ro(e,t,n=_t+1){for(;n<Qe.length;n++){const s=Qe[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Qe.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function zr(e){if(cn.length){const t=[...new Set(cn)].sort((n,s)=>Mn(n)-Mn(s));if(cn.length=0,Gt){for(let n=0;n<t.length;n++)Gt.push(t[n]);return}for(Gt=t,rn=0;rn<Gt.length;rn++){const n=Gt[rn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Gt=null,rn=0}}const Mn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Jr(e){try{for(_t=0;_t<Qe.length;_t++){const t=Qe[_t];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;_t<Qe.length;_t++){const t=Qe[_t];t&&(t.flags&=-2)}_t=-1,Qe.length=0,zr(),rs=null,(Qe.length||cn.length)&&Jr()}}let Le=null,Qr=null;function is(e){const t=Le;return Le=e,Qr=e&&e.type.__scopeId||null,t}function ct(e,t=Le,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&us(-1);const r=is(t),i=Vt.length;let a;try{a=e(...o)}finally{for(let u=Vt.length;u>i;u--)wo();is(r),s._d&&us(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ne(e,t){if(Le===null)return e;const n=Es(Le),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[r,i,a,u=_e]=t[o];r&&(re(r)&&(r={mounted:r,updated:r}),r.deep&&Dt(i),s.push({dir:r,instance:n,value:i,oldValue:void 0,arg:a,modifiers:u}))}return e}function Qt(e,t,n,s){const o=e.dirs,r=t&&t.dirs;for(let i=0;i<o.length;i++){const a=o[i];r&&(a.oldValue=r[i].value);let u=a.dir[s];u&&(jt(),ht(u,n,8,[e.el,a,e,t]),Ut())}}function ts(e,t){if(Be){let n=Be.provides;const s=Be.parent&&Be.parent.provides;s===n&&(n=Be.provides=Object.create(s)),n[e]=t}}function ft(e,t,n=!1){const s=Na();if(s||fn){let o=fn?fn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&re(t)?t.call(s&&s.proxy):t}}const Vl=Symbol.for("v-scx"),jl=()=>ft(Vl);function Mt(e,t,n){return Yr(e,t,n)}function Yr(e,t,n=_e){const{immediate:s,deep:o,flush:r,once:i}=n,a=Fe({},n),u=t&&s||!t&&r!=="post";let d;if(Ln){if(r==="sync"){const _=jl();d=_.__watcherHandles||(_.__watcherHandles=[])}else if(!u){const _=()=>{};return _.stop=kt,_.resume=kt,_.pause=kt,_}}const c=Be;a.call=(_,N,P)=>ht(_,c,N,P);let p=!1;r==="post"?a.scheduler=_=>{et(_,c&&c.suspense)}:r!=="sync"&&(p=!0,a.scheduler=(_,N)=>{N?_():vo(_)}),a.augmentJob=_=>{t&&(_.flags|=4),p&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const h=Tl(e,t,a);return Ln&&(d?d.push(h):u&&h()),h}function Ul(e,t,n){const s=this.proxy,o=Oe(e)?e.includes(".")?Xr(s,e):()=>s[e]:e.bind(s,s);let r;re(t)?r=t:(r=t.handler,n=t);const i=Bn(this),a=Yr(o,r.bind(s),n);return i(),a}function Xr(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Ll=Symbol("_vte"),ys=e=>e.__isTeleport,Ts=Symbol("_leaveCb");function Fl(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Et){t=n;break}}return t}function Zr(e){if(!bo(e))return ys(e.type)&&e.children?Fl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&re(n.default))return n.default()}}function go(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;go(ys(n.type)&&Zr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ei(e,t){return re(e)?Fe({name:e.name},t,{setup:e}):e}function ti(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Po(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ls=new WeakMap;function Pn(e,t,n,s,o=!1){if(Z(e)){e.forEach((P,W)=>Pn(P,t&&(Z(t)?t[W]:t),n,s,o));return}if(dn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Pn(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?Es(s.component):s.el,i=o?null:r,{i:a,r:u}=e,d=t&&t.r,c=a.refs===_e?a.refs={}:a.refs,p=a.setupState,h=ve(p),_=p===_e?yr:P=>Po(c,P)?!1:ge(h,P),N=(P,W)=>!(W&&Po(c,W));if(d!=null&&d!==u){if(Oo(t),Oe(d))c[d]=null,_(d)&&(p[d]=null);else if(Ge(d)){const P=t;N(d,P.k)&&(d.value=null),P.k&&(c[P.k]=null)}}if(re(u))Hn(u,a,12,[i,c]);else{const P=Oe(u),W=Ge(u);if(P||W){const H=()=>{if(e.f){const D=P?_(u)?p[u]:c[u]:N()||!e.k?u.value:c[e.k];if(o)Z(D)&&oo(D,r);else if(Z(D))D.includes(r)||D.push(r);else if(P)c[u]=[r],_(u)&&(p[u]=c[u]);else{const B=[r];N(u,e.k)&&(u.value=B),e.k&&(c[e.k]=B)}}else P?(c[u]=i,_(u)&&(p[u]=i)):W&&(N(u,e.k)&&(u.value=i),e.k&&(c[e.k]=i))};if(i){const D=()=>{H(),ls.delete(e)};D.id=-1,ls.set(e,D),et(D,n)}else Oo(e),H()}}}function Oo(e){const t=ls.get(e);t&&(t.flags|=8,ls.delete(e))}gs().requestIdleCallback;gs().cancelIdleCallback;const dn=e=>!!e.type.__asyncLoader,bo=e=>e.type.__isKeepAlive;function ql(e,t){ni(e,"a",t)}function Hl(e,t){ni(e,"da",t)}function ni(e,t,n=Be){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ws(t,s,n),n){let o=n.parent;for(;o&&o.parent;)bo(o.parent.vnode)&&Bl(s,t,n,o),o=o.parent}}function Bl(e,t,n,s){const o=ws(t,e,s,!0);si(()=>{oo(s[t],o)},n)}function ws(e,t,n=Be,s=!1){if(n){const o=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...i)=>{jt();const a=Bn(n),u=ht(t,n,e,i);return a(),Ut(),u});return s?o.unshift(r):o.push(r),r}}const Ft=e=>(t,n=Be)=>{(!Ln||e==="sp")&&ws(e,(...s)=>t(...s),n)},Gl=Ft("bm"),xo=Ft("m"),Kl=Ft("bu"),Wl=Ft("u"),zl=Ft("bum"),si=Ft("um"),Jl=Ft("sp"),Ql=Ft("rtg"),Yl=Ft("rtc");function Xl(e,t=Be){ws("ec",e,t)}const Zl="components";function yn(e,t){return ta(Zl,e,!0,t)||e}const ea=Symbol.for("v-ndc");function ta(e,t,n=!0,s=!1){const o=Le||Be;if(o){const r=o.type;{const a=La(r,!1);if(a&&(a===t||a===Xe(t)||a===hs(Xe(t))))return r}const i=To(o[e]||r[e],t)||To(o.appContext[e],t);return!i&&s?r:i}}function To(e,t){return e&&(e[t]||e[Xe(t)]||e[hs(Xe(t))])}function Pe(e,t,n,s){let o;const r=n,i=Z(e);if(i||Oe(e)){const a=i&&tn(e);let u=!1,d=!1;a&&(u=!at(e),d=Lt(e),e=bs(e)),o=new Array(e.length);for(let c=0,p=e.length;c<p;c++)o[c]=t(u?d?mn(mt(e[c])):mt(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,r)}else if(xe(e))if(e[Symbol.iterator])o=Array.from(e,(a,u)=>t(a,u,void 0,r));else{const a=Object.keys(e);o=new Array(a.length);for(let u=0,d=a.length;u<d;u++){const c=a[u];o[u]=t(e[c],c,u,r)}}else o=[];return o}function na(e,t,n,s,o,r){if(n==null&&(n={}),Le.ce||Le.parent&&dn(Le.parent)&&Le.parent.ce){const d=n,c=Object.keys(d).length>0;return w(),tt(ie,null,[Ce("slot",d,s)],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const a=Vt.length;w();let u;try{const d=i&&oi(i(n)),c=n.key||r||d&&d.key;u=tt(ie,{key:(c&&!pt(c)?c:`_${t}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&e._===1?64:-2)}catch(d){for(let c=Vt.length;c>a;c--)wo();throw d}finally{i&&i._c&&(i._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function oi(e){return e.some(t=>jn(t)?!(t.type===Et||t.type===ie&&!oi(t.children)):!0)?e:null}const zs=e=>e?Ei(e)?Es(e):zs(e.parent):null,On=Fe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>zs(e.parent),$root:e=>zs(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ii(e),$forceUpdate:e=>e.f||(e.f=()=>{vo(e.update)}),$nextTick:e=>e.n||(e.n=ho.bind(e.proxy)),$watch:e=>Ul.bind(e)}),Ds=(e,t)=>e!==_e&&!e.__isScriptSetup&&ge(e,t),sa={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:r,accessCache:i,type:a,appContext:u}=e;if(t[0]!=="$"){const h=i[t];if(h!==void 0)switch(h){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return r[t]}else{if(Ds(s,t))return i[t]=1,s[t];if(o!==_e&&ge(o,t))return i[t]=2,o[t];if(ge(r,t))return i[t]=3,r[t];if(n!==_e&&ge(n,t))return i[t]=4,n[t];Js&&(i[t]=0)}}const d=On[t];let c,p;if(d)return t==="$attrs"&&He(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==_e&&ge(n,t))return i[t]=4,n[t];if(p=u.config.globalProperties,ge(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:r}=e;return Ds(o,t)?(o[t]=n,!0):s!==_e&&ge(s,t)?(s[t]=n,!0):ge(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:r,type:i}},a){let u;return!!(n[a]||e!==_e&&a[0]!=="$"&&ge(e,a)||Ds(t,a)||ge(r,a)||ge(s,a)||ge(On,a)||ge(o.config.globalProperties,a)||(u=i.__cssModules)&&u[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ge(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Do(e){return Z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Js=!0;function oa(e){const t=ii(e),n=e.proxy,s=e.ctx;Js=!1,t.beforeCreate&&No(t.beforeCreate,e,"bc");const{data:o,computed:r,methods:i,watch:a,provide:u,inject:d,created:c,beforeMount:p,mounted:h,beforeUpdate:_,updated:N,activated:P,deactivated:W,beforeDestroy:H,beforeUnmount:D,destroyed:B,unmounted:k,render:x,renderTracked:O,renderTriggered:U,errorCaptured:L,serverPrefetch:Ae,expose:ee,inheritAttrs:V,components:De,directives:z,filters:Ze}=t;if(d&&ra(d,s,null),i)for(const de in i){const ue=i[de];re(ue)&&(s[de]=ue.bind(n))}if(o){const de=o.call(n,n);xe(de)&&(e.data=xs(de))}if(Js=!0,r)for(const de in r){const ue=r[de],ut=re(ue)?ue.bind(n,n):re(ue.get)?ue.get.bind(n,n):kt,gt=!re(ue)&&re(ue.set)?ue.set.bind(n):kt,Ke=we({get:ut,set:gt});Object.defineProperty(s,de,{enumerable:!0,configurable:!0,get:()=>Ke.value,set:Te=>Ke.value=Te})}if(a)for(const de in a)ri(a[de],s,n,de);if(u){const de=re(u)?u.call(n):u;Reflect.ownKeys(de).forEach(ue=>{ts(ue,de[ue])})}c&&No(c,e,"c");function Se(de,ue){Z(ue)?ue.forEach(ut=>de(ut.bind(n))):ue&&de(ue.bind(n))}if(Se(Gl,p),Se(xo,h),Se(Kl,_),Se(Wl,N),Se(ql,P),Se(Hl,W),Se(Xl,L),Se(Yl,O),Se(Ql,U),Se(zl,D),Se(si,k),Se(Jl,Ae),Z(ee))if(ee.length){const de=e.exposed||(e.exposed={});ee.forEach(ue=>{Object.defineProperty(de,ue,{get:()=>n[ue],set:ut=>n[ue]=ut,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===kt&&(e.render=x),V!=null&&(e.inheritAttrs=V),De&&(e.components=De),z&&(e.directives=z),Ae&&ti(e)}function ra(e,t,n=kt){Z(e)&&(e=Qs(e));for(const s in e){const o=e[s];let r;xe(o)?"default"in o?r=ft(o.from||s,o.default,!0):r=ft(o.from||s):r=ft(o),Ge(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:i=>r.value=i}):t[s]=r}}function No(e,t,n){ht(Z(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function ri(e,t,n,s){let o=s.includes(".")?Xr(n,s):()=>n[s];if(Oe(e)){const r=t[e];re(r)&&Mt(o,r)}else if(re(e))Mt(o,e.bind(n));else if(xe(e))if(Z(e))e.forEach(r=>ri(r,t,n,s));else{const r=re(e.handler)?e.handler.bind(n):t[e.handler];re(r)&&Mt(o,r,e)}}function ii(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:r,config:{optionMergeStrategies:i}}=e.appContext,a=r.get(t);let u;return a?u=a:!o.length&&!n&&!s?u=t:(u={},o.length&&o.forEach(d=>as(u,d,i,!0)),as(u,t,i)),xe(t)&&r.set(t,u),u}function as(e,t,n,s=!1){const{mixins:o,extends:r}=t;r&&as(e,r,n,!0),o&&o.forEach(i=>as(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const a=ia[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const ia={data:Mo,props:Vo,emits:Vo,methods:En,computed:En,beforeCreate:ze,created:ze,beforeMount:ze,mounted:ze,beforeUpdate:ze,updated:ze,beforeDestroy:ze,beforeUnmount:ze,destroyed:ze,unmounted:ze,activated:ze,deactivated:ze,errorCaptured:ze,serverPrefetch:ze,components:En,directives:En,watch:aa,provide:Mo,inject:la};function Mo(e,t){return t?e?function(){return Fe(re(e)?e.call(this,this):e,re(t)?t.call(this,this):t)}:t:e}function la(e,t){return En(Qs(e),Qs(t))}function Qs(e){if(Z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ze(e,t){return e?[...new Set([].concat(e,t))]:t}function En(e,t){return e?Fe(Object.create(null),e,t):t}function Vo(e,t){return e?Z(e)&&Z(t)?[...new Set([...e,...t])]:Fe(Object.create(null),Do(e),Do(t??{})):t}function aa(e,t){if(!e)return t;if(!t)return e;const n=Fe(Object.create(null),e);for(const s in t)n[s]=ze(e[s],t[s]);return n}function li(){return{app:null,config:{isNativeTag:yr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ua=0;function ca(e,t){return function(s,o=null){re(s)||(s=Fe({},s)),o!=null&&!xe(o)&&(o=null);const r=li(),i=new WeakSet,a=[];let u=!1;const d=r.app={_uid:ua++,_component:s,_props:o,_container:null,_context:r,_instance:null,version:qa,get config(){return r.config},set config(c){},use(c,...p){return i.has(c)||(c&&re(c.install)?(i.add(c),c.install(d,...p)):re(c)&&(i.add(c),c(d,...p))),d},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),d},component(c,p){return p?(r.components[c]=p,d):r.components[c]},directive(c,p){return p?(r.directives[c]=p,d):r.directives[c]},mount(c,p,h){if(!u){const _=d._ceVNode||Ce(s,o);return _.appContext=r,h===!0?h="svg":h===!1&&(h=void 0),e(_,c,h),u=!0,d._container=c,c.__vue_app__=d,Es(_.component)}},onUnmount(c){a.push(c)},unmount(){u&&(ht(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,p){return r.provides[c]=p,d},runWithContext(c){const p=fn;fn=d;try{return c()}finally{fn=p}}};return d}}let fn=null;const da=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xe(t)}Modifiers`]||e[`${sn(t)}Modifiers`];function fa(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||_e;let o=n;const r=t.startsWith("update:"),i=r&&da(s,t.slice(7));i&&(i.trim&&(o=n.map(c=>Oe(c)?c.trim():c)),i.number&&(o=n.map(vs)));let a,u=s[a=Is(t)]||s[a=Is(Xe(t))];!u&&r&&(u=s[a=Is(sn(t))]),u&&ht(u,e,6,o);const d=s[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,ht(d,e,6,o)}}const pa=new WeakMap;function ai(e,t,n=!1){const s=n?pa:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const r=e.emits;let i={},a=!1;if(!re(e)){const u=d=>{const c=ai(d,t,!0);c&&(a=!0,Fe(i,c))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!a?(xe(e)&&s.set(e,null),null):(Z(r)?r.forEach(u=>i[u]=null):Fe(i,r),xe(e)&&s.set(e,i),i)}function Cs(e,t){return!e||!fs(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ge(e,t[0].toLowerCase()+t.slice(1))||ge(e,sn(t))||ge(e,t))}function jo(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[r],slots:i,attrs:a,emit:u,render:d,renderCache:c,props:p,data:h,setupState:_,ctx:N,inheritAttrs:P}=e,W=is(e);let H,D;try{if(n.shapeFlag&4){const k=o||s,x=k;H=wt(d.call(x,k,c,p,_,h,N)),D=a}else{const k=t;H=wt(k.length>1?k(p,{attrs:a,slots:i,emit:u}):k(p,null)),D=t.props?a:ma(a)}}catch(k){Vt.length=0,_s(k,e,1),H=Ce(Et)}let B=H;if(D&&P!==!1){const k=Object.keys(D),{shapeFlag:x}=B;k.length&&x&7&&(r&&k.some(ps)&&(D=ha(D,r)),B=hn(B,D,!1,!0))}if(n.dirs&&(B=hn(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition){const k=ys(B.type)&&Zr(B)||B;go(k,n.transition)}return H=B,is(W),H}const ma=e=>{let t;for(const n in e)(n==="class"||n==="style"||fs(n))&&((t||(t={}))[n]=e[n]);return t},ha=(e,t)=>{const n={};for(const s in e)(!ps(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function va(e,t,n){const{props:s,children:o,component:r}=e,{props:i,children:a,patchFlag:u}=t,d=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?Uo(s,i,d):!!i;if(u&8){const c=t.dynamicProps;for(let p=0;p<c.length;p++){const h=c[p];if(ui(i,s,h)&&!Cs(d,h))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:s===i?!1:s?i?Uo(s,i,d):!0:!!i;return!1}function Uo(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const r=s[o];if(ui(t,e,r)&&!Cs(n,r))return!0}return!1}function ui(e,t,n){const s=e[n],o=t[n];return n==="style"&&xe(s)&&xe(o)?!Wt(s,o):s!==o}function ga({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const ci={},di=()=>Object.create(ci),fi=e=>Object.getPrototypeOf(e)===ci;function ba(e,t,n,s=!1){const o={},r=di();e.propsDefaults=Object.create(null),pi(e,t,o,r);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=s?o:Hr(o):e.type.props?e.props=o:e.props=r,e.attrs=r}function xa(e,t,n,s){const{props:o,attrs:r,vnode:{patchFlag:i}}=e,a=ve(o),[u]=e.propsOptions;let d=!1;if((s||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let p=0;p<c.length;p++){let h=c[p];if(Cs(e.emitsOptions,h))continue;const _=t[h];if(u)if(ge(r,h))_!==r[h]&&(r[h]=_,d=!0);else{const N=Xe(h);o[N]=Ys(u,a,N,_,e,!1)}else _!==r[h]&&(r[h]=_,d=!0)}}}else{pi(e,t,o,r)&&(d=!0);let c;for(const p in a)(!t||!ge(t,p)&&((c=sn(p))===p||!ge(t,c)))&&(u?n&&(n[p]!==void 0||n[c]!==void 0)&&(o[p]=Ys(u,a,p,void 0,e,!0)):delete o[p]);if(r!==a)for(const p in r)(!t||!ge(t,p))&&(delete r[p],d=!0)}d&&Tt(e.attrs,"set","")}function pi(e,t,n,s){const[o,r]=e.propsOptions;let i=!1,a;if(t)for(let u in t){if(In(u))continue;const d=t[u];let c;o&&ge(o,c=Xe(u))?!r||!r.includes(c)?n[c]=d:(a||(a={}))[c]=d:Cs(e.emitsOptions,u)||(!(u in s)||d!==s[u])&&(s[u]=d,i=!0)}if(r){const u=ve(n),d=a||_e;for(let c=0;c<r.length;c++){const p=r[c];n[p]=Ys(o,u,p,d[p],e,!ge(d,p))}}return i}function Ys(e,t,n,s,o,r){const i=e[n];if(i!=null){const a=ge(i,"default");if(a&&s===void 0){const u=i.default;if(i.type!==Function&&!i.skipFactory&&re(u)){const{propsDefaults:d}=o;if(n in d)s=d[n];else{const c=Bn(o);s=d[n]=u.call(null,t),c()}}else s=u;o.ce&&o.ce._setProp(n,s)}i[0]&&(r&&!a?s=!1:i[1]&&(s===""||s===sn(n))&&(s=!0))}return s}const _a=new WeakMap;function mi(e,t,n=!1){const s=n?_a:t.propsCache,o=s.get(e);if(o)return o;const r=e.props,i={},a=[];let u=!1;if(!re(e)){const c=p=>{u=!0;const[h,_]=mi(p,t,!0);Fe(i,h),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!u)return xe(e)&&s.set(e,an),an;if(Z(r))for(let c=0;c<r.length;c++){const p=Xe(r[c]);Lo(p)&&(i[p]=_e)}else if(r)for(const c in r){const p=Xe(c);if(Lo(p)){const h=r[c],_=i[p]=Z(h)||re(h)?{type:h}:Fe({},h),N=_.type;let P=!1,W=!0;if(Z(N))for(let H=0;H<N.length;++H){const D=N[H],B=re(D)&&D.name;if(B==="Boolean"){P=!0;break}else B==="String"&&(W=!1)}else P=re(N)&&N.name==="Boolean";_[0]=P,_[1]=W,(P||ge(_,"default"))&&a.push(p)}}const d=[i,a];return xe(e)&&s.set(e,d),d}function Lo(e){return e[0]!=="$"&&!In(e)}const _o=e=>e==="_"||e==="_ctx"||e==="$stable",yo=e=>Z(e)?e.map(wt):[wt(e)],ya=(e,t,n)=>{if(t._n)return t;const s=ct((...o)=>yo(t(...o)),n);return s._c=!1,s},hi=(e,t,n)=>{const s=e._ctx;for(const o in e){if(_o(o))continue;const r=e[o];if(re(r))t[o]=ya(o,r,s);else if(r!=null){const i=yo(r);t[o]=()=>i}}},vi=(e,t)=>{const n=yo(t);e.slots.default=()=>n},gi=(e,t,n)=>{for(const s in t)(n||!_o(s))&&(e[s]=t[s])},wa=(e,t,n)=>{const s=e.slots=di();if(e.vnode.shapeFlag&32){const o=t._;o?(gi(s,t,n),n&&Er(s,"_",o,!0)):hi(t,s)}else t&&vi(e,t)},Ca=(e,t,n)=>{const{vnode:s,slots:o}=e;let r=!0,i=_e;if(s.shapeFlag&32){const a=t._;a?n&&a===1?r=!1:gi(o,t,n):(r=!t.$stable,hi(t,o)),i=t}else t&&(vi(e,t),i={default:1});if(r)for(const a in o)!_o(a)&&i[a]==null&&delete o[a]},et=Ia;function ka(e){return Ea(e)}function Ea(e,t){const n=gs();n.__VUE__=!0;const{insert:s,remove:o,patchProp:r,createElement:i,createText:a,createComment:u,setText:d,setElementText:c,parentNode:p,nextSibling:h,setScopeId:_=kt,insertStaticContent:N}=e,P=(f,m,g,y=null,A=null,E=null,j=void 0,M=null,T=!!m.dynamicChildren)=>{if(f===m)return;f&&!Cn(f,m)&&(y=S(f),Te(f,A,E,!0),f=null),m.patchFlag===-2&&(T=!1,m.dynamicChildren=null);const{type:$,ref:X,shapeFlag:q}=m;switch($){case ks:W(f,m,g,y);break;case Et:H(f,m,g,y);break;case ns:f==null&&D(m,g,y,j);break;case ie:De(f,m,g,y,A,E,j,M,T);break;default:q&1?x(f,m,g,y,A,E,j,M,T):q&6?z(f,m,g,y,A,E,j,M,T):(q&64||q&128)&&$.process(f,m,g,y,A,E,j,M,T,Y)}X!=null&&A?Pn(X,f&&f.ref,E,m||f,!m):X==null&&f&&f.ref!=null&&Pn(f.ref,null,E,f,!0)},W=(f,m,g,y)=>{if(f==null)s(m.el=a(m.children),g,y);else{const A=m.el=f.el;m.children!==f.children&&d(A,m.children)}},H=(f,m,g,y)=>{f==null?s(m.el=u(m.children||""),g,y):m.el=f.el},D=(f,m,g,y)=>{[f.el,f.anchor]=N(f.children,m,g,y,f.el,f.anchor)},B=({el:f,anchor:m},g,y)=>{let A;for(;f&&f!==m;)A=h(f),s(f,g,y),f=A;s(m,g,y)},k=({el:f,anchor:m})=>{let g;for(;f&&f!==m;)g=h(f),o(f),f=g;o(m)},x=(f,m,g,y,A,E,j,M,T)=>{if(m.type==="svg"?j="svg":m.type==="math"&&(j="mathml"),f==null)O(m,g,y,A,E,j,M,T);else{const $=f.el&&f.el._isVueCE?f.el:null;try{$&&$._beginPatch(),Ae(f,m,A,E,j,M,T)}finally{$&&$._endPatch()}}},O=(f,m,g,y,A,E,j,M)=>{let T,$;const{props:X,shapeFlag:q,transition:Q,dirs:te}=f;if(T=f.el=i(f.type,E,X&&X.is,X),q&8?c(T,f.children):q&16&&L(f.children,T,null,y,A,Ns(f,E),j,M),te&&Qt(f,null,y,"created"),U(T,f,f.scopeId,j,y),X){for(const be in X)be!=="value"&&!In(be)&&r(T,be,null,X[be],E,y);"value"in X&&r(T,"value",null,X.value,E),($=X.onVnodeBeforeMount)&&xt($,y,f)}te&&Qt(f,null,y,"beforeMount");const ce=Sa(A,Q);ce&&Q.beforeEnter(T),s(T,m,g),(($=X&&X.onVnodeMounted)||ce||te)&&et(()=>{try{$&&xt($,y,f),ce&&Q.enter(T),te&&Qt(f,null,y,"mounted")}finally{}},A)},U=(f,m,g,y,A)=>{if(g&&_(f,g),y)for(let E=0;E<y.length;E++)_(f,y[E]);if(A){let E=A.subTree;if(m===E||yi(E.type)&&(E.ssContent===m||E.ssFallback===m)){const j=A.vnode;U(f,j,j.scopeId,j.slotScopeIds,A.parent)}}},L=(f,m,g,y,A,E,j,M,T=0)=>{for(let $=T;$<f.length;$++){const X=f[$]=M?Pt(f[$]):wt(f[$]);P(null,X,m,g,y,A,E,j,M)}},Ae=(f,m,g,y,A,E,j)=>{const M=m.el=f.el;let{patchFlag:T,dynamicChildren:$,dirs:X}=m;T|=f.patchFlag&16;const q=f.props||_e,Q=m.props||_e;let te;if(g&&Yt(g,!1),(te=Q.onVnodeBeforeUpdate)&&xt(te,g,m,f),X&&Qt(m,f,g,"beforeUpdate"),g&&Yt(g,!0),$&&(!f.dynamicChildren||f.dynamicChildren.length!==$.length)&&(T=0,j=!1,$=null),(q.innerHTML&&Q.innerHTML==null||q.textContent&&Q.textContent==null)&&c(M,""),$?ee(f.dynamicChildren,$,M,g,y,Ns(m,A),E):j||ue(f,m,M,null,g,y,Ns(m,A),E,!1),T>0){if(T&16)V(M,q,Q,g,A);else if(T&2&&q.class!==Q.class&&r(M,"class",null,Q.class,A),T&4&&r(M,"style",q.style,Q.style,A),T&8){const ce=m.dynamicProps;for(let be=0;be<ce.length;be++){const me=ce[be],Ie=q[me],$e=Q[me];($e!==Ie||me==="value")&&r(M,me,Ie,$e,A,g)}}T&1&&f.children!==m.children&&c(M,m.children)}else!j&&$==null&&V(M,q,Q,g,A);((te=Q.onVnodeUpdated)||X)&&et(()=>{te&&xt(te,g,m,f),X&&Qt(m,f,g,"updated")},y)},ee=(f,m,g,y,A,E,j)=>{for(let M=0;M<m.length;M++){const T=f[M],$=m[M],X=T.el&&(T.type===ie||!Cn(T,$)||T.shapeFlag&198)?p(T.el):g;P(T,$,X,null,y,A,E,j,!0)}},V=(f,m,g,y,A)=>{if(m!==g){if(m!==_e)for(const E in m)!In(E)&&!(E in g)&&r(f,E,m[E],null,A,y);for(const E in g){if(In(E))continue;const j=g[E],M=m[E];j!==M&&E!=="value"&&r(f,E,M,j,A,y)}"value"in g&&r(f,"value",m.value,g.value,A)}},De=(f,m,g,y,A,E,j,M,T)=>{const $=m.el=f?f.el:a(""),X=m.anchor=f?f.anchor:a("");let{patchFlag:q,dynamicChildren:Q,slotScopeIds:te}=m;te&&(M=M?M.concat(te):te),f==null?(s($,g,y),s(X,g,y),L(m.children||[],g,X,A,E,j,M,T)):q>0&&q&64&&Q&&f.dynamicChildren&&f.dynamicChildren.length===Q.length?(ee(f.dynamicChildren,Q,g,A,E,j,M),(m.key!=null||A&&m===A.subTree)&&bi(f,m,!0)):ue(f,m,g,X,A,E,j,M,T)},z=(f,m,g,y,A,E,j,M,T)=>{m.slotScopeIds=M,f==null?m.shapeFlag&512?A.ctx.activate(m,g,y,j,T):Ze(m,g,y,A,E,j,T):qt(f,m,T)},Ze=(f,m,g,y,A,E,j)=>{const M=f.component=Da(f,y,A);if(bo(f)&&(M.ctx.renderer=Y),Ma(M,!1,j),M.asyncDep){if(A&&A.registerDep(M,Se,j),!f.el){const T=M.subTree=Ce(Et);H(null,T,m,g),f.placeholder=T.el}}else Se(M,f,m,g,A,E,j)},qt=(f,m,g)=>{const y=m.component=f.component;if(va(f,m,g))if(y.asyncDep&&!y.asyncResolved){de(y,m,g);return}else y.next=m,y.update();else m.el=f.el,y.vnode=m},Se=(f,m,g,y,A,E,j)=>{const M=()=>{if(f.isMounted){let{next:q,bu:Q,u:te,parent:ce,vnode:be}=f;{const ot=xi(f);if(ot){q&&(q.el=be.el,de(f,q,j)),ot.asyncDep.then(()=>{et(()=>{f.isUnmounted||$()},A)});return}}let me=q,Ie;Yt(f,!1),q?(q.el=be.el,de(f,q,j)):q=be,Q&&es(Q),(Ie=q.props&&q.props.onVnodeBeforeUpdate)&&xt(Ie,ce,q,be),Yt(f,!0);const $e=jo(f),st=f.subTree;f.subTree=$e,P(st,$e,p(st.el),S(st),f,A,E),q.el=$e.el,me===null&&ga(f,$e.el),te&&et(te,A),(Ie=q.props&&q.props.onVnodeUpdated)&&et(()=>xt(Ie,ce,q,be),A)}else{let q;const{el:Q,props:te}=m,{bm:ce,m:be,parent:me,root:Ie,type:$e}=f,st=dn(m);Yt(f,!1),ce&&es(ce),!st&&(q=te&&te.onVnodeBeforeMount)&&xt(q,me,m),Yt(f,!0);{Ie.ce&&Ie.ce._hasShadowRoot()&&Ie.ce._injectChildStyle($e,f.parent?f.parent.type:void 0);const ot=f.subTree=jo(f);P(null,ot,g,y,f,A,E),m.el=ot.el}if(be&&et(be,A),!st&&(q=te&&te.onVnodeMounted)){const ot=m;et(()=>xt(q,me,ot),A)}(m.shapeFlag&256||me&&dn(me.vnode)&&me.vnode.shapeFlag&256)&&f.a&&et(f.a,A),f.isMounted=!0,m=g=y=null}};f.scope.on();const T=f.effect=new $r(M);f.scope.off();const $=f.update=T.run.bind(T),X=f.job=T.runIfDirty.bind(T);X.i=f,X.id=f.uid,T.scheduler=()=>vo(X),Yt(f,!0),$()},de=(f,m,g)=>{m.component=f;const y=f.vnode.props;f.vnode=m,f.next=null,xa(f,m.props,y,g),Ca(f,m.children,g),jt(),Ro(f),Ut()},ue=(f,m,g,y,A,E,j,M,T=!1)=>{const $=f&&f.children,X=f?f.shapeFlag:0,q=m.children,{patchFlag:Q,shapeFlag:te}=m;if(Q>0){if(Q&128){gt($,q,g,y,A,E,j,M,T);return}else if(Q&256){ut($,q,g,y,A,E,j,M,T);return}}te&8?(X&16&&qe($,A,E),q!==$&&c(g,q)):X&16?te&16?gt($,q,g,y,A,E,j,M,T):qe($,A,E,!0):(X&8&&c(g,""),te&16&&L(q,g,y,A,E,j,M,T))},ut=(f,m,g,y,A,E,j,M,T)=>{f=f||an,m=m||an;const $=f.length,X=m.length,q=Math.min($,X);let Q;for(Q=0;Q<q;Q++){const te=m[Q]=T?Pt(m[Q]):wt(m[Q]);P(f[Q],te,g,null,A,E,j,M,T)}$>X?qe(f,A,E,!0,!1,q):L(m,g,y,A,E,j,M,T,q)},gt=(f,m,g,y,A,E,j,M,T)=>{let $=0;const X=m.length;let q=f.length-1,Q=X-1;for(;$<=q&&$<=Q;){const te=f[$],ce=m[$]=T?Pt(m[$]):wt(m[$]);if(Cn(te,ce))P(te,ce,g,null,A,E,j,M,T);else break;$++}for(;$<=q&&$<=Q;){const te=f[q],ce=m[Q]=T?Pt(m[Q]):wt(m[Q]);if(Cn(te,ce))P(te,ce,g,null,A,E,j,M,T);else break;q--,Q--}if($>q){if($<=Q){const te=Q+1,ce=te<X?m[te].el:y;for(;$<=Q;)P(null,m[$]=T?Pt(m[$]):wt(m[$]),g,ce,A,E,j,M,T),$++}}else if($>Q)for(;$<=q;)Te(f[$],A,E,!0),$++;else{const te=$,ce=$,be=new Map;for($=ce;$<=Q;$++){const Ne=m[$]=T?Pt(m[$]):wt(m[$]);Ne.key!=null&&be.set(Ne.key,$)}let me,Ie=0;const $e=Q-ce+1;let st=!1,ot=0;const Jt=new Array($e);for($=0;$<$e;$++)Jt[$]=0;for($=te;$<=q;$++){const Ne=f[$];if(Ie>=$e){Te(Ne,A,E,!0);continue}let We;if(Ne.key!=null)We=be.get(Ne.key);else for(me=ce;me<=Q;me++)if(Jt[me-ce]===0&&Cn(Ne,m[me])){We=me;break}We===void 0?Te(Ne,A,E,!0):(Jt[We-ce]=$+1,We>=ot?ot=We:st=!0,P(Ne,m[We],g,null,A,E,j,M,T),Ie++)}const Gn=st?Aa(Jt):an;for(me=Gn.length-1,$=$e-1;$>=0;$--){const Ne=ce+$,We=m[Ne],Ht=m[Ne+1],Kn=Ne+1<X?Ht.el||_i(Ht):y;Jt[$]===0?P(null,We,g,Kn,A,E,j,M,T):st&&(me<0||$!==Gn[me]?Ke(We,g,Kn,2):me--)}}},Ke=(f,m,g,y,A=null)=>{const{el:E,type:j,transition:M,children:T,shapeFlag:$}=f;if($&6){Ke(f.component.subTree,m,g,y);return}if($&128){f.suspense.move(m,g,y);return}if($&64){j.move(f,m,g,Y);return}if(j===ie){s(E,m,g);for(let q=0;q<T.length;q++)Ke(T[q],m,g,y);s(f.anchor,m,g);return}if(j===ns){B(f,m,g);return}if(y!==2&&$&1&&M)if(y===0)M.persisted&&!E[Ts]?s(E,m,g):(M.beforeEnter(E),s(E,m,g),et(()=>M.enter(E),A));else{const{leave:q,delayLeave:Q,afterLeave:te}=M,ce=()=>{f.ctx.isUnmounted?o(E):s(E,m,g)},be=()=>{const me=E._isLeaving||!!E[Ts];E._isLeaving&&E[Ts](!0),M.persisted&&!me?ce():q(E,()=>{ce(),te&&te()})};Q?Q(E,ce,be):be()}else s(E,m,g)},Te=(f,m,g,y=!1,A=!1)=>{const{type:E,props:j,ref:M,children:T,dynamicChildren:$,shapeFlag:X,patchFlag:q,dirs:Q,cacheIndex:te,memo:ce}=f;if(q===-2&&(A=!1),M!=null&&(jt(),Pn(M,null,g,f,!0),Ut()),te!=null&&(m.renderCache[te]=void 0),X&256){m.ctx.deactivate(f);return}const be=X&1&&Q,me=!dn(f);let Ie;if(me&&(Ie=j&&j.onVnodeBeforeUnmount)&&xt(Ie,m,f),X&6)bt(f.component,g,y);else{if(X&128){f.suspense.unmount(g,y);return}be&&Qt(f,null,m,"beforeUnmount"),X&64?f.type.remove(f,m,g,Y,y):$&&!$.hasOnce&&(E!==ie||q>0&&q&64)?qe($,m,g,!1,!0):(E===ie&&q&384||!A&&X&16)&&qe(T,m,g),y&&nt(f)}const $e=ce!=null&&te==null;(me&&(Ie=j&&j.onVnodeUnmounted)||be||$e)&&et(()=>{Ie&&xt(Ie,m,f),be&&Qt(f,null,m,"unmounted"),$e&&(f.el=null)},g)},nt=f=>{const{type:m,el:g,anchor:y,transition:A}=f;if(m===ie){le(g,y);return}if(m===ns){k(f);return}const E=()=>{o(g),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(f.shapeFlag&1&&A&&!A.persisted){const{leave:j,delayLeave:M}=A,T=()=>j(g,E);M?M(f.el,E,T):T()}else E()},le=(f,m)=>{let g;for(;f!==m;)g=h(f),o(f),f=g;o(m)},bt=(f,m,g)=>{const{bum:y,scope:A,job:E,subTree:j,um:M,m:T,a:$}=f;Fo(T),Fo($),y&&es(y),A.stop(),E&&(E.flags|=8,Te(j,f,m,g)),M&&et(M,m),et(()=>{f.isUnmounted=!0},m)},qe=(f,m,g,y=!1,A=!1,E=0)=>{for(let j=E;j<f.length;j++)Te(f[j],m,g,y,A)},S=f=>{if(f.shapeFlag&6)return S(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const m=h(f.anchor||f.el),g=m&&m[Ll];return g?h(g):m};let K=!1;const F=(f,m,g)=>{let y;f==null?m._vnode&&(Te(m._vnode,null,null,!0),y=m._vnode.component):P(m._vnode||null,f,m,null,null,null,g),m._vnode=f,K||(K=!0,Ro(y),zr(),K=!1)},Y={p:P,um:Te,m:Ke,r:nt,mt:Ze,mc:L,pc:ue,pbc:ee,n:S,o:e};return{render:F,hydrate:void 0,createApp:ca(F)}}function Ns({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Yt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Sa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function bi(e,t,n=!1){const s=e.children,o=t.children;if(Z(s)&&Z(o))for(let r=0;r<s.length;r++){const i=s[r];let a=o[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[r]=Pt(o[r]),a.el=i.el),!n&&a.patchFlag!==-2&&bi(i,a)),a.type===ks&&(a.patchFlag===-1&&(a=o[r]=Pt(a)),a.el=i.el),a.type===Et&&!a.el&&(a.el=i.el)}}function Aa(e){const t=e.slice(),n=[0];let s,o,r,i,a;const u=e.length;for(s=0;s<u;s++){const d=e[s];if(d!==0){if(o=n[n.length-1],e[o]<d){t[s]=o,n.push(s);continue}for(r=0,i=n.length-1;r<i;)a=r+i>>1,e[n[a]]<d?r=a+1:i=a;d<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,i=n[r-1];r-- >0;)n[r]=i,i=t[i];return n}function xi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:xi(t)}function Fo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _i(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_i(t.subTree):null}const yi=e=>e.__isSuspense;function Ia(e,t){t&&t.pendingBranch?Z(e)?t.effects.push(...e):t.effects.push(e):Ml(e)}const ie=Symbol.for("v-fgt"),ks=Symbol.for("v-txt"),Et=Symbol.for("v-cmt"),ns=Symbol.for("v-stc"),Vt=[];let rt=null;function w(e=!1){Vt.push(rt=e?null:[])}function wo(){Vt.pop(),rt=Vt[Vt.length-1]||null}let Vn=1;function us(e,t=!1){Vn+=e,e<0&&rt&&t&&(rt.hasOnce=!0)}function wi(e){return e.dynamicChildren=Vn>0?rt||an:null,wo(),Vn>0&&rt&&rt.push(e),e}function C(e,t,n,s,o,r){return wi(l(e,t,n,s,o,r,!0))}function tt(e,t,n,s,o){return wi(Ce(e,t,n,s,o,!0))}function jn(e){return e?e.__v_isVNode===!0:!1}function Cn(e,t){return e.type===t.type&&e.key===t.key}const Ci=({key:e})=>e??null,ss=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Oe(e)||Ge(e)||re(e)?{i:Le,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,r=e===ie?0:1,i=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ci(t),ref:t&&ss(t),scopeId:Qr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Le};return a?(cs(u,n),r&128&&e.normalize(u)):n&&(u.shapeFlag|=Oe(n)?8:16),Vn>0&&!i&&rt&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&rt.push(u),u}const Ce=$a;function $a(e,t=null,n=null,s=0,o=null,r=!1){if((!e||e===ea)&&(e=Et),jn(e)){const a=hn(e,t,!0);return n&&cs(a,n),Vn>0&&!r&&rt&&(a.shapeFlag&6?rt[rt.indexOf(e)]=a:rt.push(a)),a.patchFlag=-2,a}if(Fa(e)&&(e=e.__vccOpts),t){t=Ra(t);let{class:a,style:u}=t;a&&!Oe(a)&&(t.class=Ee(a)),xe(u)&&(mo(u)&&!Z(u)&&(u=Fe({},u)),t.style=nn(u))}const i=Oe(e)?1:yi(e)?128:ys(e)?64:xe(e)?4:re(e)?2:0;return l(e,t,n,s,o,i,r,!0)}function Ra(e){return e?mo(e)||fi(e)?Fe({},e):e:null}function hn(e,t,n=!1,s=!1){const{props:o,ref:r,patchFlag:i,children:a,transition:u}=e,d=t?Pa(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Ci(d),ref:t&&t.ref?n&&r?Z(r)?r.concat(ss(t)):[r,ss(t)]:ss(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ie?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&hn(e.ssContent),ssFallback:e.ssFallback&&hn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&go(c,u.clone(c)),c}function pe(e=" ",t=0){return Ce(ks,null,e,t)}function ki(e,t){const n=Ce(ns,null,e);return n.staticCount=t,n}function J(e="",t=!1){return t?(w(),tt(Et,null,e)):Ce(Et,null,e)}function wt(e){return e==null||typeof e=="boolean"?Ce(Et):Z(e)?Ce(ie,null,e.slice()):jn(e)?Pt(e):Ce(ks,null,String(e))}function Pt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:hn(e)}function cs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Z(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),cs(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!fi(t)?t._ctx=Le:o===3&&Le&&(Le.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(re(t)){if(s&65){cs(e,{default:t});return}t={default:t,_ctx:Le},n=32}else t=String(t),s&64?(n=16,t=[pe(t)]):n=8;e.children=t,e.shapeFlag|=n}function Pa(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ee([t.class,s.class]));else if(o==="style")t.style=nn([t.style,s.style]);else if(fs(o)){const r=t[o],i=s[o];i&&r!==i&&!(Z(r)&&r.includes(i))?t[o]=r?[].concat(r,i):i:i==null&&r==null&&!ps(o)&&(t[o]=i)}else o!==""&&(t[o]=s[o])}return t}function xt(e,t,n,s=null){ht(e,t,7,[n,s])}const Oa=li();let Ta=0;function Da(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Oa,r={uid:Ta++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ll(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:mi(s,o),emitsOptions:ai(s,o),emit:null,emitted:null,propsDefaults:_e,inheritAttrs:s.inheritAttrs,ctx:_e,data:_e,props:_e,attrs:_e,slots:_e,refs:_e,setupState:_e,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=fa.bind(null,r),e.ce&&e.ce(r),r}let Be=null;const Na=()=>Be||Le;let ds,Un;{const e=gs(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),r=>{o.length>1?o.forEach(i=>i(r)):o[0](r)}};ds=t("__VUE_INSTANCE_SETTERS__",n=>Be=n),Un=t("__VUE_SSR_SETTERS__",n=>Ln=n)}const Bn=e=>{const t=Be;return ds(e),e.scope.on(),()=>{e.scope.off(),ds(t)}},qo=()=>{Be&&Be.scope.off(),ds(null)};function Ei(e){return e.vnode.shapeFlag&4}let Ln=!1;function Ma(e,t=!1,n=!1){t&&Un(t);const{props:s,children:o}=e.vnode,r=Ei(e);ba(e,s,r,t),wa(e,o,n||t);const i=r?Va(e,t):void 0;return t&&Un(!1),i}function Va(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,sa);const{setup:s}=n;if(s){jt();const o=e.setupContext=s.length>1?Ua(e):null,r=Bn(e),i=Hn(s,e,0,[e.props,o]),a=wr(i);if(Ut(),r(),(a||e.sp)&&!dn(e)&&ti(e),a){if(i.then(qo,qo),t)return i.then(u=>{Un(!0);try{Ho(e,u,t)}finally{Un(!1)}}).catch(u=>{_s(u,e,0)});e.asyncDep=i}else Ho(e,i)}else Si(e)}function Ho(e,t,n){re(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=Gr(t)),Si(e)}function Si(e,t,n){const s=e.type;e.render||(e.render=s.render||kt);{const o=Bn(e);jt();try{oa(e)}finally{Ut(),o()}}}const ja={get(e,t){return He(e,"get",""),e[t]}};function Ua(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ja),slots:e.slots,emit:e.emit,expose:t}}function Es(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Gr(Sl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in On)return On[n](e)},has(t,n){return n in t||n in On}})):e.proxy}function La(e,t=!0){return re(e)?e.displayName||e.name:e.name||t&&e.__name}function Fa(e){return re(e)&&"__vccOpts"in e}const we=(e,t)=>Pl(e,t,Ln);function Ai(e,t,n){try{us(-1);const s=arguments.length;return s===2?xe(t)&&!Z(t)?jn(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&jn(n)&&(n=[n]),Ce(e,t,n))}finally{us(1)}}const qa="3.5.41";/**
* @vue/runtime-dom v3.5.41
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Xs;const Bo=typeof window<"u"&&window.trustedTypes;if(Bo)try{Xs=Bo.createPolicy("vue",{createHTML:e=>e})}catch{}const Ii=Xs?e=>Xs.createHTML(e):e=>e,Ha="http://www.w3.org/2000/svg",Ba="http://www.w3.org/1998/Math/MathML",$t=typeof document<"u"?document:null,Go=$t&&$t.createElement("template"),Ga={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?$t.createElementNS(Ha,e):t==="mathml"?$t.createElementNS(Ba,e):n?$t.createElement(e,{is:n}):$t.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>$t.createTextNode(e),createComment:e=>$t.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>$t.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,r){const i=n?n.previousSibling:t.lastChild;if(o&&(o===r||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===r||!(o=o.nextSibling)););else{Go.innerHTML=Ii(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const a=Go.content;if(s==="svg"||s==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ka=Symbol("_vtc");function Wa(e,t,n){const s=e[Ka];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ko=Symbol("_vod"),za=Symbol("_vsh"),Ja=Symbol(""),Qa=/(?:^|;)\s*display\s*:/;function Ya(e,t,n){const s=e.style,o=Oe(n);let r=!1;if(n&&!o){if(t)if(Oe(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Sn(s,a,"")}else for(const i in t)n[i]==null&&Sn(s,i,"");for(const i in n){i==="display"&&(r=!0);const a=n[i];a!=null?Za(e,i,!Oe(t)&&t?t[i]:void 0,a)||Sn(s,i,a):Sn(s,i,"")}}else if(o){if(t!==n){const i=s[Ja];i&&(n+=";"+i),s.cssText=n,r=Qa.test(n)}}else t&&e.removeAttribute("style");Ko in e&&(e[Ko]=r?s.display:"",e[za]&&(s.display="none"))}const Wo=/\s*!important$/;function Sn(e,t,n){if(Z(n))n.forEach(s=>Sn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Xa(e,t);Wo.test(n)?e.setProperty(sn(s),n.replace(Wo,""),"important"):e[s]=n}}const zo=["Webkit","Moz","ms"],Ms={};function Xa(e,t){const n=Ms[t];if(n)return n;let s=Xe(t);if(s!=="filter"&&s in e)return Ms[t]=s;s=hs(s);for(let o=0;o<zo.length;o++){const r=zo[o]+s;if(r in e)return Ms[t]=r}return t}function Za(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Oe(s)&&n===s}const Jo="http://www.w3.org/1999/xlink";function Qo(e,t,n,s,o,r=rl(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Jo,t.slice(6,t.length)):e.setAttributeNS(Jo,t,n):n==null||r&&!Sr(n)?e.removeAttribute(t):e.setAttribute(t,r?"":pt(n)?String(n):n)}function Yo(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ii(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,u=n==null?e.type==="checkbox"?"on":"":String(n);(a!==u||!("_value"in e))&&(e.value=u),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Sr(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function Nt(e,t,n,s){e.addEventListener(t,n,s)}function eu(e,t,n,s){e.removeEventListener(t,n,s)}const Xo=Symbol("_vei");function tu(e,t,n,s,o=null){const r=e[Xo]||(e[Xo]={}),i=r[t];if(s&&i)i.value=s;else{const[a,u]=ou(t);if(s){const d=r[t]=lu(s,o);Nt(e,a,d,u)}else i&&(eu(e,a,i,u),r[t]=void 0)}}const nu=/(Once|Passive|Capture)$/,su=/^on:?(?:Once|Passive|Capture)$/;function ou(e){let t,n;for(;(n=e.match(nu))&&!su.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):sn(e.slice(2)),t]}let Vs=0;const ru=Promise.resolve(),iu=()=>Vs||(ru.then(()=>Vs=0),Vs=Date.now());function lu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Z(o)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const i=o.slice(),a=[s];for(let u=0;u<i.length&&!s._stopped;u++){const d=i[u];d&&ht(d,t,5,a)}}else ht(o,t,5,[s])};return n.value=e,n.attached=iu(),n}const Zo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,au=(e,t,n,s,o,r)=>{const i=o==="svg";t==="class"?Wa(e,s,i):t==="style"?Ya(e,n,s):fs(t)?ps(t)||tu(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):uu(e,t,s,i))?(Yo(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Qo(e,t,s,i,r,t!=="value")):e._isVueCE&&(cu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Oe(s)))?Yo(e,Xe(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Qo(e,t,s,i))};function uu(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zo(t)&&re(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Zo(t)&&Oe(n)?!1:t in e}function cu(e,t){const n=e._def.props;if(!n)return!1;const s=Xe(t);return Array.isArray(n)?n.some(o=>Xe(o)===s):Object.keys(n).some(o=>Xe(o)===s)}const zt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Z(t)?n=>es(t,n):t};function du(e){e.target.composing=!0}function er(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const it=Symbol("_assign"),Yn=Symbol("_initialValue");function js(e,t,n){return t&&(e=e.trim()),n&&(e=vs(e)),e}const fe={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[Yn]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Yn]=e.defaultValue.replace(/\r\n?/g,`
`))),e[it]=zt(o);const r=s||o.props&&o.props.type==="number";Nt(e,t?"change":"input",i=>{i.target.composing||e[it](js(e.value,n,r))}),(n||r)&&Nt(e,"change",()=>{e.value=js(e.value,n,r)}),t||(Nt(e,"compositionstart",du),Nt(e,"compositionend",er),Nt(e,"change",er))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",r=e[Yn];delete e[Yn],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[it](js(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:r}},i){if(e[it]=zt(i),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?vs(e.value):e.value,u=t??"";if(a===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===u)||(e.value=u)}},Rt={deep:!0,created(e,t,n){e[it]=zt(n),Nt(e,"change",()=>{const s=e._modelValue,o=gn(e),r=e.checked,i=e[it];if(Z(s)){const a=io(s,o),u=a!==-1;if(r&&!u)i(s.concat(o));else if(!r&&u){const d=[...s];d.splice(a,1),i(d)}}else if(_n(s)){const a=new Set(s);r?a.add(o):a.delete(o),i(a)}else i($i(e,r))})},mounted:tr,beforeUpdate(e,t,n){e[it]=zt(n),tr(e,t,n)}};function tr(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(Z(t))o=io(t,s.props.value)>-1;else if(_n(t))o=t.has(s.props.value);else{if(t===n)return;o=Wt(t,$i(e,!0))}e.checked!==o&&(e.checked=o)}const fu={created(e,{value:t},n){e.checked=Wt(t,n.props.value),e[it]=zt(n),Nt(e,"change",()=>{e[it](gn(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[it]=zt(s),t!==n&&(e.checked=Wt(t,s.props.value))}},vn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Nt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?vs(gn(r)):gn(r));e[it](e.multiple?_n(e._modelValue)?new Set(o):o:o[0]),e._assigning=!0,ho(()=>{e._assigning=!1})}),e[it]=zt(s)},mounted(e,{value:t}){nr(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[it]=zt(n)},updated(e,{value:t}){e._assigning||nr(e,t)}};function nr(e,t){const n=e.multiple,s=Z(t);if(!(n&&!s&&!_n(t))){for(let o=0,r=e.options.length;o<r;o++){const i=e.options[o],a=gn(i);if(n)if(s){const u=typeof a;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(a)):i.selected=io(t,a)>-1}else i.selected=t.has(a);else if(Wt(gn(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function gn(e){return"_value"in e?e._value:e.value}function $i(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const pu=["ctrl","shift","alt","meta"],mu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>pu.some(n=>e[`${n}Key`]&&!t.includes(n))},Ve=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...r)=>{for(let i=0;i<t.length;i++){const a=mu[t[i]];if(a&&a(o,t))return}return e(o,...r)}))},hu=Fe({patchProp:au},Ga);let sr;function vu(){return sr||(sr=ka(hu))}const gu=((...e)=>{const t=vu().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=xu(s);if(!o)return;const r=t._component;!re(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,bu(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function bu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xu(e){return Oe(e)?document.querySelector(e):e}/*!
* vue-router v4.6.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/const ln=typeof document<"u";function Ri(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function _u(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Ri(e.default)}const he=Object.assign;function Us(e,t){const n={};for(const s in t){const o=t[s];n[s]=vt(o)?o.map(e):e(o)}return n}const Tn=()=>{},vt=Array.isArray;function or(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Pi=/#/g,yu=/&/g,wu=/\//g,Cu=/=/g,ku=/\?/g,Oi=/\+/g,Eu=/%5B/g,Su=/%5D/g,Ti=/%5E/g,Au=/%60/g,Di=/%7B/g,Iu=/%7C/g,Ni=/%7D/g,$u=/%20/g;function Co(e){return e==null?"":encodeURI(""+e).replace(Iu,"|").replace(Eu,"[").replace(Su,"]")}function Ru(e){return Co(e).replace(Di,"{").replace(Ni,"}").replace(Ti,"^")}function Zs(e){return Co(e).replace(Oi,"%2B").replace($u,"+").replace(Pi,"%23").replace(yu,"%26").replace(Au,"`").replace(Di,"{").replace(Ni,"}").replace(Ti,"^")}function Pu(e){return Zs(e).replace(Cu,"%3D")}function Ou(e){return Co(e).replace(Pi,"%23").replace(ku,"%3F")}function Tu(e){return Ou(e).replace(wu,"%2F")}function Fn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Du=/\/$/,Nu=e=>e.replace(Du,"");function Ls(e,t,n="/"){let s,o={},r="",i="";const a=t.indexOf("#");let u=t.indexOf("?");return u=a>=0&&u>a?-1:u,u>=0&&(s=t.slice(0,u),r=t.slice(u,a>0?a:t.length),o=e(r.slice(1))),a>=0&&(s=s||t.slice(0,a),i=t.slice(a,t.length)),s=Uu(s??t,n),{fullPath:s+r+i,path:s,query:o,hash:Fn(i)}}function Mu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function rr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Vu(e,t,n){const s=t.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&bn(t.matched[s],n.matched[o])&&Mi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function bn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Mi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!ju(e[n],t[n]))return!1;return!0}function ju(e,t){return vt(e)?ir(e,t):vt(t)?ir(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function ir(e,t){return vt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Uu(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),o=s[s.length-1];(o===".."||o===".")&&s.push("");let r=n.length-1,i,a;for(i=0;i<s.length;i++)if(a=s[i],a!==".")if(a==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i).join("/")}const Bt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let eo=(function(e){return e.pop="pop",e.push="push",e})({}),Fs=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Lu(e){if(!e)if(ln){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Nu(e)}const Fu=/^[^#]+#/;function qu(e,t){return e.replace(Fu,"#")+t}function Hu(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Ss=()=>({left:window.scrollX,top:window.scrollY});function Bu(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Hu(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function lr(e,t){return(history.state?history.state.position-t:-1)+e}const to=new Map;function Gu(e,t){to.set(e,t)}function Ku(e){const t=to.get(e);return to.delete(e),t}function Wu(e){return typeof e=="string"||e&&typeof e=="object"}function Vi(e){return typeof e=="string"||typeof e=="symbol"}let Re=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const ji=Symbol("");Re.MATCHER_NOT_FOUND+"",Re.NAVIGATION_GUARD_REDIRECT+"",Re.NAVIGATION_ABORTED+"",Re.NAVIGATION_CANCELLED+"",Re.NAVIGATION_DUPLICATED+"";function xn(e,t){return he(new Error,{type:e,[ji]:!0},t)}function It(e,t){return e instanceof Error&&ji in e&&(t==null||!!(e.type&t))}const zu=["params","query","hash"];function Ju(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of zu)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Qu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const o=n[s].replace(Oi," "),r=o.indexOf("="),i=Fn(r<0?o:o.slice(0,r)),a=r<0?null:Fn(o.slice(r+1));if(i in t){let u=t[i];vt(u)||(u=t[i]=[u]),u.push(a)}else t[i]=a}return t}function ar(e){let t="";for(let n in e){const s=e[n];if(n=Pu(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(vt(s)?s.map(o=>o&&Zs(o)):[s&&Zs(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function Yu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=vt(s)?s.map(o=>o==null?null:""+o):s==null?s:""+s)}return t}const Xu=Symbol(""),ur=Symbol(""),As=Symbol(""),ko=Symbol(""),no=Symbol("");function kn(){let e=[];function t(s){return e.push(s),()=>{const o=e.indexOf(s);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Kt(e,t,n,s,o,r=i=>i()){const i=s&&(s.enterCallbacks[o]=s.enterCallbacks[o]||[]);return()=>new Promise((a,u)=>{const d=h=>{h===!1?u(xn(Re.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?u(h):Wu(h)?u(xn(Re.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&s.enterCallbacks[o]===i&&typeof h=="function"&&i.push(h),a())},c=r(()=>e.call(s&&s.instances[o],t,n,d));let p=Promise.resolve(c);e.length<3&&(p=p.then(d)),p.catch(h=>u(h))})}function qs(e,t,n,s,o=r=>r()){const r=[];for(const i of e)for(const a in i.components){let u=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Ri(u)){const d=(u.__vccOpts||u)[t];d&&r.push(Kt(d,n,s,i,a,o))}else{let d=u();r.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const p=_u(c)?c.default:c;i.mods[a]=c,i.components[a]=p;const h=(p.__vccOpts||p)[t];return h&&Kt(h,n,s,i,a,o)()}))}}return r}function Zu(e,t){const n=[],s=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let i=0;i<r;i++){const a=t.matched[i];a&&(e.matched.find(d=>bn(d,a))?s.push(a):n.push(a));const u=e.matched[i];u&&(t.matched.find(d=>bn(d,u))||o.push(u))}return[n,s,o]}/*!
* vue-router v4.6.4
* (c) 2025 Eduardo San Martin Morote
* @license MIT
*/let ec=()=>location.protocol+"//"+location.host;function Ui(e,t){const{pathname:n,search:s,hash:o}=t,r=e.indexOf("#");if(r>-1){let i=o.includes(e.slice(r))?e.slice(r).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),rr(a,"")}return rr(n,e)+s+o}function tc(e,t,n,s){let o=[],r=[],i=null;const a=({state:h})=>{const _=Ui(e,location),N=n.value,P=t.value;let W=0;if(h){if(n.value=_,t.value=h,i&&i===N){i=null;return}W=P?h.position-P.position:0}else s(_);o.forEach(H=>{H(n.value,N,{delta:W,type:eo.pop,direction:W?W>0?Fs.forward:Fs.back:Fs.unknown})})};function u(){i=n.value}function d(h){o.push(h);const _=()=>{const N=o.indexOf(h);N>-1&&o.splice(N,1)};return r.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(he({},h.state,{scroll:Ss()}),"")}}function p(){for(const h of r)h();r=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:d,destroy:p}}function cr(e,t,n,s=!1,o=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:o?Ss():null}}function nc(e){const{history:t,location:n}=window,s={value:Ui(e,n)},o={value:t.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,d,c){const p=e.indexOf("#"),h=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+u:ec()+e+u;try{t[c?"replaceState":"pushState"](d,"",h),o.value=d}catch(_){console.error(_),n[c?"replace":"assign"](h)}}function i(u,d){r(u,he({},t.state,cr(o.value.back,u,o.value.forward,!0),d,{position:o.value.position}),!0),s.value=u}function a(u,d){const c=he({},o.value,t.state,{forward:u,scroll:Ss()});r(c.current,c,!0),r(u,he({},cr(s.value,u,null),{position:c.position+1},d),!1),s.value=u}return{location:s,state:o,push:a,replace:i}}function sc(e){e=Lu(e);const t=nc(e),n=tc(e,t.state,t.location,t.replace);function s(r,i=!0){i||n.pauseListeners(),history.go(r)}const o=he({location:"",base:e,go:s,createHref:qu.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}let Zt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Me=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Me||{});const oc={type:Zt.Static,value:""},rc=/[a-zA-Z0-9_]/;function ic(e){if(!e)return[[]];if(e==="/")return[[oc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${d}": ${_}`)}let n=Me.Static,s=n;const o=[];let r;function i(){r&&o.push(r),r=[]}let a=0,u,d="",c="";function p(){d&&(n===Me.Static?r.push({type:Zt.Static,value:d}):n===Me.Param||n===Me.ParamRegExp||n===Me.ParamRegExpEnd?(r.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Zt.Param,value:d,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function h(){d+=u}for(;a<e.length;){if(u=e[a++],u==="\\"&&n!==Me.ParamRegExp){s=n,n=Me.EscapeNext;continue}switch(n){case Me.Static:u==="/"?(d&&p(),i()):u===":"?(p(),n=Me.Param):h();break;case Me.EscapeNext:h(),n=s;break;case Me.Param:u==="("?n=Me.ParamRegExp:rc.test(u)?h():(p(),n=Me.Static,u!=="*"&&u!=="?"&&u!=="+"&&a--);break;case Me.ParamRegExp:u===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+u:n=Me.ParamRegExpEnd:c+=u;break;case Me.ParamRegExpEnd:p(),n=Me.Static,u!=="*"&&u!=="?"&&u!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Me.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),p(),i(),o}const dr="[^/]+?",lc={sensitive:!1,strict:!1,start:!0,end:!0};var Je=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Je||{});const ac=/[.+*?^${}()[\]/\\]/g;function uc(e,t){const n=he({},lc,t),s=[];let o=n.start?"^":"";const r=[];for(const d of e){const c=d.length?[]:[Je.Root];n.strict&&!d.length&&(o+="/");for(let p=0;p<d.length;p++){const h=d[p];let _=Je.Segment+(n.sensitive?Je.BonusCaseSensitive:0);if(h.type===Zt.Static)p||(o+="/"),o+=h.value.replace(ac,"\\$&"),_+=Je.Static;else if(h.type===Zt.Param){const{value:N,repeatable:P,optional:W,regexp:H}=h;r.push({name:N,repeatable:P,optional:W});const D=H||dr;if(D!==dr){_+=Je.BonusCustomRegExp;try{`${D}`}catch(k){throw new Error(`Invalid custom RegExp for param "${N}" (${D}): `+k.message)}}let B=P?`((?:${D})(?:/(?:${D}))*)`:`(${D})`;p||(B=W&&d.length<2?`(?:/${B})`:"/"+B),W&&(B+="?"),o+=B,_+=Je.Dynamic,W&&(_+=Je.BonusOptional),P&&(_+=Je.BonusRepeatable),D===".*"&&(_+=Je.BonusWildcard)}c.push(_)}s.push(c)}if(n.strict&&n.end){const d=s.length-1;s[d][s[d].length-1]+=Je.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(d){const c=d.match(i),p={};if(!c)return null;for(let h=1;h<c.length;h++){const _=c[h]||"",N=r[h-1];p[N.name]=_&&N.repeatable?_.split("/"):_}return p}function u(d){let c="",p=!1;for(const h of e){(!p||!c.endsWith("/"))&&(c+="/"),p=!1;for(const _ of h)if(_.type===Zt.Static)c+=_.value;else if(_.type===Zt.Param){const{value:N,repeatable:P,optional:W}=_,H=N in d?d[N]:"";if(vt(H)&&!P)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const D=vt(H)?H.join("/"):H;if(!D)if(W)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):p=!0);else throw new Error(`Missing required param "${N}"`);c+=D}}return c||"/"}return{re:i,score:s,keys:r,parse:a,stringify:u}}function cc(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Je.Static+Je.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Je.Static+Je.Segment?1:-1:0}function Li(e,t){let n=0;const s=e.score,o=t.score;for(;n<s.length&&n<o.length;){const r=cc(s[n],o[n]);if(r)return r;n++}if(Math.abs(o.length-s.length)===1){if(fr(s))return 1;if(fr(o))return-1}return o.length-s.length}function fr(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const dc={strict:!1,end:!0,sensitive:!1};function fc(e,t,n){const s=uc(ic(e.path),n),o=he(s,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function pc(e,t){const n=[],s=new Map;t=or(dc,t);function o(p){return s.get(p)}function r(p,h,_){const N=!_,P=mr(p);P.aliasOf=_&&_.record;const W=or(t,p),H=[P];if("alias"in p){const k=typeof p.alias=="string"?[p.alias]:p.alias;for(const x of k)H.push(mr(he({},P,{components:_?_.record.components:P.components,path:x,aliasOf:_?_.record:P})))}let D,B;for(const k of H){const{path:x}=k;if(h&&x[0]!=="/"){const O=h.record.path,U=O[O.length-1]==="/"?"":"/";k.path=h.record.path+(x&&U+x)}if(D=fc(k,h,W),_?_.alias.push(D):(B=B||D,B!==D&&B.alias.push(D),N&&p.name&&!hr(D)&&i(p.name)),Fi(D)&&u(D),P.children){const O=P.children;for(let U=0;U<O.length;U++)r(O[U],D,_&&_.children[U])}_=_||D}return B?()=>{i(B)}:Tn}function i(p){if(Vi(p)){const h=s.get(p);h&&(s.delete(p),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(p);h>-1&&(n.splice(h,1),p.record.name&&s.delete(p.record.name),p.children.forEach(i),p.alias.forEach(i))}}function a(){return n}function u(p){const h=vc(p,n);n.splice(h,0,p),p.record.name&&!hr(p)&&s.set(p.record.name,p)}function d(p,h){let _,N={},P,W;if("name"in p&&p.name){if(_=s.get(p.name),!_)throw xn(Re.MATCHER_NOT_FOUND,{location:p});W=_.record.name,N=he(pr(h.params,_.keys.filter(B=>!B.optional).concat(_.parent?_.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),p.params&&pr(p.params,_.keys.map(B=>B.name))),P=_.stringify(N)}else if(p.path!=null)P=p.path,_=n.find(B=>B.re.test(P)),_&&(N=_.parse(P),W=_.record.name);else{if(_=h.name?s.get(h.name):n.find(B=>B.re.test(h.path)),!_)throw xn(Re.MATCHER_NOT_FOUND,{location:p,currentLocation:h});W=_.record.name,N=he({},h.params,p.params),P=_.stringify(N)}const H=[];let D=_;for(;D;)H.unshift(D.record),D=D.parent;return{name:W,path:P,params:N,matched:H,meta:hc(H)}}e.forEach(p=>r(p));function c(){n.length=0,s.clear()}return{addRoute:r,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:o}}function pr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function mr(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:mc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function mc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function hr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function hc(e){return e.reduce((t,n)=>he(t,n.meta),{})}function vc(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;Li(e,t[r])<0?s=r:n=r+1}const o=gc(e);return o&&(s=t.lastIndexOf(o,s-1)),s}function gc(e){let t=e;for(;t=t.parent;)if(Fi(t)&&Li(e,t)===0)return t}function Fi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function vr(e){const t=ft(As),n=ft(ko),s=we(()=>{const u=je(e.to);return t.resolve(u)}),o=we(()=>{const{matched:u}=s.value,{length:d}=u,c=u[d-1],p=n.matched;if(!c||!p.length)return-1;const h=p.findIndex(bn.bind(null,c));if(h>-1)return h;const _=gr(u[d-2]);return d>1&&gr(c)===_&&p[p.length-1].path!==_?p.findIndex(bn.bind(null,u[d-2])):h}),r=we(()=>o.value>-1&&wc(n.params,s.value.params)),i=we(()=>o.value>-1&&o.value===n.matched.length-1&&Mi(n.params,s.value.params));function a(u={}){if(yc(u)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(Tn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:s,href:we(()=>s.value.href),isActive:r,isExactActive:i,navigate:a}}function bc(e){return e.length===1?e[0]:e}const xc=ei({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:vr,setup(e,{slots:t}){const n=xs(vr(e)),{options:s}=ft(As),o=we(()=>({[br(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[br(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&bc(t.default(n));return e.custom?r:Ai("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},r)}}}),_c=xc;function yc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function wc(e,t){for(const n in t){const s=t[n],o=e[n];if(typeof s=="string"){if(s!==o)return!1}else if(!vt(o)||o.length!==s.length||s.some((r,i)=>r.valueOf()!==o[i].valueOf()))return!1}return!0}function gr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const br=(e,t,n)=>e??t??n,Cc=ei({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=ft(no),o=we(()=>e.route||s.value),r=ft(ur,0),i=we(()=>{let d=je(r);const{matched:c}=o.value;let p;for(;(p=c[d])&&!p.components;)d++;return d}),a=we(()=>o.value.matched[i.value]);ts(ur,we(()=>i.value+1)),ts(Xu,a),ts(no,o);const u=G();return Mt(()=>[u.value,a.value,e.name],([d,c,p],[h,_,N])=>{c&&(c.instances[p]=d,_&&_!==c&&d&&d===h&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),d&&c&&(!_||!bn(c,_)||!h)&&(c.enterCallbacks[p]||[]).forEach(P=>P(d))},{flush:"post"}),()=>{const d=o.value,c=e.name,p=a.value,h=p&&p.components[c];if(!h)return xr(n.default,{Component:h,route:d});const _=p.props[c],N=_?_===!0?d.params:typeof _=="function"?_(d):_:null,W=Ai(h,he({},N,t,{onVnodeUnmounted:H=>{H.component.isUnmounted&&(p.instances[c]=null)},ref:u}));return xr(n.default,{Component:W,route:d})||W}}});function xr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const kc=Cc;function Ec(e){const t=pc(e.routes,e),n=e.parseQuery||Qu,s=e.stringifyQuery||ar,o=e.history,r=kn(),i=kn(),a=kn(),u=Al(Bt);let d=Bt;ln&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Us.bind(null,S=>""+S),p=Us.bind(null,Tu),h=Us.bind(null,Fn);function _(S,K){let F,Y;return Vi(S)?(F=t.getRecordMatcher(S),Y=K):Y=S,t.addRoute(Y,F)}function N(S){const K=t.getRecordMatcher(S);K&&t.removeRoute(K)}function P(){return t.getRoutes().map(S=>S.record)}function W(S){return!!t.getRecordMatcher(S)}function H(S,K){if(K=he({},K||u.value),typeof S=="string"){const g=Ls(n,S,K.path),y=t.resolve({path:g.path},K),A=o.createHref(g.fullPath);return he(g,y,{params:h(y.params),hash:Fn(g.hash),redirectedFrom:void 0,href:A})}let F;if(S.path!=null)F=he({},S,{path:Ls(n,S.path,K.path).path});else{const g=he({},S.params);for(const y in g)g[y]==null&&delete g[y];F=he({},S,{params:p(g)}),K.params=p(K.params)}const Y=t.resolve(F,K),ae=S.hash||"";Y.params=c(h(Y.params));const f=Mu(s,he({},S,{hash:Ru(ae),path:Y.path})),m=o.createHref(f);return he({fullPath:f,hash:ae,query:s===ar?Yu(S.query):S.query||{}},Y,{redirectedFrom:void 0,href:m})}function D(S){return typeof S=="string"?Ls(n,S,u.value.path):he({},S)}function B(S,K){if(d!==S)return xn(Re.NAVIGATION_CANCELLED,{from:K,to:S})}function k(S){return U(S)}function x(S){return k(he(D(S),{replace:!0}))}function O(S,K){const F=S.matched[S.matched.length-1];if(F&&F.redirect){const{redirect:Y}=F;let ae=typeof Y=="function"?Y(S,K):Y;return typeof ae=="string"&&(ae=ae.includes("?")||ae.includes("#")?ae=D(ae):{path:ae},ae.params={}),he({query:S.query,hash:S.hash,params:ae.path!=null?{}:S.params},ae)}}function U(S,K){const F=d=H(S),Y=u.value,ae=S.state,f=S.force,m=S.replace===!0,g=O(F,Y);if(g)return U(he(D(g),{state:typeof g=="object"?he({},ae,g.state):ae,force:f,replace:m}),K||F);const y=F;y.redirectedFrom=K;let A;return!f&&Vu(s,Y,F)&&(A=xn(Re.NAVIGATION_DUPLICATED,{to:y,from:Y}),Ke(Y,Y,!0,!1)),(A?Promise.resolve(A):ee(y,Y)).catch(E=>It(E)?It(E,Re.NAVIGATION_GUARD_REDIRECT)?E:gt(E):ue(E,y,Y)).then(E=>{if(E){if(It(E,Re.NAVIGATION_GUARD_REDIRECT))return U(he({replace:m},D(E.to),{state:typeof E.to=="object"?he({},ae,E.to.state):ae,force:f}),K||y)}else E=De(y,Y,!0,m,ae);return V(y,Y,E),E})}function L(S,K){const F=B(S,K);return F?Promise.reject(F):Promise.resolve()}function Ae(S){const K=le.values().next().value;return K&&typeof K.runWithContext=="function"?K.runWithContext(S):S()}function ee(S,K){let F;const[Y,ae,f]=Zu(S,K);F=qs(Y.reverse(),"beforeRouteLeave",S,K);for(const g of Y)g.leaveGuards.forEach(y=>{F.push(Kt(y,S,K))});const m=L.bind(null,S,K);return F.push(m),qe(F).then(()=>{F=[];for(const g of r.list())F.push(Kt(g,S,K));return F.push(m),qe(F)}).then(()=>{F=qs(ae,"beforeRouteUpdate",S,K);for(const g of ae)g.updateGuards.forEach(y=>{F.push(Kt(y,S,K))});return F.push(m),qe(F)}).then(()=>{F=[];for(const g of f)if(g.beforeEnter)if(vt(g.beforeEnter))for(const y of g.beforeEnter)F.push(Kt(y,S,K));else F.push(Kt(g.beforeEnter,S,K));return F.push(m),qe(F)}).then(()=>(S.matched.forEach(g=>g.enterCallbacks={}),F=qs(f,"beforeRouteEnter",S,K,Ae),F.push(m),qe(F))).then(()=>{F=[];for(const g of i.list())F.push(Kt(g,S,K));return F.push(m),qe(F)}).catch(g=>It(g,Re.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function V(S,K,F){a.list().forEach(Y=>Ae(()=>Y(S,K,F)))}function De(S,K,F,Y,ae){const f=B(S,K);if(f)return f;const m=K===Bt,g=ln?history.state:{};F&&(Y||m?o.replace(S.fullPath,he({scroll:m&&g&&g.scroll},ae)):o.push(S.fullPath,ae)),u.value=S,Ke(S,K,F,m),gt()}let z;function Ze(){z||(z=o.listen((S,K,F)=>{if(!bt.listening)return;const Y=H(S),ae=O(Y,bt.currentRoute.value);if(ae){U(he(ae,{replace:!0,force:!0}),Y).catch(Tn);return}d=Y;const f=u.value;ln&&Gu(lr(f.fullPath,F.delta),Ss()),ee(Y,f).catch(m=>It(m,Re.NAVIGATION_ABORTED|Re.NAVIGATION_CANCELLED)?m:It(m,Re.NAVIGATION_GUARD_REDIRECT)?(U(he(D(m.to),{force:!0}),Y).then(g=>{It(g,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&!F.delta&&F.type===eo.pop&&o.go(-1,!1)}).catch(Tn),Promise.reject()):(F.delta&&o.go(-F.delta,!1),ue(m,Y,f))).then(m=>{m=m||De(Y,f,!1),m&&(F.delta&&!It(m,Re.NAVIGATION_CANCELLED)?o.go(-F.delta,!1):F.type===eo.pop&&It(m,Re.NAVIGATION_ABORTED|Re.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),V(Y,f,m)}).catch(Tn)}))}let qt=kn(),Se=kn(),de;function ue(S,K,F){gt(S);const Y=Se.list();return Y.length?Y.forEach(ae=>ae(S,K,F)):console.error(S),Promise.reject(S)}function ut(){return de&&u.value!==Bt?Promise.resolve():new Promise((S,K)=>{qt.add([S,K])})}function gt(S){return de||(de=!S,Ze(),qt.list().forEach(([K,F])=>S?F(S):K()),qt.reset()),S}function Ke(S,K,F,Y){const{scrollBehavior:ae}=e;if(!ln||!ae)return Promise.resolve();const f=!F&&Ku(lr(S.fullPath,0))||(Y||!F)&&history.state&&history.state.scroll||null;return ho().then(()=>ae(S,K,f)).then(m=>m&&Bu(m)).catch(m=>ue(m,S,K))}const Te=S=>o.go(S);let nt;const le=new Set,bt={currentRoute:u,listening:!0,addRoute:_,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:P,resolve:H,options:e,push:k,replace:x,go:Te,back:()=>Te(-1),forward:()=>Te(1),beforeEach:r.add,beforeResolve:i.add,afterEach:a.add,onError:Se.add,isReady:ut,install(S){S.component("RouterLink",_c),S.component("RouterView",kc),S.config.globalProperties.$router=bt,Object.defineProperty(S.config.globalProperties,"$route",{enumerable:!0,get:()=>je(u)}),ln&&!nt&&u.value===Bt&&(nt=!0,k(o.location).catch(Y=>{}));const K={};for(const Y in Bt)Object.defineProperty(K,Y,{get:()=>u.value[Y],enumerable:!0});S.provide(As,bt),S.provide(ko,Hr(K)),S.provide(no,u);const F=S.unmount;le.add(S),S.unmount=function(){le.delete(S),le.size<1&&(d=Bt,z&&z(),z=null,u.value=Bt,nt=!1,de=!1),F()}}};function qe(S){return S.reduce((K,F)=>K.then(()=>Ae(F)),Promise.resolve())}return bt}function Eo(){return ft(As)}function qi(e){return ft(ko)}const Xn=window.location.pathname.startsWith("/portal/"),Ye={esPortal:Xn,baseRuta:Xn?"/portal/studio/":"/studio/",apiBase:Xn?"/portal":"/app",urlLogin:Xn?"/portal/login":"/login"};function se(e){return Ye.apiBase+e}async function Zn(e,t={}){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t.headers}}),s=n.headers.get("content-type")||"";if(n.redirected||!s.includes("application/json"))throw window.location.href=Ye.urlLogin,new Error("Sesión expirada");const o=await n.json();if(!n.ok){const r=typeof(o==null?void 0:o.error)=="string"?o.error:o==null?void 0:o.message;throw new Error(r||"Error de servidor")}return o}const oe={get:e=>Zn(e),post:(e,t)=>Zn(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Zn(e,{method:"PUT",body:JSON.stringify(t)}),del:e=>Zn(e,{method:"DELETE"})},An=G(!1),Sc={class:"h-14 px-4 flex items-center gap-2 border-b border-borde"},Ac={key:0,class:"px-3 pt-3"},Ic={key:1,class:"px-3 pt-2 text-xs text-red-600 dark:text-red-400"},$c={class:"flex-1 overflow-y-auto px-2 py-3 space-y-0.5"},Rc={key:0,class:"px-2 text-xs text-tenue"},Pc={key:1,class:"px-2 text-xs text-tenue"},Oc={class:"truncate"},Tc={class:"flex items-center gap-1 mt-0.5"},Dc={class:"text-[11px] text-tenue"},Nc={key:0,class:"flex opacity-0 group-hover:opacity-100 transition-opacity pr-1.5 gap-0.5"},Mc=["onClick"],Vc=["onClick"],jc={class:"card w-full max-w-lg p-6 animate-escalar shadow-2xl"},Uc={class:"font-semibold text-texto mb-4"},Lc={key:0,class:"grid grid-cols-2 gap-3"},Fc=["value"],qc={class:"text-[11px] text-tenue mt-1"},Hc=["value"],Bc={class:"text-[11px] text-tenue mt-1"},Gc={class:"flex items-center gap-2 text-sm text-texto"},Kc={class:"flex justify-end gap-2 pt-2"},Wc={__name:"Sidebar",setup(e,{expose:t}){const n=qi(),s=Eo(),o=G([]),r=G([]),i=G([]),a=G(!0),u=G(""),d=G(!1),c=G(null),p=G(_()),h=we(()=>n.params.tenantId||n.params.id);Mt(()=>n.fullPath,()=>{An.value=!1});function _(){return{nombre:"",dominios_permitidos:"",activo:!0,cliente_id:null,plan_id:null}}async function N(){a.value=!0,u.value="";try{const x=await oe.get(se("/umind/tenants"));o.value=x.items||[]}catch(x){u.value=x.message}finally{a.value=!1}}function P(x){return Array.isArray(x)?x:(x==null?void 0:x.items)||(x==null?void 0:x.registros)||[]}async function W(){if(Ye.esPortal)return;const[x,O]=await Promise.allSettled([oe.get("/app/api/clientes/select"),oe.get("/app/umind-planes/list")]);r.value=x.status==="fulfilled"?P(x.value):[],i.value=O.status==="fulfilled"?P(O.value):[];const U=[];x.status==="rejected"&&U.push("clientes"),O.status==="rejected"&&U.push("planes"),U.length&&(u.value=`No se pudo cargar la lista de ${U.join(" ni ")}.`)}function H(){c.value=null,p.value=_(),d.value=!0}function D(x){c.value=x,p.value={nombre:x.nombre,dominios_permitidos:x.dominios_permitidos,activo:x.activo,cliente_id:x.cliente_id??null,plan_id:x.plan_id??null},d.value=!0}async function B(){const x={...p.value,dominios_permitidos:p.value.dominios_permitidos.split(",").map(O=>O.trim()).filter(Boolean)};try{if(c.value)await oe.put(se(`/umind/tenants/${c.value.ID}`),x),d.value=!1,await N();else{const O=await oe.post(se("/umind/tenants"),x);d.value=!1,await N(),s.push(`/tenants/${O.id}`)}}catch(O){u.value=O.message}}async function k(x){confirm(`¿Eliminar el espacio "${x.nombre}"? Esto borra también sus agentes. No se puede deshacer.`)&&(await oe.del(se(`/umind/tenants/${x.ID}`)),h.value===String(x.ID)&&s.push("/"),await N())}return t({recargar:N}),xo(()=>{N(),W()}),(x,O)=>{const U=yn("router-link");return w(),C(ie,null,[je(An)?(w(),C("div",{key:0,class:"fixed inset-0 bg-black/50 z-30 md:hidden",onClick:O[0]||(O[0]=L=>An.value=!1)})):J("",!0),l("aside",{class:Ee(["w-64 shrink-0 flex flex-col border-r border-borde bg-superficie fixed inset-y-0 left-0 z-40 transition-transform duration-200 md:static md:h-screen md:sticky md:top-0 md:translate-x-0",je(An)?"translate-x-0":"-translate-x-full"])},[l("div",Sc,[Ce(U,{to:"/",class:"flex items-center gap-2 text-base font-semibold text-texto"},{default:ct(()=>[...O[8]||(O[8]=[l("svg",{viewBox:"0 0 96 96",class:"w-6 h-6 shrink-0","aria-hidden":"true"},[l("rect",{width:"96",height:"96",rx:"22",fill:"#8eb02f"}),l("path",{d:"M32,42 V58 A14,14 0 0 0 60,58 V42",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M60,58 V64",fill:"none",stroke:"#fff","stroke-width":"10","stroke-linecap":"round"}),l("circle",{cx:"60",cy:"28",r:"7",fill:"#fff"})],-1),l("span",null,[pe("uMind "),l("span",{class:"text-brand"},"Studio")],-1)])]),_:1})]),je(Ye).esPortal?J("",!0):(w(),C("div",Ac,[l("button",{class:"btn-primary w-full",onClick:H}," + Nuevo espacio ")])),u.value?(w(),C("p",Ic,R(u.value),1)):J("",!0),l("nav",$c,[a.value?(w(),C("p",Rc,"Cargando...")):o.value.length===0?(w(),C("p",Pc,R(je(Ye).esPortal?"Todavía no tenés ningún espacio asignado. Escribinos y lo activamos.":"Sin espacios todavía."),1)):J("",!0),(w(!0),C(ie,null,Pe(o.value,L=>(w(),C("div",{key:L.ID,class:Ee(["group flex items-center rounded-lg transition-colors",h.value===String(L.ID)?"bg-brand/10":"hover:bg-elevado"])},[Ce(U,{to:`/tenants/${L.ID}`,class:Ee(["flex-1 min-w-0 px-2.5 py-2 text-sm",h.value===String(L.ID)?"text-brand font-medium":"text-texto"])},{default:ct(()=>[l("div",Oc,R(L.nombre),1),l("div",Tc,[l("span",{class:Ee(["w-1.5 h-1.5 rounded-full",L.activo?"bg-green-500":"bg-tenue/40"])},null,2),l("span",Dc,R(L.activo?"activo":"inactivo"),1)])]),_:2},1032,["to","class"]),je(Ye).esPortal?J("",!0):(w(),C("div",Nc,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ae=>D(L)}," ✎ ",8,Mc),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ae=>k(L)}," ✕ ",8,Vc)]))],2))),128))])],2),d.value?(w(),C("div",{key:1,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:O[7]||(O[7]=Ve(L=>d.value=!1,["self"]))},[l("div",jc,[l("h2",Uc,R(c.value?"Editar espacio":"Nuevo espacio"),1),O[17]||(O[17]=l("p",{class:"text-xs text-tenue mb-3"}," Un espacio es el negocio o sitio dueño de los dominios permitidos. La config de IA, tono y demás se configuran por agente, dentro del tenant. ",-1)),l("form",{class:"space-y-3",onSubmit:Ve(B,["prevent"])},[l("div",null,[O[9]||(O[9]=l("label",{class:"label"},"Nombre",-1)),ne(l("input",{"onUpdate:modelValue":O[1]||(O[1]=L=>p.value.nombre=L),required:"",class:"input"},null,512),[[fe,p.value.nombre]])]),l("div",null,[O[10]||(O[10]=l("label",{class:"label"},"Dominios permitidos (separados por coma)",-1)),ne(l("input",{"onUpdate:modelValue":O[2]||(O[2]=L=>p.value.dominios_permitidos=L),placeholder:"ejemplo.com, www.ejemplo.com",required:"",class:"input"},null,512),[[fe,p.value.dominios_permitidos]])]),je(Ye).esPortal?J("",!0):(w(),C("div",Lc,[l("div",null,[O[12]||(O[12]=l("label",{class:"label"},"Cliente",-1)),ne(l("select",{"onUpdate:modelValue":O[3]||(O[3]=L=>p.value.cliente_id=L),class:"input"},[O[11]||(O[11]=l("option",{value:null},"— sin asignar —",-1)),(w(!0),C(ie,null,Pe(r.value,L=>(w(),C("option",{key:L.ID,value:L.ID},R(L.nombre),9,Fc))),128))],512),[[vn,p.value.cliente_id]]),l("p",qc,R(r.value.length?"Define quién ve este espacio desde el portal.":"No hay clientes activos — creá uno en Clientes."),1)]),l("div",null,[O[14]||(O[14]=l("label",{class:"label"},"Plan",-1)),ne(l("select",{"onUpdate:modelValue":O[4]||(O[4]=L=>p.value.plan_id=L),class:"input"},[O[13]||(O[13]=l("option",{value:null},"— sin plan —",-1)),(w(!0),C(ie,null,Pe(i.value,L=>(w(),C("option",{key:L.ID,value:L.ID},R(L.nombre)+" ("+R(L.max_agentes===0?"∞":L.max_agentes)+" agentes) ",9,Hc))),128))],512),[[vn,p.value.plan_id]]),l("p",Bc,R(i.value.length?"Límite de agentes y precios de consumo.":"No hay planes — creá uno en uMind Planes."),1)])])),l("label",Gc,[ne(l("input",{"onUpdate:modelValue":O[5]||(O[5]=L=>p.value.activo=L),type:"checkbox"},null,512),[[Rt,p.value.activo]]),O[15]||(O[15]=pe(" Activo ",-1))]),l("div",Kc,[l("button",{type:"button",class:"btn-ghost",onClick:O[6]||(O[6]=L=>d.value=!1)}," Cancelar "),O[16]||(O[16]=l("button",{type:"submit",class:"btn-primary"}," Guardar ",-1))])],32)])])):J("",!0)],64)}}},Hi="umind-tema";function zc(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"oscuro":"claro"}const pn=G(localStorage.getItem(Hi)||zc());function Bi(){document.documentElement.classList.toggle("dark",pn.value==="oscuro")}function _r(){pn.value=pn.value==="oscuro"?"claro":"oscuro",localStorage.setItem(Hi,pn.value),Bi()}Bi();const Jc={class:"min-h-screen flex"},Qc={class:"flex-1 min-w-0 flex flex-col"},Yc={class:"h-14 shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-borde"},Xc=["title"],Zc={class:"text-base leading-none"},ed={class:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 animate-aparecer"},td={__name:"App",setup(e){return(t,n)=>{const s=yn("router-view");return w(),C("div",Jc,[Ce(Wc),l("main",Qc,[l("header",Yc,[l("button",{class:"btn-ghost !px-2 !py-1.5 md:hidden","aria-label":"Abrir menú",onClick:n[0]||(n[0]=o=>An.value=!0)},[...n[2]||(n[2]=[l("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),n[3]||(n[3]=l("span",{class:"flex-1"},null,-1)),l("button",{class:"btn-ghost !px-2.5 !py-1.5",title:je(pn)==="oscuro"?"Cambiar a claro":"Cambiar a oscuro",onClick:n[1]||(n[1]=(...o)=>je(_r)&&je(_r)(...o))},[l("span",Zc,R(je(pn)==="oscuro"?"☀️":"🌙"),1)],8,Xc)]),l("div",ed,[Ce(s)])])])}}},nd=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},sd=["width","height","aria-label"],od=["fill"],rd=["stroke"],id=["cy"],ld=["cy"],ad=["cy"],ud=["cy"],cd={key:1,d:"M41,66 h12 M67,66 h12",class:"umi-linea","stroke-width":"5","stroke-linecap":"round",fill:"none"},dd={key:4,d:"M50,78 q10,8 20,0",class:"umi-linea","stroke-width":"4",fill:"none","stroke-linecap":"round"},fd={__name:"UiMascota",props:{estado:{type:String,default:"normal"},tam:{type:[Number,String],default:72}},setup(e){return(t,n)=>(w(),C("svg",{width:e.tam,height:e.tam,viewBox:"0 0 120 120",class:"shrink-0",role:"img","aria-label":`Umi, la mascota de uMind (${e.estado})`},[l("circle",{cx:"60",cy:"26",r:"6",fill:e.estado==="alerta"?"#dc2626":"currentColor",class:Ee(e.estado==="pensando"?"umi-late":"")},null,10,od),l("line",{x1:"60",y1:"32",x2:"60",y2:"44",stroke:e.estado==="alerta"?"#dc2626":"currentColor","stroke-width":"4","stroke-linecap":"round"},null,8,rd),n[7]||(n[7]=l("path",{d:"M30,46 V76 A30,30 0 0 0 90,76 V46 Z",fill:"currentColor"},null,-1)),e.estado==="normal"||e.estado==="contenta"||e.estado==="alerta"?(w(),C(ie,{key:0},[l("circle",{cx:"47",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,id),l("circle",{cx:"73",cy:e.estado==="contenta"?64:66,r:"6",class:"umi-ojo"},null,8,ld),l("circle",{cx:"48",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,ad),l("circle",{cx:"74",cy:e.estado==="contenta"?65:67,r:"3",class:"umi-pupila"},null,8,ud)],64)):e.estado==="durmiendo"?(w(),C("path",cd)):e.estado==="pensando"?(w(),C(ie,{key:2},[n[0]||(n[0]=l("circle",{cx:"45",cy:"66",r:"4.5",class:"umi-ojo umi-p1"},null,-1)),n[1]||(n[1]=l("circle",{cx:"60",cy:"66",r:"4.5",class:"umi-ojo umi-p2"},null,-1)),n[2]||(n[2]=l("circle",{cx:"75",cy:"66",r:"4.5",class:"umi-ojo umi-p3"},null,-1))],64)):e.estado==="buscando"?(w(),C(ie,{key:3},[n[3]||(n[3]=l("circle",{cx:"47",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[4]||(n[4]=l("circle",{cx:"73",cy:"66",r:"6",class:"umi-ojo"},null,-1)),n[5]||(n[5]=l("circle",{cx:"50",cy:"66",r:"3",class:"umi-pupila"},null,-1)),n[6]||(n[6]=l("circle",{cx:"76",cy:"66",r:"3",class:"umi-pupila"},null,-1))],64)):J("",!0),e.estado==="contenta"?(w(),C("path",dd)):J("",!0)],8,sd))}},Gi=nd(fd,[["__scopeId","data-v-551897a0"]]),pd={key:0,class:"flex flex-col items-center justify-center py-24 text-sm text-tenue"},md={key:1,class:"max-w-md mx-auto text-center py-20"},hd={key:2,class:"flex flex-col items-center justify-center text-center py-24"},vd={class:"text-lg font-medium text-texto"},gd={class:"text-sm text-tenue mt-1"},bd={__name:"Home",setup(e){const t=Eo(),n=G(Ye.esPortal),s=G(!1);async function o(){if(Ye.esPortal)try{const i=(await oe.get(se("/umind/tenants"))).items||[];if(i.length===0){s.value=!0;return}if(i.length!==1)return;const a=i[0].ID,d=(await oe.get(se(`/umind/agentes?tenant_id=${a}`))).items||[];if(d.length===1){t.replace(`/tenants/${a}/agentes/${d[0].ID}`);return}t.replace(`/tenants/${a}`)}catch{}finally{n.value=!1}}return xo(o),(r,i)=>n.value?(w(),C("div",pd," Abriendo tu asistente… ")):s.value?(w(),C("div",md,[Ce(Gi,{estado:"durmiendo",tam:80,class:"mx-auto mb-4 text-brand"}),i[0]||(i[0]=ki('<h1 class="text-lg font-medium text-texto">Todavía no tenés un asistente activo</h1><p class="text-sm text-tenue mt-2"> uMind contesta por vos en WhatsApp y en tu sitio, con la información de tu negocio. Entiende las notas de voz y lee las fotos y archivos que te mandan tus clientes. </p><a class="btn-primary inline-block mt-5" href="mailto:soporte@u-site.app?subject=Quiero%20activar%20uMind">Quiero activarlo</a><p class="text-xs text-tenue mt-4"><a href="/portal/dashboard" class="underline">Volver al portal</a></p>',4))])):(w(),C("div",hd,[i[1]||(i[1]=l("div",{class:"text-4xl mb-4"},"💬",-1)),l("h1",vd,R(je(Ye).esPortal?"Elegí tu espacio de la izquierda":"Elegí un espacio de la izquierda"),1),l("p",gd,R(je(Ye).esPortal?"Adentro vas a poder crear y configurar tus agentes.":"o creá uno nuevo para empezar a configurar su agente."),1)]))}},xd={class:"flex flex-col items-center justify-center text-center py-12 px-6"},_d={key:0,class:"text-3xl mb-3 opacity-70"},yd={class:"text-sm font-medium text-texto"},wd={key:2,class:"text-xs text-tenue mt-1.5 max-w-sm leading-relaxed"},Cd={key:3,class:"mt-4"},Ot={__name:"UiEmptyState",props:{estado:{type:String,default:"durmiendo"},titulo:String,detalle:String,icono:{type:String,default:""}},setup(e){return(t,n)=>(w(),C("div",xd,[e.icono?(w(),C("div",_d,R(e.icono),1)):(w(),tt(Gi,{key:1,estado:e.estado,tam:64,class:"mb-3 text-brand"},null,8,["estado"])),l("p",yd,R(e.titulo),1),e.detalle?(w(),C("p",wd,R(e.detalle),1)):J("",!0),t.$slots.default?(w(),C("div",Cd,[na(t.$slots,"default")])):J("",!0)]))}},kd={key:0,class:"mb-6"},Ed={class:"flex items-start justify-between gap-4"},Sd={class:"text-xl font-semibold text-texto"},Ad={class:"text-xs text-tenue mt-1"},Id={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},$d={class:"flex items-center justify-between mb-4"},Rd={class:"flex items-center gap-2"},Pd={key:0,class:"badge-alerta"},Od={key:1,class:"badge-neutro"},Td=["disabled"],Dd={key:2,class:"text-xs text-tenue -mt-2 mb-4"},Nd={key:3,class:"text-xs text-tenue -mt-2 mb-4"},Md={key:4,class:"grid gap-3 sm:grid-cols-2"},Vd=["disabled"],jd={key:6,class:"grid gap-3 sm:grid-cols-2"},Ud={class:"flex items-start gap-3"},Ld={class:"min-w-0 flex-1"},Fd={class:"flex items-center gap-2"},qd={class:"font-medium text-texto truncate"},Hd={class:"text-xs text-tenue mt-0.5 truncate"},Bd={class:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"},Gd=["onClick"],Kd=["onClick"],Wd=["onClick"],zd={class:"flex items-center gap-4 mt-3.5 pt-3 border-t border-borde text-xs text-tenue"},Jd={class:"tabular-nums"},Qd={class:"text-texto font-medium"},Yd={class:"tabular-nums"},Xd={class:"text-texto font-medium"},Zd={class:"tabular-nums"},ef={class:"text-texto font-medium"},tf={class:"bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 w-full max-w-lg max-h-[calc(100vh-2rem)] overflow-y-auto"},nf={class:"font-semibold text-gray-800 dark:text-gray-100 mb-4"},sf={key:0},of={class:"grid gap-1.5"},rf=["value"],lf={class:"min-w-0"},af={class:"block text-sm text-texto"},uf={class:"block text-xs text-tenue"},cf={key:0,class:"block text-xs text-tenue mt-0.5"},df=["value"],ff={class:"flex items-center gap-2"},pf={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300"},mf={class:"flex justify-end gap-2 pt-2"},hf={type:"submit",class:"bg-brand hover:bg-brand-dark text-white text-sm font-medium px-4 py-2 rounded-lg"},vf={__name:"TenantAgentes",props:{id:{type:String,required:!0}},setup(e){const t=e,n=we(()=>Number(t.id)),s=Eo(),o=G(null),r=G([]),i=G([]),a=G(""),u=G(!1),d=G(null),c=G(D()),p=G(null),h=G({}),_=G(!0);function N(ee){const V=h.value[ee.ID]||{};return ee.activo?V.documentos>0?{tipo:"ok",texto:"listo"}:{tipo:"alerta",texto:"sin conocimiento"}:{tipo:"neutro",texto:"inactivo"}}function P(ee){const V=h.value[ee.ID]||{};return{documentos:V.documentos||0,canales:V.canales||0,conversaciones:V.conversaciones_7d||0}}function W(ee){return String(ee||"?").trim().split(/\s+/).slice(0,2).map(V=>V[0]).join("").toUpperCase()}const H=we(()=>{if(!p.value)return{sinPlan:!0};const ee=p.value.max_agentes||0;return{sinPlan:!1,nombre:p.value.nombre,ilimitado:ee<=0,max:ee,usados:r.value.length,lleno:ee>0&&r.value.length>=ee}});function D(){return{nombre:"",ai_config_id:null,tono:"",mensaje_bienvenida:"",color:"#8eb02f",activo:!0,plantilla_rubro:""}}const B=G([]);async function k(){a.value="",_.value=!0;try{const[ee,V,De,z]=await Promise.all([oe.get(se("/umind/tenants")),oe.get(se(`/umind/agentes?tenant_id=${t.id}`)),oe.get(se("/umind/ai-configs")),oe.get(se("/umind/plantillas-rubro"))]);o.value=(ee.items||[]).find(Ze=>String(Ze.ID)===t.id)||null,r.value=V.items||[],p.value=V.plan||null,h.value=V.resumen||{},i.value=De.items||[],B.value=z.items||[]}catch(ee){a.value=ee.message}finally{_.value=!1}}async function x(ee){const V=prompt(`Nombre de la copia de "${ee.nombre}":`,`${ee.nombre} (copia)`);if(V!==null){a.value="";try{const De=await oe.post(se(`/umind/agentes/${ee.ID}/duplicar`),{tenant_id:Number(n.value),nombre:V.trim()});await k(),De.aviso&&alert(De.aviso)}catch(De){a.value=De.message}}}function O(){d.value=null,c.value=D(),u.value=!0}function U(ee){d.value=ee,c.value={nombre:ee.nombre,ai_config_id:ee.ai_config_id,tono:ee.tono,mensaje_bienvenida:ee.mensaje_bienvenida,color:ee.color||"#8eb02f",activo:ee.activo},u.value=!0}async function L(){try{if(d.value)await oe.put(se(`/umind/agentes/${d.value.ID}`),{tenant_id:n.value,...c.value}),u.value=!1,await k();else{const ee=await oe.post(se("/umind/agentes"),{tenant_id:n.value,...c.value});u.value=!1,s.push(`/tenants/${n.value}/agentes/${ee.id}`)}}catch(ee){a.value=ee.message}}async function Ae(ee){confirm(`¿Eliminar el agente "${ee.nombre}"? Esto no se puede deshacer.`)&&(await oe.del(se(`/umind/agentes/${ee.ID}`)),await k())}return Mt(()=>t.id,k,{immediate:!0}),(ee,V)=>{const De=yn("router-link");return w(),C("div",null,[o.value?(w(),C("div",kd,[l("div",Ed,[l("div",null,[l("h1",Sd,R(o.value.nombre),1),l("p",Ad,R(o.value.dominios_permitidos||"sin dominios configurados"),1)]),Ce(De,{to:`/tenants/${n.value??e.id}/ia`,class:"btn-ghost"},{default:ct(()=>[...V[10]||(V[10]=[pe("Tu IA",-1)])]),_:1},8,["to"]),Ce(De,{to:`/tenants/${n.value??e.id}/uso`,class:"btn-ghost"},{default:ct(()=>[...V[11]||(V[11]=[pe("📊 Consumo",-1)])]),_:1},8,["to"])])])):J("",!0),a.value?(w(),C("p",Id,R(a.value),1)):J("",!0),l("div",$d,[l("div",Rd,[V[12]||(V[12]=l("h2",{class:"text-sm font-medium text-tenue"},"Agentes",-1)),H.value.sinPlan?(w(),C("span",Pd,"sin plan · sin límite")):H.value.ilimitado?(w(),C("span",Od,R(H.value.nombre)+" · ilimitado",1)):(w(),C("span",{key:2,class:Ee(H.value.lleno?"badge-alerta":"badge-neutro")},R(H.value.nombre)+" · "+R(H.value.usados)+" de "+R(H.value.max),3))]),l("button",{class:"btn-primary",disabled:H.value.lleno,onClick:O},"+ Nuevo agente",8,Td)]),H.value.sinPlan&&!je(Ye).esPortal?(w(),C("p",Dd," Este espacio no tiene plan asignado, así que no se le aplica ningún límite de agentes. Asignale uno desde el lápiz del espacio, en la barra izquierda. ")):H.value.lleno?(w(),C("p",Nd," Alcanzaste el máximo de agentes de tu plan. ")):J("",!0),_.value?(w(),C("div",Md,[(w(),C(ie,null,Pe(2,z=>l("div",{key:z,class:"card p-4 animate-pulse"},[...V[13]||(V[13]=[ki('<div class="flex items-center gap-3"><div class="w-10 h-10 rounded-xl bg-elevado"></div><div class="flex-1"><div class="h-3.5 w-28 rounded bg-elevado"></div><div class="h-2.5 w-16 rounded bg-elevado mt-2"></div></div></div><div class="h-2.5 w-full rounded bg-elevado mt-4"></div>',2)])])),64))])):r.value.length===0?(w(),tt(Ot,{key:5,class:"card",estado:"durmiendo",titulo:"Todavía no hay agentes",detalle:"Creá el primero y cargale su base de conocimiento para que empiece a responder."},{default:ct(()=>[l("button",{class:"btn-primary",disabled:H.value.lleno,onClick:O},"+ Crear el primer agente",8,Vd)]),_:1})):(w(),C("div",jd,[(w(!0),C(ie,null,Pe(r.value,z=>(w(),tt(De,{key:z.ID,to:`/tenants/${n.value}/agentes/${z.ID}`,class:"card p-4 relative group hover:shadow-lg hover:-translate-y-0.5 transition-all overflow-hidden"},{default:ct(()=>[l("span",{class:"absolute inset-x-0 top-0 h-1",style:nn({background:z.color||"#8eb02f"})},null,4),l("div",Ud,[l("span",{class:"w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-semibold shrink-0",style:nn({background:z.color||"#8eb02f",opacity:z.activo?1:.4})},R(W(z.nombre)),5),l("div",Ld,[l("div",Fd,[l("span",qd,R(z.nombre),1),l("span",{class:Ee(`badge-${N(z).tipo}`)},R(N(z).texto),3)]),l("p",Hd,R(z.tono||"sin tono definido"),1)]),l("div",Bd,[l("button",{class:"p-1 text-tenue hover:text-texto",title:"Editar",onClick:Ve(Ze=>U(z),["prevent","stop"])},"✎",8,Gd),l("button",{class:"p-1 text-tenue hover:text-texto",title:"Duplicar: copia el conocimiento y las herramientas a un agente nuevo",onClick:Ve(Ze=>x(z),["prevent","stop"])},"⧉",8,Kd),l("button",{class:"p-1 text-tenue hover:text-red-600",title:"Eliminar",onClick:Ve(Ze=>Ae(z),["prevent","stop"])},"✕",8,Wd)])]),l("div",zd,[l("span",Jd,[l("b",Qd,R(P(z).conversaciones),1),V[14]||(V[14]=pe(" conversaciones · 7d",-1))]),l("span",Yd,[l("b",Xd,R(P(z).documentos),1),V[15]||(V[15]=pe(" fuentes",-1))]),l("span",Zd,[l("b",ef,R(P(z).canales),1),V[16]||(V[16]=pe(" canales",-1))])])]),_:2},1032,["to"]))),128))])),u.value?(w(),C("div",{key:7,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:V[9]||(V[9]=Ve(z=>u.value=!1,["self"]))},[l("div",tf,[l("h2",nf,R(d.value?"Editar agente":"Nuevo agente"),1),l("form",{class:"space-y-3",onSubmit:Ve(L,["prevent"])},[l("div",null,[V[17]||(V[17]=l("label",{class:"label"},"Nombre",-1)),ne(l("input",{"onUpdate:modelValue":V[0]||(V[0]=z=>c.value.nombre=z),required:"",placeholder:"ej: Ventas, Soporte",class:"input"},null,512),[[fe,c.value.nombre]])]),!d.value&&B.value.length?(w(),C("div",sf,[V[18]||(V[18]=l("label",{class:"label"},"Arrancar con",-1)),l("div",of,[(w(!0),C(ie,null,Pe([{clave:"",nombre:"Agente en blanco",descripcion:"Sin conocimiento cargado. Lo escribís vos desde cero."},...B.value],z=>(w(),C("label",{key:z.clave,class:Ee(["flex gap-2.5 p-2.5 rounded-lg border cursor-pointer transition-colors",c.value.plantilla_rubro===z.clave?"border-brand bg-brand/5":"border-borde hover:border-brand/40"])},[ne(l("input",{"onUpdate:modelValue":V[1]||(V[1]=Ze=>c.value.plantilla_rubro=Ze),type:"radio",value:z.clave,class:"mt-1 text-brand focus:ring-brand"},null,8,rf),[[fu,c.value.plantilla_rubro]]),l("span",lf,[l("span",af,R(z.nombre),1),l("span",uf,R(z.descripcion),1),z.notas?(w(),C("span",cf,R(z.notas)+" notas listas para editar · "+R(z.resumen),1)):J("",!0)])],2))),128))]),V[19]||(V[19]=l("p",{class:"text-xs text-tenue mt-1.5"}," Las notas vienen con ejemplos entre corchetes — abrilas y reemplazalas por tus datos reales. ",-1))])):J("",!0),l("div",null,[V[21]||(V[21]=l("label",{class:"label"},"Config de IA",-1)),ne(l("select",{"onUpdate:modelValue":V[2]||(V[2]=z=>c.value.ai_config_id=z),class:"input"},[V[20]||(V[20]=l("option",{value:null},"— sin asignar —",-1)),(w(!0),C(ie,null,Pe(i.value,z=>(w(),C("option",{key:z.ID,value:z.ID},R(z.nombre)+" ("+R(z.provider)+")",9,df))),128))],512),[[vn,c.value.ai_config_id]])]),l("div",null,[V[22]||(V[22]=l("label",{class:"label"},"Tono / personalidad",-1)),ne(l("textarea",{"onUpdate:modelValue":V[3]||(V[3]=z=>c.value.tono=z),rows:"2",class:"input"},null,512),[[fe,c.value.tono]])]),l("div",null,[V[23]||(V[23]=l("label",{class:"label"},"Mensaje de bienvenida",-1)),ne(l("input",{"onUpdate:modelValue":V[4]||(V[4]=z=>c.value.mensaje_bienvenida=z),class:"input"},null,512),[[fe,c.value.mensaje_bienvenida]])]),l("div",null,[V[24]||(V[24]=l("label",{class:"label"},"Color del widget",-1)),l("div",ff,[ne(l("input",{"onUpdate:modelValue":V[5]||(V[5]=z=>c.value.color=z),type:"color",class:"w-10 h-9 border border-gray-300 dark:border-gray-700 rounded cursor-pointer bg-white dark:bg-gray-800"},null,512),[[fe,c.value.color]]),ne(l("input",{"onUpdate:modelValue":V[6]||(V[6]=z=>c.value.color=z),type:"text",pattern:"#[0-9a-fA-F]{6}",class:"flex-1 border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-100 rounded-lg px-3 py-2 text-sm font-mono"},null,512),[[fe,c.value.color]])])]),l("label",pf,[ne(l("input",{"onUpdate:modelValue":V[7]||(V[7]=z=>c.value.activo=z),type:"checkbox"},null,512),[[Rt,c.value.activo]]),V[25]||(V[25]=pe(" Activo ",-1))]),l("div",mf,[l("button",{type:"button",class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400",onClick:V[8]||(V[8]=z=>u.value=!1)},"Cancelar"),l("button",hf,R(d.value?"Guardar":"Crear"),1)])],32)])])):J("",!0)])}}},gf={key:0,class:"mb-6 mt-1 flex items-start justify-between gap-4"},bf={class:"min-w-0"},xf={class:"text-xl font-semibold text-texto"},_f={class:"text-xs text-tenue mt-1"},yf={class:"bg-elevado px-1.5 py-0.5 rounded"},wf=["href"],Cf={key:1,class:"text-sm text-red-600 dark:text-red-400 mb-4"},kf={class:"flex gap-1.5 mb-6 overflow-x-auto sin-barra pb-1"},Ef=["onClick"],Sf={key:2},Af={class:"card p-4 mb-4"},If={class:"flex gap-1 mb-3"},$f=["onClick"],Rf={class:"flex items-center justify-between"},Pf=["disabled"],Of={class:"flex items-center justify-between"},Tf=["disabled"],Df={class:"flex gap-2"},Nf={class:"flex items-center justify-between"},Mf={class:"flex items-center gap-2 text-xs text-tenue cursor-pointer"},Vf=["disabled"],jf={class:"card divide-y divide-borde"},Uf={class:"text-sm text-texto"},Lf={class:"text-xs text-tenue mt-0.5"},Ff={key:0},qf={key:1},Hf={key:2},Bf={key:3,class:"text-red-600 dark:text-red-400"},Gf={class:"flex items-center gap-3 shrink-0"},Kf=["title","onClick"],Wf=["onClick"],zf=["disabled","title","onClick"],Jf=["onClick"],Qf={class:"card w-full max-w-2xl p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},Yf={class:"flex justify-end gap-2 pt-1"},Xf=["disabled"],Zf={key:3},ep={class:"card divide-y divide-borde"},tp={class:"text-sm text-texto font-mono"},np={class:"label mt-0.5"},sp={class:"text-xs text-tenue mt-0.5"},op={key:0,class:"ml-1 text-green-600 dark:text-green-400"},rp={key:1,class:"ml-1 text-gray-400"},ip={class:"flex gap-3 text-sm shrink-0"},lp=["onClick"],ap=["onClick"],up={class:"card p-6 w-full max-w-xl max-h-[85vh] overflow-y-auto"},cp={class:"font-semibold text-texto mb-4"},dp={class:"border border-borde rounded-lg p-3 space-y-2"},fp=["onUpdate:modelValue"],pp=["onUpdate:modelValue"],mp=["onUpdate:modelValue"],hp={class:"label flex items-center gap-1"},vp=["onUpdate:modelValue"],gp=["onClick"],bp={key:0,class:"text-xs text-gray-400"},xp={class:"border border-borde rounded-lg p-3 space-y-2"},_p={class:"flex items-center gap-2 label"},yp={class:"flex items-center gap-2 text-sm text-texto"},wp={class:"flex justify-end gap-2 pt-2"},Cp={key:4},kp={class:"card p-4 mb-4"},Ep={class:"flex items-center justify-between mb-2"},Sp={class:"bg-elevado border border-borde rounded-lg p-2.5 text-xs text-texto overflow-x-auto"},Ap={class:"card divide-y divide-borde"},Ip={class:"flex items-center justify-between"},$p={class:"font-medium text-texto capitalize"},Rp={class:"flex gap-3 text-sm"},Pp=["onClick"],Op=["onClick"],Tp={class:"flex gap-4 mt-2 text-xs"},Dp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Np=["checked","onChange"],Mp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Vp=["checked","onChange"],jp={class:"flex items-center gap-1.5 text-texto cursor-pointer"},Up=["checked","onChange"],Lp={class:"label mt-1 break-all"},Fp={class:"bg-elevado px-1 rounded"},qp={key:0,class:"text-xs text-tenue mt-1"},Hp={key:1,class:"text-xs text-red-600 dark:text-red-400 mt-1"},Bp={class:"card p-6 w-full max-w-md"},Gp={key:0},Kp={class:"flex flex-col gap-2 pt-1"},Wp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},zp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Jp={class:"flex items-center gap-2 text-sm text-texto cursor-pointer"},Qp={class:"flex justify-end gap-2 pt-2"},Yp={key:5},Xp={class:"flex gap-2 mb-4"},Zp={class:"card divide-y divide-borde"},em={class:"font-medium text-texto capitalize"},tm={class:"ml-2 text-sm text-tenue"},nm=["onClick"],sm={key:6,class:"card p-4 flex flex-col h-[28rem]"},om={class:"flex-1 overflow-y-auto space-y-2 mb-3"},rm={key:0,class:"text-sm text-tenue"},im={key:1,class:"text-xs text-tenue"},lm=["disabled"],am={key:7,class:"grid grid-cols-3 gap-4"},um={class:"col-span-1 card divide-y divide-borde max-h-[28rem] overflow-y-auto"},cm=["onClick"],dm={class:"text-texto truncate"},fm={class:"text-xs text-tenue mt-0.5"},pm={class:"col-span-2 card p-4 max-h-[28rem] overflow-y-auto space-y-2"},mm={key:0,class:"text-sm text-tenue"},hm={key:8},vm={class:"card divide-y divide-borde max-h-[32rem] overflow-y-auto"},gm={class:"cursor-pointer flex items-center gap-2 text-sm"},bm={class:"text-tenue text-xs shrink-0"},xm={class:"text-texto truncate"},_m={class:"text-tenue text-xs ml-auto shrink-0"},ym={key:0,class:"mt-2 bg-elevado border border-borde rounded-lg p-2 text-xs text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap"},wm={__name:"AgenteDetail",props:{tenantId:{type:String,required:!0},agenteId:{type:String,required:!0}},setup(e){const t=e,n=we(()=>Number(t.agenteId)),s=qi(),o=G(null),r=G(""),i=G(typeof s.query.tab=="string"?s.query.tab:Ye.esPortal?"conversaciones":"conocimiento"),a=G([]),u=G(""),d=G(30),c=G(!1);async function p(){const I=await oe.get(se(`/umind/agentes?tenant_id=${t.tenantId}`));o.value=(I.items||[]).find(v=>String(v.ID)===t.agenteId)||null}async function h(){const I=await oe.get(se(`/umind/documentos?agente_id=${t.agenteId}`));a.value=I.items||[]}const _=G("texto"),N=G(!0),P=G(""),W=G(""),H=G(null);async function D(){if(u.value.trim()){c.value=!0,r.value="";try{await oe.post(se("/umind/documentos"),{agente_id:n.value,url:u.value.trim(),max_paginas:Number(d.value)||30,auto_actualizar:N.value}),u.value="",await h()}catch(I){r.value=I.message}finally{c.value=!1}}}async function B(){if(W.value.trim()){c.value=!0,r.value="";try{await oe.post(se("/umind/documentos/texto"),{agente_id:n.value,titulo:P.value.trim(),contenido:W.value}),P.value="",W.value="",await h()}catch(I){r.value=I.message}finally{c.value=!1}}}async function k(){var v,St;const I=(St=(v=H.value)==null?void 0:v.files)==null?void 0:St[0];if(I){c.value=!0,r.value="";try{const b=new FormData;b.append("agente_id",String(n.value)),b.append("archivo",I);const ke=await fetch(se("/umind/documentos/archivo"),{method:"POST",body:b}),lt=await ke.json();if(!ke.ok)throw new Error(lt.error||"No se pudo subir");H.value.value="",await h()}catch(b){r.value=b.message}finally{c.value=!1}}}const x=G(null),O=G({titulo:"",contenido:""}),U=G(!1);function L(I){x.value=I,O.value={titulo:I.origen,contenido:I.contenido||""}}async function Ae(){if(x.value){U.value=!0,r.value="";try{await oe.put(se(`/umind/documentos/${x.value.ID}`),{titulo:O.value.titulo,contenido:O.value.contenido}),x.value=null,await h()}catch(I){r.value=I.message}finally{U.value=!1}}}async function ee(I){r.value="";try{await oe.post(se(`/umind/documentos/${I.ID}/reprocesar`),{}),await h()}catch(v){r.value=v.message}}async function V(I){try{await oe.put(se(`/umind/documentos/${I.ID}`),{auto_actualizar:!I.auto_actualizar}),await h()}catch(v){r.value=v.message}}function De(I){if(!I)return"sin procesar";const v=Math.floor((Date.now()-new Date(I))/864e5);if(v<=0)return"hoy";if(v===1)return"ayer";if(v<30)return`hace ${v} días`;const St=Math.floor(v/30);return St===1?"hace un mes":`hace ${St} meses`}function z(I){return I.procesado_at?Date.now()-new Date(I.procesado_at)>60*864e5:!1}async function Ze(I){confirm("¿Eliminar esta fuente y sus fragmentos indexados?")&&(await oe.del(se(`/umind/documentos/${I}`)),await h())}const qt=we(()=>I=>({listo:"badge-ok",procesando:"badge-alerta",pendiente:"badge-neutro",error:"badge-error"})[I]||"badge-neutro"),Se=G([]),de=G([]),ue=G(null);async function ut(){const I=await oe.get(se(`/umind/sesiones?agente_id=${t.agenteId}`));Se.value=I.items||[]}async function gt(I){ue.value=I;const v=await oe.get(se(`/umind/historial?agente_id=${t.agenteId}&session_id=${I}`));de.value=v.items||[]}const Ke=G([]),Te=G(!1),nt=G(null),le=G(bt());function bt(){return{nombre:"",descripcion:"",url:"",auth_header_nombre:"",auth_header_valor:"",tocarAuth:!1,parametros:[],activa:!0}}async function qe(){const I=await oe.get(se(`/umind/tools?agente_id=${t.agenteId}`));Ke.value=I.items||[]}function S(){nt.value=null,le.value=bt(),Te.value=!0}function K(I){nt.value=I;let v=[];try{v=JSON.parse(I.parametros_json||"[]")||[]}catch{v=[]}le.value={nombre:I.nombre,descripcion:I.descripcion,url:I.url,auth_header_nombre:I.auth_header_nombre,auth_header_valor:"",tocarAuth:!1,parametros:v,activa:I.activa},Te.value=!0}function F(){le.value.parametros.push({nombre:"",tipo:"string",descripcion:"",requerido:!1})}function Y(I){le.value.parametros.splice(I,1)}async function ae(){const I={agente_id:n.value,nombre:le.value.nombre.trim(),descripcion:le.value.descripcion,url:le.value.url.trim(),auth_header_nombre:le.value.auth_header_nombre,parametros:le.value.parametros,activa:le.value.activa};le.value.tocarAuth&&(I.auth_header_valor=le.value.auth_header_valor);try{nt.value?await oe.put(se(`/umind/tools/${nt.value.ID}`),I):await oe.post(se("/umind/tools"),I),Te.value=!1,await qe()}catch(v){r.value=v.message}}async function f(I){confirm(`¿Eliminar la herramienta "${I.nombre}"?`)&&(await oe.del(se(`/umind/tools/${I.ID}`)),await qe())}const m=G([]),g=G(!1),y=G(T()),A=G(!1),E=we(()=>{const I=new Date,v=new Date(I.getFullYear(),I.getMonth(),1).toISOString().slice(0,10),St=I.toISOString().slice(0,10);return se(`/umind/reporte.xlsx?agente_id=${t.agenteId}&desde=${v}&hasta=${St}`)}),j=we(()=>{var v;const I=((v=o.value)==null?void 0:v.site_key)||"TU_SITE_KEY";return`<script src="${window.location.origin}/widget/umind.js" data-site="${I}" defer><\/script>`});async function M(){try{await navigator.clipboard.writeText(j.value),A.value=!0,setTimeout(()=>A.value=!1,2e3)}catch{r.value="No se pudo copiar automáticamente — seleccioná el texto y copialo a mano."}}function T(){return{tipo:"telegram",bot_token:"",phone_number_id:"",access_token:"",app_secret:"",verify_token:"",usar_whisper_audio:!1,usar_ocr_imagenes:!1,usar_archivos_docs:!1}}async function $(){const I=await oe.get(se(`/umind/canales?agente_id=${t.agenteId}`));m.value=I.items||[]}function X(){y.value=T(),g.value=!0}async function q(){const I=y.value.tipo==="telegram"?{bot_token:y.value.bot_token}:{phone_number_id:y.value.phone_number_id,access_token:y.value.access_token,app_secret:y.value.app_secret,verify_token:y.value.verify_token};try{await oe.post(se("/umind/canales"),{agente_id:n.value,tipo:y.value.tipo,credenciales:I,activo:!0,usar_whisper_audio:y.value.usar_whisper_audio,usar_ocr_imagenes:y.value.usar_ocr_imagenes,usar_archivos_docs:y.value.usar_archivos_docs}),g.value=!1,await $()}catch(v){r.value=v.message}}async function Q(I,v){await oe.put(se(`/umind/canales/${I.ID}`),{activo:I.activo,credenciales:{},usar_whisper_audio:I.usar_whisper_audio,usar_ocr_imagenes:I.usar_ocr_imagenes,usar_archivos_docs:I.usar_archivos_docs,...v}),await $()}const te=I=>Q(I,{activo:!I.activo}),ce=I=>Q(I,{usar_whisper_audio:!I.usar_whisper_audio}),be=I=>Q(I,{usar_ocr_imagenes:!I.usar_ocr_imagenes}),me=I=>Q(I,{usar_archivos_docs:!I.usar_archivos_docs});async function Ie(I){confirm(`¿Eliminar el canal ${I.tipo}?`)&&(await oe.del(se(`/umind/canales/${I.ID}`)),await $())}const $e=G([]);async function st(){const I=await oe.get(se(`/umind/conexiones?agente_id=${t.agenteId}`));$e.value=I.items||[]}function ot(I){window.location.href=se(`/umind/conexiones/conectar?agente_id=${n.value}&proveedor=${I}`)}async function Jt(I){confirm(`¿Desconectar la cuenta ${I.email||I.proveedor}?`)&&(await oe.del(se(`/umind/conexiones/${I.ID}`)),await st())}const Gn=`staff-preview-${Math.random().toString(36).slice(2)}`,Ne=G([]),We=G(""),Ht=G(!1);async function Kn(){const I=We.value.trim();if(!(!I||Ht.value)){We.value="",Ne.value.push({role:"user",content:I}),Ht.value=!0;try{const v=await oe.post(se("/umind/chat"),{agente_id:n.value,session_id:Gn,mensaje:I});Ne.value.push({role:"assistant",content:v.respuesta})}catch(v){Ne.value.push({role:"assistant",content:`⚠️ ${v.message}`})}finally{Ht.value=!1}}}const Ki=we(()=>Ye.esPortal?[["conversaciones","Conversaciones"],["chat","Probar"],["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["auditoria","Auditoría"]]:[["conocimiento","Base de conocimiento"],["herramientas","Herramientas"],["canales","Canales"],["conexiones","Conexiones"],["chat","Chat de prueba"],["conversaciones","Conversaciones"],["auditoria","Auditoría"]]),Wn=G([]);async function Wi(){const I=await oe.get(se(`/umind/eventos?agente_id=${t.agenteId}`));Wn.value=I.items||[]}const zi=we(()=>I=>({error:"badge-error",warn:"badge-alerta"})[I]||"badge-neutro");function Ji(I){try{return new Date(I).toLocaleString()}catch{return I}}return Mt(()=>[t.tenantId,t.agenteId],async()=>{r.value="",o.value=null,a.value=[],Se.value=[],de.value=[],ue.value=null,Ke.value=[],m.value=[],$e.value=[],Wn.value=[];try{await Promise.all([p(),h(),ut(),qe(),$(),st(),Wi()])}catch(I){r.value=I.message}},{immediate:!0}),(I,v)=>{const St=yn("router-link");return w(),C("div",null,[Ce(St,{to:`/tenants/${e.tenantId}`,class:"label hover:text-brand"},{default:ct(()=>[...v[32]||(v[32]=[pe("← Agentes",-1)])]),_:1},8,["to"]),o.value?(w(),C("div",gf,[l("div",bf,[l("h1",xf,R(o.value.nombre),1),l("p",_f,[v[33]||(v[33]=pe(" site_key: ",-1)),l("code",yf,R(o.value.site_key),1)])]),l("a",{href:E.value,class:"btn-ghost shrink-0",title:"Conversaciones y consumo del mes en Excel"}," ⬇ Reporte del mes ",8,wf)])):J("",!0),r.value?(w(),C("p",Cf,R(r.value),1)):J("",!0),l("div",kf,[(w(!0),C(ie,null,Pe(Ki.value,([b,ke])=>(w(),C("button",{key:b,class:Ee(["px-3 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors",i.value===b?"bg-brand text-white font-medium":"bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-400 border border-borde hover:border-brand/50"]),onClick:lt=>i.value=b},R(ke),11,Ef))),128))]),i.value==="conocimiento"?(w(),C("div",Sf,[l("div",Af,[l("div",If,[(w(),C(ie,null,Pe([["texto","✍️ Escribir"],["archivo","📄 Subir archivo"],["url","🌐 Sitio web"]],([b,ke])=>l("button",{key:b,class:Ee(["px-3 py-1.5 rounded-lg text-sm",_.value===b?"bg-brand text-white font-medium":"text-tenue hover:text-texto"]),onClick:lt=>_.value=b},R(ke),11,$f)),64))]),_.value==="texto"?(w(),C("form",{key:0,class:"space-y-2",onSubmit:Ve(B,["prevent"])},[ne(l("input",{"onUpdate:modelValue":v[0]||(v[0]=b=>P.value=b),placeholder:"Título (ej: Horarios y zonas de entrega)",class:"input"},null,512),[[fe,P.value]]),ne(l("textarea",{"onUpdate:modelValue":v[1]||(v[1]=b=>W.value=b),rows:"5",required:"",placeholder:"Atendemos de lunes a viernes de 9 a 18. No hacemos envíos fuera de la ciudad. La garantía es de 6 meses y cubre…",class:"input font-normal"},null,512),[[fe,W.value]]),l("div",Rf,[v[34]||(v[34]=l("p",{class:"text-xs text-tenue"},"Lo que te preguntan todos los días y no está en tu web.",-1)),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},R(c.value?"Guardando…":"Guardar"),9,Pf)])],32)):_.value==="archivo"?(w(),C("form",{key:1,class:"space-y-2",onSubmit:Ve(k,["prevent"])},[l("input",{ref_key:"archivoRef",ref:H,type:"file",accept:".pdf,.docx,.txt,.md,.csv,.html,image/*",class:"text-sm text-texto"},null,512),l("div",Of,[v[35]||(v[35]=l("p",{class:"text-xs text-tenue"},"PDF, Word, texto o una foto. Ej: tu lista de precios.",-1)),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},R(c.value?"Leyendo…":"Subir"),9,Tf)])],32)):(w(),C("form",{key:2,class:"space-y-2",onSubmit:Ve(D,["prevent"])},[l("div",Df,[ne(l("input",{"onUpdate:modelValue":v[2]||(v[2]=b=>u.value=b),type:"url",placeholder:"https://ejemplo.com",required:"",class:"input flex-1"},null,512),[[fe,u.value]]),ne(l("input",{"onUpdate:modelValue":v[3]||(v[3]=b=>d.value=b),type:"number",min:"1",max:"200",class:"input w-24",title:"Máximo de páginas a leer"},null,512),[[fe,d.value]])]),l("div",Nf,[l("label",Mf,[ne(l("input",{"onUpdate:modelValue":v[4]||(v[4]=b=>N.value=b),type:"checkbox",class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Rt,N.value]]),v[36]||(v[36]=pe(" Releer el sitio cada semana ",-1))]),l("button",{type:"submit",disabled:c.value,class:"btn-primary disabled:opacity-50"},R(c.value?"Leyendo…":"Leer sitio"),9,Vf)])],32))]),l("div",jf,[a.value.length===0?(w(),tt(Ot,{key:0,estado:"buscando",titulo:"Todavía no sabe nada de tu negocio",detalle:"Sin información cargada va a contestar que no sabe. Empezá por escribir tus horarios y lo que te preguntan todos los días — es lo más rápido y lo que más se nota."})):J("",!0),(w(!0),C(ie,null,Pe(a.value,b=>(w(),C("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("div",Uf,R(b.origen),1),l("div",Lf,[l("span",{class:Ee(["px-1.5 py-0.5 rounded",qt.value(b.estado)])},R(b.estado),3),b.tipo?(w(),C("span",Ff," · "+R({url:"sitio",archivo:"archivo",texto:"nota"}[b.tipo]||b.tipo),1)):J("",!0),b.total_chunks?(w(),C("span",qf," · "+R(b.total_chunks)+" fragmentos",1)):J("",!0),l("span",{class:Ee(z(b)?"text-amber-600 dark:text-amber-400 font-medium":"")}," · leído "+R(De(b.procesado_at)),3),b.auto_actualizar?(w(),C("span",Hf," · se actualiza sola")):J("",!0),b.error?(w(),C("span",Bf," · "+R(b.error),1)):J("",!0)])]),l("div",Gf,[b.tipo==="url"?(w(),C("button",{key:0,class:"text-xs text-tenue hover:text-texto",title:b.auto_actualizar?"Dejar de releer sola":"Releer el sitio cada semana",onClick:ke=>V(b)},R(b.auto_actualizar?"🔁 auto":"↻ manual"),9,Kf)):J("",!0),b.tipo==="texto"||b.tipo==="archivo"?(w(),C("button",{key:1,class:"text-sm text-brand hover:underline",onClick:ke=>L(b)},"Editar",8,Wf)):J("",!0),l("button",{class:"text-sm text-tenue hover:text-texto disabled:opacity-40",disabled:b.estado==="procesando",title:b.tipo==="url"?"Volver a leer el sitio":"Rehacer los fragmentos",onClick:ke=>ee(b)},"Actualizar",8,zf),l("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:ke=>Ze(b.ID)},"Eliminar",8,Jf)])]))),128))]),x.value?(w(),C("div",{key:0,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:v[8]||(v[8]=Ve(b=>x.value=null,["self"]))},[l("div",Qf,[v[40]||(v[40]=l("h2",{class:"font-semibold text-texto mb-1"},"Editar fuente",-1)),v[41]||(v[41]=l("p",{class:"text-xs text-tenue mb-4"}," Al guardar se vuelve a leer y el agente empieza a contestar con esto. ",-1)),l("form",{class:"space-y-3",onSubmit:Ve(Ae,["prevent"])},[l("div",null,[v[37]||(v[37]=l("label",{class:"label"},"Título",-1)),ne(l("input",{"onUpdate:modelValue":v[5]||(v[5]=b=>O.value.titulo=b),required:"",class:"input"},null,512),[[fe,O.value.titulo]])]),l("div",null,[v[38]||(v[38]=l("label",{class:"label"},"Contenido",-1)),ne(l("textarea",{"onUpdate:modelValue":v[6]||(v[6]=b=>O.value.contenido=b),rows:"16",required:"",class:"input font-normal leading-relaxed"},null,512),[[fe,O.value.contenido]]),v[39]||(v[39]=l("p",{class:"text-xs text-tenue mt-1.5"}," Si viene de una plantilla, reemplazá lo que está [entre corchetes] por tus datos. Lo que quede sin reemplazar el agente lo va a leer tal cual. ",-1))]),l("div",Yf,[l("button",{type:"button",class:"btn-ghost",onClick:v[7]||(v[7]=b=>x.value=null)},"Cancelar"),l("button",{type:"submit",class:"btn-primary",disabled:U.value},R(U.value?"Guardando…":"Guardar y volver a leer"),9,Xf)])],32)])])):J("",!0)])):i.value==="herramientas"?(w(),C("div",Zf,[l("div",{class:"flex justify-between items-center mb-4"},[v[42]||(v[42]=l("p",{class:"label"},"Máximo 10 herramientas activas por agente.",-1)),l("button",{class:"btn-primary",onClick:S}," + Nueva herramienta ")]),l("div",ep,[Ke.value.length===0?(w(),tt(Ot,{key:0,titulo:"Sin herramientas conectadas",detalle:"Las herramientas le dejan consultar tus sistemas mientras conversa: stock, estado de un pedido, disponibilidad de turnos. Sin ninguna, responde solo con lo que tiene cargado."})):J("",!0),(w(!0),C(ie,null,Pe(Ke.value,b=>(w(),C("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("div",tp,R(b.nombre),1),l("div",np,R(b.descripcion),1),l("div",sp,[pe(R(b.url)+" ",1),b.auth_configurado?(w(),C("span",op,"· auth configurada")):J("",!0),b.activa?J("",!0):(w(),C("span",rp,"· inactiva"))])]),l("div",ip,[l("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:ke=>K(b)},"Editar",8,lp),l("button",{class:"text-red-500 hover:text-red-700",onClick:ke=>f(b)},"Eliminar",8,ap)])]))),128))]),Te.value?(w(),C("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[17]||(v[17]=Ve(b=>Te.value=!1,["self"]))},[l("div",up,[l("h2",cp,R(nt.value?"Editar herramienta":"Nueva herramienta"),1),l("form",{class:"space-y-3",onSubmit:Ve(ae,["prevent"])},[l("div",null,[v[43]||(v[43]=l("label",{class:"label"},"Nombre (identificador, ej: consultar_stock)",-1)),ne(l("input",{"onUpdate:modelValue":v[9]||(v[9]=b=>le.value.nombre=b),required:"",pattern:"[a-z][a-z0-9_]{2,63}",class:"input font-mono"},null,512),[[fe,le.value.nombre]])]),l("div",null,[v[44]||(v[44]=l("label",{class:"label"},"Descripción (esto lo lee el modelo para decidir cuándo usarla)",-1)),ne(l("textarea",{"onUpdate:modelValue":v[10]||(v[10]=b=>le.value.descripcion=b),rows:"2",required:"",class:"input"},null,512),[[fe,le.value.descripcion]])]),l("div",null,[v[45]||(v[45]=l("label",{class:"label"},"URL del webhook (https)",-1)),ne(l("input",{"onUpdate:modelValue":v[11]||(v[11]=b=>le.value.url=b),type:"url",required:"",placeholder:"https://...",class:"input"},null,512),[[fe,le.value.url]])]),l("div",dp,[l("div",{class:"flex items-center justify-between"},[v[46]||(v[46]=l("label",{class:"label"},"Parámetros que completa el modelo",-1)),l("button",{type:"button",class:"text-xs text-brand",onClick:F},"+ agregar")]),(w(!0),C(ie,null,Pe(le.value.parametros,(b,ke)=>(w(),C("div",{key:ke,class:"flex gap-2 items-center"},[ne(l("input",{"onUpdate:modelValue":lt=>b.nombre=lt,placeholder:"nombre",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs font-mono"},null,8,fp),[[fe,b.nombre]]),ne(l("select",{"onUpdate:modelValue":lt=>b.tipo=lt,class:"border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},[...v[47]||(v[47]=[l("option",{value:"string"},"string",-1),l("option",{value:"number"},"number",-1),l("option",{value:"boolean"},"boolean",-1)])],8,pp),[[vn,b.tipo]]),ne(l("input",{"onUpdate:modelValue":lt=>b.descripcion=lt,placeholder:"descripción",class:"flex-1 border border-borde bg-white dark:bg-gray-800 text-texto rounded px-2 py-1 text-xs"},null,8,mp),[[fe,b.descripcion]]),l("label",hp,[ne(l("input",{"onUpdate:modelValue":lt=>b.requerido=lt,type:"checkbox"},null,8,vp),[[Rt,b.requerido]]),v[48]||(v[48]=pe(" req. ",-1))]),l("button",{type:"button",class:"text-red-400 text-xs",onClick:lt=>Y(ke)},"✕",8,gp)]))),128)),le.value.parametros.length===0?(w(),C("p",bp,"Sin parámetros.")):J("",!0)]),l("div",xp,[v[49]||(v[49]=l("label",{class:"label"},"Autenticación saliente (opcional)",-1)),ne(l("input",{"onUpdate:modelValue":v[12]||(v[12]=b=>le.value.auth_header_nombre=b),placeholder:"Nombre del header, ej: Authorization",class:"input"},null,512),[[fe,le.value.auth_header_nombre]]),l("label",_p,[ne(l("input",{"onUpdate:modelValue":v[13]||(v[13]=b=>le.value.tocarAuth=b),type:"checkbox"},null,512),[[Rt,le.value.tocarAuth]]),pe(" "+R(nt.value?"Cambiar el valor del secreto":"Configurar valor"),1)]),le.value.tocarAuth?ne((w(),C("input",{key:0,"onUpdate:modelValue":v[14]||(v[14]=b=>le.value.auth_header_valor=b),type:"password",placeholder:"Valor del header (ej: Bearer xxxx)",class:"input"},null,512)),[[fe,le.value.auth_header_valor]]):J("",!0)]),l("label",yp,[ne(l("input",{"onUpdate:modelValue":v[15]||(v[15]=b=>le.value.activa=b),type:"checkbox"},null,512),[[Rt,le.value.activa]]),v[50]||(v[50]=pe(" Activa ",-1))]),l("div",wp,[l("button",{type:"button",class:"btn-ghost",onClick:v[16]||(v[16]=b=>Te.value=!1)},"Cancelar"),v[51]||(v[51]=l("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):J("",!0)])):i.value==="canales"?(w(),C("div",Cp,[l("div",kp,[l("div",Ep,[v[52]||(v[52]=l("div",null,[l("span",{class:"font-medium text-texto"},"Web (widget)"),l("span",{class:"ml-2 px-1.5 py-0.5 rounded text-xs badge-ok"}," siempre activo ")],-1)),l("button",{class:Ee(["text-sm font-medium px-3 py-1.5 rounded-lg transition-colors",A.value?"bg-green-600 text-white":"bg-brand hover:bg-brand-dark text-white"]),onClick:M},R(A.value?"✓ Copiado":"Copiar código"),3)]),v[53]||(v[53]=l("p",{class:"label mb-2"},[pe(" Pegá esto antes de "),l("code",{class:"bg-elevado px-1 rounded"},"</body>"),pe(" en las páginas de tu sitio. ")],-1)),l("pre",Sp,[l("code",null,R(j.value),1)])]),l("div",{class:"flex justify-end mb-4"},[l("button",{class:"btn-primary",onClick:X}," + Nuevo canal ")]),l("div",Ap,[m.value.length===0?(w(),tt(Ot,{key:0,titulo:"No está atendiendo en ningún lado",detalle:"Conectá WhatsApp o Telegram para que empiece a responderle a tus clientes. El widget de tu web funciona aparte, con la clave de sitio de arriba."})):J("",!0),(w(!0),C(ie,null,Pe(m.value,b=>(w(),C("div",{key:b.ID,class:"p-4"},[l("div",Ip,[l("div",null,[l("span",$p,R(b.tipo),1),l("span",{class:Ee(["ml-2 px-1.5 py-0.5 rounded text-xs",b.activo?"badge-ok":"badge-neutro"])},R(b.activo?"activo":"inactivo"),3)]),l("div",Rp,[l("button",{class:"text-tenue hover:text-gray-800 dark:hover:text-gray-100",onClick:ke=>te(b)},R(b.activo?"Desactivar":"Activar"),9,Pp),l("button",{class:"text-red-500 hover:text-red-700",onClick:ke=>Ie(b)},"Eliminar",8,Op)])]),l("div",Tp,[l("label",Dp,[l("input",{type:"checkbox",checked:b.usar_whisper_audio,onChange:ke=>ce(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Np),v[54]||(v[54]=pe(" Transcribir audios (Whisper) ",-1))]),l("label",Mp,[l("input",{type:"checkbox",checked:b.usar_ocr_imagenes,onChange:ke=>be(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Vp),v[55]||(v[55]=pe(" Leer texto de imágenes (OCR) ",-1))]),l("label",jp,[l("input",{type:"checkbox",checked:b.usar_archivos_docs,onChange:ke=>me(b),class:"rounded border-borde text-brand focus:ring-brand"},null,40,Up),v[56]||(v[56]=pe(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),l("p",Lp,[v[57]||(v[57]=pe(" Webhook: ",-1)),l("code",Fp,R(b.webhook_url),1)]),b.tipo==="whatsapp"?(w(),C("p",qp,' Registrá esta URL como "Callback URL" en Meta for Developers → WhatsApp → Configuration, con el mismo verify_token que pusiste acá. ')):J("",!0),b.ultimo_error?(w(),C("p",Hp,R(b.ultimo_error),1)):J("",!0)]))),128))]),g.value?(w(),C("div",{key:0,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",onClick:v[28]||(v[28]=Ve(b=>g.value=!1,["self"]))},[l("div",Bp,[v[69]||(v[69]=l("h2",{class:"font-semibold text-texto mb-4"},"Nuevo canal",-1)),l("form",{class:"space-y-3",onSubmit:Ve(q,["prevent"])},[l("div",null,[v[59]||(v[59]=l("label",{class:"label"},"Tipo",-1)),ne(l("select",{"onUpdate:modelValue":v[18]||(v[18]=b=>y.value.tipo=b),class:"input"},[...v[58]||(v[58]=[l("option",{value:"telegram"},"Telegram",-1),l("option",{value:"whatsapp"},"WhatsApp Business",-1)])],512),[[vn,y.value.tipo]])]),y.value.tipo==="telegram"?(w(),C("div",Gp,[v[60]||(v[60]=l("label",{class:"label"},"Bot token (de @BotFather)",-1)),ne(l("input",{"onUpdate:modelValue":v[19]||(v[19]=b=>y.value.bot_token=b),type:"password",required:"",class:"input"},null,512),[[fe,y.value.bot_token]])])):(w(),C(ie,{key:1},[l("div",null,[v[61]||(v[61]=l("label",{class:"label"},"Phone Number ID",-1)),ne(l("input",{"onUpdate:modelValue":v[20]||(v[20]=b=>y.value.phone_number_id=b),required:"",class:"input"},null,512),[[fe,y.value.phone_number_id]])]),l("div",null,[v[62]||(v[62]=l("label",{class:"label"},"Access Token",-1)),ne(l("input",{"onUpdate:modelValue":v[21]||(v[21]=b=>y.value.access_token=b),type:"password",required:"",class:"input"},null,512),[[fe,y.value.access_token]])]),l("div",null,[v[63]||(v[63]=l("label",{class:"label"},"App Secret",-1)),ne(l("input",{"onUpdate:modelValue":v[22]||(v[22]=b=>y.value.app_secret=b),type:"password",required:"",class:"input"},null,512),[[fe,y.value.app_secret]])]),l("div",null,[v[64]||(v[64]=l("label",{class:"label"},"Verify Token (lo inventás vos, lo vas a usar en Meta)",-1)),ne(l("input",{"onUpdate:modelValue":v[23]||(v[23]=b=>y.value.verify_token=b),required:"",class:"input"},null,512),[[fe,y.value.verify_token]])])],64)),l("div",Kp,[l("label",Wp,[ne(l("input",{type:"checkbox","onUpdate:modelValue":v[24]||(v[24]=b=>y.value.usar_whisper_audio=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Rt,y.value.usar_whisper_audio]]),v[65]||(v[65]=pe(" Transcribir audios con Whisper ",-1))]),l("label",zp,[ne(l("input",{type:"checkbox","onUpdate:modelValue":v[25]||(v[25]=b=>y.value.usar_ocr_imagenes=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Rt,y.value.usar_ocr_imagenes]]),v[66]||(v[66]=pe(" Leer texto de imágenes con OCR ",-1))]),l("label",Jp,[ne(l("input",{type:"checkbox","onUpdate:modelValue":v[26]||(v[26]=b=>y.value.usar_archivos_docs=b),class:"rounded border-borde text-brand focus:ring-brand"},null,512),[[Rt,y.value.usar_archivos_docs]]),v[67]||(v[67]=pe(" Leer archivos adjuntos (PDF, Word, texto) ",-1))])]),l("div",Qp,[l("button",{type:"button",class:"btn-ghost",onClick:v[27]||(v[27]=b=>g.value=!1)},"Cancelar"),v[68]||(v[68]=l("button",{type:"submit",class:"btn-primary"},"Guardar",-1))])],32)])])):J("",!0)])):i.value==="conexiones"?(w(),C("div",Yp,[v[70]||(v[70]=l("p",{class:"label mb-4"}," Conectá una cuenta de correo para que este agente pueda enviar y leer correo en su nombre. Se soporta una cuenta activa a la vez. ",-1)),l("div",Xp,[l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:v[29]||(v[29]=b=>ot("google"))}," Conectar Google "),l("button",{class:"border border-borde hover:border-brand text-sm font-medium px-4 py-2 rounded-lg text-gray-700 dark:text-gray-200 transition-colors",onClick:v[30]||(v[30]=b=>ot("microsoft"))}," Conectar Outlook ")]),l("div",Zp,[$e.value.length===0?(w(),tt(Ot,{key:0,titulo:"Sin cuentas conectadas",detalle:"Conectando una cuenta de correo, el agente puede leer y responder mensajes con tu dirección."})):J("",!0),(w(!0),C(ie,null,Pe($e.value,b=>(w(),C("div",{key:b.ID,class:"p-4 flex items-center justify-between"},[l("div",null,[l("span",em,R(b.proveedor),1),l("span",tm,R(b.email),1),l("span",{class:Ee(["ml-2 px-1.5 py-0.5 rounded text-xs",b.activo?"badge-ok":"badge-neutro"])},R(b.activo?"activa":"inactiva"),3)]),l("button",{class:"text-red-500 hover:text-red-700 text-sm",onClick:ke=>Jt(b)},"Desconectar",8,nm)]))),128))])])):i.value==="chat"?(w(),C("div",sm,[l("div",om,[Ne.value.length===0?(w(),C("p",rm," Probá este agente tal cual lo va a ver un visitante — usa la misma config de IA, las mismas herramientas y la misma base de conocimiento. ")):J("",!0),(w(!0),C(ie,null,Pe(Ne.value,(b,ke)=>(w(),C("div",{key:ke,class:Ee(["max-w-[80%] px-3 py-2 rounded-lg text-sm whitespace-pre-wrap",b.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},R(b.content),3))),128)),Ht.value?(w(),C("p",im,"Pensando...")):J("",!0)]),l("form",{class:"flex gap-2",onSubmit:Ve(Kn,["prevent"])},[ne(l("input",{"onUpdate:modelValue":v[31]||(v[31]=b=>We.value=b),placeholder:"Escribí un mensaje de prueba...",class:"flex-1 input"},null,512),[[fe,We.value]]),l("button",{type:"submit",disabled:Ht.value,class:"btn-primary disabled:opacity-50 transition-colors"}," Enviar ",8,lm)],32)])):i.value==="conversaciones"?(w(),C("div",am,[l("div",um,[Se.value.length===0?(w(),tt(Ot,{key:0,titulo:"Nadie escribió todavía",detalle:"Acá vas a ver todo lo que le preguntan y qué contestó."})):J("",!0),(w(!0),C(ie,null,Pe(Se.value,b=>(w(),C("button",{key:b.session_id,class:Ee(["w-full text-left p-3 hover:bg-elevado text-sm",ue.value===b.session_id?"bg-gray-50 dark:bg-gray-800":""]),onClick:ke=>gt(b.session_id)},[l("div",dm,R(b.content),1),l("div",fm,R(b.session_id),1)],10,cm))),128))]),l("div",pm,[ue.value?J("",!0):(w(),C("p",mm,"Elegí una conversación de la izquierda.")),(w(!0),C(ie,null,Pe(de.value,b=>(w(),C("div",{key:b.ID,class:Ee(["max-w-[80%] px-3 py-2 rounded-lg text-sm",b.role==="user"?"bg-brand text-white ml-auto":"bg-elevado text-texto"])},R(b.content),3))),128))])])):(w(),C("div",hm,[v[71]||(v[71]=l("p",{class:"label mb-4"}," Errores y eventos técnicos de este agente — fallos al llamar a la IA, a una herramienta, al correo o a los canales. Últimos 100. ",-1)),l("div",vm,[Wn.value.length===0?(w(),tt(Ot,{key:0,estado:"contenta",titulo:"Ningún problema registrado",detalle:"Acá aparecen los errores: una herramienta que no responde, una fuente que no se pudo leer. Que esté vacío es buena señal."})):J("",!0),(w(!0),C(ie,null,Pe(Wn.value,b=>(w(),C("details",{key:b.ID,class:"p-3"},[l("summary",gm,[l("span",{class:Ee(["px-1.5 py-0.5 rounded text-xs shrink-0",zi.value(b.nivel)])},R(b.nivel),3),l("span",bm,R(b.origen),1),l("span",xm,R(b.mensaje),1),l("span",_m,R(Ji(b.CreatedAt)),1)]),b.detalle?(w(),C("pre",ym,R(b.detalle),1)):J("",!0)]))),128))])]))])}}},Cm={class:"flex items-start justify-between gap-4 mb-6"},km={class:"card p-4 mb-4"},Em={class:"flex flex-wrap items-end gap-3"},Sm={class:"flex gap-1 ml-auto"},Am={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},Im={key:1,class:"text-sm text-tenue"},$m={class:"grid gap-3 sm:grid-cols-3 mb-4"},Rm={class:"card p-4"},Pm={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Om={class:"card p-4"},Tm={class:"text-2xl font-semibold text-texto mt-1 tabular-nums"},Dm={class:"card p-4"},Nm={class:"text-lg font-semibold text-texto mt-1"},Mm={key:0,class:"text-[11px] text-tenue mt-0.5"},Vm={key:0,class:"card p-4 mb-4"},jm={class:"flex items-center justify-between text-sm mb-2"},Um={class:"text-tenue tabular-nums"},Lm={class:"h-2 rounded-full bg-elevado overflow-hidden"},Fm={key:0,class:"text-xs text-amber-600 dark:text-amber-400 mt-2"},qm={class:"card divide-y divide-borde mb-4"},Hm={class:"text-lg"},Bm={class:"min-w-0 flex-1"},Gm={class:"text-sm text-texto"},Km={class:"text-xs text-tenue tabular-nums"},Wm={class:"text-sm font-medium text-texto tabular-nums"},zm={key:1,class:"card p-4"},Jm={class:"flex items-end gap-1 h-28"},Qm=["title"],Ym={class:"flex justify-between text-[11px] text-tenue mt-2"},Xm={__name:"Uso",props:{id:{type:String,required:!0}},setup(e){const t=e,n=G(!0),s=G(""),o=G(null),r=new Date,i=G(new Date(r.getFullYear(),r.getMonth(),1).toISOString().slice(0,10)),a=G(r.toISOString().slice(0,10)),u={ia:{nombre:"Inteligencia artificial",icono:"🧠",color:"#8eb02f"},ocr:{nombre:"Lectura de imágenes",icono:"🖼️",color:"#2f7fb0"},whisper:{nombre:"Transcripción de audio",icono:"🎙️",color:"#b0752f"}},d=k=>u[k]||{nombre:k,icono:"•",color:"#94a3b8"};async function c(){n.value=!0,s.value="";try{o.value=await oe.get(se(`/umind/uso?tenant_id=${t.id}&desde=${i.value}&hasta=${a.value}`))}catch(k){s.value=k.message}finally{n.value=!1}}const p=we(()=>{var k,x;return((x=(k=o.value)==null?void 0:k.plan)==null?void 0:x.moneda)||"COP"}),h=we(()=>{var k;return((k=o.value)==null?void 0:k.resumen)||[]}),_=we(()=>{var k;return((k=o.value)==null?void 0:k.total_periodo)||0}),N=we(()=>{var k,x;return((x=(k=o.value)==null?void 0:k.plan)==null?void 0:x.tope_consumo_mensual)||0}),P=we(()=>N.value?Math.min(100,_.value/N.value*100):0);function W(k){return`${p.value} ${Number(k||0).toLocaleString("es-CO",{maximumFractionDigits:2})}`}function H(k){return Number(k||0).toLocaleString("es-CO",{maximumFractionDigits:0})}const D=we(()=>{var U;const k=new Map;for(const L of((U=o.value)==null?void 0:U.detalle)||[]){const Ae=String(L.CreatedAt).slice(0,10);k.set(Ae,(k.get(Ae)||0)+(L.costo||0))}const x=[...k.entries()].sort((L,Ae)=>L[0].localeCompare(Ae[0])),O=Math.max(...x.map(L=>L[1]),0);return{dias:x,max:O}});function B(k){const x=new Date,O=new Date;O.setDate(O.getDate()-k),i.value=O.toISOString().slice(0,10),a.value=x.toISOString().slice(0,10),c()}return Mt(()=>t.id,c,{immediate:!0}),(k,x)=>{var U;const O=yn("router-link");return w(),C("div",null,[l("div",Cm,[x[6]||(x[6]=l("div",null,[l("h1",{class:"text-xl font-semibold text-texto"},"Consumo"),l("p",{class:"text-sm text-tenue mt-0.5"},"Lo que usaron tus agentes y cuánto cuesta.")],-1)),Ce(O,{to:`/tenants/${e.id}`,class:"btn-ghost"},{default:ct(()=>[...x[5]||(x[5]=[pe("← Agentes",-1)])]),_:1},8,["to"])]),l("div",km,[l("div",Em,[l("div",null,[x[7]||(x[7]=l("label",{class:"label"},"Desde",-1)),ne(l("input",{"onUpdate:modelValue":x[0]||(x[0]=L=>i.value=L),type:"date",class:"input !w-auto"},null,512),[[fe,i.value]])]),l("div",null,[x[8]||(x[8]=l("label",{class:"label"},"Hasta",-1)),ne(l("input",{"onUpdate:modelValue":x[1]||(x[1]=L=>a.value=L),type:"date",class:"input !w-auto"},null,512),[[fe,a.value]])]),l("button",{class:"btn-primary",onClick:c},"Aplicar"),l("div",Sm,[l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[2]||(x[2]=L=>B(6))},"7 días"),l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[3]||(x[3]=L=>B(29))},"30 días"),l("button",{class:"btn-ghost !px-2.5 !py-1 !text-xs",onClick:x[4]||(x[4]=L=>B(89))},"90 días")])])]),s.value?(w(),C("p",Am,R(s.value),1)):J("",!0),n.value?(w(),C("p",Im,"Cargando…")):o.value?(w(),C(ie,{key:2},[l("div",$m,[l("div",Rm,[x[9]||(x[9]=l("p",{class:"text-xs text-tenue"},"Consumo del período",-1)),l("p",Pm,R(W(_.value)),1)]),l("div",Om,[x[10]||(x[10]=l("p",{class:"text-xs text-tenue"},"Pendiente de facturar",-1)),l("p",Tm,R(W(o.value.pendiente_facturar)),1),x[11]||(x[11]=l("p",{class:"text-[11px] text-tenue mt-0.5"},"Se suma a tu próxima factura.",-1))]),l("div",Dm,[x[12]||(x[12]=l("p",{class:"text-xs text-tenue"},"Plan",-1)),l("p",Nm,R(((U=o.value.plan)==null?void 0:U.nombre)||"Sin plan"),1),o.value.plan?(w(),C("p",Mm," Mensualidad "+R(W(o.value.plan.precio_mensual)),1)):J("",!0)])]),N.value?(w(),C("div",Vm,[l("div",jm,[x[13]||(x[13]=l("span",{class:"text-texto"},"Tope mensual",-1)),l("span",Um,R(W(_.value))+" / "+R(W(N.value)),1)]),l("div",Lm,[l("div",{class:Ee(["h-full rounded-full transition-all duration-500",P.value>=100?"bg-red-500":P.value>=80?"bg-amber-500":"bg-brand"]),style:nn({width:P.value+"%"})},null,6)]),P.value>=100?(w(),C("p",Fm," Superaste el tope de tu plan. El servicio sigue funcionando y el excedente se cobra en el próximo ciclo. ")):J("",!0)])):J("",!0),l("div",qm,[x[14]||(x[14]=l("div",{class:"px-4 py-3"},[l("h2",{class:"text-sm font-medium text-texto"},"Desglose")],-1)),h.value.length===0?(w(),tt(Ot,{key:0,icono:"📊",titulo:"Sin consumo en este período",detalle:"Cuando tus agentes respondan mensajes, lean imágenes o transcriban audios, vas a verlo acá."})):J("",!0),(w(!0),C(ie,null,Pe(h.value,L=>(w(),C("div",{key:L.tipo,class:"px-4 py-3 flex items-center gap-3"},[l("span",Hm,R(d(L.tipo).icono),1),l("div",Bm,[l("p",Gm,R(d(L.tipo).nombre),1),l("p",Km,R(H(L.cantidad))+" "+R(L.unidad)+" · "+R(H(L.eventos))+" usos ",1)]),l("span",Wm,R(W(L.costo)),1)]))),128))]),D.value.dias.length?(w(),C("div",zm,[x[15]||(x[15]=l("h2",{class:"text-sm font-medium text-texto mb-3"},"Por día",-1)),l("div",Jm,[(w(!0),C(ie,null,Pe(D.value.dias,([L,Ae])=>(w(),C("div",{key:L,class:"flex-1 min-w-[3px] bg-brand/70 hover:bg-brand rounded-t transition-colors",style:nn({height:D.value.max?Math.max(2,Ae/D.value.max*100)+"%":"2px"}),title:`${L}: ${W(Ae)}`},null,12,Qm))),128))]),l("div",Ym,[l("span",null,R(D.value.dias[0][0]),1),l("span",null,R(D.value.dias[D.value.dias.length-1][0]),1)])])):J("",!0)],64)):J("",!0)])}}},Zm={class:"flex items-start justify-between gap-4 mb-6"},eh={key:0,class:"text-sm text-red-600 dark:text-red-400 mb-4"},th={key:1,class:"text-sm text-tenue"},nh={key:3,class:"card divide-y divide-borde"},sh={class:"flex items-start justify-between gap-4"},oh={class:"min-w-0"},rh={class:"text-sm text-texto font-medium"},ih={class:"text-xs text-tenue mt-0.5"},lh={class:"font-mono"},ah={class:"flex items-center gap-3 shrink-0 text-sm"},uh=["disabled","onClick"],ch=["onClick"],dh=["onClick"],fh={key:4,class:"text-xs text-tenue mt-3"},ph={class:"card w-full max-w-lg p-6 max-h-[calc(100vh-2rem)] overflow-y-auto"},mh={class:"font-semibold text-texto mb-4"},hh=["value"],vh={key:0,class:"text-xs text-tenue mt-1"},gh={class:"font-mono"},bh=["placeholder"],xh={key:0},_h={class:"label"},yh={key:0,class:"text-tenue font-normal"},wh=["required"],Ch={key:1},kh={class:"flex justify-end gap-2 pt-2"},Eh=["disabled"],Sh={__name:"AiPropia",props:{id:{type:String,required:!0}},setup(e){const t=e,n=G([]),s=G(!0),o=G(""),r=G(!1),i=G(null),a=G(!1),u=G(null),d=G({}),c=[{valor:"openai",nombre:"OpenAI",modelo:"gpt-4o-mini",donde:"platform.openai.com/api-keys"},{valor:"anthropic",nombre:"Anthropic (Claude)",modelo:"claude-sonnet-4-20250514",donde:"console.anthropic.com"},{valor:"gemini",nombre:"Google Gemini",modelo:"gemini-2.0-flash",donde:"aistudio.google.com/apikey"},{valor:"groq",nombre:"Groq",modelo:"llama-3.3-70b-versatile",donde:"console.groq.com/keys"},{valor:"deepseek",nombre:"DeepSeek",modelo:"deepseek-chat",donde:"platform.deepseek.com"},{valor:"qwen",nombre:"Qwen (Alibaba)",modelo:"qwen2.5-72b-instruct",donde:"dashscope.console.aliyun.com"},{valor:"ollama",nombre:"Ollama (tu servidor)",modelo:"llama3.1",donde:""}];function p(){return{nombre:"",provider:"openai",api_key:"",base_url:"",model_name:""}}const h=G(p());function _(k){return c.find(x=>x.valor===k)||c[0]}async function N(){s.value=!0,o.value="";try{const k=await oe.get(se(`/umind/ai-propia?tenant_id=${t.id}`));n.value=k.items||[]}catch(k){o.value=k.message}finally{s.value=!1}}Mt(()=>t.id,N,{immediate:!0});function P(){i.value=null,h.value=p(),r.value=!0}function W(k){i.value=k,h.value={nombre:k.nombre,provider:k.provider,api_key:"",base_url:k.base_url||"",model_name:k.model_name||""},r.value=!0}async function H(){a.value=!0,o.value="";try{const k={tenant_id:Number(t.id),...h.value};i.value?await oe.put(se(`/umind/ai-propia/${i.value.ID}`),k):await oe.post(se("/umind/ai-propia"),k),r.value=!1,await N()}catch(k){o.value=k.message}finally{a.value=!1}}async function D(k){u.value=k.ID,d.value={...d.value,[k.ID]:null};try{const x=await oe.post(se(`/umind/ai-propia/${k.ID}/probar`),{});d.value={...d.value,[k.ID]:{ok:!0,texto:x.respuesta}}}catch(x){d.value={...d.value,[k.ID]:{ok:!1,texto:x.message}}}finally{u.value=null}}async function B(k){if(confirm(`¿Eliminar "${k.nombre}"?`)){o.value="";try{await oe.del(se(`/umind/ai-propia/${k.ID}`)),await N()}catch(x){o.value=x.message}}}return(k,x)=>{const O=yn("router-link");return w(),C("div",null,[l("div",Zm,[l("div",null,[Ce(O,{to:`/tenants/${e.id}`,class:"text-sm text-tenue hover:text-texto"},{default:ct(()=>[...x[7]||(x[7]=[pe("← Agentes",-1)])]),_:1},8,["to"]),x[8]||(x[8]=l("h1",{class:"text-xl font-semibold text-texto mt-1"},"Tu cuenta de IA",-1)),x[9]||(x[9]=l("p",{class:"text-sm text-tenue mt-1 max-w-xl"}," Podés usar tu propia cuenta de OpenAI, Claude o Gemini en vez de la nuestra. El consumo se factura directo con el proveedor y no pasa por tu plan. ",-1))]),l("button",{class:"btn-primary shrink-0",onClick:P},"+ Conectar cuenta")]),o.value?(w(),C("p",eh,R(o.value),1)):J("",!0),s.value?(w(),C("div",th,"Cargando…")):n.value.length===0?(w(),tt(Ot,{key:2,class:"card",titulo:"Estás usando la IA de uMind",detalle:"Funciona sin que hagas nada. Conectá tu propia cuenta solo si querés facturar el consumo por tu lado o usar un modelo puntual."},{default:ct(()=>[l("button",{class:"btn-primary",onClick:P},"Conectar mi cuenta")]),_:1})):(w(),C("div",nh,[(w(!0),C(ie,null,Pe(n.value,U=>(w(),C("div",{key:U.ID,class:"p-4"},[l("div",sh,[l("div",oh,[l("div",rh,R(U.nombre),1),l("div",ih,[pe(R(_(U.provider).nombre)+" · "+R(U.model_name)+" · ",1),l("span",lh,R(U.api_key_pista),1)]),d.value[U.ID]?(w(),C("p",{key:0,class:Ee(["text-xs mt-1.5",d.value[U.ID].ok?"text-brand":"text-red-600 dark:text-red-400"])},R(d.value[U.ID].ok?`Responde bien — dijo "${d.value[U.ID].texto}"`:d.value[U.ID].texto),3)):J("",!0)]),l("div",ah,[l("button",{class:"text-brand hover:underline disabled:opacity-40",disabled:u.value===U.ID,onClick:L=>D(U)},R(u.value===U.ID?"Probando…":"Probar"),9,uh),l("button",{class:"text-tenue hover:text-texto",onClick:L=>W(U)},"Editar",8,ch),l("button",{class:"text-red-500 hover:text-red-700",onClick:L=>B(U)},"Eliminar",8,dh)])])]))),128))])),n.value.length?(w(),C("p",fh,[...x[10]||(x[10]=[pe(" Para que un agente la use, elegila en su campo ",-1),l("strong",null,"Config de IA",-1),pe(". ",-1)])])):J("",!0),r.value?(w(),C("div",{key:5,class:"fixed inset-0 bg-black/40 flex items-center justify-center p-4 z-50",onClick:x[6]||(x[6]=Ve(U=>r.value=!1,["self"]))},[l("div",ph,[l("h2",mh,R(i.value?"Editar cuenta de IA":"Conectar tu cuenta de IA"),1),l("form",{class:"space-y-3",onSubmit:Ve(H,["prevent"])},[l("div",null,[x[11]||(x[11]=l("label",{class:"label"},"Nombre",-1)),ne(l("input",{"onUpdate:modelValue":x[0]||(x[0]=U=>h.value.nombre=U),required:"",placeholder:"ej: Mi cuenta de OpenAI",class:"input"},null,512),[[fe,h.value.nombre]])]),l("div",null,[x[13]||(x[13]=l("label",{class:"label"},"Proveedor",-1)),ne(l("select",{"onUpdate:modelValue":x[1]||(x[1]=U=>h.value.provider=U),class:"input"},[(w(),C(ie,null,Pe(c,U=>l("option",{key:U.valor,value:U.valor},R(U.nombre),9,hh)),64))],512),[[vn,h.value.provider]]),_(h.value.provider).donde?(w(),C("p",vh,[x[12]||(x[12]=pe(" La clave se saca de ",-1)),l("span",gh,R(_(h.value.provider).donde),1)])):J("",!0)]),l("div",null,[x[14]||(x[14]=l("label",{class:"label"},"Modelo",-1)),ne(l("input",{"onUpdate:modelValue":x[2]||(x[2]=U=>h.value.model_name=U),required:"",placeholder:`ej: ${_(h.value.provider).modelo}`,class:"input font-mono"},null,8,bh),[[fe,h.value.model_name]])]),h.value.provider!=="ollama"?(w(),C("div",xh,[l("label",_h,[x[15]||(x[15]=pe(" Clave de API ",-1)),i.value?(w(),C("span",yh,"— dejala vacía para no cambiarla")):J("",!0)]),ne(l("input",{"onUpdate:modelValue":x[3]||(x[3]=U=>h.value.api_key=U),type:"password",autocomplete:"new-password",required:!i.value,placeholder:"sk-...",class:"input font-mono"},null,8,wh),[[fe,h.value.api_key]]),x[16]||(x[16]=l("p",{class:"text-xs text-tenue mt-1"},"Se guarda cifrada y no se vuelve a mostrar.",-1))])):J("",!0),h.value.provider==="ollama"?(w(),C("div",Ch,[x[17]||(x[17]=l("label",{class:"label"},"URL de tu servidor",-1)),ne(l("input",{"onUpdate:modelValue":x[4]||(x[4]=U=>h.value.base_url=U),required:"",placeholder:"https://ollama.tudominio.com/v1",class:"input font-mono"},null,512),[[fe,h.value.base_url]])])):J("",!0),l("div",kh,[l("button",{type:"button",class:"btn-ghost",onClick:x[5]||(x[5]=U=>r.value=!1)},"Cancelar"),l("button",{type:"submit",class:"btn-primary",disabled:a.value},R(a.value?"Guardando…":"Guardar"),9,Eh)])],32)])])):J("",!0)])}}},Ah=Ec({history:sc(Ye.baseRuta),routes:[{path:"/",name:"home",component:bd},{path:"/tenants/:id",name:"tenant-agentes",component:vf,props:!0},{path:"/tenants/:id/uso",name:"uso",component:Xm,props:!0},{path:"/tenants/:id/ia",name:"ai-propia",component:Sh,props:!0},{path:"/tenants/:tenantId/agentes/:agenteId",name:"agente-detail",component:wm,props:!0}]});gu(td).use(Ah).mount("#app");