wissive 0.1.0
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/LICENSE +21 -0
- package/README.md +193 -0
- package/dist/index.d.ts +695 -0
- package/dist/react.cjs +2 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +52 -0
- package/dist/react.js +17 -0
- package/dist/react.js.map +1 -0
- package/dist/vue.cjs +2 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.ts +78 -0
- package/dist/vue.js +22 -0
- package/dist/vue.js.map +1 -0
- package/dist/wissive.cjs +187 -0
- package/dist/wissive.cjs.map +1 -0
- package/dist/wissive.js +2687 -0
- package/dist/wissive.js.map +1 -0
- package/dist/wissive.umd.js +187 -0
- package/dist/wissive.umd.js.map +1 -0
- package/package.json +86 -0
- package/src/astro/Wissive.astro +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.cjs","sources":["../src/react.tsx"],"sourcesContent":["/**\n * Wrapper oficial para React — `import { Wissive } from 'wissive/react'`.\n *\n * Es exactamente el patrón documentado en README.md 4.5 (useRef + useEffect\n * + destroy en el cleanup), empaquetado una sola vez para que el consumidor\n * no tenga que escribirlo. `react` es peer dependency opcional: si no está\n * instalada, importar 'wissive' (sin /react) sigue funcionando igual.\n */\nimport { useEffect, useRef } from 'react';\nimport { createEmoji } from './index';\nimport type { WissiveInstance, WissiveOptions } from './index';\n\nexport interface WissiveProps extends Omit<WissiveOptions, 'target'> {\n name: string;\n}\n\nexport function Wissive({ name, ...options }: WissiveProps) {\n const slotRef = useRef<HTMLDivElement>(null);\n const instanceRef = useRef<WissiveInstance | null>(null);\n\n useEffect(() => {\n if (!slotRef.current) return;\n\n instanceRef.current = createEmoji(name, { target: slotRef.current, ...options });\n\n return () => {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n };\n // Solo remonta si cambia el nombre — cambiar una opción suelta (size,\n // sound, etc.) no justifica destruir y recrear la instancia entera.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [name]);\n\n return <div ref={slotRef} />;\n}\n"],"names":["Wissive","name","options","slotRef","useRef","instanceRef","useEffect","createEmoji","_a","jsx"],"mappings":"mKAgBO,SAASA,EAAQ,CAAE,KAAAC,EAAM,GAAGC,GAAyB,CAC1D,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCC,EAAcD,EAAAA,OAA+B,IAAI,EAEvDE,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAKH,EAAQ,QAEb,OAAAE,EAAY,QAAUE,EAAAA,YAAYN,EAAM,CAAE,OAAQE,EAAQ,QAAS,GAAGD,EAAS,EAExE,IAAM,QACXM,EAAAH,EAAY,UAAZ,MAAAG,EAAqB,UACrBH,EAAY,QAAU,IACxB,CAIF,EAAG,CAACJ,CAAI,CAAC,EAEFQ,EAAAA,IAAC,MAAA,CAAI,IAAKN,CAAA,CAAS,CAC5B"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
declare type CoreInteractionState = 'idle' | 'near' | 'hover' | 'click';
|
|
4
|
+
|
|
5
|
+
declare interface EmojiTheme {
|
|
6
|
+
baseColor: string;
|
|
7
|
+
strokeColor?: string;
|
|
8
|
+
glowColor?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare type InteractionState = CoreInteractionState | LifecycleState | ReactionState | MorphState | ProductCycleState | (string & {});
|
|
12
|
+
|
|
13
|
+
declare type LifecycleState = 'sleeping' | 'waking' | 'idle' | 'listening' | 'thinking' | 'searching' | 'working';
|
|
14
|
+
|
|
15
|
+
declare type MorphState = 'orbit' | 'radar' | 'progress';
|
|
16
|
+
|
|
17
|
+
declare type ProductCycleState = 'spawning' | 'humming' | 'loading' | 'dictating' | 'writing' | 'sending' | 'receiving' | 'uploading' | 'notifying' | 'alerting' | 'dragging' | 'bouncing' | 'powering-down';
|
|
18
|
+
|
|
19
|
+
declare type ReactionState = 'excited' | 'surprised' | 'suspicious' | 'angry' | 'drowsy' | 'happy' | 'curious' | 'confused' | 'bored' | 'proud' | 'shy' | 'sad' | 'laughing' | 'scared' | 'playful' | 'celebrate';
|
|
20
|
+
|
|
21
|
+
declare type ThemeOption = 'auto' | EmojiTheme;
|
|
22
|
+
|
|
23
|
+
export declare function Wissive({ name, ...options }: WissiveProps): JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare interface WissiveOptions {
|
|
26
|
+
target: HTMLElement;
|
|
27
|
+
size?: WissiveSize;
|
|
28
|
+
sound?: boolean;
|
|
29
|
+
interactive?: boolean;
|
|
30
|
+
draggable?: boolean;
|
|
31
|
+
nearRadius?: number;
|
|
32
|
+
flipX?: boolean;
|
|
33
|
+
emphasis?: boolean;
|
|
34
|
+
gazeTracking?: boolean;
|
|
35
|
+
ambientParticles?: boolean;
|
|
36
|
+
/** Visita reacciones al azar cuando está en reposo, para que se sienta vivo (default: true) */
|
|
37
|
+
autonomousStates?: boolean;
|
|
38
|
+
/** Qué estados puede visitar al deambular (default: `definition.autonomousStatePool` o AUTONOMOUS_STATES) */
|
|
39
|
+
autonomousStatePool?: InteractionState[];
|
|
40
|
+
reducedMotion?: 'auto' | boolean;
|
|
41
|
+
theme?: ThemeOption;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare type WissivePresetSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl';
|
|
45
|
+
|
|
46
|
+
export declare interface WissiveProps extends Omit<WissiveOptions, 'target'> {
|
|
47
|
+
name: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare type WissiveSize = WissivePresetSize | number;
|
|
51
|
+
|
|
52
|
+
export { }
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useEffect as f } from "react";
|
|
3
|
+
import { createEmoji as i } from "./wissive.js";
|
|
4
|
+
function p({ name: e, ...o }) {
|
|
5
|
+
const r = u(null), t = u(null);
|
|
6
|
+
return f(() => {
|
|
7
|
+
if (r.current)
|
|
8
|
+
return t.current = i(e, { target: r.current, ...o }), () => {
|
|
9
|
+
var n;
|
|
10
|
+
(n = t.current) == null || n.destroy(), t.current = null;
|
|
11
|
+
};
|
|
12
|
+
}, [e]), /* @__PURE__ */ c("div", { ref: r });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
p as Wissive
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/react.tsx"],"sourcesContent":["/**\n * Wrapper oficial para React — `import { Wissive } from 'wissive/react'`.\n *\n * Es exactamente el patrón documentado en README.md 4.5 (useRef + useEffect\n * + destroy en el cleanup), empaquetado una sola vez para que el consumidor\n * no tenga que escribirlo. `react` es peer dependency opcional: si no está\n * instalada, importar 'wissive' (sin /react) sigue funcionando igual.\n */\nimport { useEffect, useRef } from 'react';\nimport { createEmoji } from './index';\nimport type { WissiveInstance, WissiveOptions } from './index';\n\nexport interface WissiveProps extends Omit<WissiveOptions, 'target'> {\n name: string;\n}\n\nexport function Wissive({ name, ...options }: WissiveProps) {\n const slotRef = useRef<HTMLDivElement>(null);\n const instanceRef = useRef<WissiveInstance | null>(null);\n\n useEffect(() => {\n if (!slotRef.current) return;\n\n instanceRef.current = createEmoji(name, { target: slotRef.current, ...options });\n\n return () => {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n };\n // Solo remonta si cambia el nombre — cambiar una opción suelta (size,\n // sound, etc.) no justifica destruir y recrear la instancia entera.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [name]);\n\n return <div ref={slotRef} />;\n}\n"],"names":["Wissive","name","options","slotRef","useRef","instanceRef","useEffect","createEmoji","_a","jsx"],"mappings":";;;AAgBO,SAASA,EAAQ,EAAE,MAAAC,GAAM,GAAGC,KAAyB;AAC1D,QAAMC,IAAUC,EAAuB,IAAI,GACrCC,IAAcD,EAA+B,IAAI;AAEvD,SAAAE,EAAU,MAAM;AACd,QAAKH,EAAQ;AAEb,aAAAE,EAAY,UAAUE,EAAYN,GAAM,EAAE,QAAQE,EAAQ,SAAS,GAAGD,GAAS,GAExE,MAAM;;AACX,SAAAM,IAAAH,EAAY,YAAZ,QAAAG,EAAqB,WACrBH,EAAY,UAAU;AAAA,MACxB;AAAA,EAIF,GAAG,CAACJ,CAAI,CAAC,GAEF,gBAAAQ,EAAC,OAAA,EAAI,KAAKN,EAAA,CAAS;AAC5B;"}
|
package/dist/vue.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("./wissive.cjs"),i=t.defineComponent({name:"Wissive",props:{name:{type:String,required:!0},options:{type:Object,default:()=>({})}},setup(o){const n=t.ref(null);let e=null;return t.onMounted(()=>{n.value&&(e=r.createEmoji(o.name,{target:n.value,...o.options}))}),t.onUnmounted(()=>{e==null||e.destroy(),e=null}),()=>t.h("div",{ref:n})}});exports.Wissive=i;
|
|
2
|
+
//# sourceMappingURL=vue.cjs.map
|
package/dist/vue.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.cjs","sources":["../src/vue.ts"],"sourcesContent":["/**\n * Wrapper oficial para Vue — `import { Wissive } from 'wissive/vue'`.\n *\n * Mismo patrón que react.tsx (onMounted + onUnmounted + destroy), pero como\n * componente de opciones con render function en vez de un .vue de un solo\n * archivo — evita sumar @vitejs/plugin-vue solo para compilar un SFC.\n * `vue` es peer dependency opcional, igual que react/cuelume.\n */\nimport { defineComponent, h, onMounted, onUnmounted, ref, type PropType } from 'vue';\nimport { createEmoji } from './index';\nimport type { WissiveInstance, WissiveOptions } from './index';\n\nexport const Wissive = defineComponent({\n name: 'Wissive',\n props: {\n name: { type: String, required: true },\n options: { type: Object as PropType<Omit<WissiveOptions, 'target'>>, default: () => ({}) },\n },\n setup(props) {\n const slot = ref<HTMLDivElement | null>(null);\n let instance: WissiveInstance | null = null;\n\n onMounted(() => {\n if (!slot.value) return;\n instance = createEmoji(props.name, { target: slot.value, ...props.options });\n });\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => h('div', { ref: slot });\n },\n});\n"],"names":["Wissive","defineComponent","props","slot","ref","instance","onMounted","createEmoji","onUnmounted","h"],"mappings":"kIAYaA,EAAUC,EAAAA,gBAAgB,CACrC,KAAM,UACN,MAAO,CACL,KAAM,CAAE,KAAM,OAAQ,SAAU,EAAA,EAChC,QAAS,CAAE,KAAM,OAAoD,QAAS,KAAO,CAAA,EAAC,CAAG,EAE3F,MAAMC,EAAO,CACX,MAAMC,EAAOC,EAAAA,IAA2B,IAAI,EAC5C,IAAIC,EAAmC,KAEvCC,OAAAA,EAAAA,UAAU,IAAM,CACTH,EAAK,QACVE,EAAWE,EAAAA,YAAYL,EAAM,KAAM,CAAE,OAAQC,EAAK,MAAO,GAAGD,EAAM,QAAS,EAC7E,CAAC,EAEDM,EAAAA,YAAY,IAAM,CAChBH,GAAA,MAAAA,EAAU,UACVA,EAAW,IACb,CAAC,EAEM,IAAMI,EAAAA,EAAE,MAAO,CAAE,IAAKN,EAAM,CACrC,CACF,CAAC"}
|
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
2
|
+
import { ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { DefineComponent } from 'vue';
|
|
4
|
+
import { ExtractPropTypes } from 'vue';
|
|
5
|
+
import { PropType } from 'vue';
|
|
6
|
+
import { PublicProps } from 'vue';
|
|
7
|
+
import { RendererElement } from 'vue';
|
|
8
|
+
import { RendererNode } from 'vue';
|
|
9
|
+
import { VNode } from 'vue';
|
|
10
|
+
|
|
11
|
+
declare type CoreInteractionState = 'idle' | 'near' | 'hover' | 'click';
|
|
12
|
+
|
|
13
|
+
declare interface EmojiTheme {
|
|
14
|
+
baseColor: string;
|
|
15
|
+
strokeColor?: string;
|
|
16
|
+
glowColor?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare type InteractionState = CoreInteractionState | LifecycleState | ReactionState | MorphState | ProductCycleState | (string & {});
|
|
20
|
+
|
|
21
|
+
declare type LifecycleState = 'sleeping' | 'waking' | 'idle' | 'listening' | 'thinking' | 'searching' | 'working';
|
|
22
|
+
|
|
23
|
+
declare type MorphState = 'orbit' | 'radar' | 'progress';
|
|
24
|
+
|
|
25
|
+
declare type ProductCycleState = 'spawning' | 'humming' | 'loading' | 'dictating' | 'writing' | 'sending' | 'receiving' | 'uploading' | 'notifying' | 'alerting' | 'dragging' | 'bouncing' | 'powering-down';
|
|
26
|
+
|
|
27
|
+
declare type ReactionState = 'excited' | 'surprised' | 'suspicious' | 'angry' | 'drowsy' | 'happy' | 'curious' | 'confused' | 'bored' | 'proud' | 'shy' | 'sad' | 'laughing' | 'scared' | 'playful' | 'celebrate';
|
|
28
|
+
|
|
29
|
+
declare type ThemeOption = 'auto' | EmojiTheme;
|
|
30
|
+
|
|
31
|
+
export declare const Wissive: DefineComponent<ExtractPropTypes< {
|
|
32
|
+
name: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
options: {
|
|
37
|
+
type: PropType<Omit<WissiveOptions, "target">>;
|
|
38
|
+
default: () => {};
|
|
39
|
+
};
|
|
40
|
+
}>, () => VNode<RendererNode, RendererElement, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
|
|
43
|
+
name: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
options: {
|
|
48
|
+
type: PropType<Omit<WissiveOptions, "target">>;
|
|
49
|
+
default: () => {};
|
|
50
|
+
};
|
|
51
|
+
}>> & Readonly<{}>, {
|
|
52
|
+
options: Omit<WissiveOptions, "target">;
|
|
53
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
|
|
55
|
+
declare interface WissiveOptions {
|
|
56
|
+
target: HTMLElement;
|
|
57
|
+
size?: WissiveSize;
|
|
58
|
+
sound?: boolean;
|
|
59
|
+
interactive?: boolean;
|
|
60
|
+
draggable?: boolean;
|
|
61
|
+
nearRadius?: number;
|
|
62
|
+
flipX?: boolean;
|
|
63
|
+
emphasis?: boolean;
|
|
64
|
+
gazeTracking?: boolean;
|
|
65
|
+
ambientParticles?: boolean;
|
|
66
|
+
/** Visita reacciones al azar cuando está en reposo, para que se sienta vivo (default: true) */
|
|
67
|
+
autonomousStates?: boolean;
|
|
68
|
+
/** Qué estados puede visitar al deambular (default: `definition.autonomousStatePool` o AUTONOMOUS_STATES) */
|
|
69
|
+
autonomousStatePool?: InteractionState[];
|
|
70
|
+
reducedMotion?: 'auto' | boolean;
|
|
71
|
+
theme?: ThemeOption;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare type WissivePresetSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl';
|
|
75
|
+
|
|
76
|
+
declare type WissiveSize = WissivePresetSize | number;
|
|
77
|
+
|
|
78
|
+
export { }
|
package/dist/vue.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as n, ref as r, onMounted as i, onUnmounted as u, h as l } from "vue";
|
|
2
|
+
import { createEmoji as m } from "./wissive.js";
|
|
3
|
+
const a = n({
|
|
4
|
+
name: "Wissive",
|
|
5
|
+
props: {
|
|
6
|
+
name: { type: String, required: !0 },
|
|
7
|
+
options: { type: Object, default: () => ({}) }
|
|
8
|
+
},
|
|
9
|
+
setup(o) {
|
|
10
|
+
const t = r(null);
|
|
11
|
+
let e = null;
|
|
12
|
+
return i(() => {
|
|
13
|
+
t.value && (e = m(o.name, { target: t.value, ...o.options }));
|
|
14
|
+
}), u(() => {
|
|
15
|
+
e == null || e.destroy(), e = null;
|
|
16
|
+
}), () => l("div", { ref: t });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
a as Wissive
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=vue.js.map
|
package/dist/vue.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.js","sources":["../src/vue.ts"],"sourcesContent":["/**\n * Wrapper oficial para Vue — `import { Wissive } from 'wissive/vue'`.\n *\n * Mismo patrón que react.tsx (onMounted + onUnmounted + destroy), pero como\n * componente de opciones con render function en vez de un .vue de un solo\n * archivo — evita sumar @vitejs/plugin-vue solo para compilar un SFC.\n * `vue` es peer dependency opcional, igual que react/cuelume.\n */\nimport { defineComponent, h, onMounted, onUnmounted, ref, type PropType } from 'vue';\nimport { createEmoji } from './index';\nimport type { WissiveInstance, WissiveOptions } from './index';\n\nexport const Wissive = defineComponent({\n name: 'Wissive',\n props: {\n name: { type: String, required: true },\n options: { type: Object as PropType<Omit<WissiveOptions, 'target'>>, default: () => ({}) },\n },\n setup(props) {\n const slot = ref<HTMLDivElement | null>(null);\n let instance: WissiveInstance | null = null;\n\n onMounted(() => {\n if (!slot.value) return;\n instance = createEmoji(props.name, { target: slot.value, ...props.options });\n });\n\n onUnmounted(() => {\n instance?.destroy();\n instance = null;\n });\n\n return () => h('div', { ref: slot });\n },\n});\n"],"names":["Wissive","defineComponent","props","slot","ref","instance","onMounted","createEmoji","onUnmounted","h"],"mappings":";;AAYO,MAAMA,IAAUC,EAAgB;AAAA,EACrC,MAAM;AAAA,EACN,OAAO;AAAA,IACL,MAAM,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA,IAChC,SAAS,EAAE,MAAM,QAAoD,SAAS,OAAO,CAAA,GAAC;AAAA,EAAG;AAAA,EAE3F,MAAMC,GAAO;AACX,UAAMC,IAAOC,EAA2B,IAAI;AAC5C,QAAIC,IAAmC;AAEvC,WAAAC,EAAU,MAAM;AACd,MAAKH,EAAK,UACVE,IAAWE,EAAYL,EAAM,MAAM,EAAE,QAAQC,EAAK,OAAO,GAAGD,EAAM,SAAS;AAAA,IAC7E,CAAC,GAEDM,EAAY,MAAM;AAChB,MAAAH,KAAA,QAAAA,EAAU,WACVA,IAAW;AAAA,IACb,CAAC,GAEM,MAAMI,EAAE,OAAO,EAAE,KAAKN,GAAM;AAAA,EACrC;AACF,CAAC;"}
|
package/dist/wissive.cjs
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";var Qt=Object.create;var Ae=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Kt=(o,t,e)=>t in o?Ae(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var eo=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of qt(t))!Ht.call(o,n)&&n!==e&&Ae(o,n,{get:()=>t[n],enumerable:!(i=Vt(t,n))||i.enumerable});return o};var to=(o,t,e)=>(e=o!=null?Qt(Ut(o)):{},eo(t||!o||!o.__esModule?Ae(e,"default",{value:o,enumerable:!0}):e,o));var g=(o,t,e)=>Kt(o,typeof t!="symbol"?t+"":t,e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function f(o={}){return{eyeOpen:1,eyeScale:1,eyeType:0,eyeGap:32,eyeY:45,mouthY:63,mouthCurve:0,mouthWidth:.8,mouthOpen:0,mouthType:0,browY:0,browTilt:0,cheek:0,bob:0,shiftX:0,tears:0,gazeX:0,gazeY:0,turnAngle:0,zzz:0,sweat:0,storm:0,scribble:0,puff:0,...o}}const Ge={name:"mochi",emotion:"happy",baseColor:"#F2A9B8",silhouette:"heart",motion:{stiffness:220,damping:14,idleSpeed:3.2,idleAmplitude:2.5,idleIntervalMin:6e3,idleIntervalMax:12e3,motionType:"bouncy"},expressions:{idle:[f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0,bob:-1.5}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0,bob:1}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0})],near:[f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0,bob:-1.5}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:0,bob:-2.5})],hover:[f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:.3,bob:-4}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:.3,bob:-4.5})],click:[f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:.5,bob:-7}),f({eyeType:2,eyeScale:1,eyeGap:28.33,eyeY:43.33,mouthType:0,mouthY:53.33,mouthWidth:.39,mouthCurve:.43,cheek:.5,bob:-6})]}},Ve={name:"zumi",emotion:"flutter",baseColor:"#F2CB4E",silhouette:"round-blob",motion:{stiffness:300,damping:10,idleSpeed:4.5,idleAmplitude:3.8,idleIntervalMin:4e3,idleIntervalMax:9e3,motionType:"flutter"},expressions:{idle:[f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.3}),f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.4,bob:-1.5}),f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.35,bob:1})],near:[f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.5,bob:-2})],hover:[f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.7,bob:-4})],click:[f({eyeType:2,eyeScale:1,eyeGap:30,eyeY:43.33,mouthType:3,mouthY:45.83,mouthWidth:.27,mouthCurve:0,cheek:.9,bob:-6})]}},qe={name:"suri",emotion:"pleasure",baseColor:"#F28FC2",silhouette:"elongated-oval",motion:{stiffness:140,damping:18,idleSpeed:1.8,idleAmplitude:1.8,idleIntervalMin:7e3,idleIntervalMax:14e3,motionType:"serene"},expressions:{idle:[f({eyeType:1,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:0,mouthY:53.33,mouthWidth:.36,mouthCurve:.48,cheek:.4}),f({eyeType:1,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:0,mouthY:53.33,mouthWidth:.36,mouthCurve:.48,cheek:.5,bob:1})],near:[f({eyeType:1,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:0,mouthY:53.33,mouthWidth:.36,mouthCurve:.48,cheek:.6,bob:2})],hover:[f({eyeType:1,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:0,mouthY:53.33,mouthWidth:.36,mouthCurve:.48,cheek:.75,bob:3.5})],click:[f({eyeType:1,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:0,mouthY:53.33,mouthWidth:.36,mouthCurve:.48,cheek:.9,bob:5})]}},Ue={name:"nima",emotion:"peaceful",baseColor:"#9AC9A0",silhouette:"ghost-blob",motion:{stiffness:110,damping:22,idleSpeed:1.2,idleAmplitude:2,idleIntervalMin:8e3,idleIntervalMax:15e3,motionType:"float"},expressions:{idle:[f({eyeType:14,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:14,mouthY:51.67,mouthWidth:0,mouthCurve:0}),f({eyeType:14,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:14,mouthY:51.67,mouthWidth:0,mouthCurve:0,bob:1.5})],near:[f({eyeType:14,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:14,mouthY:51.67,mouthWidth:0,mouthCurve:0,bob:2})],hover:[f({eyeType:14,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:14,mouthY:51.67,mouthWidth:0,mouthCurve:0,cheek:.3,bob:3})],click:[f({eyeType:14,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:14,mouthY:51.67,mouthWidth:0,mouthCurve:0,cheek:.5,bob:4.5})]}},fe={name:"cota",emotion:"normal",baseColor:"#C9DCD3",silhouette:"oval",motion:{stiffness:160,damping:18,idleSpeed:1.5,idleAmplitude:1.2,idleIntervalMin:8e3,idleIntervalMax:16e3,motionType:"calm"},expressions:{idle:[f({eyeType:0,eyeScale:1,eyeGap:23.33,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0}),f({eyeType:0,eyeScale:1,eyeGap:23.33,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:-.8})],near:[f({eyeType:0,eyeScale:1,eyeGap:23.33,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:1.2})],hover:[f({eyeType:0,eyeScale:1,eyeGap:23.33,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,cheek:.2,bob:2.5})],click:[f({eyeType:0,eyeScale:1,eyeGap:23.33,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,cheek:.4,bob:4})]}},He={name:"dozy",emotion:"tired",baseColor:"#D6DBCF",silhouette:"wide-oval",motion:{stiffness:90,damping:24,idleSpeed:.9,idleAmplitude:2.8,idleIntervalMin:6e3,idleIntervalMax:12e3,motionType:"droop"},expressions:{idle:[f({eyeType:15,eyeScale:.85,eyeGap:26.67,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.24,mouthCurve:0,sweat:1,puff:.7,bob:1.5}),f({eyeType:15,eyeScale:.85,eyeGap:26.67,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.24,mouthCurve:0,sweat:1,puff:.7,bob:2.5})],near:[f({eyeType:15,eyeScale:.85,eyeGap:26.67,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.24,mouthCurve:0,sweat:1,puff:.7,bob:3.5})],hover:[f({eyeType:15,eyeScale:.85,eyeGap:26.67,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.24,mouthCurve:0,sweat:1,puff:.85,bob:4.5})],click:[f({eyeType:15,eyeScale:.85,eyeGap:26.67,eyeY:45.83,mouthType:3,mouthY:56.67,mouthWidth:.24,mouthCurve:0,sweat:1,puff:1,bob:6.5})]}},Ke={name:"lumo",emotion:"sad",baseColor:"#7FA6D9",silhouette:"teardrop-blob",motion:{stiffness:100,damping:20,idleSpeed:1.1,idleAmplitude:2.2,idleIntervalMin:7e3,idleIntervalMax:13e3,motionType:"sob"},expressions:{idle:[f({eyeType:16,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:3,mouthY:55,mouthWidth:.3,mouthCurve:0,tears:1,bob:1.8}),f({eyeType:16,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:3,mouthY:55,mouthWidth:.3,mouthCurve:0,tears:1,bob:2.8})],near:[f({eyeType:16,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:3,mouthY:55,mouthWidth:.3,mouthCurve:0,tears:1,bob:3.5})],hover:[f({eyeType:16,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:3,mouthY:55,mouthWidth:.3,mouthCurve:0,tears:1,bob:4.8})],click:[f({eyeType:16,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:3,mouthY:55,mouthWidth:.3,mouthCurve:0,tears:1,bob:6})]}},et={name:"fidge",emotion:"anxiety",baseColor:"#A99BD9",silhouette:"cloud-blob",motion:{stiffness:350,damping:8,idleSpeed:5.5,idleAmplitude:1.5,idleIntervalMin:3e3,idleIntervalMax:7e3,motionType:"jitter"},expressions:{idle:[f({eyeType:5,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:13,mouthY:56.67,mouthWidth:.08,mouthCurve:0}),f({eyeType:5,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:13,mouthY:56.67,mouthWidth:.08,mouthCurve:0,shiftX:1.5})],near:[f({eyeType:5,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:13,mouthY:56.67,mouthWidth:.08,mouthCurve:0,shiftX:2.5})],hover:[f({eyeType:5,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:13,mouthY:56.67,mouthWidth:.08,mouthCurve:0,shiftX:4})],click:[f({eyeType:5,eyeScale:1,eyeGap:25,eyeY:43.33,mouthType:13,mouthY:56.67,mouthWidth:.08,mouthCurve:0,shiftX:6})]}},tt={name:"brix",emotion:"anger",baseColor:"#D9566A",silhouette:"flame-blob",motion:{stiffness:280,damping:12,idleSpeed:3.8,idleAmplitude:2,idleIntervalMin:4e3,idleIntervalMax:8e3,motionType:"fiery"},expressions:{idle:[f({eyeType:17,eyeScale:1,eyeGap:28.33,eyeY:46.67,mouthType:0,mouthY:61.67,mouthWidth:.33,mouthCurve:-.48}),f({eyeType:17,eyeScale:1,eyeGap:28.33,eyeY:46.67,mouthType:0,mouthY:61.67,mouthWidth:.33,mouthCurve:-.48})],near:[f({eyeType:17,eyeScale:1,eyeGap:28.33,eyeY:46.67,mouthType:0,mouthY:61.67,mouthWidth:.33,mouthCurve:-.48})],hover:[f({eyeType:17,eyeScale:1,eyeGap:28.33,eyeY:46.67,mouthType:0,mouthY:61.67,mouthWidth:.33,mouthCurve:-.48})],click:[f({eyeType:17,eyeScale:1,eyeGap:28.33,eyeY:46.67,mouthType:0,mouthY:61.67,mouthWidth:.33,mouthCurve:-.48})]}},ot={name:"wilt",emotion:"disappointed",baseColor:"#EBD98A",silhouette:"droopy-blob",motion:{stiffness:100,damping:22,idleSpeed:1,idleAmplitude:2,idleIntervalMin:7e3,idleIntervalMax:14e3,motionType:"wilt"},expressions:{idle:[f({eyeType:15,eyeScale:1.15,eyeGap:25,eyeY:43.33,mouthType:0,mouthY:63.33,mouthWidth:.45,mouthCurve:-.54,bob:1.5}),f({eyeType:15,eyeScale:1.15,eyeGap:25,eyeY:43.33,mouthType:0,mouthY:63.33,mouthWidth:.45,mouthCurve:-.54,bob:2.5})],near:[f({eyeType:15,eyeScale:1.15,eyeGap:25,eyeY:43.33,mouthType:0,mouthY:63.33,mouthWidth:.45,mouthCurve:-.54,bob:3.5})],hover:[f({eyeType:15,eyeScale:1.15,eyeGap:25,eyeY:43.33,mouthType:0,mouthY:63.33,mouthWidth:.45,mouthCurve:-.54,bob:4.5})],click:[f({eyeType:15,eyeScale:1.15,eyeGap:25,eyeY:43.33,mouthType:0,mouthY:63.33,mouthWidth:.45,mouthCurve:-.54,bob:6})]}},it={name:"knot",emotion:"stress",baseColor:"#C97F76",silhouette:"bear-blob",motion:{stiffness:320,damping:9,idleSpeed:4.8,idleAmplitude:2.2,idleIntervalMin:3500,idleIntervalMax:7500,motionType:"dizzy"},expressions:{idle:[f({eyeType:18,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:58.33,mouthWidth:.42,mouthCurve:0,storm:1,scribble:1}),f({eyeType:18,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:58.33,mouthWidth:.42,mouthCurve:0,storm:1,scribble:1,shiftX:1.5})],near:[f({eyeType:18,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:58.33,mouthWidth:.42,mouthCurve:0,storm:1,scribble:1,shiftX:3})],hover:[f({eyeType:18,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:58.33,mouthWidth:.42,mouthCurve:0,storm:1,scribble:1,shiftX:4.5})],click:[f({eyeType:18,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:58.33,mouthWidth:.42,mouthCurve:0,storm:1,scribble:1,shiftX:6.5})]}},st={name:"snug",emotion:"sleepy",baseColor:"#AFCBE0",silhouette:"soft-round",motion:{stiffness:85,damping:25,idleSpeed:.7,idleAmplitude:2.2,idleIntervalMin:6e3,idleIntervalMax:12e3,motionType:"snooze"},expressions:{idle:[f({eyeType:19,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:56.67,mouthWidth:.27,mouthCurve:0,zzz:1,bob:.5}),f({eyeType:19,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:56.67,mouthWidth:.27,mouthCurve:0,zzz:1,bob:1.5})],near:[f({eyeType:19,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:56.67,mouthWidth:.27,mouthCurve:0,zzz:1,bob:2.5})],hover:[f({eyeType:19,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:56.67,mouthWidth:.27,mouthCurve:0,zzz:1,bob:3.8})],click:[f({eyeType:19,eyeScale:1,eyeGap:26.67,eyeY:45,mouthType:3,mouthY:56.67,mouthWidth:.27,mouthCurve:0,zzz:1,bob:5.5})]}},at={name:"pip",emotion:"surprised",baseColor:"#F0B98A",silhouette:"octopus-blob",motion:{stiffness:250,damping:12,idleSpeed:2.8,idleAmplitude:3,idleIntervalMin:5e3,idleIntervalMax:1e4,motionType:"pop"},expressions:{idle:[f({eyeType:20,eyeScale:.8,eyeGap:21.67,eyeY:43.33,mouthType:1,mouthY:55,mouthWidth:.21,mouthCurve:0}),f({eyeType:20,eyeScale:.8,eyeGap:21.67,eyeY:43.33,mouthType:1,mouthY:55,mouthWidth:.21,mouthCurve:0,bob:-2})],near:[f({eyeType:20,eyeScale:.8,eyeGap:21.67,eyeY:43.33,mouthType:1,mouthY:55,mouthWidth:.21,mouthCurve:0,bob:-3})],hover:[f({eyeType:20,eyeScale:.8,eyeGap:21.67,eyeY:43.33,mouthType:1,mouthY:55,mouthWidth:.21,mouthCurve:0,bob:-5})],click:[f({eyeType:20,eyeScale:.8,eyeGap:21.67,eyeY:43.33,mouthType:1,mouthY:55,mouthWidth:.21,mouthCurve:0,bob:-8})]}},nt={name:"void",emotion:"numbness",baseColor:"#D9C6E0",silhouette:"wave-blob",motion:{stiffness:100,damping:24,idleSpeed:.8,idleAmplitude:1.5,idleIntervalMin:9e3,idleIntervalMax:18e3,motionType:"drift"},expressions:{idle:[f({eyeType:20,eyeScale:.75,eyeGap:23.33,eyeY:44.17,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0}),f({eyeType:20,eyeScale:.75,eyeGap:23.33,eyeY:44.17,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:1})],near:[f({eyeType:20,eyeScale:.75,eyeGap:23.33,eyeY:44.17,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:2})],hover:[f({eyeType:20,eyeScale:.75,eyeGap:23.33,eyeY:44.17,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:3})],click:[f({eyeType:20,eyeScale:.75,eyeGap:23.33,eyeY:44.17,mouthType:3,mouthY:56.67,mouthWidth:.33,mouthCurve:0,bob:4.5})]}},H={mochi:Ge,zumi:Ve,suri:qe,nima:Ue,cota:fe,dozy:He,lumo:Ke,fidge:et,brix:tt,wilt:ot,knot:it,snug:st,pip:at,void:nt};function Ie(o){const t=o.toLowerCase();return H[t]?H[t]:Object.values(H).find(i=>i.emotion===t)||Ge}function rt(o,t={}){const{stiffness:e=180,damping:i=18,mass:n=1}=t,c={current:o,target:o,velocity:0};return{state:c,setTarget(a){c.target=a},setCurrent(a){c.current=a,c.target=a,c.velocity=0},update(a){const b=a/4;let $=!1;for(let d=0;d<4;d++){const M=c.current-c.target,v=-e*M,Y=-i*c.velocity,A=(v+Y)/n;c.velocity+=A*b,c.current+=c.velocity*b,(Math.abs(c.velocity)>1e-4||Math.abs(c.current-c.target)>1e-4)&&($=!0)}return $||(c.current=c.target,c.velocity=0),$}}}function lt(o,t){const e=Object.keys(o),i={};for(const n of e)i[n]=rt(o[n],t);return{getValues(){const n={};for(const c of e)n[c]=i[c].state.current;return n},setTargets(n){for(const c in n)c in i&&i[c].setTarget(n[c])},setValues(n){for(const c in n)c in i&&i[c].setCurrent(n[c])},update(n){let c=!1;for(const a of e)i[a].update(n)&&(c=!0);return c}}}function oo(o,t){const e={...o};switch(t){case"sleeping":e.eyeOpen=.05,e.eyeType=2,e.mouthCurve=.2,e.browY=3,e.browTilt=-.1,e.cheek=.2,e.zzz=1;break;case"drowsy":case"powering-down":e.eyeOpen=.35,e.mouthCurve=0,e.browY=4,e.browTilt=.1,e.zzz=.55,e.sweat=.8,e.puff=.7;break;case"bored":e.eyeOpen=.45,e.mouthCurve=-.2,e.browY=2,e.gazeX=6,e.puff=.4;break;case"waking":case"spawning":e.eyeOpen=.75,e.eyeScale=1.1,e.mouthCurve=.4,e.browY=-2;break;case"angry":e.eyeType=3,e.browTilt=-.75,e.mouthCurve=-.65,e.mouthOpen=.2,e.eyeScale=1.15,e.storm=1;break;case"alerting":case"notifying":e.eyeScale=1.3,e.browTilt=-.4,e.mouthOpen=.45,e.mouthCurve=.1;break;case"suspicious":e.browTilt=-.5,e.eyeScale=.9,e.mouthCurve=-.3,e.gazeX=-8;break;case"excited":case"celebrate":e.eyeScale=1.35,e.mouthCurve=.9,e.mouthOpen=.55,e.cheek=.85,e.browY=-4;break;case"happy":case"playful":e.eyeScale=1.15,e.mouthCurve=.75,e.cheek=.6,e.browY=-2;break;case"laughing":e.eyeType=2,e.mouthCurve=.95,e.mouthOpen=.7,e.cheek=.9,e.bob=-3;break;case"proud":e.eyeScale=1.1,e.mouthCurve=.65,e.browY=-3,e.bob=-4;break;case"thinking":case"searching":e.browTilt=.5,e.eyeScale=1.1,e.mouthWidth=.6,e.mouthCurve=.1,e.shiftX=-4;break;case"dictating":case"listening":case"writing":case"humming":e.mouthOpen=.45,e.mouthCurve=.4,e.eyeScale=1.08,e.cheek=.4;break;case"loading":case"orbit":case"radar":case"progress":e.eyeScale=1.15,e.mouthCurve=.3,e.browY=-2;break;case"surprised":e.eyeScale=1.45,e.mouthOpen=.75,e.mouthCurve=0,e.browY=-7;break;case"scared":e.eyeScale=1.4,e.mouthOpen=.8,e.mouthCurve=-.55,e.browTilt=.5;break;case"confused":e.browTilt=.65,e.mouthCurve=-.3,e.shiftX=-5,e.scribble=1;break;case"curious":e.browTilt=-.3,e.eyeScale=1.2,e.mouthCurve=.45,e.shiftX=3;break;case"shy":e.eyeScale=.85,e.gazeY=6,e.cheek=.95,e.mouthCurve=.35;break;case"sad":e.browTilt=.6,e.mouthCurve=-.65,e.tears=.8,e.browY=2;break}return e}class ct{constructor(){g(this,"currentState","idle");g(this,"lastIndices",{})}getState(){return this.currentState}setState(t){const e=this.currentState!==t;return this.currentState=t,e}resolvePool(t,e=this.currentState){let i=[];if(t[e]&&t[e].length>0)i=t[e];else switch(e){case"happy":case"excited":case"playful":case"celebrate":case"laughing":case"proud":i=t.hover||t.idle;break;case"surprised":case"scared":case"alerting":case"notifying":case"bouncing":i=t.click||t.hover||t.idle;break;case"suspicious":case"angry":i=t.click||t.idle;break;case"curious":case"thinking":case"searching":case"listening":case"working":case"confused":case"shy":case"sad":case"dictating":case"writing":case"sending":case"receiving":case"uploading":case"dragging":case"humming":case"loading":case"orbit":case"radar":case"progress":i=t.near||t.hover||t.idle;break;default:i=t[e]||t.idle;break}return i.map(n=>oo(n,e))}pickVariant(t,e=this.currentState){if(!t||t.length===0)throw new Error(`Empty variant pool for state "${e}"`);if(t.length===1)return this.lastIndices[e]=0,t[0];const i=this.lastIndices[e]??-1;let n=Math.floor(Math.random()*t.length);for(;n===i;)n=Math.floor(Math.random()*t.length);return this.lastIndices[e]=n,t[n]}}class io{constructor(){g(this,"callbacks",new Set);g(this,"handle",null);g(this,"lastTime",0)}add(t){this.callbacks.add(t),this.handle||(this.lastTime=performance.now(),this.tick=this.tick.bind(this),this.handle=requestAnimationFrame(this.tick))}remove(t){this.callbacks.delete(t),this.callbacks.size===0&&this.handle!==null&&(cancelAnimationFrame(this.handle),this.handle=null)}get size(){return this.callbacks.size}tick(t){const e=Math.min((t-this.lastTime)/1e3,.1);this.lastTime=t,this.callbacks.forEach(i=>i(e)),this.callbacks.size>0?this.handle=requestAnimationFrame(this.tick):this.handle=null}}const G=new io;function ht(o=2.2,t=.25){const e=[],i=o*Math.PI*2;for(let n=0;n<=i;n+=t){const c=n/i;e.push([Math.cos(n)*c,Math.sin(n)*c])}return e}function ut(o){switch(o){case"circle":return"M 50 13 A 37 37 0 1 0 50 87 A 37 37 0 1 0 50 13 Z";case"heart":return"M 50 21.67 C 54.17 17.5 65 12.5 74.17 16.67 C 85 21.67 89.17 35.83 85 48.33 C 80.83 61.67 66.67 74.17 50 74.17 C 33.33 74.17 19.17 61.67 15 48.33 C 10.83 35.83 15 21.67 25.83 16.67 C 35 12.5 45.83 17.5 50 21.67 Z";case"capsule":return"M 26 26 L 74 26 C 88 26 88 74 74 74 L 26 74 C 12 74 12 26 26 26 Z";case"rounded-squircle":return"M 32 18 L 68 18 C 84 18 84 32 84 50 C 84 68 84 82 68 82 L 32 82 C 16 82 16 68 16 50 C 16 32 16 18 32 18 Z";case"pear-blob":return"M 50 14 C 66 14 72 32 80 54 C 86 70 80 86 50 86 C 20 86 14 70 20 54 C 28 32 34 14 50 14 Z";case"egg-oval":return"M 18 54 C 18 26 32 14 50 14 C 68 14 82 26 82 54 C 82 74 70 84 50 84 C 30 84 18 74 18 54 Z";case"starburst-puff":return"M 34 18 C 50 24 50 24 66 18 C 78 18 84 30 80 46 C 84 62 78 82 66 82 C 50 76 50 76 34 82 C 22 82 16 62 20 46 C 16 30 22 18 34 18 Z";case"pill-vertical":return"M 26 28 C 26 12 74 12 74 28 L 74 72 C 74 88 26 88 26 72 Z";case"round-blob":return"M 86.5 53.64 C 86.5 73.98 70.16 77.2 50 77.2 C 29.84 77.2 13.5 73.98 13.5 53.64 C 13.5 33.29 29.84 16.8 50 16.8 C 70.16 16.8 86.5 33.29 86.5 53.64 Z";case"ghost-blob":return"M 50 14.17 C 70 14.17 83.33 29.17 83.33 47.5 L 83.33 70 C 83.33 75 78.33 75.83 75.83 71.67 C 73.33 65.83 67.5 65.83 65 71.67 C 62.5 77.5 56.67 77.5 54.17 71.67 C 51.67 65.83 45.83 65.83 43.33 71.67 C 40.83 77.5 35 77.5 32.5 71.67 C 30 65.83 24.17 65.83 21.67 71.67 C 19.17 75.83 16.67 75 16.67 70 L 16.67 47.5 C 16.67 29.17 30 14.17 50 14.17 Z";case"oval":return"M 45.24 12.83 C 58.45 10.98 74.32 28.1 76.87 46.26 C 79.31 63.59 69.61 78.41 54.76 80.5 C 39.9 82.59 26.49 71.01 24.06 53.68 C 21.51 35.52 32.04 14.69 45.24 12.83 Z";case"elongated-oval":return"M 86.38 54.82 C 87.03 78.56 86.38 75.48 49.94 76.67 C 13.52 77.86 13.5 75.67 13.5 54.82 C 13.5 33.97 29.81 17.07 49.94 17.07 C 70.06 17.07 86.38 33.97 86.38 54.82 Z";case"teardrop-blob":return"M 50 14.17 C 70 14.17 84.17 28.33 84.17 47.5 C 84.17 69.17 69.17 81.67 49.17 81.67 C 30 81.67 15.83 68.33 15.83 47.5 C 15.83 28.33 30 14.17 50 14.17 Z";case"flame-blob":return"M 20 43.33 L 25.83 18.33 L 36.67 35 L 47.5 13.33 L 58.33 33.33 L 70 20 L 75.83 43.33 C 82.5 51.67 80 65.83 70 74.17 C 58.33 83.33 38.33 81.67 27.5 72.5 C 18.33 65 14.17 51.67 20 43.33 Z";case"droopy-blob":return"M 47.83 15.03 C 64.86 12.2 79.26 26.85 79.26 43.84 C 79.26 62.72 77.35 73.65 59.63 78.17 C 41.9 82.69 18.53 73.61 19.16 56.42 C 19.16 33.97 20.59 24.37 35.7 17.57 C 39.66 15.66 43.78 15.72 47.83 15.03 Z M 13.5 49.19 A 6.92 6.92 0 1 0 27.34 49.19 A 6.92 6.92 0 1 0 13.5 49.19 Z M 72.66 49.19 A 6.92 6.92 0 1 0 86.5 49.19 A 6.92 6.92 0 1 0 72.66 49.19 Z";case"bear-blob":return"M 85.2 51.24 C 85.2 71.22 69.15 78.94 49.35 78.94 C 29.55 78.94 13.5 71.22 13.5 51.24 C 13.5 31.26 29.55 15.06 49.35 15.06 C 69.15 15.06 85.2 31.26 85.2 51.24 Z M 86.5 29.08 C 86.5 34.3 81.98 38.53 76.4 38.53 C 70.82 38.53 66.29 34.3 66.29 29.08 C 66.29 23.86 70.82 19.63 76.4 19.63 C 81.98 19.63 86.5 23.86 86.5 29.08 Z M 13.5 29.08 A 10.1 9.45 0 1 0 33.7 29.08 A 10.1 9.45 0 1 0 13.5 29.08 Z";case"spiky-blob":return"M 50 12 C 76 12 88 26 88 48 C 88 64 88 78 84 86 C 78 82 72 92 64 86 C 56 82 50 90 44 86 C 36 92 30 82 12 48 C 12 26 24 12 50 12 Z";case"cloud-blob":return"M 50 12.5 C 60 9.17 69.17 15.83 71.67 21.67 C 79.17 24.17 83.33 32.5 80.83 40 C 85.83 47.5 83.33 57.5 78.33 61.67 C 76.67 70.83 68.33 76.67 60 74.17 C 53.33 80 42.5 80 35.83 74.17 C 27.5 76.67 20 70 18.33 61.67 C 13.33 56.67 11.67 47.5 16.67 40 C 14.17 32.5 20 24.17 27.5 21.67 C 30.83 15 40 9.17 50 12.5 Z";case"wide-oval":return"M 50 20.83 C 73.33 20.83 87.5 31.67 87.5 47.5 C 87.5 64.17 73.33 75.83 50 75.83 C 26.67 75.83 12.5 64.17 12.5 47.5 C 12.5 31.67 26.67 20.83 50 20.83 Z";case"soft-round":return"M 50 15 C 73.33 15 85 26.67 85 48.33 C 85 70 73.33 80 50 80 C 26.67 80 15 70 15 48.33 C 15 26.67 26.67 15 50 15 Z";case"octopus-blob":return"M 50 12.5 C 70 12.5 83.33 27.5 83.33 47.5 L 83.33 65.83 C 83.33 73.33 77.5 75 74.17 69.17 C 71.67 65 66.67 65 64.17 69.17 C 61.67 73.33 56.67 73.33 54.17 69.17 C 51.67 65 46.67 65 44.17 69.17 C 41.67 73.33 36.67 73.33 34.17 69.17 C 31.67 65 26.67 65 24.17 69.17 C 20.83 75 16.67 73.33 16.67 65.83 L 16.67 47.5 C 16.67 27.5 30 12.5 50 12.5 Z";case"wave-blob":return"M 50 13.33 C 63.33 13.33 75 20 76.67 31.67 C 77.5 40 70 43.33 76.67 50 C 82.5 56.67 75 73.33 56.67 76.67 C 50 78.33 43.33 78.33 36.67 75.83 C 21.67 70.83 17.5 58.33 23.33 51.67 C 28.33 45.83 21.67 41.67 23.33 33.33 C 25.83 20.83 36.67 13.33 50 13.33 Z";default:return"M 50 12 C 78 12 90 26 90 52 C 90 78 78 88 50 88 C 22 88 10 78 10 52 C 10 26 22 12 50 12 Z"}}const so="M -4 2 C 2 2 5 -2 1 -5 C -3 -8 -10 -6 -10 -1 C -10 5 -2 8 4 4 C 9 1 7 -6 0 -7";function ao(o,t,e,i,n,c=""){return`<g transform="translate(${o.toFixed(2)}, ${t.toFixed(2)}) scale(${e.toFixed(3)})" ${c}>
|
|
2
|
+
<path d="${so}" stroke="${i}" stroke-width="${(n/e).toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" fill="none" />
|
|
3
|
+
</g>`}function Oe(o,t,e,i,n={},c=0){const a=c||(typeof performance<"u"?performance.now()/1e3:Date.now()/1e3),h="#2C2C2A",b="#F0997B",$=3.5,M=ut(o).split(/(?=M )/).map(r=>r.trim()).filter(Boolean).map(r=>`<path d="${r}" fill="${t}" />`).join(""),{flipX:v=!1,emphasis:Y=!1}=n,A=Math.max(-13.2,Math.min(13.2,e.gazeX??0)),B=Math.max(-8.4,Math.min(8.4,e.gazeY??0)),I=(e.eyeGap??32)/2,O=(e.eyeY??45)+B,_=50-I+A,N=50+I+A,K=40,ae=50+(e.shiftX??0),ee=e.turnAngle??0,ie=r=>{const l=r-ae,k=Math.max(-K,Math.min(K,l)),C=Math.asin(k/K),L=C+ee,p=Math.cos(L),z=p>0,P=ae+K*Math.sin(L),S=z?Math.max(0,p/Math.cos(C)):0;return{projX:P,scaleX:S,isVisible:z}},D=ie(_),F=ie(N),s=(e.eyeScale??1)*(Y?1.15:1),we=Math.round(e.eyeType??0);let le="",pe="";const ce=(r,l,k,C)=>{if(k<=.01)return"";const L=s*k,p=`transform="translate(${r}, ${l}) scale(${k.toFixed(2)}, 1) translate(${-r}, ${-l})"`;switch(we){case 1:return`<g ${p}><path d="M ${r-5.83*s} ${l+1.67*s} Q ${r} ${l-5.83*s} ${r+5.83*s} ${l+1.67*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 2:return C?`<g ${p}><path d="M ${r+3.33*s} ${l-5*s} L ${r-3.33*s} ${l} L ${r+3.33*s} ${l+5*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`:`<g ${p}><path d="M ${r-3.33*s} ${l-5*s} L ${r+3.33*s} ${l} L ${r-3.33*s} ${l+5*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;case 3:return C?`<g ${p}><line x1="${r-5*s}" y1="${l+3*s}" x2="${r+5*s}" y2="${l-3*s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`:`<g ${p}><line x1="${r-5*s}" y1="${l-3*s}" x2="${r+5*s}" y2="${l+3*s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;case 4:return C?`<g ${p}><line x1="${r-5*s}" y1="${l-3*s}" x2="${r+5*s}" y2="${l+3*s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`:`<g ${p}><line x1="${r-5*s}" y1="${l+3*s}" x2="${r+5*s}" y2="${l-3*s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;case 5:return`<g ${p}>
|
|
4
|
+
<ellipse cx="${r}" cy="${l}" rx="${5*s}" ry="${5.83*s}" fill="#ffffff" />
|
|
5
|
+
<circle cx="${r}" cy="${l+.83*s}" r="${2.17*s}" fill="${h}" />
|
|
6
|
+
</g>`;case 6:return`<g ${p} fill="#E3536C"><path d="M ${r} ${l+5*s} C ${r-8*s} ${l-2*s} ${r-5*s} ${l-7*s} ${r} ${l-3*s} C ${r+5*s} ${l-7*s} ${r+8*s} ${l-2*s} ${r} ${l+5*s} Z" /></g>`;case 7:return`<g ${p} stroke="${h}" stroke-width="3.2">
|
|
7
|
+
<line x1="${r-4.5*s}" y1="${l-4.5*s}" x2="${r+4.5*s}" y2="${l+4.5*s}" stroke-linecap="round" />
|
|
8
|
+
<line x1="${r-4.5*s}" y1="${l+4.5*s}" x2="${r+4.5*s}" y2="${l-4.5*s}" stroke-linecap="round" />
|
|
9
|
+
</g>`;case 8:return`<g ${p} stroke="${h}" stroke-width="2.8" stroke-linecap="round">
|
|
10
|
+
<line x1="${r-5*s}" y1="${l-2}" x2="${r+5*s}" y2="${l-2}" />
|
|
11
|
+
<line x1="${r-5*s}" y1="${l+2}" x2="${r+5*s}" y2="${l+2}" />
|
|
12
|
+
</g>`;case 9:return C?"":`<g transform="translate(0, 0)">
|
|
13
|
+
<path d="M ${D.projX-12} ${l-2} L ${F.projX+12} ${l-2}" stroke="${h}" stroke-width="2.8" />
|
|
14
|
+
<rect x="${D.projX-9}" y="${l-6}" width="16" height="12" rx="3" fill="${h}" />
|
|
15
|
+
<rect x="${F.projX-7}" y="${l-6}" width="16" height="12" rx="3" fill="${h}" />
|
|
16
|
+
</g>`;case 10:return C?`<g ${p}><circle cx="${r}" cy="${l}" r="${3.2*s}" fill="${h}" /></g>`:`<g ${p}><ellipse cx="${r}" cy="${l}" rx="${6*s}" ry="${8*s}" fill="${h}" /></g>`;case 11:return C?`<g ${p}><circle cx="${r}" cy="${l}" r="${4.2*s}" fill="${h}" /></g>`:`<g ${p}><line x1="${r-5*s}" y1="${l}" x2="${r+5*s}" y2="${l}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;case 12:return`<g ${p}>
|
|
17
|
+
<ellipse cx="${r}" cy="${l}" rx="${3*s}" ry="${6*s}" fill="${h}" />
|
|
18
|
+
</g>`;case 13:return`<g ${p}><circle cx="${r}" cy="${l}" r="${6.5*s}" fill="${h}" /></g>`;case 14:return`<g ${p}><path d="M ${r-5.83*s} ${l-1.67*s} Q ${r} ${l+5.83*s} ${r+5.83*s} ${l-1.67*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 15:return C?`<g ${p}><path d="M ${r+6.67*s} ${l+2.5*s} Q ${r} ${l-5*s} ${r-6.67*s} ${l-.83*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`:`<g ${p}><path d="M ${r-6.67*s} ${l+2.5*s} Q ${r} ${l-5*s} ${r+6.67*s} ${l-.83*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 16:return`<g ${p}><path d="M ${r} ${l-4.17*s} L ${r} ${l+3.33*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 17:return C?`<g ${p}><path d="M ${r+5.83*s} ${l-6.67*s} L ${r-5*s} ${l+.83*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`:`<g ${p}><path d="M ${r-5.83*s} ${l-6.67*s} L ${r+5*s} ${l+.83*s}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 18:{const S=4.6*s,x=ht().map(([X,te],de)=>{const U=(r+X*S).toFixed(2),oe=(l+te*S).toFixed(2);return`${de===0?"M":"L"} ${U} ${oe}`}).join(" ");return`<g ${p}><path d="${x}" stroke="${h}" stroke-width="1.3" stroke-linecap="round" fill="none" /></g>`}case 19:return`<g ${p}>
|
|
19
|
+
<circle cx="${r}" cy="${l}" r="${4.5*s}" fill="none" stroke="${h}" stroke-width="2.63" />
|
|
20
|
+
<path d="M ${r-2.83*s} ${l-.42*s} Q ${r} ${l+2.83*s} ${r+2.83*s} ${l-.42*s}" stroke="${h}" stroke-width="2.63" stroke-linecap="round" fill="none" />
|
|
21
|
+
</g>`;case 20:return`<g ${p}><circle cx="${r}" cy="${l}" r="${3.67*s}" fill="none" stroke="${h}" stroke-width="2.8" /></g>`;case 21:{const S=6*s,x=S*.22,X=`M ${r} ${l-S} Q ${r+x} ${l-x} ${r+S} ${l} Q ${r+x} ${l+x} ${r} ${l+S} Q ${r-x} ${l+x} ${r-S} ${l} Q ${r-x} ${l-x} ${r} ${l-S} Z`;return`<g ${p}><path d="${X}" fill="${h}" /></g>`}case 22:return`<g ${p}>
|
|
22
|
+
<ellipse cx="${r}" cy="${l}" rx="${5.5*s}" ry="${3.3*s}" fill="#ffffff" stroke="${h}" stroke-width="1.4" />
|
|
23
|
+
<circle cx="${r-2.2*s}" cy="${l}" r="${1.8*s}" fill="${h}" />
|
|
24
|
+
</g>`;case 23:return C?`<g ${p}><ellipse cx="${r}" cy="${l}" rx="${2.83*s}" ry="${Math.max(.5,2.83*s*Math.max(.05,e.eyeOpen))}" fill="${h}" /></g>`:`<g ${p}><path d="M ${r-5*s} ${l} Q ${r} ${l+4*s} ${r+5*s} ${l}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" /></g>`;case 24:{const S=4.2*s,x=5.8*s;return`<g ${p}>
|
|
25
|
+
<ellipse cx="${r}" cy="${l}" rx="${S}" ry="${x}" fill="${h}" />
|
|
26
|
+
<circle cx="${r-S*.35}" cy="${l-x*.4}" r="${1.3*s}" fill="#ffffff" />
|
|
27
|
+
</g>`}case 25:return C?`<g ${p}>
|
|
28
|
+
<path d="M ${r-5*s} ${l} Q ${r} ${l+2*s} ${r+5*s} ${l}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" />
|
|
29
|
+
<line x1="${r+5*s}" y1="${l-.5*s}" x2="${r+7*s}" y2="${l-2.5*s}" stroke="${h}" stroke-width="2" stroke-linecap="round" />
|
|
30
|
+
</g>`:`<g ${p}>
|
|
31
|
+
<path d="M ${r-5*s} ${l} Q ${r} ${l+2*s} ${r+5*s} ${l}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" fill="none" />
|
|
32
|
+
<line x1="${r-5*s}" y1="${l-.5*s}" x2="${r-7*s}" y2="${l-2.5*s}" stroke="${h}" stroke-width="2" stroke-linecap="round" />
|
|
33
|
+
</g>`;case 26:return`<g ${p}>
|
|
34
|
+
<circle cx="${r}" cy="${l}" r="${5*s}" fill="none" stroke="${h}" stroke-width="2.2" />
|
|
35
|
+
<circle cx="${r+1.6*s}" cy="${l+1.6*s}" r="${1.7*s}" fill="${h}" />
|
|
36
|
+
</g>`;case 27:{const S=4*s,x=8*s;return`<g ${p}><path d="M ${r-S} ${l+x} L ${r-S} ${l-x} L ${r+S} ${l-x} L ${r+S} ${l+x}" stroke="${h}" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`}case 28:return`<g ${p}><ellipse cx="${r}" cy="${l}" rx="${4.5*s}" ry="${3*s}" fill="${h}" /></g>`;case 29:return`<g ${p}>
|
|
37
|
+
<path d="M ${r-4*s} ${l-3*s} Q ${r} ${l-6*s} ${r+4*s} ${l-2.5*s}" stroke="${h}" stroke-width="2" stroke-linecap="round" fill="none" />
|
|
38
|
+
<circle cx="${r}" cy="${l+1.5*s}" r="${1.6*s}" fill="${h}" />
|
|
39
|
+
</g>`;case 30:return C?`<g ${p}><path d="M ${r+6*s} ${l-6*s} L ${r+2*s} ${l-3*s} L ${r+5*s} ${l-1*s} L ${r-3*s} ${l+2*s}" stroke="${h}" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`:`<g ${p}><path d="M ${r-6*s} ${l-6*s} L ${r-2*s} ${l-3*s} L ${r-5*s} ${l-1*s} L ${r+3*s} ${l+2*s}" stroke="${h}" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;case 31:return`<g ${p}>
|
|
40
|
+
<circle cx="${r}" cy="${l}" r="${4*s}" fill="none" stroke="${h}" stroke-width="2" />
|
|
41
|
+
<circle cx="${r}" cy="${l}" r="${1.3*s}" fill="${h}" />
|
|
42
|
+
</g>`;case 0:default:const z=2.83*L,P=Math.max(.5,z*Math.max(.05,e.eyeOpen));return`<ellipse cx="${r.toFixed(2)}" cy="${l.toFixed(2)}" rx="${z.toFixed(2)}" ry="${P.toFixed(2)}" fill="${h}" />`}};le=D.isVisible?ce(D.projX,O,D.scaleX,!1):"",pe=F.isVisible?ce(F.projX,O,F.scaleX,!0):"";let ne="";const se=e.tears??0;if(se>.01){const r=Math.min(1,se),l=a*.36%1;let k=0,C=r,L=1;if(l<.25){const p=l/.25;k=p*1.2,L=.75+p*.35,C=r*(.3+p*.7)}else if(l<.82){const p=(l-.25)/.57;k=1.2+p*10.5,L=1.1-p*.2,C=r}else{const p=(l-.82)/.18;k=11.7+p*2.5,L=.9-p*.4,C=r*(1-p)}if(e.cascadeTears)ne=`
|
|
43
|
+
<g opacity="${C.toFixed(2)}">
|
|
44
|
+
<path d="M ${D.projX-3} ${O+4} L ${D.projX-6} 88 L ${D.projX+2} 88 Z" fill="#7FA6D9" opacity="0.85" />
|
|
45
|
+
<path d="M ${F.projX-2} ${O+4} L ${F.projX-2} 88 L ${F.projX+6} 88 Z" fill="#7FA6D9" opacity="0.85" />
|
|
46
|
+
</g>
|
|
47
|
+
`;else{const p=(O+7).toFixed(2),z=(D.projX-1.2).toFixed(2),P=(F.projX+1.2).toFixed(2),S=parseFloat(z),x=parseFloat(P),X=parseFloat(p);ne=`
|
|
48
|
+
<g opacity="${C.toFixed(2)}">
|
|
49
|
+
<g transform="translate(0, ${k.toFixed(2)}) scale(${L.toFixed(2)})">
|
|
50
|
+
<!-- Lágrima redondita ojo izquierdo -->
|
|
51
|
+
<path d="M ${z} ${(X-2.5).toFixed(2)} C ${(S+2.2).toFixed(2)} ${(X-.5).toFixed(2)} ${(S+2.2).toFixed(2)} ${(X+2.2).toFixed(2)} ${z} ${(X+3.2).toFixed(2)} C ${(S-2.2).toFixed(2)} ${(X+2.2).toFixed(2)} ${(S-2.2).toFixed(2)} ${(X-.5).toFixed(2)} ${z} ${(X-2.5).toFixed(2)} Z" fill="#ffffff" />
|
|
52
|
+
<!-- Lágrima redondita ojo derecho -->
|
|
53
|
+
<path d="M ${P} ${(X-2.5).toFixed(2)} C ${(x+2.2).toFixed(2)} ${(X-.5).toFixed(2)} ${(x+2.2).toFixed(2)} ${(X+2.2).toFixed(2)} ${P} ${(X+3.2).toFixed(2)} C ${(x-2.2).toFixed(2)} ${(X+2.2).toFixed(2)} ${(x-2.2).toFixed(2)} ${(X-.5).toFixed(2)} ${P} ${(X-2.5).toFixed(2)} Z" fill="#ffffff" />
|
|
54
|
+
</g>
|
|
55
|
+
</g>
|
|
56
|
+
`}}let R="";if(e.zzz){const r=a*.75,l=3;R+=`<g stroke="${h}" fill="none" stroke-linecap="round" stroke-linejoin="round">`;for(let k=0;k<l;k++){const C=(r+k/l)%1,L=68+C*20+Math.sin(C*Math.PI*2)*2,p=30-C*26,z=.5+Math.sin(C*Math.PI)*.65,P=Math.sin(C*Math.PI)*.95,S=(1.8+z*.7).toFixed(2),x=z.toFixed(2);P>.01&&(R+=`
|
|
57
|
+
<g transform="translate(${L.toFixed(2)}, ${p.toFixed(2)}) scale(${x}) translate(-72, -31)" opacity="${P.toFixed(2)}">
|
|
58
|
+
<path d="M 68 28 L 76 28 L 68 34 L 76 34" stroke-width="${S}" />
|
|
59
|
+
</g>
|
|
60
|
+
`)}R+="</g>"}if(e.sweat){const r=[{x:80,delay:0,scale:1},{x:20,delay:.4,scale:.85},{x:71,delay:.7,scale:.7}],l=Math.min(1,e.sweat);R+='<g fill="#7FA6D9">';for(const k of r){const C=(a*1.2+k.delay)%1,L=25+C*7,p=l*Math.sin(C*Math.PI);p>.01&&(R+=`
|
|
61
|
+
<g transform="translate(${k.x}, ${L.toFixed(2)}) scale(${k.scale}) translate(-80, -25)" opacity="${p.toFixed(2)}">
|
|
62
|
+
<path d="M 76 26 C 76 22 80 20 80 20 C 80 20 84 22 84 26 C 84 28.5 82.2 30 80 30 C 77.8 30 76 28.5 76 26 Z" />
|
|
63
|
+
</g>
|
|
64
|
+
`)}R+="</g>"}if(e.storm){const r=Math.min(1,e.storm),l=Math.sin(a*1.4)*1.2,k=Math.sin(a*1.4+1.8)*1.2,C=.85+Math.sin(a*1.4)*.15,L=.85+Math.sin(a*1.4+1.8)*.15;R+=`
|
|
65
|
+
<g opacity="${r.toFixed(2)}" fill="#8a8a86">
|
|
66
|
+
<path transform="translate(${l.toFixed(2)}, ${(Math.abs(l)*-.4).toFixed(2)})" opacity="${C.toFixed(2)}" d="M 22 6 C 22 3 25 1.5 27 2.3 C 27.6 0.5 30 -0.3 31.7 1 C 33.3 -0.7 36.5 0.3 36.5 3 C 38.2 3 39.5 4.5 39 6.2 C 39 8 37.3 9 35.6 9 L 24 9 C 22.3 9 22 7.5 22 6 Z" />
|
|
67
|
+
<path transform="translate(${k.toFixed(2)}, ${(Math.abs(k)*-.4).toFixed(2)})" opacity="${L.toFixed(2)}" d="M 62 8 C 62 5.3 64.8 3.9 66.6 4.6 C 67.2 3 69.4 2.3 71 3.5 C 72.5 1.9 75.4 2.8 75.4 5.3 C 77 5.3 78.2 6.7 77.7 8.2 C 77.7 9.8 76.1 10.7 74.6 10.7 L 63.8 10.7 C 62.3 10.7 62 9.4 62 8 Z" />
|
|
68
|
+
</g>
|
|
69
|
+
`}if(e.scribble){const r=Math.min(1,e.scribble),l=Math.sin(a*1.6)*6,k=1+Math.sin(a*2.3)*.06;R+=`
|
|
70
|
+
<g transform="translate(50, 3) rotate(${l.toFixed(2)}) translate(-50, -3)" opacity="${r.toFixed(2)}">
|
|
71
|
+
${ao(50,3,k,"#5B7FD6",2.3)}
|
|
72
|
+
</g>
|
|
73
|
+
`}if(e.puff){const r=a*.55%1,l=e.mouthY??63,k=68+r*12,C=l-r*10,L=.4+r*.9,p=Math.min(1,e.puff)*Math.sin(r*Math.PI)*.8;p>.01&&(R+=`
|
|
74
|
+
<g fill="#B9BDB6" opacity="${p.toFixed(2)}" transform="translate(${k.toFixed(2)}, ${C.toFixed(2)}) scale(${L.toFixed(2)})">
|
|
75
|
+
<circle cx="0" cy="0" r="3.4" />
|
|
76
|
+
<circle cx="3" cy="-1.2" r="2.1" />
|
|
77
|
+
<circle cx="-2.4" cy="-1" r="1.8" />
|
|
78
|
+
</g>
|
|
79
|
+
`)}let he="";if(e.browY!==0||e.browTilt!==0){const r=32+e.browY+B*.5,l=e.browTilt,k=-e.browTilt;he=`
|
|
80
|
+
<g transform="rotate(${l}, ${D.projX}, ${r})">
|
|
81
|
+
<line x1="${D.projX-6}" y1="${r}" x2="${D.projX+6}" y2="${r}" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />
|
|
82
|
+
</g>
|
|
83
|
+
<g transform="rotate(${k}, ${F.projX}, ${r})">
|
|
84
|
+
<line x1="${F.projX-6}" y1="${r}" x2="${F.projX+6}" y2="${r}" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />
|
|
85
|
+
</g>
|
|
86
|
+
`}const be=Math.round(e.mouthType??0),T=Math.max(0,14*e.mouthWidth),m=50+A*.6,u=(e.mouthY??63)+B*.4;let w="";switch(be){case 1:w=`<ellipse cx="${m}" cy="${u}" rx="${T}" ry="${T*1.24}" fill="#B3554A" />`;break;case 2:{const r=T*2/4;let l=`M ${m-T} ${u}`;for(let k=1;k<=4;k++)l+=` L ${m-T+r*k} ${u+(k%2?2.83:0)}`;w=`<path d="${l}" fill="none" stroke="${h}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round" />`;break}case 3:w=`<line x1="${m-T}" y1="${u}" x2="${m+T}" y2="${u}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />`;break;case 13:w=`<circle cx="${m}" cy="${u}" r="${T*2}" fill="none" stroke="${h}" stroke-width="2.8" />`;break;case 14:w="";break;case 4:w=`
|
|
87
|
+
<rect x="${m-10}" y="${u-4}" width="20" height="8" rx="2" fill="#ffffff" stroke="${h}" stroke-width="2.5" />
|
|
88
|
+
<line x1="${m-10}" y1="${u}" x2="${m+10}" y2="${u}" stroke="${h}" stroke-width="1.8" />
|
|
89
|
+
<line x1="${m-3}" y1="${u-4}" x2="${m-3}" y2="${u+4}" stroke="${h}" stroke-width="1.5" />
|
|
90
|
+
<line x1="${m+3}" y1="${u-4}" x2="${m+3}" y2="${u+4}" stroke="${h}" stroke-width="1.5" />
|
|
91
|
+
`;break;case 5:w=`
|
|
92
|
+
<path d="M ${m-12} ${u-2} Q ${m} ${u+12} ${m+12} ${u-2} Z" fill="${h}" />
|
|
93
|
+
<path d="M ${m-10} ${u-2} L ${m+10} ${u-2} L ${m+8} ${u+2} L ${m-8} ${u+2} Z" fill="#ffffff" />
|
|
94
|
+
`;break;case 6:w=`<path d="M ${m-13} ${u-3} Q ${m} ${u+14} ${m+13} ${u-3} Z" fill="#E87C8A" stroke="${h}" stroke-width="2.5" />`;break;case 7:w=`
|
|
95
|
+
<g stroke="${h}" stroke-width="3.5" stroke-linecap="round">
|
|
96
|
+
<line x1="${m-5}" y1="${u-5}" x2="${m+5}" y2="${u+5}" />
|
|
97
|
+
<line x1="${m-5}" y1="${u+5}" x2="${m+5}" y2="${u-5}" />
|
|
98
|
+
</g>
|
|
99
|
+
`;break;case 8:w=`
|
|
100
|
+
<g>
|
|
101
|
+
<line x1="12" y1="${u-2}" x2="${m-14}" y2="${u-2}" stroke="#ffffff" stroke-width="2" />
|
|
102
|
+
<line x1="12" y1="${u+4}" x2="${m-14}" y2="${u+4}" stroke="#ffffff" stroke-width="2" />
|
|
103
|
+
<line x1="88" y1="${u-2}" x2="${m+14}" y2="${u-2}" stroke="#ffffff" stroke-width="2" />
|
|
104
|
+
<line x1="88" y1="${u+4}" x2="${m+14}" y2="${u+4}" stroke="#ffffff" stroke-width="2" />
|
|
105
|
+
<rect x="${m-15}" y="${u-7}" width="30" height="16" rx="3" fill="#ffffff" stroke="${h}" stroke-width="2.2" />
|
|
106
|
+
</g>
|
|
107
|
+
`;break;case 9:w=`<path d="M ${m-6} ${u} Q ${m-3} ${u-3} ${m} ${u} Q ${m+3} ${u-3} ${m+6} ${u}" fill="none" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />`;break;case 10:w=`<circle cx="${m}" cy="${u}" r="2.5" fill="${h}" />`;break;case 11:w=`<line x1="${m-6}" y1="${u+3}" x2="${m+6}" y2="${u-3}" stroke="${h}" stroke-width="3" stroke-linecap="round" />`;break;case 12:w=`<path d="M ${m-T} ${u+4} Q ${m} ${u-6} ${m+T} ${u+4}" fill="none" stroke="${h}" stroke-width="3.2" stroke-linecap="round" />`;break;case 15:w=`
|
|
108
|
+
<path d="M ${m-T} ${u} Q ${m} ${u+6} ${m+T} ${u}" fill="none" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />
|
|
109
|
+
<path d="M ${m-3} ${u+2} Q ${m} ${u+10} ${m+3} ${u+2} Z" fill="#E3536C" />
|
|
110
|
+
`;break;case 16:w=`<path d="M ${m-T} ${u} Q ${m+T*.3} ${u} ${m+T} ${u-5}" fill="none" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />`;break;case 17:w=`<path d="M ${m-3.5} ${u-2} L ${m+3.5} ${u-2} L ${m} ${u+4} Z" fill="#E3536C" />`;break;case 18:w=`<path d="M ${m-3} ${u-4} Q ${m+3} ${u-4} ${m-1} ${u} Q ${m+3} ${u+4} ${m-3} ${u+4}" fill="none" stroke="${h}" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" />`;break;case 19:w=`<path d="M ${m-6} ${u-4} L ${m+6} ${u-4} L ${m+4} ${u+5} L ${m-4} ${u+5} Z" fill="#B3554A" stroke="${h}" stroke-width="2" />`;break;case 20:w=`<ellipse cx="${m}" cy="${u}" rx="3" ry="1.4" fill="none" stroke="${h}" stroke-width="2.2" />`;break;case 21:{const r=T;let l="";for(let k=1;k<4;k++){const C=m-r+2*r/4*k;l+=`<line x1="${C.toFixed(2)}" y1="${u-4}" x2="${C.toFixed(2)}" y2="${u+4}" stroke="${h}" stroke-width="1.3" />`}w=`<rect x="${(m-r).toFixed(2)}" y="${u-4}" width="${(r*2).toFixed(2)}" height="8" rx="2" fill="#ffffff" stroke="${h}" stroke-width="2.2" />${l}`;break}case 22:w=`
|
|
111
|
+
<path d="M ${m-T} ${u} Q ${m} ${u+5} ${m+T} ${u}" fill="none" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />
|
|
112
|
+
<path d="M ${m+T-3} ${u+2} Q ${m+T+3} ${u+6} ${m+T-1} ${u+9} Q ${m+T-5} ${u+6} ${m+T-3} ${u+2} Z" fill="#E3536C" />
|
|
113
|
+
`;break;case 23:w=`
|
|
114
|
+
<path d="M ${m-T*1.1} ${u-3} Q ${m} ${u+10} ${m+T*1.1} ${u-3} Z" fill="#8a2f36" />
|
|
115
|
+
<ellipse cx="${m}" cy="${u+4}" rx="${T*.6}" ry="4" fill="#E3536C" />
|
|
116
|
+
`;break;case 24:w=`
|
|
117
|
+
<path d="M ${m-T} ${u} Q ${m} ${u+7} ${m+T} ${u-2}" fill="none" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />
|
|
118
|
+
<ellipse cx="${m+T*.3}" cy="${u+3}" rx="2" ry="1.2" fill="#E3536C" opacity="0.7" />
|
|
119
|
+
`;break;case 0:default:if(e.mouthCurve===0)w=`<line x1="${m-T}" y1="${u}" x2="${m+T}" y2="${u}" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />`;else{const r=u+e.mouthCurve*14;w=`<path d="M ${m-T} ${u} Q ${m} ${r.toFixed(2)} ${m+T} ${u}" fill="none" stroke="${h}" stroke-width="${$}" stroke-linecap="round" />`}break}const ue=Math.max(0,Math.min(1,e.cheek));let j="";e.blushStripes?j=`
|
|
120
|
+
<g stroke="#E3536C" stroke-width="2" opacity="0.75" stroke-linecap="round">
|
|
121
|
+
<line x1="20" y1="52" x2="24" y2="58" />
|
|
122
|
+
<line x1="24" y1="52" x2="28" y2="58" />
|
|
123
|
+
<line x1="28" y1="52" x2="32" y2="58" />
|
|
124
|
+
<line x1="68" y1="52" x2="72" y2="58" />
|
|
125
|
+
<line x1="72" y1="52" x2="76" y2="58" />
|
|
126
|
+
<line x1="76" y1="52" x2="80" y2="58" />
|
|
127
|
+
</g>
|
|
128
|
+
`:ue>.01&&(j=`
|
|
129
|
+
<ellipse cx="${27+A*.4}" cy="${56+B*.4}" rx="6" ry="4" fill="${b}" opacity="${ue.toFixed(2)}" />
|
|
130
|
+
<ellipse cx="${73+A*.4}" cy="${56+B*.4}" rx="6" ry="4" fill="${b}" opacity="${ue.toFixed(2)}" />
|
|
131
|
+
`);const re=[`translate(${(e.shiftX??0).toFixed(2)}, ${e.bob.toFixed(2)})`,v?"translate(100, 0) scale(-1, 1)":"",Y?"translate(50, 50) scale(1.1) translate(-50, -50)":""].filter(Boolean).join(" ");return`
|
|
132
|
+
<svg width="${i}" height="${i}" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" style="overflow: visible;">
|
|
133
|
+
<defs>
|
|
134
|
+
<style>
|
|
135
|
+
@keyframes wissive-zzz-loop {
|
|
136
|
+
0% { transform: translate(0px, 4px) scale(0.55); opacity: 0; }
|
|
137
|
+
18% { transform: translate(3px, -2px) scale(0.85); opacity: 0.95; }
|
|
138
|
+
55% { transform: translate(8px, -11px) scale(1.1); opacity: 1; }
|
|
139
|
+
85% { transform: translate(14px, -19px) scale(0.85); opacity: 0.6; }
|
|
140
|
+
100% { transform: translate(18px, -25px) scale(0.5); opacity: 0; }
|
|
141
|
+
}
|
|
142
|
+
@keyframes wissive-tear-drip {
|
|
143
|
+
0% { transform: translateY(-2px) scaleY(0.7); opacity: 0.4; }
|
|
144
|
+
50% { transform: translateY(5px) scaleY(1.18); opacity: 0.95; }
|
|
145
|
+
85% { transform: translateY(12px) scaleY(0.8); opacity: 0.3; }
|
|
146
|
+
100% { transform: translateY(15px) scaleY(0.3); opacity: 0; }
|
|
147
|
+
}
|
|
148
|
+
@keyframes wissive-sweat-slide {
|
|
149
|
+
0% { transform: translateY(0px); opacity: 0.4; }
|
|
150
|
+
50% { transform: translateY(5px); opacity: 0.95; }
|
|
151
|
+
100% { transform: translateY(9px); opacity: 0.15; }
|
|
152
|
+
}
|
|
153
|
+
.wissive-zzz-1 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite 0s; transform-box: fill-box; transform-origin: center; }
|
|
154
|
+
.wissive-zzz-2 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -1s; transform-box: fill-box; transform-origin: center; }
|
|
155
|
+
.wissive-zzz-3 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -2s; transform-box: fill-box; transform-origin: center; }
|
|
156
|
+
.wissive-anim-tear { animation: wissive-tear-drip 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; transform-box: fill-box; transform-origin: top center; }
|
|
157
|
+
.wissive-anim-sweat { animation: wissive-sweat-slide 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
|
|
158
|
+
</style>
|
|
159
|
+
</defs>
|
|
160
|
+
<g transform="${re}">
|
|
161
|
+
<!-- Silueta del cuerpo (una o varias subformas: cuerpo + orejas, brazos…) -->
|
|
162
|
+
${M}
|
|
163
|
+
<!-- Mejillas o Rayas -->
|
|
164
|
+
${j}
|
|
165
|
+
<!-- Accesorios (ZZZ, Gotas) -->
|
|
166
|
+
${R}
|
|
167
|
+
<!-- Lágrimas -->
|
|
168
|
+
${ne}
|
|
169
|
+
<!-- Ojos -->
|
|
170
|
+
${le}
|
|
171
|
+
${pe}
|
|
172
|
+
<!-- Cejas -->
|
|
173
|
+
${he}
|
|
174
|
+
<!-- Boca -->
|
|
175
|
+
${w}
|
|
176
|
+
</g>
|
|
177
|
+
</svg>
|
|
178
|
+
`}function no(o,t,e,i,n={}){return Oe(o,t,e,i,n)}function We(){return typeof window>"u"||typeof window.matchMedia!="function"?!0:window.matchMedia("(hover: hover)").matches}function dt(){return typeof window>"u"?!1:typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches||"ontouchstart"in window||typeof navigator<"u"&&navigator.maxTouchPoints>0}const Te=new Set;let Se=!1;function mt(o){const t=o.clientX,e=o.clientY,i=(typeof window<"u"?window.innerWidth:1e3)/2||1,n=(typeof window<"u"?window.innerHeight:1e3)/2||1;for(const c of Te){const a=c.element.getBoundingClientRect(),h=a.left+a.width/2,b=a.top+a.height/2;if(c.onGazeMove){const M=Math.max(-.6,Math.min(.6,(t-h)/i)),v=Math.max(-.6,Math.min(.6,(e-b)/n));c.onGazeMove(22*M,14*v)}if(c.isActive())continue;const d=Math.hypot(t-h,e-b)<=c.nearRadius;d!==c.isNear&&(c.isNear=d,c.onNearChange(d))}}function ro(o){Te.add(o),!Se&&typeof window<"u"&&(window.addEventListener("mousemove",mt,{passive:!0}),Se=!0)}function lo(o){Te.delete(o),Te.size===0&&Se&&typeof window<"u"&&(window.removeEventListener("mousemove",mt),Se=!1)}function yt(o,t,e=120){if(typeof window>"u")return()=>{};let i=!1,n=!1,c=!1,a=!1;const h=()=>{i=!0,t.onHoverStart()},b=()=>{i=!1,n=!1,t.onHoverEnd()},$=N=>{N.button===0&&(n=!0,t.onClickStart())},d=()=>{n&&(n=!1,t.onClickEnd())},M=()=>{n=!0,t.onClickStart()},v=()=>{n&&(n=!1,t.onClickEnd())},Y=()=>{n&&(n=!1,t.onClickEnd())},A=()=>{c=!0,t.onHoverStart()},B=()=>{c=!1,a&&(a=!1,n=!1,t.onClickEnd()),t.onHoverEnd()},I=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),a||(a=!0,n=!0,t.onClickStart()))},O=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),a&&(a=!1,n=!1,t.onClickEnd()))};o.addEventListener("mouseenter",h),o.addEventListener("mouseleave",b),o.addEventListener("mousedown",$),window.addEventListener("mouseup",d),o.addEventListener("focus",A),o.addEventListener("blur",B),o.addEventListener("keydown",I),o.addEventListener("keyup",O),o.addEventListener("touchstart",M,{passive:!0}),window.addEventListener("touchend",v,{passive:!0}),window.addEventListener("touchcancel",Y,{passive:!0});const _={element:o,nearRadius:e,isNear:!1,isActive:()=>i||n||c,onNearChange:t.onNearChange,onGazeMove:t.onGazeMove};return(We()||t.onGazeMove)&&ro(_),()=>{o.removeEventListener("mouseenter",h),o.removeEventListener("mouseleave",b),o.removeEventListener("mousedown",$),window.removeEventListener("mouseup",d),o.removeEventListener("focus",A),o.removeEventListener("blur",B),o.removeEventListener("keydown",I),o.removeEventListener("keyup",O),o.removeEventListener("touchstart",M),window.removeEventListener("touchend",v),window.removeEventListener("touchcancel",Y),lo(_)}}let ze;function Pe(){return ze||(ze=import("cuelume").catch(()=>null)),ze}class ft{constructor(){g(this,"enabled",!0);g(this,"volume",.6);Pe().then(t=>{try{t==null||t.setVolume(this.volume)}catch{}})}setEnabled(t){this.enabled=t}isEnabled(){return this.enabled}setVolumeLevel(t){this.volume=Math.max(0,Math.min(1,t)),Pe().then(e=>{try{e==null||e.setVolume(this.volume)}catch{}})}getVolumeLevel(){return this.volume}playCue(t,e={}){this.enabled&&Pe().then(i=>{try{i==null||i.play(t,{volume:e.volume??this.volume})}catch{}})}playSound(t,e){if(!this.enabled)return;let i="tick";switch(t){case"happy":i=e==="click"?"sparkle":"chime";break;case"flutter":i=e==="click"?"pulse":"bloom";break;case"pleasure":i=e==="click"?"bloom":"droplet";break;case"peaceful":i=e==="click"?"arrival":"whisper";break;case"normal":i=e==="click"?"toggle":"tick";break;case"tired":case"sleepy":i=e==="click"?"loading":"whisper";break;case"sad":case"disappointed":i=e==="click"?"scan":"droplet";break;case"anxiety":case"stress":i=e==="click"?"pulse":"tick";break;case"anger":i=e==="click"?"press":"release";break;case"surprised":i=e==="click"?"success":"chime";break;case"numbness":i=e==="click"?"ready":"page";break;default:i=e==="click"?"sparkle":"tick";break}this.playCue(i)}}const q=new ft;function pt(o){q.setEnabled(o)}function bt(){return q.isEnabled()}function $t(o){q.setVolumeLevel(o)}function gt(){return q.getVolumeLevel()}class Mt{constructor(t,e){g(this,"particles",[]);g(this,"canvas");g(this,"ctx");g(this,"animating",!1);g(this,"rafId",null);g(this,"size");g(this,"dpr");g(this,"tick",()=>{const t=this.canvas.width,e=this.canvas.height;this.ctx.clearRect(0,0,t,e);const i=.016;for(let n=this.particles.length-1;n>=0;n--){const c=this.particles[n];if(c.life-=i,c.life<=0){this.particles.splice(n,1);continue}c.vx*=.95,c.vy*=.95,c.swayFreq&&c.swayAmp&&(c.x+=Math.sin((c.maxLife-c.life)*c.swayFreq)*c.swayAmp),c.x+=c.vx,c.y+=c.vy,c.rotation+=c.rotSpeed,this.drawParticle(c)}this.particles.length>0?this.rafId=requestAnimationFrame(this.tick):(this.animating=!1,this.ctx.clearRect(0,0,t,e))});this.size=e,this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.canvas=document.createElement("canvas"),this.setupCanvas(),t.style.position="relative",t.style.overflow="visible",t.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d")}setupCanvas(){const t=this.dpr,e=this.size*2.5;this.canvas.width=e*t,this.canvas.height=e*t,this.canvas.style.cssText=`
|
|
179
|
+
position: absolute;
|
|
180
|
+
top: -${this.size*.75}px;
|
|
181
|
+
left: -${this.size*.75}px;
|
|
182
|
+
width: ${e}px;
|
|
183
|
+
height: ${e}px;
|
|
184
|
+
pointer-events: none;
|
|
185
|
+
z-index: 10;
|
|
186
|
+
`}resize(t){this.size=t,this.dpr=typeof window<"u"&&window.devicePixelRatio||1,this.setupCanvas()}burst(t,e=8,i,n){const c=this.size*2.5,a=i??c/2,h=n??c/2;for(let b=0;b<e;b++){const $=Math.PI*2*b/e+(Math.random()-.5)*.7,d=2.5+Math.random()*3.5,M=this.createParticle(t,a,h,$,d);this.particles.push(M)}this.animating||(this.animating=!0,this.tick())}createParticle(t,e,i,n,c){const a=10+Math.random()*15,h=e+Math.cos(n)*a,b=i+Math.sin(n)*a,$=.6+Math.random()*.5,d={x:h,y:b,vx:Math.cos(n)*c,vy:Math.sin(n)*c-1.2,life:$,maxLife:$,size:(6+Math.random()*8)*(this.size/120),rotation:Math.random()*Math.PI*2,rotSpeed:(Math.random()-.5)*.2,shape:"circle",color:"#F2A9B8",opacity:1},M=Math.random()>.6,v=Y=>Y[Math.floor(Math.random()*Y.length)];switch(t){case"happy":d.shape=M?"sparkle":"heart",d.color=v(["#F2A9B8","#E3536C","#FF8FAB","#FFD1DC","#FFF0F5"]),d.vy-=.6;break;case"pleasure":d.shape=M?"circle":"petal",d.color=v(["#F28FC2","#FFC2DE","#FFE3F0","#E5739F"]),d.vy+=.9,d.vx*=.6,d.rotSpeed*=2.5,d.swayFreq=5+Math.random()*3,d.swayAmp=.9+Math.random()*.5;break;case"flutter":d.shape=M?"sparkle":"star",d.color=v(["#F2CB4E","#FFD700","#FFA500","#FFF4CC"]),d.vy-=1,d.vx*=1.5,d.rotSpeed*=2;break;case"peaceful":d.shape=M?"circle":"ring",d.color=v(["#9AC9A0","#B5E8B5","#7FD17F","#E8F5E9"]),d.vy-=.8,d.swayFreq=8+Math.random()*4,d.swayAmp=.4+Math.random()*.4;break;case"normal":d.shape=M?"circle":"dot",d.color=v(["#C9DCD3","#A8C7BB","#E4F0EA","#8FB3A4"]),d.size*=.65,d.vx*=.5,d.vy*=.5;break;case"tired":d.shape=M?"ring":"zzz",d.color=v(["#D6DBCF","#BFC7B8","#EDF0E8","#A9B3A0"]),d.vy-=1.2,d.vx*=.25,d.swayFreq=6+Math.random()*4,d.swayAmp=.5;break;case"sleepy":d.shape=M?"zzz":"bubble",d.color=v(["#AFCBE0","#D3E8F5","#ffffff","#8FB6D1"]),d.size*=1.35,d.vy-=1.5,d.vx*=.2,d.swayFreq=3+Math.random()*2,d.swayAmp=.7;break;case"sad":d.shape=M?"circle":"drop",d.color=v(["#7FA6D9","#A0C4E8","#6B9ACF","#E1F5FE"]),d.vy+=1.8,d.vx*=.3;break;case"disappointed":d.shape=M?"drop":"shard",d.color=v(["#EBD98A","#C9B86B","#F5E9B8","#A89550"]),d.vy+=1.2,d.vx*=.8,d.rotSpeed*=4;break;case"anxiety":d.shape=M?"circle":"zigzag",d.color=v(["#A99BD9","#C4B5F0","#8B7BC4","#D1C4E9"]),d.size*=.8,d.vx*=1.4;break;case"stress":d.shape=M?"zigzag":"spiral",d.color=v(["#C97F76","#E09A91","#A85F57","#F0BDB6"]),d.size*=.9,d.rotSpeed*=6,d.swayFreq=12+Math.random()*6,d.swayAmp=.6;break;case"anger":d.shape=M?"diamond":"ember",d.color=v(["#D9566A","#FF4444","#FF6B35","#FFA033"]),d.vy-=1.4,d.vx*=.7,d.size*=.9;break;case"surprised":d.shape=M?"dot":"burst",d.color=v(["#F0B98A","#FFCFA3","#FF9F1C","#FFE8D1"]),d.size*=1.15,d.vx*=1.8,d.vy*=1.8;break;case"numbness":d.shape=M?"dot":"glitch",d.color=v(["#D9C6E0","#C0A8CC","#EDE2F0","#A98FB8"]),d.vx*=.25,d.vy*=.25,d.life*=.6,d.rotSpeed=0;break;default:d.shape=M?"sparkle":"circle",d.color=v(["#F2A9B8","#F2CB4E","#9AC9A0"]);break}return d}drawParticle(t){const e=this.ctx,i=this.dpr,n=1-t.life/t.maxLife;let c=1;n<.18?c=n/.18:n>.65&&(c=(1-n)/.35),c=Math.max(0,Math.min(1.2,c));const a=t.size*c;if(a<=.1)return;const h=Math.max(0,Math.min(1,t.life/t.maxLife*1.2));switch(e.save(),e.translate(t.x*i,t.y*i),e.rotate(t.rotation),e.globalAlpha=h,t.shape){case"heart":e.fillStyle=t.color,e.beginPath(),e.moveTo(0,a*.35*i),e.bezierCurveTo(-a*.7*i,-a*.1*i,-a*.8*i,-a*.8*i,0,-a*.45*i),e.bezierCurveTo(a*.8*i,-a*.8*i,a*.7*i,-a*.1*i,0,a*.35*i),e.closePath(),e.fill();break;case"star":{e.fillStyle=t.color,e.beginPath();const b=5,$=a*i,d=a*.45*i;for(let M=0;M<b*2;M++){const v=M%2===0?$:d,Y=M*Math.PI/b-Math.PI/2,A=Math.cos(Y)*v,B=Math.sin(Y)*v;M===0?e.moveTo(A,B):e.lineTo(A,B)}e.closePath(),e.fill();break}case"sparkle":{e.fillStyle=t.color,e.beginPath();const b=a*1.1*i;e.moveTo(0,-b),e.quadraticCurveTo(0,0,b,0),e.quadraticCurveTo(0,0,0,b),e.quadraticCurveTo(0,0,-b,0),e.quadraticCurveTo(0,0,0,-b),e.closePath(),e.fill();break}case"drop":e.fillStyle=t.color,e.beginPath(),e.moveTo(0,-a*.8*i),e.bezierCurveTo(a*.7*i,-a*.2*i,a*.6*i,a*.7*i,0,a*.7*i),e.bezierCurveTo(-a*.6*i,a*.7*i,-a*.7*i,-a*.2*i,0,-a*.8*i),e.closePath(),e.fill();break;case"diamond":e.fillStyle=t.color,e.beginPath(),e.moveTo(0,-a*i),e.lineTo(a*.65*i,0),e.lineTo(0,a*i),e.lineTo(-a*.65*i,0),e.closePath(),e.fill();break;case"zigzag":e.strokeStyle=t.color,e.lineWidth=Math.max(2,a*.25)*i,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(-a*.6*i,-a*.5*i),e.lineTo(-a*.1*i,-a*.1*i),e.lineTo(-a*.3*i,a*.1*i),e.lineTo(a*.6*i,a*.5*i),e.stroke();break;case"ring":e.strokeStyle=t.color,e.lineWidth=Math.max(1.5,a*.25)*i,e.beginPath(),e.arc(0,0,a*.55*i,0,Math.PI*2),e.stroke();break;case"zzz":e.strokeStyle=t.color,e.lineWidth=Math.max(2,a*.25)*i,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(-a*.4*i,-a*.5*i),e.lineTo(a*.4*i,-a*.5*i),e.lineTo(-a*.4*i,a*.5*i),e.lineTo(a*.4*i,a*.5*i),e.stroke();break;case"petal":e.fillStyle=t.color,e.beginPath(),e.moveTo(0,-a*.9*i),e.quadraticCurveTo(a*.75*i,-a*.1*i,0,a*.9*i),e.quadraticCurveTo(-a*.75*i,-a*.1*i,0,-a*.9*i),e.closePath(),e.fill();break;case"spiral":{e.strokeStyle=t.color,e.lineWidth=Math.max(1.5,a*.2)*i,e.lineCap="round",e.beginPath();const b=a*.85*i;ht().forEach(([$,d],M)=>{const v=$*b,Y=d*b;M===0?e.moveTo(v,Y):e.lineTo(v,Y)}),e.stroke();break}case"bubble":e.strokeStyle=t.color,e.lineWidth=Math.max(1,a*.14)*i,e.beginPath(),e.arc(0,0,a*.6*i,0,Math.PI*2),e.stroke(),e.fillStyle=t.color,e.globalAlpha*=.7,e.beginPath(),e.arc(-a*.22*i,-a*.24*i,a*.13*i,0,Math.PI*2),e.fill();break;case"ember":{e.fillStyle=t.color,e.beginPath(),e.moveTo(0,-a*.95*i),e.bezierCurveTo(a*.5*i,-a*.2*i,a*.62*i,a*.55*i,0,a*.75*i),e.bezierCurveTo(-a*.62*i,a*.55*i,-a*.5*i,-a*.2*i,0,-a*.95*i),e.closePath(),e.fill();break}case"shard":e.fillStyle=t.color,e.beginPath(),e.moveTo(0,-a*.9*i),e.lineTo(a*.55*i,-a*.15*i),e.lineTo(a*.2*i,a*.85*i),e.lineTo(-a*.45*i,a*.3*i),e.closePath(),e.fill();break;case"burst":{e.strokeStyle=t.color,e.lineWidth=Math.max(1.5,a*.22)*i,e.lineCap="round",e.beginPath();for(let b=0;b<4;b++){const $=b*Math.PI/2,d=a*.3*i,M=a*i;e.moveTo(Math.cos($)*d,Math.sin($)*d),e.lineTo(Math.cos($)*M,Math.sin($)*M)}e.stroke();break}case"dot":e.fillStyle=t.color,e.beginPath(),e.arc(0,0,a*.28*i,0,Math.PI*2),e.fill();break;case"glitch":e.fillStyle=t.color,e.fillRect(-a*.6*i,-a*.28*i,a*1.2*i,a*.22*i),e.globalAlpha*=.6,e.fillRect(-a*.25*i,a*.06*i,a*.9*i,a*.16*i);break;case"circle":default:e.fillStyle=t.color,e.beginPath(),e.arc(0,0,a*.5*i,0,Math.PI*2),e.fill();break}e.restore()}destroy(){this.rafId!==null&&cancelAnimationFrame(this.rafId),this.particles=[],this.canvas.remove()}}class vt{constructor(t,e,i){g(this,"posX",0);g(this,"posY",0);g(this,"velX",0);g(this,"velY",0);g(this,"dragging",!1);g(this,"startPointerX",0);g(this,"startPointerY",0);g(this,"lastPointerX",0);g(this,"lastPointerY",0);g(this,"lastPointerTime",0);g(this,"velocitySamples",[]);g(this,"MAX_SAMPLES",6);g(this,"springK",.08);g(this,"springD",.82);g(this,"tossDecay",.96);g(this,"maxStretch",.25);g(this,"animating",!1);g(this,"rafId",null);g(this,"onUpdate");g(this,"onDragStart");g(this,"onDragEnd");g(this,"el");g(this,"handlePointerDown",t=>{t.preventDefault(),this.startDrag(t.clientX,t.clientY)});g(this,"handlePointerMove",t=>{this.dragging&&this.moveDrag(t.clientX,t.clientY)});g(this,"handlePointerUp",()=>{this.dragging&&this.endDrag()});g(this,"handleTouchDown",t=>{t.preventDefault();const e=t.touches[0];this.startDrag(e.clientX,e.clientY)});g(this,"handleTouchMove",t=>{if(!this.dragging)return;t.preventDefault();const e=t.touches[0];this.moveDrag(e.clientX,e.clientY)});g(this,"handleTouchUp",()=>{this.dragging&&this.endDrag()});g(this,"physicsTick",()=>{if(this.dragging){this.emitState(),this.rafId=requestAnimationFrame(this.physicsTick);return}const t=-this.springK*this.posX,e=-this.springK*this.posY;this.velX=(this.velX+t)*this.springD,this.velY=(this.velY+e)*this.springD,this.velX*=this.tossDecay,this.velY*=this.tossDecay,this.posX+=this.velX,this.posY+=this.velY,this.emitState();const i=Math.hypot(this.posX,this.posY),n=Math.hypot(this.velX,this.velY);if(i<.3&&n<.1){this.posX=0,this.posY=0,this.velX=0,this.velY=0,this.animating=!1,this.emitState();return}this.rafId=requestAnimationFrame(this.physicsTick)});this.el=t,this.onUpdate=e,this.onDragStart=i==null?void 0:i.onDragStart,this.onDragEnd=i==null?void 0:i.onDragEnd,this.el.addEventListener("mousedown",this.handlePointerDown),window.addEventListener("mousemove",this.handlePointerMove),window.addEventListener("mouseup",this.handlePointerUp),this.el.addEventListener("touchstart",this.handleTouchDown,{passive:!1}),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchUp)}startDrag(t,e){var i;this.dragging=!0,this.startPointerX=t-this.posX,this.startPointerY=e-this.posY,this.lastPointerX=t,this.lastPointerY=e,this.lastPointerTime=performance.now(),this.velocitySamples=[],this.velX=0,this.velY=0,this.el.style.cursor="grabbing",(i=this.onDragStart)==null||i.call(this),this.startPhysicsLoop()}moveDrag(t,e){const i=performance.now(),n=Math.max(1,i-this.lastPointerTime);this.velocitySamples.push({x:(t-this.lastPointerX)/n,y:(e-this.lastPointerY)/n}),this.velocitySamples.length>this.MAX_SAMPLES&&this.velocitySamples.shift(),this.posX=t-this.startPointerX,this.posY=e-this.startPointerY,this.lastPointerX=t,this.lastPointerY=e,this.lastPointerTime=i}endDrag(){var t;if(this.dragging=!1,this.el.style.cursor="pointer",this.velocitySamples.length>0){let e=0,i=0;for(const h of this.velocitySamples)e+=h.x,i+=h.y;const n=this.velocitySamples.length;this.velX=e/n*16,this.velY=i/n*16;const c=25,a=Math.hypot(this.velX,this.velY);a>c&&(this.velX=this.velX/a*c,this.velY=this.velY/a*c)}(t=this.onDragEnd)==null||t.call(this),this.startPhysicsLoop()}startPhysicsLoop(){this.animating||(this.animating=!0,this.rafId=requestAnimationFrame(this.physicsTick))}emitState(){let t=1,e=1,i=0;if(this.dragging){const n=this.posX,c=this.posY,a=Math.hypot(n,c),h=Math.min(this.maxStretch,a*.002),b=Math.atan2(c,n);t=1+h*Math.abs(Math.cos(b)),e=1-h*.5*Math.abs(Math.cos(b)),Math.abs(Math.sin(b))>Math.abs(Math.cos(b))&&(e=1+h*Math.abs(Math.sin(b)),t=1-h*.5*Math.abs(Math.sin(b))),i=Math.atan2(c,n)*.06}else{const n=Math.hypot(this.velX,this.velY),c=Math.min(this.maxStretch,n*.012),a=Math.atan2(this.velY,this.velX);t=1+c*Math.abs(Math.cos(a)),e=1-c*.6*Math.abs(Math.cos(a)),Math.abs(Math.sin(a))>Math.abs(Math.cos(a))&&(e=1+c*Math.abs(Math.sin(a)),t=1-c*.6*Math.abs(Math.sin(a))),i=Math.atan2(this.velY,this.velX)*.04}this.onUpdate({offsetX:this.posX,offsetY:this.posY,scaleX:t,scaleY:e,rotation:i,isDragging:this.dragging})}destroy(){this.rafId!==null&&cancelAnimationFrame(this.rafId),this.el.removeEventListener("mousedown",this.handlePointerDown),window.removeEventListener("mousemove",this.handlePointerMove),window.removeEventListener("mouseup",this.handlePointerUp),this.el.removeEventListener("touchstart",this.handleTouchDown),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchUp)}}function kt(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Ct(o){if(typeof window>"u"||!window.matchMedia)return()=>{};const t=window.matchMedia("(prefers-reduced-motion: reduce)"),e=i=>o(i.matches);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function co(o){let t=o.trim().replace("#","");if(t.length===3&&(t=t.split("").map(e=>e+e).join("")),t.length===6){const e=parseInt(t,16);return[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255]}return[0,0,0]}function Le(o){const[t,e,i]=co(o),n=b=>b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4),c=n(t),a=n(e),h=n(i);return .2126*c+.7152*a+.0722*h}function Tt(o,t){const e=Le(o),i=Le(t),n=Math.max(e,i),c=Math.min(e,i);return(n+.05)/(c+.05)}function ho(o,t,e=3){const i=Tt(o,t);return{ratio:Number(i.toFixed(2)),passes:i>=e}}const uo={happy:{baseColor:"#F7C6CE",strokeColor:"#1c1917"},excited:{baseColor:"#FFD54F",strokeColor:"#1c1917"},celebrate:{baseColor:"#FF80AB",strokeColor:"#1c1917"},laughing:{baseColor:"#FFE082",strokeColor:"#1c1917"},playful:{baseColor:"#F48FB1",strokeColor:"#1c1917"},proud:{baseColor:"#CE93D8",strokeColor:"#1c1917"},idle:{baseColor:"#F7C6CE",strokeColor:"#1c1917"},sleeping:{baseColor:"#9FA8DA",strokeColor:"#1A237E"},drowsy:{baseColor:"#C5CAE9",strokeColor:"#283593"},"powering-down":{baseColor:"#78909C",strokeColor:"#263238"},bored:{baseColor:"#B0BEC5",strokeColor:"#37474F"},angry:{baseColor:"#EF5350",strokeColor:"#B71C1C"},alerting:{baseColor:"#FF7043",strokeColor:"#BF360C"},notifying:{baseColor:"#FFA726",strokeColor:"#E65100"},suspicious:{baseColor:"#D4E157",strokeColor:"#33691E"},thinking:{baseColor:"#4DD0E1",strokeColor:"#006064"},searching:{baseColor:"#26C6DA",strokeColor:"#004D40"},loading:{baseColor:"#4FC3F7",strokeColor:"#01579B"},listening:{baseColor:"#81C784",strokeColor:"#1B5E20"},dictating:{baseColor:"#AED581",strokeColor:"#33691E"},writing:{baseColor:"#FFF176",strokeColor:"#F57F17"},orbit:{baseColor:"#80DEEA",strokeColor:"#00838F"},radar:{baseColor:"#4DB6AC",strokeColor:"#004D40"},progress:{baseColor:"#64B5F6",strokeColor:"#0D47A1"},sad:{baseColor:"#90CAF9",strokeColor:"#1565C0"},scared:{baseColor:"#B39DDB",strokeColor:"#4527A0"},confused:{baseColor:"#FFE082",strokeColor:"#E65100"},curious:{baseColor:"#A5D6A7",strokeColor:"#1B5E20"},shy:{baseColor:"#F48FB1",strokeColor:"#880E4F"},waking:{baseColor:"#FFF59D",strokeColor:"#F57F17"},spawning:{baseColor:"#E1BEE7",strokeColor:"#4A148C"}};function Qe(o){let t=o.trim().replace("#","");t.length===3&&(t=t.split("").map(i=>i+i).join(""));const e=parseInt(t,16);return isNaN(e)?{r:247,g:198,b:206}:{r:e>>16&255,g:e>>8&255,b:e&255}}function St(o,t,e){const i=Qe(o),n=Qe(t),c=Math.max(0,Math.min(1,e)),a=Math.round(i.r+(n.r-i.r)*c),h=Math.round(i.g+(n.g-i.g)*c),b=Math.round(i.b+(n.b-i.b)*c),$=d=>d.toString(16).padStart(2,"0");return`#${$(a)}${$(h)}${$(b)}`}function mo(o,t){return{baseColor:t,strokeColor:"#1c1917"}}function Q(o,t,e){const i=o/t%1;return i<e?Math.sin(i/e*Math.PI):0}const Xe={bouncy(o,t,e,i){const n=Math.abs(Math.sin(t*e));o.bob+=n*i-i*.5,o.cheek+=n*.15,o.eyeScale+=n*.04,o.turnAngle+=Math.sin(t*e*.5)*.05},flutter(o,t,e,i){const n=Math.sin(t*e);o.shiftX+=n*i,o.bob+=Math.cos(t*e*.7)*i*.5,o.turnAngle+=n*.06,o.eyeScale-=Math.abs(n)*.03},serene(o,t,e,i){const n=Math.sin(t*e);o.bob+=n*i,o.eyeScale+=n*.05,o.cheek+=(n+1)*.06,o.turnAngle+=Math.sin(t*e*.4-.6)*.045},float(o,t,e,i){o.bob+=Math.sin(t*e)*i,o.shiftX+=Math.sin(t*e*.5)*i*1.1,o.turnAngle+=Math.sin(t*e*.5-.9)*.07},calm(o,t,e,i){const n=Math.sin(t*e);o.bob+=n*i,o.eyeScale+=n*.025,o.gazeX+=Math.sin(t*e*.23)*2.5,o.turnAngle+=Math.sin(t*e*.31)*.03},droop(o,t,e,i){const n=t*e*.18%1,c=n<.82?n/.82:1-(n-.82)/.18;o.bob+=c*i*2.2,o.eyeOpen=Math.max(0,o.eyeOpen-c*.45),o.browY+=c*2,o.turnAngle+=c*.12},sob(o,t,e,i){const n=Math.sin(t*e)+Math.sin(t*e*2.7)*.4;o.bob+=n*i,o.browY+=1+Math.sin(t*e)*.8,o.gazeY+=1.5,o.mouthCurve-=.05+Math.abs(Math.sin(t*e))*.05},jitter(o,t,e,i){o.shiftX+=(Math.random()-.5)*i,o.bob+=(Math.random()-.5)*i,o.gazeX+=Math.sin(t*e*1.7)*4+(Math.random()-.5)*2,o.turnAngle+=(Math.random()-.5)*.03},fiery(o,t,e,i){const n=Math.sin(t*e*3.1)*.35,c=Math.pow(Math.max(0,Math.sin(t*e*.35)),6);o.bob+=n*i-c*i*1.8,o.shiftX+=n*i*.5,o.eyeScale+=c*.18,o.browY-=c*2.5,o.browTilt-=c*.25},wilt(o,t,e,i){const n=(Math.sin(t*e*.6)+1)/2;o.bob+=n*i*1.8,o.mouthCurve-=n*.12,o.browY+=n*1.6,o.eyeScale-=n*.05},dizzy(o,t,e,i){o.shiftX+=Math.sin(t*e)*i,o.bob+=Math.cos(t*e)*i*.7,o.turnAngle+=Math.sin(t*e)*.14,o.gazeX+=Math.cos(t*e)*3},snooze(o,t,e,i){const n=Math.sin(t*e);o.bob+=n*i*1.6,o.eyeScale+=n*.06,o.eyeOpen*=.35,o.cheek+=(n+1)*.05,o.turnAngle+=Math.sin(t*e-.8)*.05},pop(o,t,e,i){const n=Q(t,1/(e*.1),.18),c=Math.sin(t*e*1.6)*.18;o.bob+=c*i-n*i*2.2,o.eyeScale+=c*.02+n*.22,o.browY-=n*3,o.mouthOpen+=n*.25},drift(o,t,e,i){o.bob+=Math.sin(t*e)*i*.6;const n=Q(t,3.7,.04);o.shiftX+=n*(Math.random()-.5)*5,o.gazeX+=n*(Math.random()-.5)*6,o.eyeScale-=n*.08}};function wt(o,t,e,i,n,c=1){(Xe[o]||Xe.calm)(t,e,i,n*c)}const xt={sleeping(o,t){const e=Math.sin(t*.9);o.eyeOpen=.05,o.bob+=e*2.4,o.eyeScale+=e*.04,o.bob+=Q(t,9,.15)*1.8},waking(o,t){const e=Q(t,4,.4);o.bob+=Math.sin(t*2.2)*1.6-e*3,o.eyeOpen=Math.min(1,.35+e*.65),o.eyeScale+=e*.1,o.turnAngle+=Math.sin(t*1.1)*.06},listening(o,t){o.turnAngle+=.1+Math.sin(t*1.4)*.03,o.bob+=Q(t,2.6,.25)*2.2,o.eyeScale+=.06,o.gazeY-=.8},thinking(o,t){o.gazeX+=-6+Math.sin(t*.9)*3,o.gazeY+=-4+Math.cos(t*.7)*2,o.browY-=1+Math.sin(t*1.3)*.8,o.turnAngle+=Math.sin(t*.6)*.05},searching(o,t){o.gazeX+=Math.sin(t*5.5)*11,o.gazeY+=Math.sin(t*2.3)*2.5,o.turnAngle+=Math.sin(t*5.5)*.05,o.eyeScale+=.05},working(o,t){o.bob+=Math.sin(t*3.4)*1.4,o.turnAngle+=Math.sin(t*3.4-.5)*.035,o.gazeY+=1.5,o.mouthWidth*=.9},excited(o,t){o.bob+=-Math.abs(Math.sin(t*7))*5.5,o.eyeScale+=.1+Math.abs(Math.sin(t*7))*.06,o.cheek+=.2,o.turnAngle+=Math.sin(t*3.5)*.07},surprised(o,t){o.bob+=Math.sin(t*9)*.9,o.eyeScale+=.12,o.browY-=1.5,o.shiftX+=Math.sin(t*13)*.4},suspicious(o,t){o.gazeX+=-7+Math.sin(t*.5)*2.5,o.eyeScale-=.08,o.browTilt-=.12,o.bob+=Math.sin(t*.8)*.5},angry(o,t){o.shiftX+=(Math.random()-.5)*3,o.bob+=(Math.random()-.5)*2;const e=Q(t,2.2,.3);o.browY-=e*2,o.browTilt-=e*.2},drowsy(o,t){const e=(Math.sin(t*.8)+1)/2;o.bob+=e*3,o.eyeOpen=Math.max(.08,.5-e*.4),o.eyeOpen+=Q(t,6.5,.08)*.5,o.browY+=e*2},happy(o,t){o.bob+=-Math.abs(Math.sin(t*3.2))*2.4,o.cheek+=.15+Math.abs(Math.sin(t*3.2))*.1,o.turnAngle+=Math.sin(t*1.6)*.05},curious(o,t){o.turnAngle+=Math.sin(t*1.2)*.13,o.gazeX+=Math.sin(t*2.1)*6,o.eyeScale+=.08,o.bob+=Math.sin(t*2.4)*1},confused(o,t){o.turnAngle+=Math.sin(t*.9)*.16,o.shiftX+=Math.sin(t*.9)*1.8,o.browTilt+=.15+Math.sin(t*1.7)*.1,o.gazeX+=Math.sin(t*.6)*4},bored(o,t){o.shiftX+=Math.sin(t*.5)*2.2,o.gazeX+=6+Math.sin(t*.3)*3,o.eyeOpen=Math.min(o.eyeOpen,.5),o.bob+=Q(t,7,.2)*2},proud(o,t){o.bob+=-2+Math.sin(t*1.1)*.8,o.turnAngle+=Math.sin(t*.7)*.04,o.gazeY-=2,o.cheek+=.1},shy(o,t){o.bob+=1.5+Math.sin(t*1.3)*.7,o.gazeX+=-4+Math.sin(t*.9)*1.5,o.gazeY+=4,o.cheek+=.25,o.eyeScale-=.06},sad(o,t){o.bob+=2+Math.sin(t*.9)*1.4,o.gazeY+=3,o.browY+=1.5,o.turnAngle+=Math.sin(t*.5)*.03},laughing(o,t){o.bob+=-Math.abs(Math.sin(t*9))*4,o.mouthOpen+=.2+Math.abs(Math.sin(t*9))*.3,o.cheek+=.3,o.turnAngle+=Math.sin(t*4.5)*.05},scared(o,t){o.shiftX+=Math.sin(t*22)*1.2,o.bob+=1.2+Math.sin(t*18)*.8,o.eyeScale+=.14,o.browTilt+=.2},playful(o,t){o.bob+=(Math.sin(t*4.3)+Math.sin(t*6.7)*.5)*1.8,o.turnAngle+=Math.sin(t*3.1)*.11,o.shiftX+=Math.sin(t*2.2)*1.5,o.cheek+=.18},celebrate(o,t){o.bob+=-Math.abs(Math.sin(t*5))*7,o.turnAngle+=Math.sin(t*2.5)*.18,o.cheek+=.35,o.eyeScale+=.1},orbit(o,t){o.gazeX+=Math.cos(t*2.2)*10,o.gazeY+=Math.sin(t*2.2)*6,o.turnAngle+=Math.cos(t*2.2)*.06},radar(o,t){const e=Math.sin(t*1.6);o.gazeX+=Math.sign(e)*Math.pow(Math.abs(e),.45)*11,o.turnAngle+=e*.05,o.eyeScale+=.04},progress(o,t){const e=Math.pow(Math.max(0,Math.sin(t*3)),3);o.bob+=-e*3,o.eyeScale+=e*.09},spawning(o,t){const e=Math.exp(-(t*1.5%6)*.7);o.bob+=-Math.sin(t*6)*4*e,o.eyeScale+=e*.15},humming(o,t){o.bob+=Math.sin(t*2.6)*1.6,o.mouthOpen+=.1+Math.abs(Math.sin(t*2.6))*.08,o.turnAngle+=Math.sin(t*1.3)*.05,o.cheek+=.12},loading(o,t){o.eyeScale+=Math.sin(t*1.8)*.08,o.bob+=Math.sin(t*1.8)*1.2,o.gazeY+=Math.sin(t*.9)*1.5},dictating(o,t){o.mouthOpen=.25+Math.abs(Math.sin(t*11))*.4,o.bob+=Math.sin(t*2)*.6,o.browY-=.5},writing(o,t){o.gazeY+=4,o.gazeX+=Math.sin(t*4.5)*5,o.bob+=Math.abs(Math.sin(t*4.5))*1.2},sending(o,t){const e=Q(t,1.6,.3);o.shiftX+=e*4,o.bob+=-e*2,o.turnAngle+=e*.08},receiving(o,t){const e=Q(t,1.6,.3);o.shiftX+=-e*4,o.bob+=e*1.5,o.eyeScale+=e*.12},uploading(o,t){const e=1-t*.7%1;o.bob+=e*4-2,o.gazeY-=2,o.eyeScale+=(1-e)*.05},notifying(o,t){const e=Q(t,2.4,.12)+Q(t-.22,2.4,.12);o.bob+=-e*4,o.eyeScale+=e*.12,o.turnAngle+=e*.06},alerting(o,t){o.shiftX+=Math.sin(t*16)*2.5,o.bob+=Math.sin(t*12)*1.5,o.eyeScale+=.16,o.browY-=2},dragging(o,t){o.turnAngle+=Math.sin(t*2.4-1.2)*.14,o.shiftX+=Math.sin(t*2.4)*2,o.bob+=Math.cos(t*2.4-1.2)*1.5},bouncing(o,t){o.bob+=-Math.abs(Math.sin(t*5.5))*8},"powering-down"(o,t){const e=Math.min(1,t%8/8);o.bob+=e*4,o.eyeOpen=Math.max(.03,.4-e*.37),o.eyeOpen+=Q(t,2.7,.05)*.3,o.eyeScale-=e*.1}};function Yt(o,t,e,i,n){const c=xt[o];return c?(c(t,e,i,n),!0):!1}const Et=600;function Ft(o){let t=null,e=!1;const i=()=>{t!==null&&(clearTimeout(t),t=null),e=!1};return{play:(c,a={})=>{if(i(),c.length===0)return;const h=a.mode??"once";e=!0;let b=0,$=1;const d=()=>{if(!e)return;const M=c[b];o.applyStep(o.resolveStep(M)),t=setTimeout(()=>{var v;if(h==="ping-pong")c.length>1&&((b+$>=c.length||b+$<0)&&($=-$),b+=$);else if(b+=1,b>=c.length)if(h==="loop")b=0;else{i(),(v=a.onComplete)==null||v.call(a);return}d()},M.duration??Et)};d()},stop:i,isPlaying:()=>e}}const Be=[{label:"Interacción",states:["idle","near","hover","click"]},{label:"Ciclo de vida",states:["sleeping","waking","listening","thinking","searching","working"]},{label:"Reacciones",states:["excited","surprised","suspicious","angry","drowsy","happy","curious","confused","bored","proud","shy","sad","laughing","scared","playful","celebrate"]},{label:"Morfos de agente",states:["orbit","radar","progress"]},{label:"Ciclo de producto",states:["spawning","humming","loading","dictating","writing","sending","receiving","uploading","notifying","alerting","dragging","bouncing","powering-down"]}],At=Be.flatMap(o=>o.states),zt=["idle","near","hover","click"],Pt=Be.find(o=>o.label==="Reacciones").states,It=At.filter(o=>!zt.includes(o));function Lt(o,t){return o??t??Pt}function Xt(o,t){if(o.length<=1)return o[0];let e=o[Math.floor(Math.random()*o.length)];for(;e===t;)e=o[Math.floor(Math.random()*o.length)];return e}class Dt{constructor(t=[],e={}){g(this,"instances",new Map);g(this,"options");g(this,"connectedPairs",new Map);g(this,"isRunning",!1);g(this,"update",()=>{const t=Array.from(this.instances.values());if(t.length<2)return;const e=new Set;for(let i=0;i<t.length;i++)for(let n=i+1;n<t.length;n++){const c=t[i],a=t[n],h=c.getPosition(),b=a.getPosition(),$=b.x-h.x,d=b.y-h.y,M=Math.hypot($,d);if(M<=this.options.proximityThreshold&&M>0){const v=this.getPairKey(c.id,a.id);if(e.add(v),this.options.enableGazeSync){const A=Math.max(-.8,Math.min(.8,$/160))*22,B=Math.max(-.8,Math.min(.8,d/160))*14;c.setGaze({x:A,y:B}),a.setGaze({x:-A,y:-B})}let Y=this.connectedPairs.get(v);Y?Math.random()<.08&&this.options.enableSynergies&&(c.triggerParticles(1),a.triggerParticles(1)):(Y={idA:c.id,idB:a.id,connectedSince:Date.now()},this.connectedPairs.set(v,Y),this.triggerSynergy(c,a))}}for(const[i,n]of this.connectedPairs.entries())if(!e.has(i)){const c=this.instances.get(n.idA),a=this.instances.get(n.idB);c&&c.setGaze({x:0,y:0}),a&&a.setGaze({x:0,y:0}),this.connectedPairs.delete(i)}});this.options={proximityThreshold:e.proximityThreshold??220,enableGazeSync:e.enableGazeSync??!0,enableSynergies:e.enableSynergies??!0},t.forEach(i=>this.add(i)),this.start()}add(t){!t||!t.id||this.instances.set(t.id,t)}remove(t){!t||!t.id||this.instances.delete(t.id)}start(){this.isRunning||(this.isRunning=!0,G.add(this.update))}stop(){this.isRunning&&(this.isRunning=!1,G.remove(this.update))}getPairKey(t,e){return t<e?`${t}:${e}`:`${e}:${t}`}triggerSynergy(t,e){if(!this.options.enableSynergies)return;const i=t.emotionCategory||"happy",n=e.emotionCategory||"happy";if(q.playSound(i,"hover"),t.triggerParticles(6),e.triggerParticles(6),i==="happy"&&n==="happy")t.bounce(),e.bounce();else if(i==="happy"&&n==="sad"||i==="sad"&&n==="happy"){const c=i==="happy"?t:e,a=i==="sad"?t:e;c.setEmotion("hover"),a.setEmotion("near")}else(i==="intense"||n==="intense")&&(t.spin(.5),e.spin(.5))}destroy(){this.stop(),this.instances.clear(),this.connectedPairs.clear()}}function Gt(o=[],t={}){return new Dt(o,t)}const Ot="wissive:custom:";function yo(o){const t={};for(const e in o)t[e]=o[e].map(i=>({...i}));return t}function Wt(o,t={}){var $,d,M;const e=t.eyesFrom?H[t.eyesFrom]:void 0,i=t.mouthFrom?H[t.mouthFrom]:void 0,n=t.motionFrom?H[t.motionFrom]:void 0,c=t.particlesFrom?H[t.particlesFrom]:void 0,a=t.soundFrom?H[t.soundFrom]:void 0,h=yo(fe.expressions);for(const v in h){const Y=e&&((($=e.expressions[v])==null?void 0:$[0])??e.expressions.idle[0]),A=i&&(((d=i.expressions[v])==null?void 0:d[0])??i.expressions.idle[0]);h[v]=h[v].map(B=>({...B,...Y&&{eyeType:Y.eyeType,eyeScale:Y.eyeScale},...A&&{mouthType:A.mouthType,mouthCurve:A.mouthCurve,mouthWidth:A.mouthWidth},...t.eyeTypeOverride!==void 0&&{eyeType:t.eyeTypeOverride},...t.mouthTypeOverride!==void 0&&{mouthType:t.mouthTypeOverride}}))}const b=(M=t.stateBank)==null?void 0:M.filter(v=>It.includes(v));return{name:o,emotion:"custom",baseColor:t.baseColor||fe.baseColor,silhouette:t.silhouette||"circle",motion:n?{...n.motion}:{...fe.motion},expressions:h,particleEmotion:c==null?void 0:c.emotion,soundEmotion:a==null?void 0:a.emotion,...b&&b.length>0&&{autonomousStatePool:b}}}function Bt(o,t){localStorage.setItem(Ot+o,JSON.stringify(t))}function fo(o){const t=localStorage.getItem(Ot+o);return t?JSON.parse(t):null}function po(o,t={}){const e=Wt(o,t);return H[o]=e,Bt(o,e),e}const bo={idle:1,near:.7,hover:.5,click:.35},jt={xs:48,sm:80,base:120,lg:160,xl:200,"2xl":240};function De(o="base"){return typeof o=="number"?o:jt[o]??120}function _t(o,t){const{target:e,size:i="base",interactive:n=!0,draggable:c=!0,nearRadius:a=120,sound:h=!0,flipX:b=!1,emphasis:$=!1,gazeTracking:d=!1,ambientParticles:M=!0,autonomousStates:v=!0,autonomousStatePool:Y,reducedMotion:A="auto",theme:B="auto"}=t,I=Ie(o)||Ie("mochi"),O=I.motion;let _=De(i),N=A,K=B,ae=I.baseColor;const ee=I.particleEmotion||I.emotion,ie=I.soundEmotion||I.emotion,D=()=>typeof N=="boolean"?N:kt(),F=document.createElement("div");F.className="wissive-wrapper",F.style.width=`${_}px`,F.style.height=`${_}px`,F.style.display="inline-block",F.style.position="relative";const s=document.createElement("div");s.className="wissive-emoji",s.setAttribute("role","img"),n&&s.setAttribute("tabindex","0");const we={idle:"Reposo",near:"Cerca",hover:"Hover",click:"Presionado"},le=y=>{s.setAttribute("aria-label",`${I.name} (${I.emotion}) emoji - Estado: ${we[y]||y}`)};le("idle"),s.style.width=`${_}px`,s.style.height=`${_}px`,s.style.display="inline-block",s.style.userSelect="none",s.style.cursor=n?"pointer":"default",s.style.willChange="transform",s.style.transformOrigin="center center",F.appendChild(s),e.appendChild(F);const pe=Ct(()=>{te()});let ce=b,ne=$,se=d,R=h,he=c,be=M,T=v,m=Lt(Y,I.autonomousStatePool);const u=new ct,w=I.expressions.idle,ue=u.pickVariant(w,"idle"),j=lt(ue,{stiffness:O.stiffness,damping:O.damping});let re=!1,r=!1,l=!1,k=Math.random()*100,C=!1,L=null,p=null;const z=new Mt(F,_);let P={offsetX:0,offsetY:0,scaleX:1,scaleY:1,rotation:0},S=null;const x=()=>{S||(S=new vt(s,y=>{P=y,X()},{onDragStart:()=>{R&&q.playSound(ie,"click")},onDragEnd:()=>{z.burst(ee,10),R&&q.playSound(ie,"bounce")}}))};he&&n&&x();const X=()=>{const y=D(),E=y?0:O.idleSpeed*.35,W=y?0:.04,V=1+W*Math.cos(k*E),J=1-W*Math.sin(k*E),ye=P.offsetX!==0||P.offsetY!==0||P.scaleX!==1||P.scaleY!==1;let Ye,Ee,Fe;ye?(Ye=V*P.scaleX,Ee=J*P.scaleY,Fe=P.rotation):(Ye=V,Ee=J,Fe=0);const Nt=P.offsetX,Jt=P.offsetY;s.style.transform=`translate(${Nt.toFixed(1)}px, ${Jt.toFixed(1)}px) rotate(${(Fe*180/Math.PI).toFixed(2)}deg) scale(${Ye.toFixed(4)}, ${Ee.toFixed(4)})`},te=()=>{const y=j.getValues(),E=u.getState();let W=I.baseColor;if(typeof K=="object"&&K.baseColor&&(W=K.baseColor),ae=St(ae,W,.15),C&&(y.eyeOpen=.05),!D()&&!Yt(E,y,k,O.idleSpeed,O.idleAmplitude)){const J=bo[E]??1;wt(O.motionType,y,k,O.idleSpeed,O.idleAmplitude,J)}X(),s.innerHTML=Oe(I.silhouette,ae,y,_,{flipX:ce,emphasis:ne},k)},de=(y=u.getState())=>{u.setState(y);const E=u.resolvePool(I.expressions,y);if(!(!E||E.length===0)){if(E.length===1){const W=u.pickVariant(E,y);j.setTargets(W),G.add(Z);return}C=!0,G.add(Z),setTimeout(()=>{const W=u.pickVariant(E,y);j.setTargets(W),G.add(Z),setTimeout(()=>{C=!1,G.add(Z)},120)},100)}},U=y=>{le(y),de(y)},oe=Ft({resolveStep(y){return{...y.state?u.pickVariant(u.resolvePool(I.expressions,y.state),y.state):{},...y.params}},applyStep(y){j.setTargets(y),G.add(Z)}}),Z=y=>{k+=y;const E=j.update(y);te(),!E&&u.getState()!=="idle"&&G.remove(Z)};G.add(Z);const je=()=>{const W=3e3+Math.random()*4e3;p=window.setTimeout(()=>{u.getState()==="idle"&&!C&&(C=!0,G.add(Z),L=window.setTimeout(()=>{C=!1,G.add(Z)},180)),je()},W)};je();let $e=null;const _e=()=>{const y=O.idleIntervalMin,E=O.idleIntervalMax,W=y+Math.random()*(E-y);$e=window.setTimeout(()=>{u.getState()==="idle"&&!oe.isPlaying()&&de("idle"),_e()},W)};_e();let ge=null,Me=null;const Re=()=>{const W=3500+Math.random()*4500;ge=window.setTimeout(()=>{if(u.getState()==="idle"&&!se&&!oe.isPlaying()){const V=[{x:-9,y:0},{x:9,y:0},{x:-7,y:-4},{x:7,y:-4},{x:0,y:-5},{x:0,y:4}],J=V[Math.floor(Math.random()*V.length)];j.setTargets({gazeX:J.x,gazeY:J.y}),G.add(Z);const ye=1200+Math.random()*1500;Me=window.setTimeout(()=>{se||(j.setTargets({gazeX:0,gazeY:0}),G.add(Z))},ye)}Re()},W)};Re();let ve=null;const Ze=()=>{const W=3500+Math.random()*5e3;ve=window.setTimeout(()=>{if(be&&!D()){const V=u.getState();if(V==="idle"||V==="near"||V==="hover"){const J=Math.floor(2+Math.random()*3);z.burst(ee,J)}}Ze()},W)};Ze();let ke=null,Ce=null,Ne=null;const Je=()=>{const W=5e3+Math.random()*6e3;ke=window.setTimeout(()=>{if(T&&m.length>0&&!D()&&!oe.isPlaying()&&u.getState()==="idle"&&!re&&!r&&!l){const J=Xt(m,Ne);Ne=J,U(J);const ye=1800+Math.random()*2200;Ce=window.setTimeout(()=>{u.getState()===J&&!re&&!r&&!l&&U("idle")},ye)}Je()},W)};Je();const Zt=()=>{$e!==null&&(clearTimeout($e),$e=null),p!==null&&(clearTimeout(p),p=null),L!==null&&(clearTimeout(L),L=null),ge!==null&&(clearTimeout(ge),ge=null),Me!==null&&(clearTimeout(Me),Me=null),ve!==null&&(clearTimeout(ve),ve=null),ke!==null&&(clearTimeout(ke),ke=null),Ce!==null&&(clearTimeout(Ce),Ce=null)};let xe=null;const me=()=>l?"click":r?"hover":re?"near":"idle";return n&&(xe=yt(s,{onHoverStart:()=>{r=!0,R&&q.playSound(ie,"hover"),U(me())},onHoverEnd:()=>{r=!1,U(me())},onClickStart:()=>{l=!0,R&&q.playSound(ie,"click"),D()||z.burst(ee,8),U(me())},onClickEnd:()=>{l=!1,U(me())},onNearChange:y=>{re=y,U(me())},onGazeMove:(y,E)=>{se&&(j.setTargets({gazeX:y,gazeY:E}),G.add(Z))}},a)),{id:"wissive-"+Math.random().toString(36).substring(2,9),name:I.name,emotionCategory:I.emotion,getElement(){return s},getPosition(){const y=s.getBoundingClientRect();return{x:y.left+y.width/2,y:y.top+y.height/2}},getCurrentState(){return u.getState()},setEmotion(y){D()||(y==="click"?z.burst(ee,8):y==="hover"&&z.burst(ee,4)),U(y)},spin(y=1){const E=j.getValues().turnAngle||0;j.setTargets({turnAngle:E+Math.PI*2*y}),G.add(Z)},bounce(){R&&q.playSound(ie,"bounce"),D()||z.burst(ee,5);const y=j.getValues().bob||0;j.setTargets({bob:y-14}),G.add(Z)},setGaze(y){j.setTargets({gazeX:y.x,gazeY:y.y}),G.add(Z)},setGazeTracking(y){se=y,y||(j.setTargets({gazeX:0,gazeY:0}),G.add(Z))},setSound(y){R=y},setDraggable(y){he=y,y&&!S&&n?x():!y&&S&&(S.destroy(),S=null,P={offsetX:0,offsetY:0,scaleX:1,scaleY:1,rotation:0,isDragging:!1},X())},setFlipX(y){ce=y,te()},setEmphasis(y){ne=y,te()},setAmbientParticles(y){be=y},setAutonomousStates(y){T=y},setAutonomousStatePool(y){m=y},setReducedMotion(y){N=y,te()},setTheme(y){K=y,te()},setSize(y){_=De(y),F.style.width=`${_}px`,F.style.height=`${_}px`,s.style.width=`${_}px`,s.style.height=`${_}px`,z.resize(_),te()},triggerParticles(y=8){D()||z.burst(ee,y)},playSequence(y,E){oe.play(y,E)},stopSequence(){oe.stop(),de(u.getState())},isSequencePlaying(){return oe.isPlaying()},destroy(){oe.stop(),Zt(),pe(),G.remove(Z),z.destroy(),S&&S.destroy(),xe&&xe(),F.remove()}}}const Rt={create:_t,createGroup:Gt,setGlobalSound:pt,isGlobalSoundEnabled:bt,setGlobalVolume:$t,getGlobalVolume:gt,supportsHover:We,isTouchDevice:dt};exports.ALL_STATES=At;exports.ALL_WANDERABLE_STATES=It;exports.AUTONOMOUS_STATES=Pt;exports.DEFAULT_STEP_MS=Et;exports.DragPhysics=vt;exports.EMOJI_BRIX=tt;exports.EMOJI_COTA=fe;exports.EMOJI_DOZY=He;exports.EMOJI_FIDGE=et;exports.EMOJI_KNOT=it;exports.EMOJI_LUMO=Ke;exports.EMOJI_MOCHI=Ge;exports.EMOJI_NIMA=Ue;exports.EMOJI_PIP=at;exports.EMOJI_SNUG=st;exports.EMOJI_SURI=qe;exports.EMOJI_VOID=nt;exports.EMOJI_WILT=ot;exports.EMOJI_ZUMI=Ve;exports.EmojiGroup=Dt;exports.IDLE_MOTIONS=Xe;exports.LIB=H;exports.PERSONALITY_DRIVEN_STATES=zt;exports.ParticleEmitter=Mt;exports.SIZE_PRESETS=jt;exports.STATE_GROUPS=Be;exports.STATE_MOTIONS=xt;exports.STATE_THEME_MAP=uo;exports.SoundEngine=ft;exports.StateManager=ct;exports.Wissive=Rt;exports.applyIdleMotion=wt;exports.applyStateMotion=Yt;exports.attachEventListeners=yt;exports.blendColors=St;exports.buildCustomEmoji=Wt;exports.buildFace=Oe;exports.checkContrast=ho;exports.createCustomEmoji=po;exports.createEmoji=_t;exports.createEmojiGroup=Gt;exports.createMultiSpring=lt;exports.createSequencePlayer=Ft;exports.default=Rt;exports.getContrastRatio=Tt;exports.getEmojiDefinition=Ie;exports.getGlobalVolume=gt;exports.getLuminance=Le;exports.getSilhouettePath=ut;exports.getThemeForState=mo;exports.isGlobalSoundEnabled=bt;exports.isReducedMotionPreferred=kt;exports.isTouchDevice=dt;exports.loadCustomEmoji=fo;exports.makeSpring=rt;exports.pickWithoutRepeat=Xt;exports.renderSvgElement=no;exports.resolveAutonomousStatePool=Lt;exports.resolveSize=De;exports.saveCustomEmoji=Bt;exports.setGlobalSound=pt;exports.setGlobalVolume=$t;exports.sharedLoop=G;exports.soundEngine=q;exports.subscribeToReducedMotion=Ct;exports.supportsHover=We;
|
|
187
|
+
//# sourceMappingURL=wissive.cjs.map
|