qt-human 3.9.2 → 3.9.3
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.
- package/dist/bundle.iife.js +1 -1
- package/dist/bundle.umd.js +1 -1
- package/dist/esm/chunks/human-core-COvRMT3l.js +1 -0
- package/dist/esm/chunks/index-DgEJCpaj.js +1 -0
- package/dist/esm/chunks/{render-DjEFzmMF.js → render-kGcOzzbC.js} +1 -1
- package/dist/esm/chunks/{shared-D2ogTnBH.js → shared-Bsx1K6Nf.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/types/modules/human.d.ts +1 -1
- package/dist/esm/types/modules/human.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/esm/chunks/human-core-EKV7xbHB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./human-core-EKV7xbHB.js";const e=new WeakMap,r=new WeakMap,n=new WeakMap,o=Symbol("anyProducer"),i=Promise.resolve(),a=Symbol("listenerAdded"),s=Symbol("listenerRemoved");let u=!1,c=!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 h(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 y(t,e){const r=f(e)?e:o,i=n.get(t);if(i.has(r))return i.get(r)}function d(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=y(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=y(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 v(t){if(void 0===t)return m;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!m.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 b=t=>t===a||t===s;function g(t,e,r){if(b(e))try{u=!0,t.emit(e,r)}finally{u=!1}}class _{static mixin(t,e){return e=v(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 _}),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 c;const{env:t}=globalThis.process??{env:{}};return"emittery"===t.DEBUG||"*"===t.DEBUG||c}static set isDebugEnabled(t){c=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){(_.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,e,r)}on(t,e){h(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),b(n)||g(this,a,{eventName:n,listener:e})}return this.off.bind(this,t,e)}off(t,e){h(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),b(n)||g(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 d(this,t)}async emit(t,r){if(l(t),b(t)&&!u)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),c=[...a],f=b(t)?[]:[...s];await i,await Promise.all([...c.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),b(t)&&!u)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 h(t),this.logIfDebugEnabled("subscribeAny",void 0,void 0),e.get(this).add(t),g(this,a,{listener:t}),this.offAny.bind(this,t)}anyEvent(){return d(this)}offAny(t){h(t),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),g(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=y(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)+(y(this,i)?.size??0)+(y(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=v(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 m=Object.getOwnPropertyNames(_.prototype).filter((t=>"constructor"!==t));Object.defineProperty(_,"listenerAdded",{value:a,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(_,"listenerRemoved",{value:s,writable:!1,enumerable:!0,configurable:!1});var j="object"==typeof t&&t&&t.Object===Object&&t,w="object"==typeof self&&self&&self.Object===Object&&self,O=j||w||Function("return this")(),A=O.Symbol,E=Object.prototype,x=E.hasOwnProperty,z=E.toString,S=A?A.toStringTag:void 0;var T=Object.prototype.toString;var P="[object Null]",D="[object Undefined]",M=A?A.toStringTag:void 0;function I(t){return null==t?void 0===t?D:P:M&&M in Object(t)?function(t){var e=x.call(t,S),r=t[S];try{t[S]=void 0;var n=!0}catch(t){}var o=z.call(t);return n&&(e?t[S]=r:delete t[S]),o}(t):function(t){return T.call(t)}(t)}function $(t){return null!=t&&"object"==typeof t}var N="[object Symbol]";var F=Array.isArray,k=/\s/;var U=/^\s+/;function B(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&k.test(t.charAt(e)););return e}(t)+1).replace(U,""):t}function R(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var W=NaN,q=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,G=/^0o[0-7]+$/i,L=parseInt;function H(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||$(t)&&I(t)==N}(t))return W;if(R(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=R(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=B(t);var r=C.test(t);return r||G.test(t)?L(t.slice(2),r?2:8):q.test(t)?W:+t}var J=1/0,V=17976931348623157e292;function K(t){return t?(t=H(t))===J||t===-J?(t<0?-1:1)*V:t==t?t:0:0===t?t:0}function Q(t){return t}var X="[object AsyncFunction]",Y="[object Function]",Z="[object GeneratorFunction]",tt="[object Proxy]";function et(t){if(!R(t))return!1;var e=I(t);return e==Y||e==Z||e==X||e==tt}var rt,nt=O["__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,ut=Object.prototype,ct=st.toString,ft=ut.hasOwnProperty,lt=RegExp("^"+ct.call(ft).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ht(t){return!(!R(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 ht(r)?r:void 0}var yt=Object.create,dt=function(){function t(){}return function(e){if(!R(e))return{};if(yt)return yt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var vt=Date.now;var bt,gt,_t,mt=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),jt=mt?function(t,e){return mt(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Q,wt=(bt=jt,gt=0,_t=0,function(){var t=vt(),e=16-(t-_t);if(_t=t,e>0){if(++gt>=800)return arguments[0]}else gt=0;return bt.apply(void 0,arguments)}),Ot=9007199254740991,At=/^(?:0|[1-9]\d*)$/;function Et(t,e){var r=typeof t;return!!(e=null==e?Ot:e)&&("number"==r||"symbol"!=r&&At.test(t))&&t>-1&&t%1==0&&t<e}function xt(t,e,r){"__proto__"==e&&mt?mt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function zt(t,e){return t===e||t!=t&&e!=e}var St=Object.prototype.hasOwnProperty;function Tt(t,e,r){var n=t[e];St.call(t,e)&&zt(n,r)&&(void 0!==r||e in t)||xt(t,e,r)}var Pt=Math.max;function Dt(t,e){return wt(function(t,e,r){return e=Pt(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=Pt(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,Q),t+"")}var Mt=9007199254740991;function It(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Mt}function $t(t){return null!=t&&It(t.length)&&!et(t)}function Nt(t,e,r){if(!R(r))return!1;var n=typeof e;return!!("number"==n?$t(r)&&Et(e,r.length):"string"==n&&e in r)&&zt(r[e],t)}var Ft=Object.prototype;function kt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)}function Ut(t){return $(t)&&"[object Arguments]"==I(t)}var Bt=Object.prototype,Rt=Bt.hasOwnProperty,Wt=Bt.propertyIsEnumerable,qt=Ut(function(){return arguments}())?Ut:function(t){return $(t)&&Rt.call(t,"callee")&&!Wt.call(t,"callee")};var Ct="object"==typeof exports&&exports&&!exports.nodeType&&exports,Gt=Ct&&"object"==typeof module&&module&&!module.nodeType&&module,Lt=Gt&&Gt.exports===Ct?O.Buffer:void 0,Ht=(Lt?Lt.isBuffer:void 0)||function(){return!1},Jt={};Jt["[object Float32Array]"]=Jt["[object Float64Array]"]=Jt["[object Int8Array]"]=Jt["[object Int16Array]"]=Jt["[object Int32Array]"]=Jt["[object Uint8Array]"]=Jt["[object Uint8ClampedArray]"]=Jt["[object Uint16Array]"]=Jt["[object Uint32Array]"]=!0,Jt["[object Arguments]"]=Jt["[object Array]"]=Jt["[object ArrayBuffer]"]=Jt["[object Boolean]"]=Jt["[object DataView]"]=Jt["[object Date]"]=Jt["[object Error]"]=Jt["[object Function]"]=Jt["[object Map]"]=Jt["[object Number]"]=Jt["[object Object]"]=Jt["[object RegExp]"]=Jt["[object Set]"]=Jt["[object String]"]=Jt["[object WeakMap]"]=!1;var Vt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Qt=Kt&&Kt.exports===Vt&&j.process,Xt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Qt&&Qt.binding&&Qt.binding("util")}catch(t){}}(),Yt=Xt&&Xt.isTypedArray,Zt=Yt?function(t){return function(e){return t(e)}}(Yt):function(t){return $(t)&&It(t.length)&&!!Jt[I(t)]};function te(t,e){var r=F(t),n=!r&&qt(t),o=!r&&!n&&Ht(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):[],u=s.length;for(var c in t)a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Et(c,u))||s.push(c);return s}var ee=Object.prototype.hasOwnProperty;function re(t){if(!R(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=kt(t),r=[];for(var n in t)("constructor"!=n||!e&&ee.call(t,n))&&r.push(n);return r}function ne(t){return $t(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 ue(t,e){for(var r=t.length;r--;)if(zt(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 ce=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=ue(e,t);return!(r<0)&&(r==e.length-1?e.pop():ce.call(e,r,1),--this.size,!0)},fe.prototype.get=function(t){var e=this.__data__,r=ue(e,t);return r<0?void 0:e[r][1]},fe.prototype.has=function(t){return ue(this.__data__,t)>-1},fe.prototype.set=function(t,e){var r=this.__data__,n=ue(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var le=pt(O,"Map");function he(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=he(this,t).delete(t);return this.size-=e?1:0,e},pe.prototype.get=function(t){return he(this,t).get(t)},pe.prototype.has=function(t){return he(this,t).has(t)},pe.prototype.set=function(t,e){var r=he(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var ye=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),de="[object Object]",ve=Function.prototype,be=Object.prototype,ge=ve.toString,_e=be.hasOwnProperty,me=ge.call(Object);function je(t){var e=this.__data__=new fe(t);this.size=e.size}je.prototype.clear=function(){this.__data__=new fe,this.size=0},je.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},je.prototype.get=function(t){return this.__data__.get(t)},je.prototype.has=function(t){return this.__data__.has(t)},je.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 we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=we&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=Oe&&Oe.exports===we?O.Buffer:void 0;Ae&&Ae.allocUnsafe;var Ee=O.Uint8Array;function xe(t,e){var r,n,o=(r=t.buffer,n=new r.constructor(r.byteLength),new Ee(n).set(new Ee(r)),n);return new t.constructor(o,t.byteOffset,t.length)}var ze=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},Se=function(){return O.Date.now()},Te=Math.max,Pe=Math.min;function De(t,e,r){var n,o,i,a,s,u,c=0,f=!1,l=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var r=n,i=o;return n=o=void 0,c=e,a=t.apply(i,r)}function y(t){var r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=i}function d(){var t=Se();if(y(t))return v(t);s=setTimeout(d,function(t){var r=e-(t-u);return l?Pe(r,i-(t-c)):r}(t))}function v(t){return s=void 0,h&&n?p(t):(n=o=void 0,a)}function b(){var t=Se(),r=y(t);if(n=arguments,o=this,u=t,r){if(void 0===s)return function(t){return c=t,s=setTimeout(d,e),f?p(t):a}(u);if(l)return clearTimeout(s),s=setTimeout(d,e),p(u)}return void 0===s&&(s=setTimeout(d,e)),a}return e=H(e)||0,R(r)&&(f=!!r.leading,i=(l="maxWait"in r)?Te(H(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=u=o=s=void 0},b.flush=function(){return void 0===s?a:v(Se())},b}function Me(t,e,r){(void 0!==r&&!zt(t[e],r)||void 0===r&&!(e in t))&&xt(t,e,r)}function Ie(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function $e(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],u=void 0;void 0===u&&(u=t[s]),o?xt(r,s,u):Tt(r,s,u)}return r}(t,ne(t))}function Ne(t,e,r,n,o,i,a){var s=Ie(t,r),u=Ie(e,r),c=a.get(u);if(c)Me(t,r,c);else{var f,l=i?i(s,u,r+"",t,e,a):void 0,h=void 0===l;if(h){var p=F(u),y=!p&&Ht(u),d=!p&&!y&&Zt(u);l=u,p||y||d?F(s)?l=s:$(f=s)&&$t(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):y?(h=!1,l=u.slice()):d?(h=!1,l=xe(u)):l=[]:function(t){if(!$(t)||I(t)!=de)return!1;var e=ye(t);if(null===e)return!0;var r=_e.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ge.call(r)==me}(u)||qt(u)?(l=s,qt(s)?l=$e(s):R(s)&&!et(s)||(l=function(t){return"function"!=typeof t.constructor||kt(t)?{}:dt(ye(t))}(u))):h=!1}h&&(a.set(u,l),o(l,u,n,i,a),a.delete(u)),Me(t,r,l)}}function Fe(t,e,r,n,o){t!==e&&ze(e,(function(i,a){if(o||(o=new je),R(i))Ne(t,e,a,r,Fe,n,o);else{var s=n?n(Ie(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Me(t,a,s)}}),ne)}var ke,Ue=(ke=function(t,e,r){Fe(t,e,r)},Dt((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=ke.length>3&&"function"==typeof o?(n--,o):void 0,i&&Nt(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var a=e[r];a&&ke(t,a,r,o)}return t}))),Be=Math.floor,Re=Math.random;var We=parseFloat,qe=Math.min,Ce=Math.random;function Ge(t,e,r){if(r&&"boolean"!=typeof r&&Nt(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=Ce();return qe(t+o*(e-t+We("1e-"+((o+"").length-1))),e)}return function(t,e){return t+Be(Re()*(e-t+1))}(t,e)}export{_ as E,De as d,Ue as m,Ge as r};
|
|
1
|
+
import{a as t}from"./human-core-COvRMT3l.js";const e=new WeakMap,r=new WeakMap,n=new WeakMap,o=Symbol("anyProducer"),i=Promise.resolve(),a=Symbol("listenerAdded"),s=Symbol("listenerRemoved");let u=!1,c=!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 h(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 y(t,e){const r=f(e)?e:o,i=n.get(t);if(i.has(r))return i.get(r)}function d(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=y(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=y(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 v(t){if(void 0===t)return m;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!m.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 b=t=>t===a||t===s;function g(t,e,r){if(b(e))try{u=!0,t.emit(e,r)}finally{u=!1}}class _{static mixin(t,e){return e=v(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 _}),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 c;const{env:t}=globalThis.process??{env:{}};return"emittery"===t.DEBUG||"*"===t.DEBUG||c}static set isDebugEnabled(t){c=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){(_.isDebugEnabled||this.debug.enabled)&&this.debug.logger(t,this.debug.name,e,r)}on(t,e){h(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),b(n)||g(this,a,{eventName:n,listener:e})}return this.off.bind(this,t,e)}off(t,e){h(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),b(n)||g(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 d(this,t)}async emit(t,r){if(l(t),b(t)&&!u)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),c=[...a],f=b(t)?[]:[...s];await i,await Promise.all([...c.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),b(t)&&!u)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 h(t),this.logIfDebugEnabled("subscribeAny",void 0,void 0),e.get(this).add(t),g(this,a,{listener:t}),this.offAny.bind(this,t)}anyEvent(){return d(this)}offAny(t){h(t),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),g(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=y(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)+(y(this,i)?.size??0)+(y(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=v(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 m=Object.getOwnPropertyNames(_.prototype).filter((t=>"constructor"!==t));Object.defineProperty(_,"listenerAdded",{value:a,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(_,"listenerRemoved",{value:s,writable:!1,enumerable:!0,configurable:!1});var j="object"==typeof t&&t&&t.Object===Object&&t,w="object"==typeof self&&self&&self.Object===Object&&self,O=j||w||Function("return this")(),A=O.Symbol,E=Object.prototype,x=E.hasOwnProperty,z=E.toString,S=A?A.toStringTag:void 0;var T=Object.prototype.toString;var P="[object Null]",D="[object Undefined]",M=A?A.toStringTag:void 0;function I(t){return null==t?void 0===t?D:P:M&&M in Object(t)?function(t){var e=x.call(t,S),r=t[S];try{t[S]=void 0;var n=!0}catch(t){}var o=z.call(t);return n&&(e?t[S]=r:delete t[S]),o}(t):function(t){return T.call(t)}(t)}function $(t){return null!=t&&"object"==typeof t}var N="[object Symbol]";var F=Array.isArray,k=/\s/;var U=/^\s+/;function B(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&k.test(t.charAt(e)););return e}(t)+1).replace(U,""):t}function R(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var W=NaN,q=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,G=/^0o[0-7]+$/i,L=parseInt;function H(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||$(t)&&I(t)==N}(t))return W;if(R(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=R(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=B(t);var r=C.test(t);return r||G.test(t)?L(t.slice(2),r?2:8):q.test(t)?W:+t}var J=1/0,V=17976931348623157e292;function K(t){return t?(t=H(t))===J||t===-J?(t<0?-1:1)*V:t==t?t:0:0===t?t:0}function Q(t){return t}var X="[object AsyncFunction]",Y="[object Function]",Z="[object GeneratorFunction]",tt="[object Proxy]";function et(t){if(!R(t))return!1;var e=I(t);return e==Y||e==Z||e==X||e==tt}var rt,nt=O["__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,ut=Object.prototype,ct=st.toString,ft=ut.hasOwnProperty,lt=RegExp("^"+ct.call(ft).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ht(t){return!(!R(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 ht(r)?r:void 0}var yt=Object.create,dt=function(){function t(){}return function(e){if(!R(e))return{};if(yt)return yt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var vt=Date.now;var bt,gt,_t,mt=function(){try{var t=pt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),jt=mt?function(t,e){return mt(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:Q,wt=(bt=jt,gt=0,_t=0,function(){var t=vt(),e=16-(t-_t);if(_t=t,e>0){if(++gt>=800)return arguments[0]}else gt=0;return bt.apply(void 0,arguments)}),Ot=9007199254740991,At=/^(?:0|[1-9]\d*)$/;function Et(t,e){var r=typeof t;return!!(e=null==e?Ot:e)&&("number"==r||"symbol"!=r&&At.test(t))&&t>-1&&t%1==0&&t<e}function xt(t,e,r){"__proto__"==e&&mt?mt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function zt(t,e){return t===e||t!=t&&e!=e}var St=Object.prototype.hasOwnProperty;function Tt(t,e,r){var n=t[e];St.call(t,e)&&zt(n,r)&&(void 0!==r||e in t)||xt(t,e,r)}var Pt=Math.max;function Dt(t,e){return wt(function(t,e,r){return e=Pt(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=Pt(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,Q),t+"")}var Mt=9007199254740991;function It(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Mt}function $t(t){return null!=t&&It(t.length)&&!et(t)}function Nt(t,e,r){if(!R(r))return!1;var n=typeof e;return!!("number"==n?$t(r)&&Et(e,r.length):"string"==n&&e in r)&&zt(r[e],t)}var Ft=Object.prototype;function kt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)}function Ut(t){return $(t)&&"[object Arguments]"==I(t)}var Bt=Object.prototype,Rt=Bt.hasOwnProperty,Wt=Bt.propertyIsEnumerable,qt=Ut(function(){return arguments}())?Ut:function(t){return $(t)&&Rt.call(t,"callee")&&!Wt.call(t,"callee")};var Ct="object"==typeof exports&&exports&&!exports.nodeType&&exports,Gt=Ct&&"object"==typeof module&&module&&!module.nodeType&&module,Lt=Gt&&Gt.exports===Ct?O.Buffer:void 0,Ht=(Lt?Lt.isBuffer:void 0)||function(){return!1},Jt={};Jt["[object Float32Array]"]=Jt["[object Float64Array]"]=Jt["[object Int8Array]"]=Jt["[object Int16Array]"]=Jt["[object Int32Array]"]=Jt["[object Uint8Array]"]=Jt["[object Uint8ClampedArray]"]=Jt["[object Uint16Array]"]=Jt["[object Uint32Array]"]=!0,Jt["[object Arguments]"]=Jt["[object Array]"]=Jt["[object ArrayBuffer]"]=Jt["[object Boolean]"]=Jt["[object DataView]"]=Jt["[object Date]"]=Jt["[object Error]"]=Jt["[object Function]"]=Jt["[object Map]"]=Jt["[object Number]"]=Jt["[object Object]"]=Jt["[object RegExp]"]=Jt["[object Set]"]=Jt["[object String]"]=Jt["[object WeakMap]"]=!1;var Vt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Qt=Kt&&Kt.exports===Vt&&j.process,Xt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Qt&&Qt.binding&&Qt.binding("util")}catch(t){}}(),Yt=Xt&&Xt.isTypedArray,Zt=Yt?function(t){return function(e){return t(e)}}(Yt):function(t){return $(t)&&It(t.length)&&!!Jt[I(t)]};function te(t,e){var r=F(t),n=!r&&qt(t),o=!r&&!n&&Ht(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):[],u=s.length;for(var c in t)a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Et(c,u))||s.push(c);return s}var ee=Object.prototype.hasOwnProperty;function re(t){if(!R(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=kt(t),r=[];for(var n in t)("constructor"!=n||!e&&ee.call(t,n))&&r.push(n);return r}function ne(t){return $t(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 ue(t,e){for(var r=t.length;r--;)if(zt(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 ce=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=ue(e,t);return!(r<0)&&(r==e.length-1?e.pop():ce.call(e,r,1),--this.size,!0)},fe.prototype.get=function(t){var e=this.__data__,r=ue(e,t);return r<0?void 0:e[r][1]},fe.prototype.has=function(t){return ue(this.__data__,t)>-1},fe.prototype.set=function(t,e){var r=this.__data__,n=ue(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var le=pt(O,"Map");function he(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=he(this,t).delete(t);return this.size-=e?1:0,e},pe.prototype.get=function(t){return he(this,t).get(t)},pe.prototype.has=function(t){return he(this,t).has(t)},pe.prototype.set=function(t,e){var r=he(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var ye=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),de="[object Object]",ve=Function.prototype,be=Object.prototype,ge=ve.toString,_e=be.hasOwnProperty,me=ge.call(Object);function je(t){var e=this.__data__=new fe(t);this.size=e.size}je.prototype.clear=function(){this.__data__=new fe,this.size=0},je.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},je.prototype.get=function(t){return this.__data__.get(t)},je.prototype.has=function(t){return this.__data__.has(t)},je.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 we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=we&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=Oe&&Oe.exports===we?O.Buffer:void 0;Ae&&Ae.allocUnsafe;var Ee=O.Uint8Array;function xe(t,e){var r,n,o=(r=t.buffer,n=new r.constructor(r.byteLength),new Ee(n).set(new Ee(r)),n);return new t.constructor(o,t.byteOffset,t.length)}var ze=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},Se=function(){return O.Date.now()},Te=Math.max,Pe=Math.min;function De(t,e,r){var n,o,i,a,s,u,c=0,f=!1,l=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var r=n,i=o;return n=o=void 0,c=e,a=t.apply(i,r)}function y(t){var r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=i}function d(){var t=Se();if(y(t))return v(t);s=setTimeout(d,function(t){var r=e-(t-u);return l?Pe(r,i-(t-c)):r}(t))}function v(t){return s=void 0,h&&n?p(t):(n=o=void 0,a)}function b(){var t=Se(),r=y(t);if(n=arguments,o=this,u=t,r){if(void 0===s)return function(t){return c=t,s=setTimeout(d,e),f?p(t):a}(u);if(l)return clearTimeout(s),s=setTimeout(d,e),p(u)}return void 0===s&&(s=setTimeout(d,e)),a}return e=H(e)||0,R(r)&&(f=!!r.leading,i=(l="maxWait"in r)?Te(H(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=u=o=s=void 0},b.flush=function(){return void 0===s?a:v(Se())},b}function Me(t,e,r){(void 0!==r&&!zt(t[e],r)||void 0===r&&!(e in t))&&xt(t,e,r)}function Ie(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function $e(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],u=void 0;void 0===u&&(u=t[s]),o?xt(r,s,u):Tt(r,s,u)}return r}(t,ne(t))}function Ne(t,e,r,n,o,i,a){var s=Ie(t,r),u=Ie(e,r),c=a.get(u);if(c)Me(t,r,c);else{var f,l=i?i(s,u,r+"",t,e,a):void 0,h=void 0===l;if(h){var p=F(u),y=!p&&Ht(u),d=!p&&!y&&Zt(u);l=u,p||y||d?F(s)?l=s:$(f=s)&&$t(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):y?(h=!1,l=u.slice()):d?(h=!1,l=xe(u)):l=[]:function(t){if(!$(t)||I(t)!=de)return!1;var e=ye(t);if(null===e)return!0;var r=_e.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ge.call(r)==me}(u)||qt(u)?(l=s,qt(s)?l=$e(s):R(s)&&!et(s)||(l=function(t){return"function"!=typeof t.constructor||kt(t)?{}:dt(ye(t))}(u))):h=!1}h&&(a.set(u,l),o(l,u,n,i,a),a.delete(u)),Me(t,r,l)}}function Fe(t,e,r,n,o){t!==e&&ze(e,(function(i,a){if(o||(o=new je),R(i))Ne(t,e,a,r,Fe,n,o);else{var s=n?n(Ie(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Me(t,a,s)}}),ne)}var ke,Ue=(ke=function(t,e,r){Fe(t,e,r)},Dt((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=ke.length>3&&"function"==typeof o?(n--,o):void 0,i&&Nt(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var a=e[r];a&&ke(t,a,r,o)}return t}))),Be=Math.floor,Re=Math.random;var We=parseFloat,qe=Math.min,Ce=Math.random;function Ge(t,e,r){if(r&&"boolean"!=typeof r&&Nt(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=Ce();return qe(t+o*(e-t+We("1e-"+((o+"").length-1))),e)}return function(t,e){return t+Be(Re()*(e-t+1))}(t,e)}export{_ as E,De as d,Ue as m,Ge as r};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as t}from"./chunks/human-core-
|
|
1
|
+
import{H as t}from"./chunks/human-core-COvRMT3l.js";export{E as EmitEvent,G as GatewayService,b as GatewayState,V as VoiceConversation,d as VoiceConversationE2E,f as buildExpandedWakeWords,e as generateNameVariants}from"./chunks/human-core-COvRMT3l.js";import"./chunks/shared-Bsx1K6Nf.js";import"./chunks/render-kGcOzzbC.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";var i,n;!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(i||(i={})),function(t){t.DISCONNECTED="disconnected",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.CLOSED="closed"}(n||(n={}));class s{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||(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{s as InterruptHint,i as WebSocketState,t as default};
|
|
@@ -5,7 +5,7 @@ import type { IHuman, HumanConfig, Status, Voice2Text, Result, AskParams, AskRes
|
|
|
5
5
|
import { IResultData } from '@/api/interface';
|
|
6
6
|
import FramePlayer from '@/utils/framePlayer';
|
|
7
7
|
import { CameraConfig, FaceRecognitionConfig, SmileDetectionConfig } from '@/types/camera';
|
|
8
|
-
import { CameraSDK } from './camera';
|
|
8
|
+
import type { CameraSDK } from './camera';
|
|
9
9
|
declare class Human extends Emittery implements IHuman {
|
|
10
10
|
name: string;
|
|
11
11
|
core: ThreeJSApp | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"human.d.ts","sourceRoot":"","sources":["../../../../src/modules/human.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,OAAO,UAAU,MAAM,eAAe,CAAA;AACtC,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAW1C,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EAGV,MAAM,EACN,SAAS,EACT,WAAW,EACX,iBAAiB,EAEjB,WAAW,EACX,mBAAmB,EAEnB,iBAAiB,EACjB,cAAc,EAC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