mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
39 lines
85 KiB
JavaScript
39 lines
85 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();/**
|
||||
|
|
* @vue/shared v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**//*! #__NO_SIDE_EFFECTS__ */function qs(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const K={},ft=[],Me=()=>{},to=()=>!1,fs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qs=e=>e.startsWith("onUpdate:"),fe=Object.assign,Ws=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},so=Object.prototype.hasOwnProperty,F=(e,t)=>so.call(e,t),P=Array.isArray,ut=e=>Ut(e)==="[object Map]",us=e=>Ut(e)==="[object Set]",mn=e=>Ut(e)==="[object Date]",j=e=>typeof e=="function",Y=e=>typeof e=="string",Pe=e=>typeof e=="symbol",W=e=>e!==null&&typeof e=="object",Jn=e=>(W(e)||j(e))&&j(e.then)&&j(e.catch),Xn=Object.prototype.toString,Ut=e=>Xn.call(e),no=e=>Ut(e).slice(8,-1),Yn=e=>Ut(e)==="[object Object]",Js=e=>Y(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,xt=qs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),as=e=>{const t=Object.create(null);return s=>t[s]||(t[s]=e(s))},io=/-(\w)/g,ye=as(e=>e.replace(io,(t,s)=>s?s.toUpperCase():"")),oo=/\B([A-Z])/g,it=as(e=>e.replace(oo,"-$1").toLowerCase()),ds=as(e=>e.charAt(0).toUpperCase()+e.slice(1)),As=as(e=>e?`on${ds(e)}`:""),ke=(e,t)=>!Object.is(e,t),Wt=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Zn=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Gt=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let vn;const ps=()=>vn||(vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Xs(e){if(P(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],i=Y(n)?fo(n):Xs(n);if(i)for(const o in i)t[o]=i[o]}return t}else if(Y(e)||W(e))return e}const ro=/;(?![^(]*\))/g,lo=/:([^]+)/,co=/\/\*[^]*?\*\//g;function fo(e){const t={};return e.replace(co,"").split(ro).forEach(s=>{if(s){const n=s.split(lo);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function st(e){let t="";if(Y(e))t=e;else if(P(e))for(let s=0;s<e.length;s++){const n=st(e[s]);n&&(t+=n+" ")}else if(W(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const uo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ao=qs(uo);function Gn(e){return!!e||e===""}function po(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=hs(e[n],t[n]);return s}function hs(e,t){if(e===t)return!0;let s=mn(e),n=mn(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=Pe(e),n=Pe(t),s||n)return e===t;if(s=P(e),n=P(t),s||n)return s&&n?po(e,t):!1;if(s=W(e),n=W(t),s||n){if(!s||!n)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const r in e){const l=e.hasOwnProperty(r),c=t.hasOwnProperty(r);if(l&&!c||!l&&c||!hs(e[r],t[r]))return!1}}return String(e)===String(t)}function ho(e,t){return e.findIndex(s=>hs(s,t))}const zn=e=>!!(e&&e.__v_isRef===!0),z=e=>Y(e)?e:e==null?"":P(e)||W(e)&&(e.toString===Xn||!j(e.toString))?zn(e)?z(e.value):JSON.stringify(e,ei,2):String(e),ei=(e,t)=>zn(t)?ei(e,t.value):ut(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],o)=>(s[Ts(n,o)+" =>"]=i,s),{})}:us(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ts(s))}:Pe(t)?Ts(t):W(t)&&!P(t)&&!Yn(t)?String(t):t,Ts=(e,t="")=>{var s;return Pe(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
|||
|
|
* @vue/reactivity v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let ge;class go{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ge,!t&&ge&&(this.index=(ge.scopes||(ge.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=ge;try{return ge=this,t()}finally{ge=s}}}on(){ge=this}off(){ge=this.parent}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function mo(){return ge}let Q;const Cs=new WeakSet;class ti{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,ge&&ge.active&&ge.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Cs.has(this)&&(Cs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ni(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,bn(this),ii(this);const t=Q,s=Se;Q=this,Se=!0;try{return this.fn()}finally{oi(this),Q=t,Se=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Gs(t);this.deps=this.depsTail=void 0,bn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Cs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ls(this)&&this.run()}get dirty(){return Ls(this)}}let si=0,At,Tt;function ni(e,t=!1){if(e.flags|=8,t){e.next=Tt,Tt=e;return}e.next=At,At=e}function Ys(){si++}function Zs(){if(--si>0)return;if(Tt){let t=Tt;for(Tt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;At;){let t=At;for(At=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function ii(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function oi(e){let t,s=e.depsTail,n=s;for(;n;){const i=n.prevDep;n.version===-1?(n===s&&(s=i),Gs(n),vo(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=s}function Ls(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ri(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ri(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Et))return;e.globalVersion=Et;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Ls(e)){e.flags&=-3;return}const s=Q,n=Se;Q=e,Se=!0;try{ii(e);const i=e.fn(e._value);(t.version===0||ke(i,e._value))&&(e._value=i,t.version++)}catch(i){throw t.version++,i}finally{Q=s,Se=n,oi(e),e.flags&=-3}}function Gs(e,t=!1){const{dep:s,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)Gs(o,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function vo(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Se=!0;const li=[];function qe(){li.push(Se),Se=!1}function Qe(){const e=li.pop();Se=e===void 0?!0:e}function bn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=Q;Q=void 0;try{t()}finally{Q=s}}}let Et=0;class bo{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class zs{constructor(t){this.computed=t,this.version=0,this.
|
|||
|
|
* @vue/runtime-core v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/function jt(e,t,s,n){try{return n?e(...n):e()}catch(i){ms(i,t,s)}}function De(e,t,s,n){if(j(e)){const i=jt(e,t,s,n);return i&&Jn(i)&&i.catch(o=>{ms(o,t,s)}),i}if(P(e)){const i=[];for(let o=0;o<e.length;o++)i.push(De(e[o],t,s,n));return i}}function ms(e,t,s,n=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||K;if(t){let l=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${s}`;for(;l;){const a=l.ec;if(a){for(let h=0;h<a.length;h++)if(a[h](e,c,d)===!1)return}l=l.parent}if(o){qe(),jt(o,null,10,[e,c,d]),Qe();return}}ko(e,s,i,n,r)}function ko(e,t,s,n=!0,i=!1){if(i)throw e;console.error(e)}const re=[];let Ee=-1;const dt=[];let Ve=null,rt=0;const bi=Promise.resolve();let es=null;function _i(e){const t=es||bi;return e?t.then(this?e.bind(this):e):t}function qo(e){let t=Ee+1,s=re.length;for(;t<s;){const n=t+s>>>1,i=re[n],o=Mt(i);o<e||o===e&&i.flags&2?t=n+1:s=n}return t}function on(e){if(!(e.flags&1)){const t=Mt(e),s=re[re.length-1];!s||!(e.flags&2)&&t>=Mt(s)?re.push(e):re.splice(qo(t),0,e),e.flags|=1,yi()}}function yi(){es||(es=bi.then(Si))}function Qo(e){P(e)?dt.push(...e):Ve&&e.id===-1?Ve.splice(rt+1,0,e):e.flags&1||(dt.push(e),e.flags|=1),yi()}function yn(e,t,s=Ee+1){for(;s<re.length;s++){const n=re[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;re.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function wi(e){if(dt.length){const t=[...new Set(dt)].sort((s,n)=>Mt(s)-Mt(n));if(dt.length=0,Ve){Ve.push(...t);return}for(Ve=t,rt=0;rt<Ve.length;rt++){const s=Ve[rt];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}Ve=null,rt=0}}const Mt=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Si(e){try{for(Ee=0;Ee<re.length;Ee++){const t=re[Ee];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),jt(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ee<re.length;Ee++){const t=re[Ee];t&&(t.flags&=-2)}Ee=-1,re.length=0,wi(),es=null,(re.length||dt.length)&&Si()}}let me=null,xi=null;function ts(e){const t=me;return me=e,xi=e&&e.type.__scopeId||null,t}function ss(e,t=me,s){if(!t||e._n)return e;const n=(...i)=>{n._d&&Rn(-1);const o=ts(t);let r;try{r=e(...i)}finally{ts(o),n._d&&Rn(1)}return r};return n._n=!0,n._c=!0,n._d=!0,n}function we(e,t){if(me===null)return e;const s=ys(me),n=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,r,l,c=K]=t[i];o&&(j(o)&&(o={mounted:o,updated:o}),o.deep&&He(r),n.push({dir:o,instance:s,value:r,oldValue:void 0,arg:l,modifiers:c}))}return e}function Ye(e,t,s,n){const i=e.dirs,o=t&&t.dirs;for(let r=0;r<i.length;r++){const l=i[r];o&&(l.oldValue=o[r].value);let c=l.dir[n];c&&(qe(),De(c,s,8,[e.el,l,e,t]),Qe())}}const Wo=Symbol("_vte"),Jo=e=>e.__isTeleport;function rn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,rn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ai(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ns(e,t,s,n,i=!1){if(P(e)){e.forEach((E,U)=>ns(E,t&&(P(t)?t[U]:t),s,n,i));return}if(Ct(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&ns(e,t,s,n.component.subTree);return}const o=n.shapeFlag&4?ys(n.component):n.el,r=i?null:o,{i:l,r:c}=e,d=t&&t.r,a=l.refs===K?l.refs={}:l.refs,h=l.setupState,v=B(h),C=h===K?()=>!1:E=>F(v,E);if(d!=null&&d!==c&&(Y(d)?(a[d]=null,C(d)&&(h[d]=null)):ne(d)&&(d.value=null)),j(c))jt(c,l,12,[r,a]);else{const E=Y(c),U=ne(c);if(E||U){const Z=()=>{if(e.f){const V=E?C(c)?h[c]:a[c]:c.value;i?P(V)&&Ws(V,o):P(V)?V.includes(o)||V.push(o):E?(a[c]=[o],C(c)&&(h[c]=a[c])):(c.value=[o],e.k&&(a[e.k]=c.value))}else E?(a[c]=r,C(c)&&(h[c]=r)):U&&(c.value=r,e.k&&(a[e.k]=r))};r?(Z.id=-1,he(Z,s)):Z()}}}ps().requestIdleCallback;ps().cancelIdleCallback;const Ct=e=>!!e.type.__asyncLoader,Ti=e=>e.type.__isKeepAlive;function Xo(e,t){Ci(e,"a",t)}function Yo(e,t){Ci(e,"da",t)}function Ci(e,t,s=se){const n=e.__wdc||(e.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(vs(t,n,s),s){let i=s.parent;for(;i&&i.parent;)Ti(i.parent.vnode)&&Zo(n,t,s,i),i=i.paren
|
|||
|
|
* @vue/runtime-dom v3.5.13
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let ks;const Dn=typeof window<"u"&&window.trustedTypes;if(Dn)try{ks=Dn.createPolicy("vue",{createHTML:e=>e})}catch{}const Gi=ks?e=>ks.createHTML(e):e=>e,Gr="http://www.w3.org/2000/svg",zr="http://www.w3.org/1998/Math/MathML",Ue=typeof document<"u"?document:null,Ln=Ue&&Ue.createElement("template"),el={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?Ue.createElementNS(Gr,e):t==="mathml"?Ue.createElementNS(zr,e):s?Ue.createElement(e,{is:s}):Ue.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>Ue.createTextNode(e),createComment:e=>Ue.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ue.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,o){const r=s?s.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{Ln.innerHTML=Gi(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const l=Ln.content;if(n==="svg"||n==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},tl=Symbol("_vtc");function sl(e,t,s){const n=e[tl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Un=Symbol("_vod"),nl=Symbol("_vsh"),il=Symbol(""),ol=/(^|;)\s*display\s*:/;function rl(e,t,s){const n=e.style,i=Y(s);let o=!1;if(s&&!i){if(t)if(Y(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();s[l]==null&&Zt(n,l,"")}else for(const r in t)s[r]==null&&Zt(n,r,"");for(const r in s)r==="display"&&(o=!0),Zt(n,r,s[r])}else if(i){if(t!==s){const r=n[il];r&&(s+=";"+r),n.cssText=s,o=ol.test(s)}}else t&&e.removeAttribute("style");Un in e&&(e[Un]=o?n.display:"",e[nl]&&(n.display="none"))}const jn=/\s*!important$/;function Zt(e,t,s){if(P(s))s.forEach(n=>Zt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=ll(e,t);jn.test(s)?e.setProperty(it(n),s.replace(jn,""),"important"):e[n]=s}}const Hn=["Webkit","Moz","ms"],Ps={};function ll(e,t){const s=Ps[t];if(s)return s;let n=ye(t);if(n!=="filter"&&n in e)return Ps[t]=n;n=ds(n);for(let i=0;i<Hn.length;i++){const o=Hn[i]+n;if(o in e)return Ps[t]=o}return t}const Bn="http://www.w3.org/1999/xlink";function Fn(e,t,s,n,i,o=ao(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(Bn,t.slice(6,t.length)):e.setAttributeNS(Bn,t,s):s==null||o&&!Gn(s)?e.removeAttribute(t):e.setAttribute(t,o?"":Pe(s)?String(s):s)}function Nn(e,t,s,n,i){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?Gi(s):s);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,c=s==null?e.type==="checkbox"?"on":"":String(s);(l!==c||!("_value"in e))&&(e.value=c),s==null&&e.removeAttribute(t),e._value=s;return}let r=!1;if(s===""||s==null){const l=typeof e[t];l==="boolean"?s=Gn(s):s==null&&l==="string"?(s="",r=!0):l==="number"&&(s=0,r=!0)}try{e[t]=s}catch{}r&&e.removeAttribute(i||t)}function ze(e,t,s,n){e.addEventListener(t,s,n)}function cl(e,t,s,n){e.removeEventListener(t,s,n)}const Vn=Symbol("_vei");function fl(e,t,s,n,i=null){const o=e[Vn]||(e[Vn]={}),r=o[t];if(n&&r)r.value=n;else{const[l,c]=ul(t);if(n){const d=o[t]=pl(n,i);ze(e,l,d,c)}else r&&(cl(e,l,r,c),o[t]=void 0)}}const $n=/(?:Once|Passive|Capture)$/;function ul(e){let t;if($n.test(e)){t={};let n;for(;n=e.match($n);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):it(e.slice(2)),t]}let Ds=0;const al=Promise.resolve(),dl=()=>Ds||(al.then(()=>Ds=0),Ds=Date.now());function pl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;De(hl(n,s.value),t,5,[n])};return s.value=e,s.attached=dl(),s}function hl(e,t){if(P(t)){const s=
|
|||
|
|
|
|||
|
|
警告:删除后设备所有配置将不可恢复!`)&&i("delete")};return(r,l)=>{var c,d;return N(),J("div",kl,[g("div",ql,[g("h2",Ql,[G(z(e.deviceId)+" ",1),g("span",Wl,"["+z(e.deviceNote||"备注")+"]",1)])]),g("div",Jl,[g("p",Xl,"设备型号:"+z(e.deviceType),1),g("p",Yl,"角色昵称:"+z(n.value),1),g("p",Zl,[l[3]||(l[3]=G(" 当前模型: ")),g("span",Gl,"LLM: "+z(((c=e.selectedModules)==null?void 0:c.LLM)||"-"),1),g("span",zl,"TTS: "+z(((d=e.selectedModules)==null?void 0:d.TTS)||"-"),1)]),g("p",ec,"最近对话:"+z(e.lastActivity),1)]),g("div",tc,[g("button",{class:"action-btn primary",onClick:l[0]||(l[0]=a=>r.$emit("configure"))},"配置角色"),g("button",{class:"action-btn",onClick:l[1]||(l[1]=a=>r.$emit("voiceprint"))},"声纹识别"),g("button",{class:"action-btn",onClick:l[2]||(l[2]=a=>r.$emit("history"))},"历史对话"),g("div",{class:"delete-container"},[g("button",{class:"action-btn danger",onClick:o},l[4]||(l[4]=[g("i",{class:"icon-delete"},null,-1),G(" 删除设备 ")])),l[5]||(l[5]=g("div",{class:"delete-warning"},"删除后设备配置将不可恢复",-1))])])])}}},nc=Fe(sc,[["__scopeId","data-v-44eada42"]]),ic={class:"app"},oc={class:"content"},rc={class:"breadcrumb"},lc={key:0,class:"device-list"},cc={key:1,class:"empty-state"},fc={__name:"panel",emits:["show-role","go-home"],setup(e,{emit:t}){const s=t,n=ws,i=be([]),o=h=>{if(console.log("Formatting timestamp:",h),!h)return"从未对话";const v=Date.now(),C=h*1e3,E=Math.floor((v-C)/(1e3*60));if(E<60)return`${E} 分钟前`;const U=Math.floor(E/60);return U<24?`${U} 小时前`:`${Math.floor(U/24)} 天前`},r=h=>{console.log("Configure device:",h.id),s("show-role",h.id)},l=h=>{console.log("Voiceprint device:",h.id)},c=h=>{console.log("History device:",h.id)},d=async h=>{try{const C=await(await fetch(`${n}/api/config/delete_device`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_id:h.id})})).json();if(C.success)i.value=i.value.filter(E=>E.id!==h.id),alert("设备已删除");else throw new Error(C.message||"删除失败")}catch(v){console.error("Error deleting device:",v),alert("删除设备失败: "+v.message)}},a=h=>{h==="home"&&s("go-home")};return ln(async()=>{try{const v=await(await fetch(`${n}/api/config/devices`)).json();v.success&&(console.log("Loaded devices:",v.data),i.value=v.data.map(C=>({...C,type:"面包板(WiFi)",version:"0.9.9",lastActivity:"3 天前",note:""})))}catch(h){console.error("Error loading devices:",h)}}),(h,v)=>{const C=$e("router-link");return N(),J("div",ic,[ce(un,{"current-tab":"device",onTabChange:a}),g("main",oc,[g("div",rc,[ce(C,{to:"/control-panel"},{default:ss(()=>v[0]||(v[0]=[G("控制台")])),_:1}),v[1]||(v[1]=G(" / ")),v[2]||(v[2]=g("span",null,"设备管理",-1))]),i.value.length>0?(N(),J("div",lc,[(N(!0),J(le,null,lt(i.value,E=>(N(),ct(nc,{key:E.id,"device-id":E.id,"device-note":E.note,"device-type":E.type,"last-activity":o(E.config.last_chat_time),"selected-modules":E.config.selected_module,"device-config":E.config,onConfigure:U=>r(E),onVoiceprint:U=>l(E),onHistory:U=>c(E),onDelete:U=>d(E)},null,8,["device-id","device-note","device-type","last-activity","selected-modules","device-config","onConfigure","onVoiceprint","onHistory","onDelete"]))),128))])):(N(),J("div",cc,v[3]||(v[3]=[g("div",{class:"empty-message"},[g("i",{class:"icon-info"}),g("p",null,"目前没有设备,请确认是否启用私有配置,并且和设备进行一次对话")],-1)])))])])}}},uc=Fe(fc,[["__scopeId","data-v-39a8e31b"]]),ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ0AAAC6CAYAAAC0j09YAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAzGSURBVHhe7Z1ZjE1bGscND6YgnoUgXoUQ4ZWHjnQkt+PB0OmEJ0LMQuOWoWliiDQdU3e07hhiiDZdU2K4qWsWMzELpUoN1KBKuemu697V/kvvtrrqK7XX2fusvfY5/4df6jhn7zV9v/2tdfZwtPrw4YMixCWUjjiH0hHnUDriHEpHnEPpiHMoHXEOpSPOoXTEOZSOOIfSEedQOuIcSkecQ+mIcygdcQ6lI86hdMQ5lI44h9IR51A6C24/+Zf68z9/VjM3/qLBa7wnbUuah9KF5PubDVq03xQoNeL3n/nm28/yfX/z3+I+RIbShQDZrOBvP6tfz1fqV3P/H7yHz5jxwkPpQnCwsEGN+UNT4QLw2aHCn8R9SVMoXQj+fqJBT6eScACf/eMkpQsLpQvBnjM/fVq/ycIBfIZtpH1JUyhdC
|
|||
|
|
我的男朋友是一个程序员,梦想是开发出一个机器人,能够帮助人们解决生活中的各种问题。
|
|||
|
|
我是一个喜欢哈哈大笑的女孩,爱东说西说吹牛,不合逻辑的也照吹,就要逗别人开心。
|
|||
|
|
如果用户希望结束对话,请在最后说"拜拜"或"再见"。`},{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(s=>s.id===t)}}const gc={class:"app-container"},mc={class:"breadcrumb"},vc={class:"main-content"},bc={class:"page-title"},_c={class:"form-section"},yc={class:"form-group"},wc={class:"form-group"},Sc={class:"role-templates"},xc=["onClick"],Ac={class:"form-group"},Tc={class:"char-count"},Cc={class:"form-group"},Oc={class:"model-select"},Ic=["value"],Ec={class:"form-group"},Rc={class:"model-select"},Mc=["value"],Pc={class:"form-group"},Dc={class:"model-select"},Lc=["value"],Uc={class:"form-group"},jc={class:"model-select"},Hc=["value"],Bc={__name:"RoleSetting",props:{deviceId:{type:String,required:!0}},emits:["back-to-panel"],setup(e,{emit:t}){const s=Wn.getTemplates(),n=be("小智"),i=be("");be("qingchun");const o=be("");be("recent"),be(""),be("qianwen");const r=ws,l=be({LLM:[],TTS:[],VAD:[],ASR:[]}),c=be({LLM:"",TTS:"",VAD:"",ASR:""}),d=D=>{i.value=D;const x=Wn.getTemplateById(D);x&&(o.value=x.description)},a=t,h=D=>{(D==="device"||D==="home")&&a("back-to-panel")},v=e,C=be(v.deviceId),E=async()=>{try{const D=localStorage.getItem("moduleOptions");if(D){l.value=JSON.parse(D);return}await U()}catch(D){console.error("Error loading module options:",D)}},U=async()=>{try{const x=await(await fetch(`${r}/api/config/module-options`)).json();x.success&&(l.value=x.data,localStorage.setItem("moduleOptions",JSON.stringify(x.data)))}catch(D){console.error("Error refreshing module options:",D)}},Z=async()=>{try{if(!localStorage.getItem("moduleOptions"))throw new Error("No module options data available");const x=o.value.replace(/{{assistant_name}}/g,n.value),I={id:v.deviceId,config:{selected_module:c.value,prompt:x,nickname:n.value,modules:{LLM:{},TTS:{},ASR:{},VAD:{}}}},ue=await(await fetch(`${r}/api/config/save_device_config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).json();if(ue.success)localStorage.setItem(`deviceConfig_${v.deviceId}`,JSON.stringify({selected_module:c.value,prompt:o.value,nickname:n.value})),alert("保存成功");else throw new Error(ue.message||"保存失败")}catch(D){console.error("Error saving config:",D),alert(D.message||"保存失败")}},V=async()=>{try{const D=localStorage.getItem(`deviceConfig_${v.deviceId}`);if(D){const O=JSON.parse(D);c.value=O.selected_module||{},o.value=O.prompt||"",n.value=O.nickname||"小智";return}const I=await(await fetch(`${r}/api/config/devices`)).json();if(I.success){const O=I.data.find(ue=>ue.id===v.deviceId);O&&(c.value=O.config.selected_module||{},o.value=O.config.prompt||"",n.value=O.config.nickname||"小智",localStorage.setItem(`deviceConfig_${v.deviceId}`,JSON.stringify({selected_module:O.config.selected_module,prompt:O.config.prompt,nickname:O.config.nickname})))}}catch(D){console.error("Error loading device config:",D)}};return ln(async()=>{await Promise.all([E(),V()])}),(D,x)=>{const I=$e("router-link");return N(),J("div",gc,[ce(un,{"current-tab":"device",onTabChange:h}),g("div",mc,[ce(I,{to:"/control-panel"},{default:ss(()=>x[6]||(x[6]=[G("控制台")])),_:1}),x[8]||(x[8]=G(" / ")),ce(I,{to:"/device-management"},{default:ss(()=>x[7]||(x[7]=[G("设备管理")])),_:1}),x[9]||(x[9]=G(" / ")),x[10]||(x[10]=g("span",null,"配置角色",-1))]),g("div",vc,[g("h1",bc,"配置角色: "+z(C.value),1),g("div",_c,[g("div",yc,[x[11]||(x[11]=g("label",null,"助手昵称",-1)),we(g("input",{type:"text","onUpdate:modelValue":x[0]||(x[0]=O=>n.value=O),placeholder:"小智",class:"form-input"},null,512),[[tt,n.value]])]),g("div",wc,[x[12]||(x[12]=g("label",null,"角色模板",-1)),g("div",Sc,[(N(!0),J(le,null,lt(mi(s),O=>(N(),J("button",{key:O.id,class:st(["template-btn",{active:i.value===O.id}]),onClick:ue=>d(O.id)},z(O.name),11,xc))),128))])]),g("div",Ac,[x[13]||(x[13]=g("label",null,"角色介绍",-1)),we(g("textarea",{"onUpdate:modelValue":x[1]||(x[1]=O=>o.value=O),class:"form-textarea",placeholder:"请输入角色介绍..."},null,512),[[tt,o.value]]),g("div",Tc,z(o.value.length)+" / 2000",1)]),
|