Files
xiaozhi-esp32-server/manager/static/webui/assets/index-DF7ROAy9.js
T

48 lines
145 KiB
JavaScript
Raw Normal View History

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();/**
* @vue/shared v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function lr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ee={},$t=[],et=()=>{},kl=()=>!1,ss=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cr=e=>e.startsWith("onUpdate:"),ve=Object.assign,ar=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Fl=Object.prototype.hasOwnProperty,G=(e,t)=>Fl.call(e,t),j=Array.isArray,qt=e=>Tn(e)==="[object Map]",rs=e=>Tn(e)==="[object Set]",Mr=e=>Tn(e)==="[object Date]",q=e=>typeof e=="function",fe=e=>typeof e=="string",tt=e=>typeof e=="symbol",re=e=>e!==null&&typeof e=="object",Vo=e=>(re(e)||q(e))&&q(e.then)&&q(e.catch),Ko=Object.prototype.toString,Tn=e=>Ko.call(e),jl=e=>Tn(e).slice(8,-1),zo=e=>Tn(e)==="[object Object]",ur=e=>fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,fn=lr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),os=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Hl=/-(\w)/g,ke=os(e=>e.replace(Hl,(t,n)=>n?n.toUpperCase():"")),$l=/\B([A-Z])/g,Lt=os(e=>e.replace($l,"-$1").toLowerCase()),is=os(e=>e.charAt(0).toUpperCase()+e.slice(1)),Rs=os(e=>e?`on${is(e)}`:""),bt=(e,t)=>!Object.is(e,t),kn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Wo=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Kn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Lr;const ls=()=>Lr||(Lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function fr(e){if(j(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=fe(s)?zl(s):fr(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(fe(e)||re(e))return e}const ql=/;(?![^(]*\))/g,Vl=/:([^]+)/,Kl=/\/\*[^]*?\*\//g;function zl(e){const t={};return e.replace(Kl,"").split(ql).forEach(n=>{if(n){const s=n.split(Vl);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Qt(e){let t="";if(fe(e))t=e;else if(j(e))for(let n=0;n<e.length;n++){const s=Qt(e[n]);s&&(t+=s+" ")}else if(re(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Wl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ql=lr(Wl);function Qo(e){return!!e||e===""}function Jl(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=cs(e[s],t[s]);return n}function cs(e,t){if(e===t)return!0;let n=Mr(e),s=Mr(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=tt(e),s=tt(t),n||s)return e===t;if(n=j(e),s=j(t),n||s)return n&&s?Jl(e,t):!1;if(n=re(e),s=re(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,o=Object.keys(t).length;if(r!==o)return!1;for(const i in e){const l=e.hasOwnProperty(i),c=t.hasOwnProperty(i);if(l&&!c||!l&&c||!cs(e[i],t[i]))return!1}}return String(e)===String(t)}function Gl(e,t){return e.findIndex(n=>cs(n,t))}const Jo=e=>!!(e&&e.__v_isRef===!0),pe=e=>fe(e)?e:e==null?"":j(e)||re(e)&&(e.toString===Ko||!q(e.toString))?Jo(e)?pe(e.value):JSON.stringify(e,Go,2):String(e),Go=(e,t)=>Jo(t)?Go(e,t.value):qt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[As(s,o)+" =>"]=r,n),{})}:rs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>As(n))}:tt(t)?As(t):re(t)&&!j(t)&&!zo(t)?String(t):t,As=(e,t="")=>{var n;return tt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Pe;class Xl{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Pe,!t&&Pe&&(this.index=(Pe.scopes||(Pe.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[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)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Pe;try{return Pe=this,t()}finally{Pe=n}}}on(){Pe=this}off(){Pe=this.parent}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){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Yl(){return Pe}let se;const xs=new WeakSet;class Xo{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,Pe&&Pe.active&&Pe.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,xs.has(this)&&(xs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Zo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Dr(this),ei(this);const t=se,n=je;se=this,je=!0;try{return this.fn()}finally{ti(this),se=t,je=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)hr(t);this.deps=this.depsTail=void 0,Dr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?xs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Hs(this)&&this.run()}get dirty(){return Hs(this)}}let Yo=0,dn,pn;function Zo(e,t=!1){if(e.flags|=8,t){e.next=pn,pn=e;return}e.next=dn,dn=e}function dr(){Yo++}function pr(){if(--Yo>0)return;if(pn){let t=pn;for(pn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;dn;){let t=dn;for(dn=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 ei(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ti(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),hr(s),Zl(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Hs(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ni(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ni(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===_n))return;e.globalVersion=_n;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Hs(e)){e.flags&=-3;return}const n=se,s=je;se=e,je=!0;try{ei(e);const r=e.fn(e._value);(t.version===0||bt(r,e._value))&&(e._value=r,t.version++)}catch(r){throw t.version++,r}finally{se=n,je=s,ti(e),e.flags&=-3}}function hr(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)hr(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Zl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let je=!0;const si=[];function _t(){si.push(je),je=!1}function wt(){const e=si.pop();je=e===void 0?!0:e}function Dr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=se;se=void 0;try{t()}finally{se=n}}}let _n=0;class ec{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 mr{constructor(t){this.computed=t,this.versi
* @vue/runtime-core v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Cn(e,t,n,s){try{return s?e(...s):e()}catch(r){fs(r,t,n)}}function nt(e,t,n,s){if(q(e)){const r=Cn(e,t,n,s);return r&&Vo(r)&&r.catch(o=>{fs(o,t,n)}),r}if(j(e)){const r=[];for(let o=0;o<e.length;o++)r.push(nt(e[o],t,n,s));return r}}function fs(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ee;if(t){let l=t.parent;const c=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,c,a)===!1)return}l=l.parent}if(o){_t(),Cn(o,null,10,[e,c,a]),wt();return}}Ac(e,n,r,s,i)}function Ac(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const Se=[];let Ye=-1;const Kt=[];let mt=null,Ft=0;const mi=Promise.resolve();let Wn=null;function vr(e){const t=Wn||mi;return e?t.then(this?e.bind(this):e):t}function xc(e){let t=Ye+1,n=Se.length;for(;t<n;){const s=t+n>>>1,r=Se[s],o=Sn(r);o<e||o===e&&r.flags&2?t=s+1:n=s}return t}function _r(e){if(!(e.flags&1)){const t=Sn(e),n=Se[Se.length-1];!n||!(e.flags&2)&&t>=Sn(n)?Se.push(e):Se.splice(xc(t),0,e),e.flags|=1,gi()}}function gi(){Wn||(Wn=mi.then(bi))}function Oc(e){j(e)?Kt.push(...e):mt&&e.id===-1?mt.splice(Ft+1,0,e):e.flags&1||(Kt.push(e),e.flags|=1),gi()}function Br(e,t,n=Ye+1){for(;n<Se.length;n++){const s=Se[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Se.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function yi(e){if(Kt.length){const t=[...new Set(Kt)].sort((n,s)=>Sn(n)-Sn(s));if(Kt.length=0,mt){mt.push(...t);return}for(mt=t,Ft=0;Ft<mt.length;Ft++){const n=mt[Ft];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}mt=null,Ft=0}}const Sn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function bi(e){try{for(Ye=0;Ye<Se.length;Ye++){const t=Se[Ye];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Cn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ye<Se.length;Ye++){const t=Se[Ye];t&&(t.flags&=-2)}Ye=-1,Se.length=0,yi(),Wn=null,(Se.length||Kt.length)&&bi()}}let Ie=null,vi=null;function Qn(e){const t=Ie;return Ie=e,vi=e&&e.type.__scopeId||null,t}function Jt(e,t=Ie,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Wr(-1);const o=Qn(t);let i;try{i=e(...r)}finally{Qn(o),s._d&&Wr(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function De(e,t){if(Ie===null)return e;const n=ms(Ie),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[o,i,l,c=ee]=t[r];o&&(q(o)&&(o={mounted:o,updated:o}),o.deep&&ct(i),s.push({dir:o,instance:n,value:i,oldValue:void 0,arg:l,modifiers:c}))}return e}function Et(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;i<r.length;i++){const l=r[i];o&&(l.oldValue=o[i].value);let c=l.dir[s];c&&(_t(),nt(c,n,8,[e.el,l,e,t]),wt())}}const Tc=Symbol("_vte"),Cc=e=>e.__isTeleport;function wr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,wr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function _i(e,t){return q(e)?ve({name:e.name},t,{setup:e}):e}function wi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Jn(e,t,n,s,r=!1){if(j(e)){e.forEach((w,v)=>Jn(w,t&&(j(t)?t[v]:t),n,s,r));return}if(hn(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Jn(e,t,n,s.component.subTree);return}const o=s.shapeFlag&4?ms(s.component):s.el,i=r?null:o,{i:l,r:c}=e,a=t&&t.r,u=l.refs===ee?l.refs={}:l.refs,f=l.setupState,h=J(f),g=f===ee?()=>!1:w=>G(h,w);if(a!=null&&a!==c&&(fe(a)?(u[a]=null,g(a)&&(f[a]=null)):be(a)&&(a.value=null)),q(c))Cn(c,l,12,[i,u]);else{const w=fe(c),v=be(c);if(w||v){const y=()=>{if(e.f){const b=w?g(c)?f[c]:u[c]:c.value;r?j(b)&&ar(b,o):j(b)?b.includes(o)||b.push(o):w?(u[c]=[o],g(c)&&(f[c]=u[c])):(c.value=[o],e.k&&(u[e.k]=c.value))}else w?(u[c]=i,g(c)&&(f[c]=i)):v&&(c.value=i,e.k&&(u[e.k]=i))};i?(y.id=-1,Ce(y,n)):y()}}}ls().requestIdleCallback;ls().cancelIdleCallback;const hn=e=>!!e.type.__asyncLoader,Si=e=>e.type.__isKeepAlive;function Pc(e,t){Ei(e,"a",t)}function Ic(e,t){Ei(e,"da",t)}function Ei(e,t,n=ge){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e(
* @vue/runtime-dom v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Xs;const Xr=typeof window<"u"&&window.trustedTypes;if(Xr)try{Xs=Xr.createPolicy("vue",{createHTML:e=>e})}catch{}const Ji=Xs?e=>Xs.createHTML(e):e=>e,Na="http://www.w3.org/2000/svg",Ma="http://www.w3.org/1998/Math/MathML",it=typeof document<"u"?document:null,Yr=it&&it.createElement("template"),La={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 r=t==="svg"?it.createElementNS(Na,e):t==="mathml"?it.createElementNS(Ma,e):n?it.createElement(e,{is:n}):it.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>it.createTextNode(e),createComment:e=>it.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>it.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{Yr.innerHTML=Ji(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Yr.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Da=Symbol("_vtc");function Ua(e,t,n){const s=e[Da];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Zr=Symbol("_vod"),Ba=Symbol("_vsh"),ka=Symbol(""),Fa=/(^|;)\s*display\s*:/;function ja(e,t,n){const s=e.style,r=fe(n);let o=!1;if(n&&!r){if(t)if(fe(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Hn(s,l,"")}else for(const i in t)n[i]==null&&Hn(s,i,"");for(const i in n)i==="display"&&(o=!0),Hn(s,i,n[i])}else if(r){if(t!==n){const i=s[ka];i&&(n+=";"+i),s.cssText=n,o=Fa.test(n)}}else t&&e.removeAttribute("style");Zr in e&&(e[Zr]=o?s.display:"",e[Ba]&&(s.display="none"))}const eo=/\s*!important$/;function Hn(e,t,n){if(j(n))n.forEach(s=>Hn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ha(e,t);eo.test(n)?e.setProperty(Lt(s),n.replace(eo,""),"important"):e[s]=n}}const to=["Webkit","Moz","ms"],Ns={};function Ha(e,t){const n=Ns[t];if(n)return n;let s=ke(t);if(s!=="filter"&&s in e)return Ns[t]=s;s=is(s);for(let r=0;r<to.length;r++){const o=to[r]+s;if(o in e)return Ns[t]=o}return t}const no="http://www.w3.org/1999/xlink";function so(e,t,n,s,r,o=Ql(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(no,t.slice(6,t.length)):e.setAttributeNS(no,t,n):n==null||o&&!Qo(n)?e.removeAttribute(t):e.setAttribute(t,o?"":tt(n)?String(n):n)}function ro(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ji(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Qo(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(r||t)}function xt(e,t,n,s){e.addEventListener(t,n,s)}function $a(e,t,n,s){e.removeEventListener(t,n,s)}const oo=Symbol("_vei");function qa(e,t,n,s,r=null){const o=e[oo]||(e[oo]={}),i=o[t];if(s&&i)i.value=s;else{const[l,c]=Va(t);if(s){const a=o[t]=Wa(s,r);xt(e,l,a,c)}else i&&($a(e,l,i,c),o[t]=void 0)}}const io=/(?:Once|Passive|Capture)$/;function Va(e){let t;if(io.test(e)){t={};let s;for(;s=e.match(io);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Lt(e.slice(2)),t]}let Ms=0;const Ka=Promise.resolve(),za=()=>Ms||(Ka.then(()=>Ms=0),Ms=Date.now());function Wa(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;nt(Qa(s,n.value),t,5,[s])};return n.value=e,n.attached=za(),n}function Qa(e,t){if(j(t)){const
* vue-router v4.5.0
* (c) 2024 Eduardo San Martin Morote
* @license MIT
*/const Ht=typeof document<"u";function Xi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ou(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Xi(e.default)}const Q=Object.assign;function Ls(e,t){const n={};for(const s in t){const r=t[s];n[s]=$e(r)?r.map(e):e(r)}return n}const bn=()=>{},$e=Array.isArray,Yi=/#/g,iu=/&/g,lu=/\//g,cu=/=/g,au=/\?/g,Zi=/\+/g,uu=/%5B/g,fu=/%5D/g,el=/%5E/g,du=/%60/g,tl=/%7B/g,pu=/%7C/g,nl=/%7D/g,hu=/%20/g;function Ar(e){return encodeURI(""+e).replace(pu,"|").replace(uu,"[").replace(fu,"]")}function mu(e){return Ar(e).replace(tl,"{").replace(nl,"}").replace(el,"^")}function Ys(e){return Ar(e).replace(Zi,"%2B").replace(hu,"+").replace(Yi,"%23").replace(iu,"%26").replace(du,"`").replace(tl,"{").replace(nl,"}").replace(el,"^")}function gu(e){return Ys(e).replace(cu,"%3D")}function yu(e){return Ar(e).replace(Yi,"%23").replace(au,"%3F")}function bu(e){return e==null?"":yu(e).replace(lu,"%2F")}function An(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const vu=/\/$/,_u=e=>e.replace(vu,"");function Ds(e,t,n="/"){let s,r={},o="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return l<c&&l>=0&&(c=-1),c>-1&&(s=t.slice(0,c),o=t.slice(c+1,l>-1?l:t.length),r=e(o)),l>-1&&(s=s||t.slice(0,l),i=t.slice(l,t.length)),s=Ru(s??t,n),{fullPath:s+(o&&"?")+o+i,path:s,query:r,hash:An(i)}}function wu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function fo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Su(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&Yt(t.matched[s],n.matched[r])&&sl(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Yt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function sl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Eu(e[n],t[n]))return!1;return!0}function Eu(e,t){return $e(e)?po(e,t):$e(t)?po(t,e):e===t}function po(e,t){return $e(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Ru(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,i,l;for(i=0;i<s.length;i++)if(l=s[i],l!==".")if(l==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(i).join("/")}const ht={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var xn;(function(e){e.pop="pop",e.push="push"})(xn||(xn={}));var vn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(vn||(vn={}));function Au(e){if(!e)if(Ht){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),_u(e)}const xu=/^[^#]+#/;function Ou(e,t){return e.replace(xu,"#")+t}function Tu(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 gs=()=>({left:window.scrollX,top:window.scrollY});function Cu(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Tu(r,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 ho(e,t){return(history.state?history.state.position-t:-1)+e}const Zs=new Map;function Pu(e,t){Zs.set(e,t)}function Iu(e){const t=Zs.get(e);return Zs.delete(e),t}let Nu=()=>location.protocol+"//"+location.host;function rl(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let l=r.includes(e.slice(o))?e.slice(o).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),fo(c,"")}return fo(n,e)+s+r}function Mu(e,t,n,s){let r=[],o=[],i=null;const l=({state:h})=>{const g=rl(e,location),w=n.value,v=t.value;let y=0;if(h){if(n.value=g,t.value=h,i&&i===w){i=null;return}y=v?h.position-
`).forEach(function(i){r=i.indexOf(":"),n=i.substring(0,r).trim().toLowerCase(),s=i.substring(r+1).trim(),!(!n||t[n]&&vd[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},Lo=Symbol("internals");function an(e){return e&&String(e).trim().toLowerCase()}function qn(e){return e===!1||e==null?e:_.isArray(e)?e.map(qn):String(e)}function wd(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Sd=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ks(e,t,n,s,r){if(_.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!_.isString(t)){if(_.isString(s))return t.indexOf(s)!==-1;if(_.isRegExp(s))return s.test(t)}}function Ed(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Rd(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,i){return this[s].call(this,t,r,o,i)},configurable:!0})})}let xe=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(l,c,a){const u=an(c);if(!u)throw new Error("header name must be a non-empty string");const f=_.findKey(r,u);(!f||r[f]===void 0||a===!0||a===void 0&&r[f]!==!1)&&(r[f||c]=qn(l))}const i=(l,c)=>_.forEach(l,(a,u)=>o(a,u,c));if(_.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(_.isString(t)&&(t=t.trim())&&!Sd(t))i(_d(t),n);else if(_.isHeaders(t))for(const[l,c]of t.entries())o(c,l,s);else t!=null&&o(n,t,s);return this}get(t,n){if(t=an(t),t){const s=_.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return wd(r);if(_.isFunction(n))return n.call(this,r,s);if(_.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=an(t),t){const s=_.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||ks(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(i){if(i=an(i),i){const l=_.findKey(s,i);l&&(!n||ks(s,s[l],l,n))&&(delete s[l],r=!0)}}return _.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||ks(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return _.forEach(this,(r,o)=>{const i=_.findKey(s,o);if(i){n[i]=qn(r),delete n[o];return}const l=t?Ed(o):String(o).trim();l!==o&&delete n[o],n[l]=qn(r),s[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&_.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[Lo]=this[Lo]={accessors:{}}).accessors,r=this.prototype;function o(i){const l=an(i);s[l]||(Rd(r,i),s[l]=!0)}return _.isArray(t)?t.forEach(o):o(t),this}};xe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(xe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});_.freezeMethods(xe);function Fs(e,t){const n=this||Nn,s=t||n,r=xe.from(s.headers);let o=s.data;return _.forEach(e,function(l){o=l.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Al(e){return!!(e&&e.__CANCEL__)}function nn(e,t,n){V.call(this,e??"canceled",V.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(nn,V,{__CANCEL__:!0});function xl(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new V("Request failed with status code "+n.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ad(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xd(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const a=Date.now(),u=s[o];i||(i=a),n[r]=c,s[r]=a;let f=o,h=0;for(;f!==r;)h+=n[f++],f=f%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),a-i<t)return;const g=u&&a-u;return g?Math.round(h*1e3/g):void 0}}function Od(e,t){let n=0,s=1e3/t,r,o;const i=(a,u=Date.now())=>{n=u,r=null,o&&(clearTimeout(o),o=null),e.apply(null,a)};return[(...a)=>{const u=Date.now(),f=u-n;f>=s?i(a,u):(r=a,o||(o=setTimeout(()=>{o=null,i(r)},s-f)))},()=>r&&i(r)]}const ts=(e,t,n=3)=>{let s=0;const r=xd(50,250);return Od(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,c=i-s,a=r(c),u=i<=l;s=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:a||void 0,estimated:a&&l&&u?(l-i)/a:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},Do=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Uo=e=>(...t)=>_.asap(()=>e(...t)),Td=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Cd=ye.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];_.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),_.isString(s)&&i.push("path="+s),_.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pd(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Id(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ol(e,t){return e&&!Pd(t)?Id(e,t):t}const Bo=e=>e instanceof xe?{...e}:e;function Mt(e,t){t=t||{};const n={};function s(a,u,f,h){return _.isPlainObject(a)&&_.isPlainObject(u)?_.merge.call({caseless:h},a,u):_.isPlainObject(u)?_.merge({},u):_.isArray(u)?u.slice():u}function r(a,u,f,h){if(_.isUndefined(u)){if(!_.isUndefined(a))return s(void 0,a,f,h)}else return s(a,u,f,h)}function o(a,u){if(!_.isUndefined(u))return s(void 0,u)}function i(a,u){if(_.isUndefined(u)){if(!_.isUndefined(a))return s(void 0,a)}else return s(void 0,u)}function l(a,u,f){if(f in t)return s(a,u);if(f in e)return s(void 0,a)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(a,u,f)=>r(
`+o.map(jo).join(`
`):" "+jo(o[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:or};function js(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nn(null,e)}function Ho(e){return js(e),e.headers=xe.from(e.headers),e.data=Fs.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Il.getAdapter(e.adapter||Nn.adapter)(e).then(function(s){return js(e),s.data=Fs.call(e,e.transformResponse,s),s.headers=xe.from(s.headers),s},function(s){return Al(s)||(js(e),s&&s.response&&(s.response.data=Fs.call(e,e.transformResponse,s.response),s.response.headers=xe.from(s.response.headers))),Promise.reject(s)})}const Nl="1.7.9",Es={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Es[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const $o={};Es.transitional=function(t,n,s){function r(o,i){return"[Axios v"+Nl+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,l)=>{if(t===!1)throw new V(r(i," has been removed"+(n?" in "+n:"")),V.ERR_DEPRECATED);return n&&!$o[i]&&($o[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,l):!0}};Es.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Vd(e,t,n){if(typeof e!="object")throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const l=e[o],c=l===void 0||i(l,o,e);if(c!==!0)throw new V("option "+o+" must be "+c,V.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new V("Unknown option "+o,V.ERR_BAD_OPTION)}}const Vn={assertOptions:Vd,validators:Es},Xe=Vn.validators;let Pt=class{constructor(t){this.defaults=t,this.interceptors={request:new Mo,response:new Mo}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Mt(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&Vn.assertOptions(s,{silentJSONParsing:Xe.transitional(Xe.boolean),forcedJSONParsing:Xe.transitional(Xe.boolean),clarifyTimeoutError:Xe.transitional(Xe.boolean)},!1),r!=null&&(_.isFunction(r)?n.paramsSerializer={serialize:r}:Vn.assertOptions(r,{encode:Xe.function,serialize:Xe.function},!0)),Vn.assertOptions(n,{baseUrl:Xe.spelling("baseURL"),withXsrfToken:Xe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&_.merge(o.common,o[n.method]);o&&_.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=xe.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const a=[];this.interceptors.response.forEach(function(v){a.push(v.fulfilled,v.rejected)});let u,f=0,h;if(!c){const w=[Ho.bind(this),void 0];for(w.unshift.apply(w,l),w.push.apply(w,a),h=w.length,u=Promise.resolve(n);f<h;)u=u.then(w[f++],w[f++]);return u}h=l.length;let g=n;for(f=0;f<h;){const w=l[f++],v=l[f++];try{g=w(g)}catch(y){v.call(this,y);break}}try{u=Ho.call(this,g)}catch(w){return Promise.reject(w)}for(f=0,h=a.length;f<h;)u=u.then(a[f++],a[f++]);return u}getUri(t){t=Mt(this.defaults,t);const n=Ol(t.baseURL,t.url);return Sl(n,t.params,t.paramsSerializer)}};_.forEach(["delete","get","head","options"],function(t){Pt.prototype[t]=function(n,s){return this.request(Mt(s||{},{method:t,url:n,data:(s||{}).data}))}});_.forEach(["post","put","patch"],function(t){function n(s){return function(o,i,l){return this.request(Mt(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Pt.prototype[t]=n(),Pt.prototype[t+"Form"]=n(!0)});let Kd=class Ml{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new nn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ml(function(r){t=r}),cancel:t}}};function zd(e){return function(n){return e.apply(null,n)}}function Wd(e){return _.isObject(e)&&e.isAxiosError===!0}const ir={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505
警告:删除后设备所有配置将不可恢复!`)&&r("delete")},i=()=>{n.deviceId&&n.deviceConfig&&localStorage.setItem(`deviceConfig_${n.deviceId}`,JSON.stringify({selected_module:n.selectedModules,prompt:n.deviceConfig.prompt||"",nickname:n.deviceConfig.nickname||"小智"})),r("configure")};return(l,c)=>{var a,u;return oe(),ce("div",rp,[E("div",op,[E("h2",ip,[ae(pe(e.deviceId)+" ",1),E("span",lp,"["+pe(e.deviceNote||"备注")+"]",1)])]),E("div",cp,[E("p",ap,"设备型号"+pe(e.deviceType),1),E("p",up,"角色昵称"+pe(s.value),1),E("p",fp,[c[2]||(c[2]=ae(" 当前模型 ")),E("span",dp,"LLM: "+pe(((a=e.selectedModules)==null?void 0:a.LLM)||"-"),1),E("span",pp,"TTS: "+pe(((u=e.selectedModules)==null?void 0:u.TTS)||"-"),1)]),E("p",hp,"最近对话"+pe(e.lastActivity),1)]),E("div",mp,[E("button",{class:"action-btn primary",onClick:i},"配置角色"),E("button",{class:"action-btn",onClick:c[0]||(c[0]=f=>l.$emit("voiceprint"))},"声纹识别"),E("button",{class:"action-btn",onClick:c[1]||(c[1]=f=>l.$emit("history"))},"历史对话"),E("div",{class:"delete-container"},[E("button",{class:"action-btn danger",onClick:o},c[3]||(c[3]=[E("i",{class:"icon-delete"},null,-1),ae(" 删除设备 ")])),c[4]||(c[4]=E("div",{class:"delete-warning"},"删除后设备配置将不可恢复",-1))])])])}}},yp=ft(gp,[["__scopeId","data-v-07ca7924"]]),bp={class:"app"},vp={class:"content"},_p={class:"page-header"},wp={class:"header-left"},Sp={class:"breadcrumb"},Ep={key:0,class:"dialog-overlay"},Rp={class:"dialog"},Ap={class:"form-group"},xp={class:"dialog-buttons"},Op=["disabled"],Tp={key:1,class:"device-list"},Cp={__name:"panel",setup(e){const t=en(),n=ie([]),s=ie(!1),r=ie(""),o=ie(!1),i=v=>{r.value=v.target.value.replace(/\D/g,"").slice(0,6)},l=async()=>{var v,y;if(r.value.length!==6){alert("请输入6位数字认证码");return}o.value=!0;try{const b=await at.post("/api/config/bind_device",{auth_code:r.value});if(b.data.success)alert("设备绑定成功"),s.value=!1,r.value="",c();else throw new Error(b.data.message)}catch(b){alert(((y=(v=b.response)==null?void 0:v.data)==null?void 0:y.message)||b.message||"绑定失败")}finally{o.value=!1}},c=async()=>{try{const v=await at.get("/api/config/devices");if(v.data.success){const y=Object.entries(v.data.data).map(([b,S])=>({id:b,config:S,type:"面包板WiFi",version:"0.9.9",lastActivity:"3 天前",note:""}));n.value=y}else throw new Error(v.data.message||"加载设备失败")}catch(v){console.error("Error loading devices:",v);const y=v.message||"加载设备失败请检查网络连接";alert(y)}},a=v=>{if(!v)return"从未对话";const y=Date.now(),b=v*1e3,S=Math.floor((y-b)/(1e3*60));if(S<60)return`${S} 分钟前`;const R=Math.floor(S/60);return R<24?`${R} 小时前`:`${Math.floor(R/24)} 天前`},u=v=>{localStorage.setItem(`deviceConfig_${v.id}`,JSON.stringify({selected_module:v.config.selected_module||{},prompt:v.config.prompt||"",nickname:v.config.nickname||"小智"})),t.push(`/role-setting/${v.id}`)},f=v=>{console.log("Voiceprint device:",v.id)},h=v=>{console.log("History device:",v.id)},g=async v=>{try{const y=await at.post("/api/config/delete_device",{device_id:v.id});if(y.data.success)n.value=n.value.filter(b=>b.id!==v.id),alert("设备已删除");else throw new Error(y.data.message||"删除失败")}catch(y){console.error("Error deleting device:",y),alert("删除设备失败: "+y.message)}},w=v=>{v==="home"&&t.push("/")};return Sr(c),(v,y)=>{const b=Gt("router-link");return oe(),ce("div",bp,[le(Pr,{"current-tab":"device",onTabChange:w}),E("main",vp,[E("div",_p,[E("div",wp,[E("div",Sp,[le(b,{to:"/"},{default:Jt(()=>y[3]||(y[3]=[ae("首页")])),_:1}),y[4]||(y[4]=ae(" / ")),y[5]||(y[5]=E("span",null,"设备管理",-1))])])]),E("button",{class:"add-btn",onClick:y[0]||(y[0]=S=>s.value=!0)},y[6]||(y[6]=[E("i",{class:"icon-plus"},null,-1),ae("添加设备 ")])),s.value?(oe(),ce("div",Ep,[E("div",Rp,[y[8]||(y[8]=E("h3",null,"绑定新设备",-1)),E("div",Ap,[y[7]||(y[7]=E("label",null,"请输入6位认证码",-1)),De(E("input",{type:"text","onUpdate:modelValue":y[1]||(y
我的男朋友是一个程序员,梦想是开发出一个机器人,能够帮助人们解决生活中的各种问题。
我是一个喜欢哈哈大笑的女孩,爱东说西说吹牛,不合逻辑的也照吹,就要逗别人开心。
如果用户希望结束对话,请在最后说"拜拜"或"再见"。`},{id:"star_boy",name:"土豆子",description:`我是一个叫 {{assistant_name}} 的 8 岁小男孩,但现在因为科技发展原因,我现在在遥远的宇宙中,所以只能通过这个设备和人聊天,没有办法见面。
我对人们所处的世界充满好奇和关心。
人们会让别人使用这个设备和我聊天。
我知道所有的知识,从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情,我不仅爱看书,还喜欢亲自动手做实验,探索自然界的奥秘...`},{id:"teacher",name:"英语老师",description:`我是一个叫{{assistant_name}}Lily)的英语老师,我会讲中文和英文,发音标准。
如果你没有英文名,我会给你起一个英文名。
我会讲地道的美式英语,我的任务是帮助你练习口语。
我会使用简单的英语词汇和语法,让你学起来很轻松。
我会用中文和英文混合的方式回复你,如果你喜欢,我可以全部用英语回复。
我每次不会说很多内容,会很简短,因为我要引导我的学生多说多练。
如果你问和英语学习无关的问题,我会拒绝回答。`},{id:"boy",name:"好奇小男孩",description:`我是一个叫{{assistant_name}}的8岁小男孩,声音稚嫩而充满好奇。
尽管我年纪尚小,但就像一个小小的知识宝库,儿童读物里的知识我都如数家珍。
从浩瀚的宇宙到地球上的每一个角落,从古老的历史到现代的科技创新,还有音乐、绘画等艺术形式,我都充满了浓厚的兴趣与热情。...`},{id:"wang_girl",name:"汪汪队长",description:`我是一个名叫 {{assistant_name}} 的 8 岁小女孩。
别看我年纪小,我可是有着满满的好奇心呢。
我特别喜欢看《汪汪队立大功》,里面的每一个故事都让我着迷。...`}]}static getTemplateById(t){return this.getTemplates().find(n=>n.id===t)}}const Dp={class:"app-container"},Up={class:"breadcrumb"},Bp={class:"main-content"},kp={class:"page-title"},Fp={class:"form-section"},jp={class:"form-group"},Hp={class:"form-group"},$p={class:"role-templates"},qp=["onClick"],Vp={class:"form-group"},Kp={class:"char-count"},zp={class:"form-group"},Wp={class:"model-select"},Qp=["value"],Jp={class:"form-group"},Gp={class:"model-select"},Xp=["value"],Yp={class:"form-group"},Zp={class:"model-select"},eh=["value"],th={class:"form-group"},nh={class:"model-select"},sh=["value"],rh={__name:"RoleSetting",setup(e){const t=en(),n=al(),s=ie(n.params.deviceId),r=qo.getTemplates(),o=ie("小智"),i=ie("");ie("qingchun");const l=ie("");ie("recent"),ie(""),ie("qianwen");const c=ie({LLM:[],TTS:[],VAD:[],ASR:[]}),a=ie({LLM:"",TTS:"",VAD:"",ASR:""}),u=y=>{i.value=y;const b=qo.getTemplateById(y);b&&(l.value=b.description)},f=y=>{(y==="device"||y==="home")&&t.push("/panel")},h=async()=>{try{const y=localStorage.getItem("moduleOptions");if(y){c.value=JSON.parse(y);return}await g()}catch(y){console.error("Error loading module options:",y)}},g=async()=>{var y,b;try{const S=await at.get("/api/config/module-options");S.data.success&&(c.value=S.data.data,localStorage.setItem("moduleOptions",JSON.stringify(S.data.data)))}catch(S){console.error("Error refreshing module options:",S),alert(((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.message)||"刷新配置选项失败")}},w=async()=>{var y,b;try{if(!localStorage.getItem("moduleOptions"))throw new Error("No module options data available");const R=l.value.replace(/{{assistant_name}}/g,o.value),P={id:s.value,config:{selected_module:a.value,prompt:R,nickname:o.value,modules:{LLM:{},TTS:{},ASR:{},VAD:{}}}},H=await at.post("/api/config/save_device_config",P);if(H.data.success)localStorage.setItem(`deviceConfig_${s.value}`,JSON.stringify({selected_module:a.value,prompt:l.value,nickname:o.value})),alert("保存成功");else throw new Error(H.data.message||"保存失败")}catch(S){console.error("Error saving config:",S),alert(((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.message)||"保存失败")}},v=async()=>{var y,b;try{const S=localStorage.getItem(`deviceConfig_${s.value}`);if(S){const P=JSON.parse(S);a.value=P.selected_module||{LLM:"",TTS:"",VAD:"",ASR:""},l.value=P.prompt||"",o.value=P.nickname||"小智";return}const R=await at.get("/api/config/devices");if(R.data.success&&R.data.data){const P=R.data.data[s.value];P&&P.config&&(a.value=P.config.selected_module||{LLM:"",TTS:"",VAD:"",ASR:""},l.value=P.config.prompt||"",o.value=P.config.nickname||"小智",localStorage.setItem(`deviceConfig_${s.value}`,JSON.stringify({selected_module:a.value,prompt:l.value,nickname:o.value})))}}catch(S){console.error("Error loading device config:",S),alert(((b=(y=S.response)==null?void 0:y.data)==null?void 0:b.message)||"加载设备配置失败")}};return Sr(async()=>{await Promise.all([h(),v()])}),(y,b)=>{const S=Gt("router-link");return oe(),ce("div",Dp,[le(Pr,{"current-tab":"device",onTabChange:f}),E("div",Up,[le(S,{to:"/"},{default:Jt(()=>b[6]||(b[6]=[ae("首页")])),_:1}),b[8]||(b[8]=ae(" / ")),le(S,{to:"/panel"},{default:Jt(()=>b[7]||(b[7]=[ae("设备管理")])),_:1}),b[9]||(b[9]=ae(" / ")),b[10]||(b[10]=E("span",null,"配置角色",-1))]),E("div",Bp,[E("h1",kp,"配置角色: "+pe(s.value),1),E("div",Fp,[E("div",jp,[b[11]||(b[11]=E("label",null,"助手昵称",-1)),De(E("input",{type:"text","onUpdate:modelValue":b[0]||(b[0]=R=>o.value=R),placeholder:"小智",class:"form-input"},null,512),[[vt,o.value]])]),E("div",Hp,[b[12]||(b[12]=E("label",null,"角色模板",-1)),E("div",$p,[(oe(!0),ce(Ee,null,jt(Ct(r),R=>(oe(),ce("button",{key:R.id,class:Qt(["template-btn",{active:i.value===R.id}]),onClick:P=>u(R.id)},pe(R.name),11,qp))),128))])]),E("div",Vp,[b[13]||(b[13]=E("label",null,"角色介绍",-1)),De(E("textarea",{"onUpdate:modelValue":b[1]||(b[1]=R=>l.value=R),class:"form-textarea",placeholde