Files
soft_usite/public/orchestrator/assets/index-CRnmvnlL.js
T
Lizandro GuarnizoandClaude Opus 5 5086087e1b feat(umind): duplicar un agente para usarlo como plantilla del siguiente
El catálogo de rubros da un arranque genérico, pero el mejor punto de partida
para el segundo restaurante es el primero — el que ya tiene el conocimiento
real, el tono ajustado y las herramientas andando. Ahora se puede copiar: se
lleva conocimiento, tono, bienvenida, color, config de IA y herramientas.

Tres cosas no se copian, y es a propósito:

Los canales. Llevan las credenciales de una cuenta concreta de WhatsApp o
Telegram; copiarlas haría que dos agentes contesten por el mismo número.

Las claves de las herramientas. Son secretos de un tercero, atados a una
cuenta. La copia llega sin ellas y, si la herramienta las necesitaba, llega
desactivada — para que la falta se note al configurarla y no cuando un cliente
recibe un error.

La site_key. Es la identidad pública del widget y tiene índice único:
compartirla sería servir dos agentes distintos bajo el mismo nombre.

El conocimiento se rehace desde cero en vez de copiar los vectores. Es más
lento, pero los chunks viejos pueden venir de otro modelo de embeddings, y
mezclar vectores de modelos distintos rompe la comparación por similitud —
la búsqueda devolvería cualquier cosa.

Permisos: se verifica el acceso al agente de origen y también al tenant
destino. Copiar es crear, y crear en un tenant ajeno tampoco corresponde.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 18:28:15 -05:00

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