qt-human 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{a as t}from"./human-core--eD9PU8K.js";const e=new WeakMap,r=new WeakMap,n=new WeakMap,o=Symbol("anyProducer"),i=Promise.resolve(),a=Symbol("listenerAdded"),s=Symbol("listenerRemoved");let c=!1,u=!1;const f=t=>"string"==typeof t||"symbol"==typeof t||"number"==typeof t;function l(t){if(!f(t))throw new TypeError("`eventName` must be a string, symbol, or number")}function d(t){if("function"!=typeof t)throw new TypeError("listener must be a function")}function p(t,e){const n=r.get(t);if(n.has(e))return n.get(e)}function h(t,e){const r=f(e)?e:o,i=n.get(t);if(i.has(r))return i.get(r)}function _(t,e){e=Array.isArray(e)?e:[e];let r=!1,o=()=>{},i=[];const a={enqueue(t){i.push(t),o()},finish(){r=!0,o()}};for(const r of e){let e=h(t,r);if(!e){e=new Set;n.get(t).set(r,e)}e.add(a)}return{async next(){return i?0===i.length?r?(i=void 0,this.next()):(await new Promise((t=>{o=t})),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(r){i=void 0;for(const r of e){const e=h(t,r);if(e&&(e.delete(a),0===e.size)){n.get(t).delete(r)}}return o(),arguments.length>0?{done:!0,value:await r}:{done:!0}},[Symbol.asyncIterator](){return this}}}function y(t){if(void 0===t)return g;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!g.includes(e)){if("string"!=typeof e)throw new TypeError("`methodNames` element must be a string");throw new Error(`${e} is not Emittery method`)}return t}const v=t=>t===a||t===s;function b(t,e,r){if(v(e))try{c=!0,t.emit(e,r)}finally{c=!1}}class E{static mixin(t,e){return e=y(e),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(const t of e)if(void 0!==r.prototype[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(r.prototype,t,{enumerable:!1,get:function(){return Object.defineProperty(this,t,{enumerable:!1,value:new E}),this[t]}});const n=e=>function(...r){return this[t][e](...r)};for(const t of e)Object.defineProperty(r.prototype,t,{enumerable:!1,value:n(t)});return r}}static get isDebugEnabled(){if("object"!=typeof globalThis.process?.env)return u;const{env:t}=globalThis.process??{env:{}};return"emittery"===t.DEBUG||"*"===t.DEBUG||u}static set isDebugEnabled(t){u=t}constructor(t={}){e.set(this,new Set),r.set(this,new Map),n.set(this,new Map),n.get(this).set(o,new Set),this.debug=t.debug??{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,e,r,n)=>{try{n=JSON.stringify(n)}catch{n=`Object with the following keys failed to stringify: ${Object.keys(n).join(",")}`}"symbol"!=typeof r&&"number"!=typeof r||(r=r.toString());const o=new Date;o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()})}logIfDebugEnabled(t,e,r){(E.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,e,r)}on(t,e){d(e),t=Array.isArray(t)?t:[t];for(const n of t){l(n);let t=p(this,n);if(!t){t=new Set;r.get(this).set(n,t)}t.add(e),this.logIfDebugEnabled("subscribe",n,void 0),v(n)||b(this,a,{eventName:n,listener:e})}return this.off.bind(this,t,e)}off(t,e){d(e),t=Array.isArray(t)?t:[t];for(const n of t){l(n);const t=p(this,n);if(t&&(t.delete(e),0===t.size)){r.get(this).delete(n)}this.logIfDebugEnabled("unsubscribe",n,void 0),v(n)||b(this,s,{eventName:n,listener:e})}}once(t){let e;const r=new Promise((r=>{e=this.on(t,(t=>{e(),r(t)}))}));return r.off=e,r}events(t){t=Array.isArray(t)?t:[t];for(const e of t)l(e);return _(this,t)}async emit(t,r){if(l(t),v(t)&&!c)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emit",t,r),function(t,e,r){const i=n.get(t);if(i.has(e))for(const t of i.get(e))t.enqueue(r);if(i.has(o)){const t=Promise.all([e,r]);for(const e of i.get(o))e.enqueue(t)}}(this,t,r);const a=p(this,t)??new Set,s=e.get(this),u=[...a],f=v(t)?[]:[...s];await i,await Promise.all([...u.map((async t=>{if(a.has(t))return t(r)})),...f.map((async e=>{if(s.has(e))return e(t,r)}))])}async emitSerial(t,r){if(l(t),v(t)&&!c)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emitSerial",t,r);const n=p(this,t)??new Set,o=e.get(this),a=[...n],s=[...o];await i;for(const t of a)n.has(t)&&await t(r);for(const e of s)o.has(e)&&await e(t,r)}onAny(t){return d(t),this.logIfDebugEnabled("subscribeAny",void 0,void 0),e.get(this).add(t),b(this,a,{listener:t}),this.offAny.bind(this,t)}anyEvent(){return _(this)}offAny(t){d(t),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),b(this,s,{listener:t}),e.get(this).delete(t)}clearListeners(t){t=Array.isArray(t)?t:[t];for(const o of t)if(this.logIfDebugEnabled("clear",o,void 0),f(o)){const t=p(this,o);t&&t.clear();const e=h(this,o);if(e){for(const t of e)t.finish();e.clear()}}else{e.get(this).clear();for(const[t,e]of r.get(this).entries())e.clear(),r.get(this).delete(t);for(const[t,e]of n.get(this).entries()){for(const t of e)t.finish();e.clear(),n.get(this).delete(t)}}}listenerCount(t){t=Array.isArray(t)?t:[t];let o=0;for(const i of t)if(f(i))o+=e.get(this).size+(p(this,i)?.size??0)+(h(this,i)?.size??0)+(h(this)?.size??0);else{void 0!==i&&l(i),o+=e.get(this).size;for(const t of r.get(this).values())o+=t.size;for(const t of n.get(this).values())o+=t.size}return o}bindMethods(t,e){if("object"!=typeof t||null===t)throw new TypeError("`target` must be an object");e=y(e);for(const r of e){if(void 0!==t[r])throw new Error(`The property \`${r}\` already exists on \`target\``);Object.defineProperty(t,r,{enumerable:!1,value:this[r].bind(this)})}}}const g=Object.getOwnPropertyNames(E.prototype).filter((t=>"constructor"!==t));Object.defineProperty(E,"listenerAdded",{value:a,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(E,"listenerRemoved",{value:s,writable:!1,enumerable:!0,configurable:!1});var O="object"==typeof t&&t&&t.Object===Object&&t,T="object"==typeof self&&self&&self.Object===Object&&self,A=O||T||Function("return this")(),m=A.Symbol,I=Object.prototype,N=I.hasOwnProperty,R=I.toString,w=m?m.toStringTag:void 0;var j=Object.prototype.toString;var S="[object Null]",C="[object Undefined]",D=m?m.toStringTag:void 0;function P(t){return null==t?void 0===t?C:S:D&&D in Object(t)?function(t){var e=N.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=R.call(t);return n&&(e?t[w]=r:delete t[w]),o}(t):function(t){return j.call(t)}(t)}function M(t){return null!=t&&"object"==typeof t}var x="[object Symbol]";var L=Array.isArray,U=/\s/;var z=/^\s+/;function G(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&U.test(t.charAt(e)););return e}(t)+1).replace(z,""):t}function V(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var W=NaN,Y=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,B=/^0o[0-7]+$/i,F=parseInt;function $(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||M(t)&&P(t)==x}(t))return W;if(V(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=V(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=G(t);var r=k.test(t);return r||B.test(t)?F(t.slice(2),r?2:8):Y.test(t)?W:+t}var H=1/0,q=17976931348623157e292;function K(t){return t?(t=$(t))===H||t===-H?(t<0?-1:1)*q:t==t?t:0:0===t?t:0}function X(t){return t}var J="[object AsyncFunction]",Q="[object Function]",Z="[object GeneratorFunction]",tt="[object Proxy]";function et(t){if(!V(t))return!1;var e=P(t);return e==Q||e==Z||e==J||e==tt}var rt,nt=A["__core-js_shared__"],ot=(rt=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||""))?"Symbol(src)_1."+rt:"";var it=Function.prototype.toString;var at=/^\[object .+?Constructor\]$/,st=Function.prototype,ct=Object.prototype,ut=st.toString,ft=ct.hasOwnProperty,lt=RegExp("^"+ut.call(ft).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dt(t){return!(!V(t)||(e=t,ot&&ot in e))&&(et(t)?lt:at).test(function(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return dt(r)?r:void 0}var ht=Object.create,_t=function(){function t(){}return function(e){if(!V(e))return{};if(ht)return ht(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var yt=Date.now;var vt,bt,Et,gt=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ot=gt?function(t,e){return gt(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:X,Tt=(vt=Ot,bt=0,Et=0,function(){var t=yt(),e=16-(t-Et);if(Et=t,e>0){if(++bt>=800)return arguments[0]}else bt=0;return vt.apply(void 0,arguments)}),At=9007199254740991,mt=/^(?:0|[1-9]\d*)$/;function It(t,e){var r=typeof t;return!!(e=null==e?At:e)&&("number"==r||"symbol"!=r&&mt.test(t))&&t>-1&&t%1==0&&t<e}function Nt(t,e,r){"__proto__"==e&&gt?gt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Rt(t,e){return t===e||t!=t&&e!=e}var wt=Object.prototype.hasOwnProperty;function jt(t,e,r){var n=t[e];wt.call(t,e)&&Rt(n,r)&&(void 0!==r||e in t)||Nt(t,e,r)}var St=Math.max;function Ct(t,e){return Tt(function(t,e,r){return e=St(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=St(n.length-e,0),a=Array(i);++o<i;)a[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(a),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,s)}}(t,e,X),t+"")}var Dt=9007199254740991;function Pt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Dt}function Mt(t){return null!=t&&Pt(t.length)&&!et(t)}function xt(t,e,r){if(!V(r))return!1;var n=typeof e;return!!("number"==n?Mt(r)&&It(e,r.length):"string"==n&&e in r)&&Rt(r[e],t)}var Lt=Object.prototype;function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)}function zt(t){return M(t)&&"[object Arguments]"==P(t)}var Gt=Object.prototype,Vt=Gt.hasOwnProperty,Wt=Gt.propertyIsEnumerable,Yt=zt(function(){return arguments}())?zt:function(t){return M(t)&&Vt.call(t,"callee")&&!Wt.call(t,"callee")};var kt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Bt=kt&&"object"==typeof module&&module&&!module.nodeType&&module,Ft=Bt&&Bt.exports===kt?A.Buffer:void 0,$t=(Ft?Ft.isBuffer:void 0)||function(){return!1},Ht={};Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Arguments]"]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object Boolean]"]=Ht["[object DataView]"]=Ht["[object Date]"]=Ht["[object Error]"]=Ht["[object Function]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht["[object Object]"]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object WeakMap]"]=!1;var qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Kt&&Kt.exports===qt&&O.process,Jt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Xt&&Xt.binding&&Xt.binding("util")}catch(t){}}(),Qt=Jt&&Jt.isTypedArray,Zt=Qt?function(t){return function(e){return t(e)}}(Qt):function(t){return M(t)&&Pt(t.length)&&!!Ht[P(t)]};function te(t,e){var r=L(t),n=!r&&Yt(t),o=!r&&!n&&$t(t),i=!r&&!n&&!o&&Zt(t),a=r||n||o||i,s=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=s.length;for(var u in t)a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||It(u,c))||s.push(u);return s}var ee=Object.prototype.hasOwnProperty;function re(t){if(!V(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Ut(t),r=[];for(var n in t)("constructor"!=n||!e&&ee.call(t,n))&&r.push(n);return r}function ne(t){return Mt(t)?te(t):re(t)}var oe=pt(Object,"create");var ie=Object.prototype.hasOwnProperty;var ae=Object.prototype.hasOwnProperty;function se(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ce(t,e){for(var r=t.length;r--;)if(Rt(t[r][0],e))return r;return-1}se.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},se.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},se.prototype.get=function(t){var e=this.__data__;if(oe){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ie.call(e,t)?e[t]:void 0},se.prototype.has=function(t){var e=this.__data__;return oe?void 0!==e[t]:ae.call(e,t)},se.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=oe&&void 0===e?"__lodash_hash_undefined__":e,this};var ue=Array.prototype.splice;function fe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.__data__=[],this.size=0},fe.prototype.delete=function(t){var e=this.__data__,r=ce(e,t);return!(r<0)&&(r==e.length-1?e.pop():ue.call(e,r,1),--this.size,!0)},fe.prototype.get=function(t){var e=this.__data__,r=ce(e,t);return r<0?void 0:e[r][1]},fe.prototype.has=function(t){return ce(this.__data__,t)>-1},fe.prototype.set=function(t,e){var r=this.__data__,n=ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var le=pt(A,"Map");function de(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function pe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pe.prototype.clear=function(){this.size=0,this.__data__={hash:new se,map:new(le||fe),string:new se}},pe.prototype.delete=function(t){var e=de(this,t).delete(t);return this.size-=e?1:0,e},pe.prototype.get=function(t){return de(this,t).get(t)},pe.prototype.has=function(t){return de(this,t).has(t)},pe.prototype.set=function(t,e){var r=de(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var he=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),_e="[object Object]",ye=Function.prototype,ve=Object.prototype,be=ye.toString,Ee=ve.hasOwnProperty,ge=be.call(Object);function Oe(t){var e=this.__data__=new fe(t);this.size=e.size}Oe.prototype.clear=function(){this.__data__=new fe,this.size=0},Oe.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Oe.prototype.get=function(t){return this.__data__.get(t)},Oe.prototype.has=function(t){return this.__data__.has(t)},Oe.prototype.set=function(t,e){var r=this.__data__;if(r instanceof fe){var n=r.__data__;if(!le||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new pe(n)}return r.set(t,e),this.size=r.size,this};var Te="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ae=Te&&"object"==typeof module&&module&&!module.nodeType&&module,me=Ae&&Ae.exports===Te?A.Buffer:void 0;me&&me.allocUnsafe;var Ie=A.Uint8Array;function Ne(t,e){var r,n,o=(r=t.buffer,n=new r.constructor(r.byteLength),new Ie(n).set(new Ie(r)),n);return new t.constructor(o,t.byteOffset,t.length)}var Re=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var s=i[++n];if(!1===e(o[s],s,o))break}return t},we=function(){return A.Date.now()},je=Math.max,Se=Math.min;function Ce(t,e,r){var n,o,i,a,s,c,u=0,f=!1,l=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var r=n,i=o;return n=o=void 0,u=e,a=t.apply(i,r)}function h(t){var r=t-c;return void 0===c||r>=e||r<0||l&&t-u>=i}function _(){var t=we();if(h(t))return y(t);s=setTimeout(_,function(t){var r=e-(t-c);return l?Se(r,i-(t-u)):r}(t))}function y(t){return s=void 0,d&&n?p(t):(n=o=void 0,a)}function v(){var t=we(),r=h(t);if(n=arguments,o=this,c=t,r){if(void 0===s)return function(t){return u=t,s=setTimeout(_,e),f?p(t):a}(c);if(l)return clearTimeout(s),s=setTimeout(_,e),p(c)}return void 0===s&&(s=setTimeout(_,e)),a}return e=$(e)||0,V(r)&&(f=!!r.leading,i=(l="maxWait"in r)?je($(r.maxWait)||0,e):i,d="trailing"in r?!!r.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},v.flush=function(){return void 0===s?a:y(we())},v}function De(t,e,r){(void 0!==r&&!Rt(t[e],r)||void 0===r&&!(e in t))&&Nt(t,e,r)}function Pe(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Me(t){return function(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=void 0;void 0===c&&(c=t[s]),o?Nt(r,s,c):jt(r,s,c)}return r}(t,ne(t))}function xe(t,e,r,n,o,i,a){var s=Pe(t,r),c=Pe(e,r),u=a.get(c);if(u)De(t,r,u);else{var f,l=i?i(s,c,r+"",t,e,a):void 0,d=void 0===l;if(d){var p=L(c),h=!p&&$t(c),_=!p&&!h&&Zt(c);l=c,p||h||_?L(s)?l=s:M(f=s)&&Mt(f)?l=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(s):h?(d=!1,l=c.slice()):_?(d=!1,l=Ne(c)):l=[]:function(t){if(!M(t)||P(t)!=_e)return!1;var e=he(t);if(null===e)return!0;var r=Ee.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&be.call(r)==ge}(c)||Yt(c)?(l=s,Yt(s)?l=Me(s):V(s)&&!et(s)||(l=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:_t(he(t))}(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),De(t,r,l)}}function Le(t,e,r,n,o){t!==e&&Re(e,(function(i,a){if(o||(o=new Oe),V(i))xe(t,e,a,r,Le,n,o);else{var s=n?n(Pe(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),De(t,a,s)}}),ne)}var Ue,ze=(Ue=function(t,e,r){Le(t,e,r)},Ct((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=Ue.length>3&&"function"==typeof o?(n--,o):void 0,i&&xt(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var a=e[r];a&&Ue(t,a,r,o)}return t}))),Ge=Math.floor,Ve=Math.random;var We,Ye,ke,Be=parseFloat,Fe=Math.min,$e=Math.random;function He(t,e,r){if(r&&"boolean"!=typeof r&&xt(t,e,r)&&(e=r=void 0),void 0===r&&("boolean"==typeof e?(r=e,e=void 0):"boolean"==typeof t&&(r=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=K(t),void 0===e?(e=t,t=0):e=K(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var o=$e();return Fe(t+o*(e-t+Be("1e-"+((o+"").length-1))),e)}return function(t,e){return t+Ge(Ve()*(e-t+1))}(t,e)}!function(t){t.HUMAN_READY="human.ready",t.HUMAN_ERROR="human.error",t.HUMAN_ACTION_PENDING="human.action.pending",t.HUMAN_LOAD_PROGRESS="human.load.progress",t.CORE_BUNDLES_LOADED="core.bundles.loaded",t.AUDIO_PLAY="audio.play",t.AUDIO_PAUSE="audio.pause",t.AUDIO_MUTE="audio.mute",t.RECORDER_MESSAGE="recorder.message",t.RECORDER_START="recorder.start",t.RECORDER_STOP="recorder.stop",t.RECORDER_SENDING="recorder.sending",t.VOICE_SLEEP="voice.sleep",t.VOICE_WAKE="voice.wake",t.VOICE_INTERRUPT="voice.interrupt",t.VOICE_BARGE_IN="voice.barge_in",t.VOICE2TEXT="voice2text",t.WAKE_RECORDER_START="wake.record.start",t.WAKE_RECORDER_STOP="wake.record.stop",t.VOICE_INTERACTION_OPENED="voice.interaction.opened",t.VOICE_INTERACTION_CLOSED="voice.interaction.closed",t.VOICE_INTERACTION_WAKEUP="voice.interaction.wakeup",t.VOICE_INTERACTION_SLEEP="voice.interaction.sleep",t.VOICE_INTERACTION_WAKE_CONFIRM="voice.interaction.wake.confirm",t.VOICE_INTERACTION_EXIT_PROMPT="voice.interaction.exit.prompt",t.VOICE_INTERACTION_POST_EXIT_IDLE="voice.interaction.post_exit_idle",t.VOICE_INTERACTION_INTERRUPT="voice.interaction.interrupt",t.VOICE_INTERRUPT_HINT_SHOW="voice.interrupt.hint.show",t.VOICE_INTERRUPT_HINT_HIDE="voice.interrupt.hint.hide",t.VOICE_INTERRUPTED="voice.interrupted",t.VOICE_INTERACTION_AUDIO_START="voice.interaction.audio.start",t.VOICE_INTERACTION_AUDIO_STOP="voice.interaction.audio.stop",t.VOICE_INTERACTION_PLAY_START="voice.interaction.play.start",t.VOICE_INTERACTION_PLAY_END="voice.interaction.play.end",t.VOICE_INTERACTION_WEBRTC_STATE="voice.interaction.webrtc.state",t.WEBRTC_TTS_PLAY_START="webrtc.tts.play.start",t.WEBRTC_TTS_PLAY_END="webrtc.tts.play.end",t.CHAT_MESSAGE_BS_PLAY_START="chat.message.bs.play.start",t.CHAT_MESSAGE_BS_PLAY_END="chat.message.bs.play.end",t.TOOL_RESULT="tool.result",t.GATEWAY_CONNECTED="gateway.connected",t.GATEWAY_DISCONNECTED="gateway.disconnected",t.GATEWAY_RECONNECTING="gateway.reconnecting",t.GATEWAY_MESSAGE="gateway.message",t.GATEWAY_ERROR="gateway.error",t.GATEWAY_STATE_PUSH="gateway.state.push",t.CAMERA_PERSON_TEST_RESULT="camera.person.test.result",t.CAMERA_FACE_RECOGNITION_RESULT="camera.face.recognition.result",t.EXPRESSION_SMILE_DETECTED="expression.smile.detected",t.EXPRESSION_SMILE_STATE_CHANGED="expression.smile.state_changed",t.RENDER_READY="render.ready",t.RENDER_ERROR="render.error",t.MODEL_LOAD_PROGRESS="model.load.progress",t.MODEL_LOADED="model.loaded",t.MODEL_LOAD_FAILED="model.load.failed",t.ANIMATION_START="animation.start",t.ANIMATION_END="animation.end",t.ERROR="error"}(We||(We={})),function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(Ye||(Ye={})),function(t){t.DISCONNECTED="disconnected",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.CLOSED="closed"}(ke||(ke={}));export{E,Ye as W,We as a,Ce as d,ze as m,He as r};
1
+ import{a as t}from"./human-core-B5XXN8k3.js";const e=new WeakMap,r=new WeakMap,n=new WeakMap,o=Symbol("anyProducer"),i=Promise.resolve(),a=Symbol("listenerAdded"),s=Symbol("listenerRemoved");let c=!1,u=!1;const f=t=>"string"==typeof t||"symbol"==typeof t||"number"==typeof t;function l(t){if(!f(t))throw new TypeError("`eventName` must be a string, symbol, or number")}function d(t){if("function"!=typeof t)throw new TypeError("listener must be a function")}function p(t,e){const n=r.get(t);if(n.has(e))return n.get(e)}function h(t,e){const r=f(e)?e:o,i=n.get(t);if(i.has(r))return i.get(r)}function _(t,e){e=Array.isArray(e)?e:[e];let r=!1,o=()=>{},i=[];const a={enqueue(t){i.push(t),o()},finish(){r=!0,o()}};for(const r of e){let e=h(t,r);if(!e){e=new Set;n.get(t).set(r,e)}e.add(a)}return{async next(){return i?0===i.length?r?(i=void 0,this.next()):(await new Promise((t=>{o=t})),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(r){i=void 0;for(const r of e){const e=h(t,r);if(e&&(e.delete(a),0===e.size)){n.get(t).delete(r)}}return o(),arguments.length>0?{done:!0,value:await r}:{done:!0}},[Symbol.asyncIterator](){return this}}}function y(t){if(void 0===t)return g;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!g.includes(e)){if("string"!=typeof e)throw new TypeError("`methodNames` element must be a string");throw new Error(`${e} is not Emittery method`)}return t}const v=t=>t===a||t===s;function b(t,e,r){if(v(e))try{c=!0,t.emit(e,r)}finally{c=!1}}class E{static mixin(t,e){return e=y(e),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(const t of e)if(void 0!==r.prototype[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(r.prototype,t,{enumerable:!1,get:function(){return Object.defineProperty(this,t,{enumerable:!1,value:new E}),this[t]}});const n=e=>function(...r){return this[t][e](...r)};for(const t of e)Object.defineProperty(r.prototype,t,{enumerable:!1,value:n(t)});return r}}static get isDebugEnabled(){if("object"!=typeof globalThis.process?.env)return u;const{env:t}=globalThis.process??{env:{}};return"emittery"===t.DEBUG||"*"===t.DEBUG||u}static set isDebugEnabled(t){u=t}constructor(t={}){e.set(this,new Set),r.set(this,new Map),n.set(this,new Map),n.get(this).set(o,new Set),this.debug=t.debug??{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,e,r,n)=>{try{n=JSON.stringify(n)}catch{n=`Object with the following keys failed to stringify: ${Object.keys(n).join(",")}`}"symbol"!=typeof r&&"number"!=typeof r||(r=r.toString());const o=new Date;o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()})}logIfDebugEnabled(t,e,r){(E.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,e,r)}on(t,e){d(e),t=Array.isArray(t)?t:[t];for(const n of t){l(n);let t=p(this,n);if(!t){t=new Set;r.get(this).set(n,t)}t.add(e),this.logIfDebugEnabled("subscribe",n,void 0),v(n)||b(this,a,{eventName:n,listener:e})}return this.off.bind(this,t,e)}off(t,e){d(e),t=Array.isArray(t)?t:[t];for(const n of t){l(n);const t=p(this,n);if(t&&(t.delete(e),0===t.size)){r.get(this).delete(n)}this.logIfDebugEnabled("unsubscribe",n,void 0),v(n)||b(this,s,{eventName:n,listener:e})}}once(t){let e;const r=new Promise((r=>{e=this.on(t,(t=>{e(),r(t)}))}));return r.off=e,r}events(t){t=Array.isArray(t)?t:[t];for(const e of t)l(e);return _(this,t)}async emit(t,r){if(l(t),v(t)&&!c)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emit",t,r),function(t,e,r){const i=n.get(t);if(i.has(e))for(const t of i.get(e))t.enqueue(r);if(i.has(o)){const t=Promise.all([e,r]);for(const e of i.get(o))e.enqueue(t)}}(this,t,r);const a=p(this,t)??new Set,s=e.get(this),u=[...a],f=v(t)?[]:[...s];await i,await Promise.all([...u.map((async t=>{if(a.has(t))return t(r)})),...f.map((async e=>{if(s.has(e))return e(t,r)}))])}async emitSerial(t,r){if(l(t),v(t)&&!c)throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");this.logIfDebugEnabled("emitSerial",t,r);const n=p(this,t)??new Set,o=e.get(this),a=[...n],s=[...o];await i;for(const t of a)n.has(t)&&await t(r);for(const e of s)o.has(e)&&await e(t,r)}onAny(t){return d(t),this.logIfDebugEnabled("subscribeAny",void 0,void 0),e.get(this).add(t),b(this,a,{listener:t}),this.offAny.bind(this,t)}anyEvent(){return _(this)}offAny(t){d(t),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),b(this,s,{listener:t}),e.get(this).delete(t)}clearListeners(t){t=Array.isArray(t)?t:[t];for(const o of t)if(this.logIfDebugEnabled("clear",o,void 0),f(o)){const t=p(this,o);t&&t.clear();const e=h(this,o);if(e){for(const t of e)t.finish();e.clear()}}else{e.get(this).clear();for(const[t,e]of r.get(this).entries())e.clear(),r.get(this).delete(t);for(const[t,e]of n.get(this).entries()){for(const t of e)t.finish();e.clear(),n.get(this).delete(t)}}}listenerCount(t){t=Array.isArray(t)?t:[t];let o=0;for(const i of t)if(f(i))o+=e.get(this).size+(p(this,i)?.size??0)+(h(this,i)?.size??0)+(h(this)?.size??0);else{void 0!==i&&l(i),o+=e.get(this).size;for(const t of r.get(this).values())o+=t.size;for(const t of n.get(this).values())o+=t.size}return o}bindMethods(t,e){if("object"!=typeof t||null===t)throw new TypeError("`target` must be an object");e=y(e);for(const r of e){if(void 0!==t[r])throw new Error(`The property \`${r}\` already exists on \`target\``);Object.defineProperty(t,r,{enumerable:!1,value:this[r].bind(this)})}}}const g=Object.getOwnPropertyNames(E.prototype).filter((t=>"constructor"!==t));Object.defineProperty(E,"listenerAdded",{value:a,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(E,"listenerRemoved",{value:s,writable:!1,enumerable:!0,configurable:!1});var O="object"==typeof t&&t&&t.Object===Object&&t,T="object"==typeof self&&self&&self.Object===Object&&self,A=O||T||Function("return this")(),m=A.Symbol,I=Object.prototype,N=I.hasOwnProperty,R=I.toString,w=m?m.toStringTag:void 0;var j=Object.prototype.toString;var S="[object Null]",C="[object Undefined]",D=m?m.toStringTag:void 0;function P(t){return null==t?void 0===t?C:S:D&&D in Object(t)?function(t){var e=N.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=R.call(t);return n&&(e?t[w]=r:delete t[w]),o}(t):function(t){return j.call(t)}(t)}function M(t){return null!=t&&"object"==typeof t}var x="[object Symbol]";var L=Array.isArray,U=/\s/;var z=/^\s+/;function G(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&U.test(t.charAt(e)););return e}(t)+1).replace(z,""):t}function V(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var W=NaN,Y=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,B=/^0o[0-7]+$/i,F=parseInt;function $(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||M(t)&&P(t)==x}(t))return W;if(V(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=V(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=G(t);var r=k.test(t);return r||B.test(t)?F(t.slice(2),r?2:8):Y.test(t)?W:+t}var H=1/0,q=17976931348623157e292;function K(t){return t?(t=$(t))===H||t===-H?(t<0?-1:1)*q:t==t?t:0:0===t?t:0}function X(t){return t}var J="[object AsyncFunction]",Q="[object Function]",Z="[object GeneratorFunction]",tt="[object Proxy]";function et(t){if(!V(t))return!1;var e=P(t);return e==Q||e==Z||e==J||e==tt}var rt,nt=A["__core-js_shared__"],ot=(rt=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||""))?"Symbol(src)_1."+rt:"";var it=Function.prototype.toString;var at=/^\[object .+?Constructor\]$/,st=Function.prototype,ct=Object.prototype,ut=st.toString,ft=ct.hasOwnProperty,lt=RegExp("^"+ut.call(ft).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dt(t){return!(!V(t)||(e=t,ot&&ot in e))&&(et(t)?lt:at).test(function(t){if(null!=t){try{return it.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return dt(r)?r:void 0}var ht=Object.create,_t=function(){function t(){}return function(e){if(!V(e))return{};if(ht)return ht(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var yt=Date.now;var vt,bt,Et,gt=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ot=gt?function(t,e){return gt(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:X,Tt=(vt=Ot,bt=0,Et=0,function(){var t=yt(),e=16-(t-Et);if(Et=t,e>0){if(++bt>=800)return arguments[0]}else bt=0;return vt.apply(void 0,arguments)}),At=9007199254740991,mt=/^(?:0|[1-9]\d*)$/;function It(t,e){var r=typeof t;return!!(e=null==e?At:e)&&("number"==r||"symbol"!=r&&mt.test(t))&&t>-1&&t%1==0&&t<e}function Nt(t,e,r){"__proto__"==e&&gt?gt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Rt(t,e){return t===e||t!=t&&e!=e}var wt=Object.prototype.hasOwnProperty;function jt(t,e,r){var n=t[e];wt.call(t,e)&&Rt(n,r)&&(void 0!==r||e in t)||Nt(t,e,r)}var St=Math.max;function Ct(t,e){return Tt(function(t,e,r){return e=St(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=St(n.length-e,0),a=Array(i);++o<i;)a[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(a),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,s)}}(t,e,X),t+"")}var Dt=9007199254740991;function Pt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Dt}function Mt(t){return null!=t&&Pt(t.length)&&!et(t)}function xt(t,e,r){if(!V(r))return!1;var n=typeof e;return!!("number"==n?Mt(r)&&It(e,r.length):"string"==n&&e in r)&&Rt(r[e],t)}var Lt=Object.prototype;function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)}function zt(t){return M(t)&&"[object Arguments]"==P(t)}var Gt=Object.prototype,Vt=Gt.hasOwnProperty,Wt=Gt.propertyIsEnumerable,Yt=zt(function(){return arguments}())?zt:function(t){return M(t)&&Vt.call(t,"callee")&&!Wt.call(t,"callee")};var kt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Bt=kt&&"object"==typeof module&&module&&!module.nodeType&&module,Ft=Bt&&Bt.exports===kt?A.Buffer:void 0,$t=(Ft?Ft.isBuffer:void 0)||function(){return!1},Ht={};Ht["[object Float32Array]"]=Ht["[object Float64Array]"]=Ht["[object Int8Array]"]=Ht["[object Int16Array]"]=Ht["[object Int32Array]"]=Ht["[object Uint8Array]"]=Ht["[object Uint8ClampedArray]"]=Ht["[object Uint16Array]"]=Ht["[object Uint32Array]"]=!0,Ht["[object Arguments]"]=Ht["[object Array]"]=Ht["[object ArrayBuffer]"]=Ht["[object Boolean]"]=Ht["[object DataView]"]=Ht["[object Date]"]=Ht["[object Error]"]=Ht["[object Function]"]=Ht["[object Map]"]=Ht["[object Number]"]=Ht["[object Object]"]=Ht["[object RegExp]"]=Ht["[object Set]"]=Ht["[object String]"]=Ht["[object WeakMap]"]=!1;var qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=qt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Kt&&Kt.exports===qt&&O.process,Jt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Xt&&Xt.binding&&Xt.binding("util")}catch(t){}}(),Qt=Jt&&Jt.isTypedArray,Zt=Qt?function(t){return function(e){return t(e)}}(Qt):function(t){return M(t)&&Pt(t.length)&&!!Ht[P(t)]};function te(t,e){var r=L(t),n=!r&&Yt(t),o=!r&&!n&&$t(t),i=!r&&!n&&!o&&Zt(t),a=r||n||o||i,s=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=s.length;for(var u in t)a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||It(u,c))||s.push(u);return s}var ee=Object.prototype.hasOwnProperty;function re(t){if(!V(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Ut(t),r=[];for(var n in t)("constructor"!=n||!e&&ee.call(t,n))&&r.push(n);return r}function ne(t){return Mt(t)?te(t):re(t)}var oe=pt(Object,"create");var ie=Object.prototype.hasOwnProperty;var ae=Object.prototype.hasOwnProperty;function se(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ce(t,e){for(var r=t.length;r--;)if(Rt(t[r][0],e))return r;return-1}se.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},se.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},se.prototype.get=function(t){var e=this.__data__;if(oe){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ie.call(e,t)?e[t]:void 0},se.prototype.has=function(t){var e=this.__data__;return oe?void 0!==e[t]:ae.call(e,t)},se.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=oe&&void 0===e?"__lodash_hash_undefined__":e,this};var ue=Array.prototype.splice;function fe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.__data__=[],this.size=0},fe.prototype.delete=function(t){var e=this.__data__,r=ce(e,t);return!(r<0)&&(r==e.length-1?e.pop():ue.call(e,r,1),--this.size,!0)},fe.prototype.get=function(t){var e=this.__data__,r=ce(e,t);return r<0?void 0:e[r][1]},fe.prototype.has=function(t){return ce(this.__data__,t)>-1},fe.prototype.set=function(t,e){var r=this.__data__,n=ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var le=pt(A,"Map");function de(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function pe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pe.prototype.clear=function(){this.size=0,this.__data__={hash:new se,map:new(le||fe),string:new se}},pe.prototype.delete=function(t){var e=de(this,t).delete(t);return this.size-=e?1:0,e},pe.prototype.get=function(t){return de(this,t).get(t)},pe.prototype.has=function(t){return de(this,t).has(t)},pe.prototype.set=function(t,e){var r=de(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var he=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),_e="[object Object]",ye=Function.prototype,ve=Object.prototype,be=ye.toString,Ee=ve.hasOwnProperty,ge=be.call(Object);function Oe(t){var e=this.__data__=new fe(t);this.size=e.size}Oe.prototype.clear=function(){this.__data__=new fe,this.size=0},Oe.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Oe.prototype.get=function(t){return this.__data__.get(t)},Oe.prototype.has=function(t){return this.__data__.has(t)},Oe.prototype.set=function(t,e){var r=this.__data__;if(r instanceof fe){var n=r.__data__;if(!le||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new pe(n)}return r.set(t,e),this.size=r.size,this};var Te="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ae=Te&&"object"==typeof module&&module&&!module.nodeType&&module,me=Ae&&Ae.exports===Te?A.Buffer:void 0;me&&me.allocUnsafe;var Ie=A.Uint8Array;function Ne(t,e){var r,n,o=(r=t.buffer,n=new r.constructor(r.byteLength),new Ie(n).set(new Ie(r)),n);return new t.constructor(o,t.byteOffset,t.length)}var Re=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var s=i[++n];if(!1===e(o[s],s,o))break}return t},we=function(){return A.Date.now()},je=Math.max,Se=Math.min;function Ce(t,e,r){var n,o,i,a,s,c,u=0,f=!1,l=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var r=n,i=o;return n=o=void 0,u=e,a=t.apply(i,r)}function h(t){var r=t-c;return void 0===c||r>=e||r<0||l&&t-u>=i}function _(){var t=we();if(h(t))return y(t);s=setTimeout(_,function(t){var r=e-(t-c);return l?Se(r,i-(t-u)):r}(t))}function y(t){return s=void 0,d&&n?p(t):(n=o=void 0,a)}function v(){var t=we(),r=h(t);if(n=arguments,o=this,c=t,r){if(void 0===s)return function(t){return u=t,s=setTimeout(_,e),f?p(t):a}(c);if(l)return clearTimeout(s),s=setTimeout(_,e),p(c)}return void 0===s&&(s=setTimeout(_,e)),a}return e=$(e)||0,V(r)&&(f=!!r.leading,i=(l="maxWait"in r)?je($(r.maxWait)||0,e):i,d="trailing"in r?!!r.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},v.flush=function(){return void 0===s?a:y(we())},v}function De(t,e,r){(void 0!==r&&!Rt(t[e],r)||void 0===r&&!(e in t))&&Nt(t,e,r)}function Pe(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Me(t){return function(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var s=e[i],c=void 0;void 0===c&&(c=t[s]),o?Nt(r,s,c):jt(r,s,c)}return r}(t,ne(t))}function xe(t,e,r,n,o,i,a){var s=Pe(t,r),c=Pe(e,r),u=a.get(c);if(u)De(t,r,u);else{var f,l=i?i(s,c,r+"",t,e,a):void 0,d=void 0===l;if(d){var p=L(c),h=!p&&$t(c),_=!p&&!h&&Zt(c);l=c,p||h||_?L(s)?l=s:M(f=s)&&Mt(f)?l=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(s):h?(d=!1,l=c.slice()):_?(d=!1,l=Ne(c)):l=[]:function(t){if(!M(t)||P(t)!=_e)return!1;var e=he(t);if(null===e)return!0;var r=Ee.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&be.call(r)==ge}(c)||Yt(c)?(l=s,Yt(s)?l=Me(s):V(s)&&!et(s)||(l=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:_t(he(t))}(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),De(t,r,l)}}function Le(t,e,r,n,o){t!==e&&Re(e,(function(i,a){if(o||(o=new Oe),V(i))xe(t,e,a,r,Le,n,o);else{var s=n?n(Pe(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),De(t,a,s)}}),ne)}var Ue,ze=(Ue=function(t,e,r){Le(t,e,r)},Ct((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=Ue.length>3&&"function"==typeof o?(n--,o):void 0,i&&xt(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var a=e[r];a&&Ue(t,a,r,o)}return t}))),Ge=Math.floor,Ve=Math.random;var We,Ye,ke,Be=parseFloat,Fe=Math.min,$e=Math.random;function He(t,e,r){if(r&&"boolean"!=typeof r&&xt(t,e,r)&&(e=r=void 0),void 0===r&&("boolean"==typeof e?(r=e,e=void 0):"boolean"==typeof t&&(r=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=K(t),void 0===e?(e=t,t=0):e=K(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var o=$e();return Fe(t+o*(e-t+Be("1e-"+((o+"").length-1))),e)}return function(t,e){return t+Ge(Ve()*(e-t+1))}(t,e)}!function(t){t.HUMAN_READY="human.ready",t.HUMAN_ERROR="human.error",t.HUMAN_ACTION_PENDING="human.action.pending",t.HUMAN_LOAD_PROGRESS="human.load.progress",t.CORE_BUNDLES_LOADED="core.bundles.loaded",t.AUDIO_PLAY="audio.play",t.AUDIO_PAUSE="audio.pause",t.AUDIO_MUTE="audio.mute",t.RECORDER_MESSAGE="recorder.message",t.RECORDER_START="recorder.start",t.RECORDER_STOP="recorder.stop",t.RECORDER_SENDING="recorder.sending",t.VOICE_SLEEP="voice.sleep",t.VOICE_WAKE="voice.wake",t.VOICE_INTERRUPT="voice.interrupt",t.VOICE_BARGE_IN="voice.barge_in",t.VOICE2TEXT="voice2text",t.WAKE_RECORDER_START="wake.record.start",t.WAKE_RECORDER_STOP="wake.record.stop",t.VOICE_INTERACTION_OPENED="voice.interaction.opened",t.VOICE_INTERACTION_CLOSED="voice.interaction.closed",t.VOICE_INTERACTION_WAKEUP="voice.interaction.wakeup",t.VOICE_INTERACTION_SLEEP="voice.interaction.sleep",t.VOICE_INTERACTION_WAKE_CONFIRM="voice.interaction.wake.confirm",t.VOICE_INTERACTION_EXIT_PROMPT="voice.interaction.exit.prompt",t.VOICE_INTERACTION_POST_EXIT_IDLE="voice.interaction.post_exit_idle",t.VOICE_INTERACTION_INTERRUPT="voice.interaction.interrupt",t.VOICE_INTERRUPT_HINT_SHOW="voice.interrupt.hint.show",t.VOICE_INTERRUPT_HINT_HIDE="voice.interrupt.hint.hide",t.VOICE_INTERRUPTED="voice.interrupted",t.VOICE_INTERACTION_AUDIO_START="voice.interaction.audio.start",t.VOICE_INTERACTION_AUDIO_STOP="voice.interaction.audio.stop",t.VOICE_INTERACTION_PLAY_START="voice.interaction.play.start",t.VOICE_INTERACTION_PLAY_END="voice.interaction.play.end",t.VOICE_INTERACTION_WEBRTC_STATE="voice.interaction.webrtc.state",t.WEBRTC_TTS_PLAY_START="webrtc.tts.play.start",t.WEBRTC_TTS_PLAY_END="webrtc.tts.play.end",t.CHAT_MESSAGE_BS_PLAY_START="chat.message.bs.play.start",t.CHAT_MESSAGE_BS_PLAY_END="chat.message.bs.play.end",t.TOOL_RESULT="tool.result",t.GATEWAY_CONNECTED="gateway.connected",t.GATEWAY_DISCONNECTED="gateway.disconnected",t.GATEWAY_RECONNECTING="gateway.reconnecting",t.GATEWAY_MESSAGE="gateway.message",t.GATEWAY_ERROR="gateway.error",t.GATEWAY_STATE_PUSH="gateway.state.push",t.CAMERA_PERSON_TEST_RESULT="camera.person.test.result",t.CAMERA_FACE_RECOGNITION_RESULT="camera.face.recognition.result",t.EXPRESSION_SMILE_DETECTED="expression.smile.detected",t.EXPRESSION_SMILE_STATE_CHANGED="expression.smile.state_changed",t.RENDER_READY="render.ready",t.RENDER_ERROR="render.error",t.MODEL_LOAD_PROGRESS="model.load.progress",t.MODEL_LOADED="model.loaded",t.MODEL_LOAD_FAILED="model.load.failed",t.ANIMATION_START="animation.start",t.ANIMATION_END="animation.end",t.ERROR="error"}(We||(We={})),function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(Ye||(Ye={})),function(t){t.DISCONNECTED="disconnected",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.CLOSED="closed"}(ke||(ke={}));export{E,Ye as W,We as a,Ce as d,ze as m,He as r};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{H as t}from"./chunks/human-core--eD9PU8K.js";export{G as GatewayService,b as GatewayState,V as VoiceConversation,d as VoiceConversationE2E,f as buildExpandedWakeWords,e as generateNameVariants}from"./chunks/human-core--eD9PU8K.js";export{a as EmitEvent,W as WebSocketState}from"./chunks/shared-UjU9uxX5.js";import"./chunks/render-CeTzdSzv.js";import"three";import"three/examples/jsm/controls/OrbitControls.js";import"three/examples/jsm/loaders/RGBELoader.js";import"three/examples/jsm/loaders/GLTFLoader.js";import"three/examples/jsm/loaders/KTX2Loader.js";import"three/examples/jsm/libs/meshopt_decoder.module.js";import"three/examples/jsm/loaders/DRACOLoader.js";import"three/addons/controls/OrbitControls.js";class i{container;conversation;hintElement=null;config;isVisible=!1;handleShow;handleHide;handleInterrupted;constructor(t){if("string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container element not found: ${t.container}`);this.container=e}else this.container=t.container;this.conversation=t.conversation,this.config={textPrefix:t.textPrefix??"说",textSuffix:t.textSuffix??"可打断",animationDuration:t.animationDuration??300,customStyles:t.customStyles},this.handleShow=this.show.bind(this),this.handleHide=this.hide.bind(this),this.handleInterrupted=this.onInterrupted.bind(this),this.registerEventListeners()}registerEventListeners(){this.conversation.on("interruptHintShow",this.handleShow),this.conversation.on("interruptHintHide",this.handleHide),this.conversation.on("interrupted",this.handleInterrupted)}unregisterEventListeners(){this.conversation.off("interruptHintShow",this.handleShow),this.conversation.off("interruptHintHide",this.handleHide),this.conversation.off("interrupted",this.handleInterrupted)}createHintElement(t){const e=document.createElement("div");e.id="interrupt-hint",e.className="interrupt-hint",Object.assign(e.style,{position:"fixed",bottom:"120px",left:"50%",transform:"translateX(-50%) translateY(20px)",padding:"12px 24px",backgroundColor:"rgba(0, 0, 0, 0.7)",backdropFilter:"blur(10px)",borderRadius:"24px",color:"#ffffff",fontSize:"16px",fontWeight:"500",display:"flex",alignItems:"center",gap:"8px",opacity:"0",transition:`opacity ${this.config.animationDuration}ms ease, transform ${this.config.animationDuration}ms ease`,zIndex:"10000",pointerEvents:"none",whiteSpace:"nowrap",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)"}),this.config.customStyles&&Object.assign(e.style,this.config.customStyles);const i=document.createElement("span");i.innerHTML="🎙️",i.style.fontSize="20px",e.appendChild(i);const n=document.createElement("span"),s=t.map((t=>`"${t}"`)).join("、");return n.textContent=`${this.config.textPrefix}${s}${this.config.textSuffix}`,e.appendChild(n),e}show(t){this.isVisible||(t.words,this.hintElement&&this.hintElement.remove(),this.hintElement=this.createHintElement(t.words),this.container.appendChild(this.hintElement),requestAnimationFrame((()=>{this.hintElement&&(this.hintElement.style.opacity="1",this.hintElement.style.transform="translateX(-50%) translateY(0)")})),this.isVisible=!0)}hide(){if(!this.isVisible||!this.hintElement)return;this.hintElement.style.opacity="0",this.hintElement.style.transform="translateX(-50%) translateY(20px)";const t=this.hintElement;setTimeout((()=>{t.remove()}),this.config.animationDuration),this.hintElement=null,this.isVisible=!1}onInterrupted(t){this.hide(),this.showFeedback(t.feedback)}showFeedback(t){const e=document.createElement("div");e.className="interrupt-feedback",Object.assign(e.style,{position:"fixed",bottom:"120px",left:"50%",transform:"translateX(-50%)",padding:"12px 24px",backgroundColor:"rgba(76, 175, 80, 0.9)",borderRadius:"24px",color:"#ffffff",fontSize:"16px",fontWeight:"500",opacity:"0",transition:"opacity 200ms ease",zIndex:"10001",pointerEvents:"none"}),e.textContent=t,this.container.appendChild(e),requestAnimationFrame((()=>{e.style.opacity="1"})),setTimeout((()=>{e.style.opacity="0",setTimeout((()=>{e.remove()}),200)}),1e3)}get visible(){return this.isVisible}forceShow(t){this.show({words:t||this.conversation.coreInterruptWords})}forceHide(){this.hide()}destroy(){this.unregisterEventListeners(),this.hintElement&&(this.hintElement.remove(),this.hintElement=null),this.isVisible=!1}}export{i as InterruptHint,t as default};
1
+ import{H as t}from"./chunks/human-core-B5XXN8k3.js";export{G as GatewayService,b as GatewayState,V as VoiceConversation,d as VoiceConversationE2E,f as buildExpandedWakeWords,e as generateNameVariants}from"./chunks/human-core-B5XXN8k3.js";export{a as EmitEvent,W as WebSocketState}from"./chunks/shared-OkYqVHlV.js";import"./chunks/render-XYHbtvY-.js";import"three";import"three/examples/jsm/controls/OrbitControls.js";import"three/examples/jsm/loaders/RGBELoader.js";import"three/examples/jsm/loaders/GLTFLoader.js";import"three/examples/jsm/loaders/KTX2Loader.js";import"three/examples/jsm/libs/meshopt_decoder.module.js";import"three/examples/jsm/loaders/DRACOLoader.js";import"three/addons/controls/OrbitControls.js";class i{container;conversation;hintElement=null;config;isVisible=!1;handleShow;handleHide;handleInterrupted;constructor(t){if("string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container element not found: ${t.container}`);this.container=e}else this.container=t.container;this.conversation=t.conversation,this.config={textPrefix:t.textPrefix??"说",textSuffix:t.textSuffix??"可打断",animationDuration:t.animationDuration??300,customStyles:t.customStyles},this.handleShow=this.show.bind(this),this.handleHide=this.hide.bind(this),this.handleInterrupted=this.onInterrupted.bind(this),this.registerEventListeners()}registerEventListeners(){this.conversation.on("interruptHintShow",this.handleShow),this.conversation.on("interruptHintHide",this.handleHide),this.conversation.on("interrupted",this.handleInterrupted)}unregisterEventListeners(){this.conversation.off("interruptHintShow",this.handleShow),this.conversation.off("interruptHintHide",this.handleHide),this.conversation.off("interrupted",this.handleInterrupted)}createHintElement(t){const e=document.createElement("div");e.id="interrupt-hint",e.className="interrupt-hint",Object.assign(e.style,{position:"fixed",bottom:"120px",left:"50%",transform:"translateX(-50%) translateY(20px)",padding:"12px 24px",backgroundColor:"rgba(0, 0, 0, 0.7)",backdropFilter:"blur(10px)",borderRadius:"24px",color:"#ffffff",fontSize:"16px",fontWeight:"500",display:"flex",alignItems:"center",gap:"8px",opacity:"0",transition:`opacity ${this.config.animationDuration}ms ease, transform ${this.config.animationDuration}ms ease`,zIndex:"10000",pointerEvents:"none",whiteSpace:"nowrap",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)"}),this.config.customStyles&&Object.assign(e.style,this.config.customStyles);const i=document.createElement("span");i.innerHTML="🎙️",i.style.fontSize="20px",e.appendChild(i);const n=document.createElement("span"),s=t.map((t=>`"${t}"`)).join("、");return n.textContent=`${this.config.textPrefix}${s}${this.config.textSuffix}`,e.appendChild(n),e}show(t){this.isVisible||(t.words,this.hintElement&&this.hintElement.remove(),this.hintElement=this.createHintElement(t.words),this.container.appendChild(this.hintElement),requestAnimationFrame((()=>{this.hintElement&&(this.hintElement.style.opacity="1",this.hintElement.style.transform="translateX(-50%) translateY(0)")})),this.isVisible=!0)}hide(){if(!this.isVisible||!this.hintElement)return;this.hintElement.style.opacity="0",this.hintElement.style.transform="translateX(-50%) translateY(20px)";const t=this.hintElement;setTimeout((()=>{t.remove()}),this.config.animationDuration),this.hintElement=null,this.isVisible=!1}onInterrupted(t){this.hide(),this.showFeedback(t.feedback)}showFeedback(t){const e=document.createElement("div");e.className="interrupt-feedback",Object.assign(e.style,{position:"fixed",bottom:"120px",left:"50%",transform:"translateX(-50%)",padding:"12px 24px",backgroundColor:"rgba(76, 175, 80, 0.9)",borderRadius:"24px",color:"#ffffff",fontSize:"16px",fontWeight:"500",opacity:"0",transition:"opacity 200ms ease",zIndex:"10001",pointerEvents:"none"}),e.textContent=t,this.container.appendChild(e),requestAnimationFrame((()=>{e.style.opacity="1"})),setTimeout((()=>{e.style.opacity="0",setTimeout((()=>{e.remove()}),200)}),1e3)}get visible(){return this.isVisible}forceShow(t){this.show({words:t||this.conversation.coreInterruptWords})}forceHide(){this.hide()}destroy(){this.unregisterEventListeners(),this.hintElement&&(this.hintElement.remove(),this.hintElement=null),this.isVisible=!1}}export{i as InterruptHint,t as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qt-human",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
4
4
  "description": "A JavaScript SDK for 3D digital human rendering and interaction",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"