@aidenvigue/tresjs-core
Version:
Declarative ThreeJS using Vue Components
1,694 lines (1,693 loc) • 89.2 kB
JavaScript
/**
* name: @aidenvigue/tresjs-core
* version: v3.7.1
* (c) 2024
* description: Declarative ThreeJS using Vue Components
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
*/
var Lt = Object.defineProperty;
var Rt = (e, t, u) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: u }) : e[t] = u;
var he = (e, t, u) => (Rt(e, typeof t != "symbol" ? t + "" : t, u), u);
import { ref as V, computed as z, watchEffect as X, onUnmounted as pe, shallowRef as ee, watch as ft, reactive as dt, readonly as ye, provide as Ae, inject as It, createRenderer as Ht, defineComponent as Te, useSlots as Nt, getCurrentInstance as je, onMounted as zt, openBlock as Ut, createElementBlock as $t, normalizeClass as Vt, unref as Wt, normalizeStyle as Yt, h as Le, Fragment as Gt } from "vue";
import * as pt from "three";
import { PerspectiveCamera as _e, OrthographicCamera as qt, Camera as Kt, Clock as Zt, Vector3 as vt, Color as le, MeshBasicMaterial as ht, DoubleSide as Jt, REVISION as Xt, SRGBColorSpace as Qt, ACESFilmicToneMapping as eu, PCFSoftShadowMap as tu, WebGLRenderer as me, LoadingManager as uu, TextureLoader as ru, Vector2 as nu, Raycaster as au, BufferAttribute as ou, Scene as su, Line as iu, BufferGeometry as Re, Float32BufferAttribute as Ie, LineBasicMaterial as lu, Mesh as cu, BackSide as fu, DirectionalLightHelper as du, PointLightHelper as pu, SpotLightHelper as vu, HemisphereLightHelper as hu, ArrowHelper as mu } from "three";
import { createEventHook as te, useRafFn as mt, toValue as O, unrefElement as gu, useDevicePixelRatio as Eu, usePointer as yu, useWindowSize as gt, useElementBounding as Au, useElementSize as _u, refDebounced as He, useFps as Cu, useMemory as Du } from "@vueuse/core";
const bu = "@aidenvigue/tresjs-core", wu = "module", xu = "3.7.1", ku = "pnpm@8.10.2", Bu = "Declarative ThreeJS using Vue Components", Ou = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", Fu = "MIT", Su = [
"vue",
"3d",
"threejs",
"three",
"threejs-vue"
], Pu = !1, Mu = {
".": {
types: "./dist/index.d.ts",
require: "./dist/tres.umd.cjs",
import: "./dist/tres.js"
},
"./components": {
types: "./dist/components/index.d.ts"
},
"./composables": {
types: "./dist/composables/index.d.ts"
},
"./types": {
types: "./dist/types/index.d.ts"
},
"./utils": {
types: "./dist/utils/index.d.ts"
},
"./*": "./*"
}, Tu = "./dist/tres.js", ju = "./dist/tres.js", Lu = "./dist/index.d.ts", Ru = [
"dist",
"*.d.ts"
], Iu = {
access: "public"
}, Hu = {
dev: "cd playground && npm run dev",
build: "vite build",
playground: "cd playground && npm run dev",
test: "vitest",
"test:ci": "vitest run",
"test:ui": "vitest --ui",
release: "release-it",
coverage: "vitest run --coverage",
lint: "eslint . --ext .js,.jsx,.ts,.tsx,.vue",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs",
"docs:preview": "vitepress preview docs",
"docs:contributors": "esno scripts/update-contributors.ts"
}, Nu = {
three: ">=0.133",
vue: ">=3.3"
}, zu = {
"@alvarosabu/utils": "^3.1.1",
"@vueuse/core": "^10.7.0"
}, Uu = {
"@release-it/conventional-changelog": "^8.0.1",
"@stackblitz/sdk": "^1.9.0",
"@tresjs/cientos": "3.6.0",
"@tresjs/eslint-config-vue": "^0.2.1",
"@types/three": "^0.159.0",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-vue": "^4.5.2",
"@vitest/coverage-c8": "^0.33.0",
"@vitest/ui": "^1.0.4",
"@vue/test-utils": "^2.4.3",
eslint: "^8.55.0",
"eslint-plugin-vue": "^9.19.2",
esno: "^4.0.0",
gsap: "^3.12.3",
jsdom: "^23.0.1",
kolorist: "^1.8.0",
ohmyfetch: "^0.4.21",
pathe: "^1.1.1",
"release-it": "^17.0.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-visualizer": "^5.11.0",
three: "^0.159.0",
unocss: "^0.58.0",
unplugin: "^1.5.1",
"unplugin-vue-components": "^0.26.0",
vite: "^5.0.8",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-dts": "3.6.4",
"vite-plugin-inspect": "^0.8.1",
"vite-plugin-require-transform": "^1.0.21",
"vite-svg-loader": "^5.1.0",
vitepress: "1.0.0-rc.44",
vitest: "^1.0.4",
vue: "^3.3.11",
"vue-demi": "^0.14.6"
}, $u = {
name: bu,
type: wu,
version: xu,
packageManager: ku,
description: Bu,
author: Ou,
license: Fu,
keywords: Su,
sideEffects: Pu,
exports: Mu,
main: Tu,
module: ju,
types: Lu,
files: Ru,
publishConfig: Iu,
scripts: Hu,
peerDependencies: Nu,
dependencies: zu,
devDependencies: Uu
}, Vu = ({ sizes: e, scene: t }) => {
const u = V([]), r = z(
() => u.value[0]
), a = (s, d = !1) => {
u.value.some(({ uuid: l }) => l === s.uuid) || (d ? o(s) : u.value.push(s));
}, n = (s) => {
u.value = u.value.filter(({ uuid: d }) => d !== s.uuid);
}, o = (s) => {
const d = s instanceof Kt ? s : u.value.find((v) => v.uuid === s);
if (!d)
return;
const l = u.value.filter(({ uuid: v }) => v !== d.uuid);
u.value = [d, ...l];
};
return X(() => {
e.aspectRatio.value && u.value.forEach((s) => {
s instanceof _e && (s.aspect = e.aspectRatio.value), (s instanceof _e || s instanceof qt) && s.updateProjectionMatrix();
});
}), t.userData.tres__registerCamera = a, t.userData.tres__deregisterCamera = n, pe(() => {
u.value = [];
}), {
camera: r,
cameras: u,
registerCamera: a,
deregisterCamera: n,
setCameraActive: o
};
}, Et = te(), yt = te(), be = te(), Q = new Zt();
let ce = 0, fe = 0;
const { pause: Wu, resume: Yu, isActive: Gu } = mt(
() => {
Et.trigger({ delta: ce, elapsed: fe, clock: Q }), yt.trigger({ delta: ce, elapsed: fe, clock: Q }), be.trigger({ delta: ce, elapsed: fe, clock: Q });
},
{ immediate: !1 }
);
be.on(() => {
ce = Q.getDelta(), fe = Q.getElapsedTime();
});
const we = () => ({
onBeforeLoop: Et.on,
onLoop: yt.on,
onAfterLoop: be.on,
pause: Wu,
resume: Yu,
isActive: Gu
}), yn = !0, Ne = "[TresJS ▲ ■ ●] ";
function U() {
function e(r, a) {
console.error(`${Ne} ${r}`, a || "");
}
function t(r) {
console.warn(`${Ne} ${r}`);
}
function u(r, a) {
}
return {
logError: e,
logWarning: t,
logMessage: u
};
}
function An(e) {
return typeof e == "number" ? [e, e, e] : e instanceof vt ? [e.x, e.y, e.z] : e;
}
function qu(e) {
return e instanceof le ? e : Array.isArray(e) ? new le(...e) : new le(e);
}
class Ku extends pt.Mesh {
constructor(...u) {
super(...u);
he(this, "type", "HightlightMesh");
he(this, "createTime");
this.createTime = Date.now();
}
onBeforeRender() {
const r = (Date.now() - this.createTime) / 1e3, o = 1 + 0.07 * Math.sin(2.5 * r);
this.scale.set(o, o, o);
}
}
const At = (e, t) => {
for (const u of Object.keys(t))
t[u] instanceof Object && Object.assign(t[u], At(e[u], t[u]));
return Object.assign(e || {}, t), e;
}, Zu = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", Ju = /* @__PURE__ */ Xu(Zu);
function ze(e) {
return e && e.nodeType === 1;
}
function ae(e) {
return e.replace(/-([a-z])/g, (t, u) => u.toUpperCase());
}
function Xu(e, t) {
const u = /* @__PURE__ */ Object.create(null), r = e.split(",");
for (let a = 0; a < r.length; a++)
u[r[a]] = !0;
return t ? (a) => !!u[a.toLowerCase()] : (a) => !!u[a];
}
const Qu = (e, t) => {
const u = /* @__PURE__ */ new Set(), r = [];
for (const a of e) {
const n = t(a);
u.has(n) || (u.add(n), r.push(a));
}
return r;
}, Ue = (e, t) => {
if (!t)
return;
const u = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
return u == null ? void 0 : u.reduce((r, a) => r && r[a], e);
}, er = (e, t, u) => {
const r = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
r && r.reduce((a, n, o) => (a[n] === void 0 && (a[n] = {}), o === r.length - 1 && (a[n] = u), a[n]), e);
};
function _t(e, t) {
if (ze(e) && ze(t)) {
const a = e.attributes, n = t.attributes;
return a.length !== n.length ? !1 : Array.from(a).every(({ name: o, value: s }) => t.getAttribute(o) === s);
}
if (e === t)
return !0;
if (e === null || typeof e != "object" || t === null || typeof t != "object")
return !1;
const u = Object.keys(e), r = Object.keys(t);
if (u.length !== r.length)
return !1;
for (const a of u)
if (!r.includes(a) || !_t(e[a], t[a]))
return !1;
return !0;
}
function tr(e, t) {
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
return !1;
for (let u = 0; u < e.length; u++)
if (!_t(e[u], t[u]))
return !1;
return !0;
}
const ur = Array.isArray;
function rr(e, t, u, r) {
const a = (d) => {
if (d.uuid === t)
return d;
for (const l of d.children) {
const v = a(l);
if (v)
return v;
}
}, n = a(e);
if (!n) {
console.warn("Object with UUID not found in the scene.");
return;
}
let o = n;
for (let d = 0; d < u.length - 1; d++)
if (o[u[d]] !== void 0)
o = o[u[d]];
else {
console.warn(`Property path is not valid: ${u.join(".")}`);
return;
}
const s = u[u.length - 1];
o[s] !== void 0 ? o[s] = r : console.warn(`Property path is not valid: ${u.join(".")}`);
}
function nr(e) {
const t = new ht({
color: 11003607,
// Highlight color, e.g., yellow
transparent: !0,
opacity: 0.2,
depthTest: !1,
// So the highlight is always visible
side: Jt
// To e
});
return new Ku(e.geometry.clone(), t);
}
function Ct(e) {
var u;
let t = e.value;
return e.value && ((u = e.value) != null && u.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new vt(...t)), t;
}
const ar = Number.parseInt(Xt.replace("dev", "")), oe = {
realistic: {
shadows: !0,
physicallyCorrectLights: !0,
outputColorSpace: Qt,
toneMapping: eu,
toneMappingExposure: 3,
shadowMap: {
enabled: !0,
type: tu
}
}
};
function or({
scene: e,
canvas: t,
options: u,
disableRender: r,
contextParts: { sizes: a, camera: n }
}) {
const o = z(() => ({
alpha: O(u.alpha),
depth: O(u.depth),
canvas: gu(t),
context: O(u.context),
stencil: O(u.stencil),
antialias: O(u.antialias) === void 0 ? !0 : O(u.antialias),
precision: O(u.precision),
powerPreference: O(u.powerPreference),
premultipliedAlpha: O(u.premultipliedAlpha),
preserveDrawingBuffer: O(u.preserveDrawingBuffer),
logarithmicDepthBuffer: O(u.logarithmicDepthBuffer),
failIfMajorPerformanceCaveat: O(u.failIfMajorPerformanceCaveat)
})), s = ee(new me(o.value));
ft(o, () => {
s.value.dispose(), s.value = new me(o.value);
}), X(() => {
s.value.setSize(a.width.value, a.height.value);
});
const { pixelRatio: d } = Eu();
X(() => {
s.value.setPixelRatio(d.value);
});
const { logError: l } = U(), i = (() => {
const p = new me(), g = {
shadowMap: {
enabled: p.shadowMap.enabled,
type: p.shadowMap.type
},
toneMapping: p.toneMapping,
toneMappingExposure: p.toneMappingExposure,
outputColorSpace: p.outputColorSpace
};
return p.dispose(), g;
})();
X(() => {
const p = O(u.preset);
p && (p in oe || l(`Renderer Preset must be one of these: ${Object.keys(oe).join(", ")}`), At(s.value, oe[p]));
const g = (A, k) => {
const x = O(A), w = () => {
if (p)
return Ue(oe[p], k);
};
if (x !== void 0)
return x;
const P = w();
return P !== void 0 ? P : Ue(i, k);
}, m = (A, k) => er(s.value, k, g(A, k));
m(u.shadows, "shadowMap.enabled"), m(u.toneMapping, "toneMapping"), m(u.shadowMapType, "shadowMap.type"), ar < 150 && m(!u.useLegacyLights, "physicallyCorrectLights"), m(u.outputColorSpace, "outputColorSpace"), m(u.toneMappingExposure, "toneMappingExposure");
const _ = g(u.clearColor, "clearColor");
_ && s.value.setClearColor(
_ ? qu(_) : new le(0)
// default clear color is not easily/efficiently retrievable from three
);
});
const { pause: c, resume: f, onLoop: h } = we();
return h(() => {
n.value && !O(r) && s.value.render(e, n.value);
}), f(), pe(() => {
c(), s.value.dispose(), s.value.forceContextLoss();
}), {
renderer: s
};
}
const $e = (e) => typeof e == "function", sr = (e) => !!e && e.constructor === Array;
function ir(e) {
const t = { nodes: {}, materials: {} };
return e && e.traverse((u) => {
u.name && (t.nodes[u.name] = u), u.material && !t.materials[u.material.name] && (t.materials[u.material.name] = u.material);
}), t;
}
async function _n(e, t, u, r, a) {
const { logError: n } = U(), o = new e();
a && a(o), u && u(o);
const d = (Array.isArray(t) ? t : [t]).map(
(l) => new Promise((v, i) => {
o.load(
l,
(c) => {
c.scene && Object.assign(c, ir(c.scene)), v(c);
},
r,
(c) => i(n("[useLoader] - Failed to load resource", c))
);
})
);
return sr(t) ? await Promise.all(d) : await d[0];
}
async function Cn(e) {
const t = new uu(), u = new ru(t), r = (a) => new Promise((n, o) => {
u.load(
a,
(s) => n(s),
() => null,
() => {
o(new Error("[useTextures] - Failed to load texture"));
}
);
});
if (ur(e)) {
const a = await Promise.all(e.map((n) => r(n)));
return e.length > 1 ? a : a[0];
} else {
const {
map: a,
displacementMap: n,
normalMap: o,
roughnessMap: s,
metalnessMap: d,
aoMap: l,
alphaMap: v,
matcap: i
} = e;
return {
map: a ? await r(a) : null,
displacementMap: n ? await r(n) : null,
normalMap: o ? await r(o) : null,
roughnessMap: s ? await r(s) : null,
metalnessMap: d ? await r(d) : null,
aoMap: l ? await r(l) : null,
alphaMap: v ? await r(v) : null,
matcap: i ? await r(i) : null
};
}
}
const lr = (e, { renderer: t, camera: u, raycaster: r }, a) => {
const n = z(() => t.value.domElement), o = a ? window : n, { x: s, y: d } = yu({ target: o }), l = {
...gt(),
top: V(0),
left: V(0)
}, { width: v, height: i, top: c, left: f } = a ? l : Au(n), h = ({ x: C, y: B }) => {
if (n.value)
return {
x: (C - f.value) / v.value * 2 - 1,
y: -((B - c.value) / i.value) * 2 + 1
};
}, p = ({ x: C, y: B }) => {
if (u.value)
return r.value.setFromCamera(new nu(C, B), u.value), r.value.intersectObjects(e.value, !1);
}, g = (C) => {
const B = h({
x: (C == null ? void 0 : C.clientX) ?? s.value,
y: (C == null ? void 0 : C.clientY) ?? d.value
});
return B ? p(B) || [] : [];
}, m = z(() => g()), _ = te(), A = te(), k = (C, B) => {
C.trigger({ event: B, intersects: g(B) });
}, x = (C) => {
k(A, C);
};
let w;
const P = (C) => {
var B;
w = (B = g(C)[0]) == null ? void 0 : B.object;
}, j = (C) => {
var B;
C instanceof PointerEvent && w === ((B = g(C)[0]) == null ? void 0 : B.object) && k(_, C);
}, F = (C) => A.trigger({ event: C, intersects: [] });
return a ? (window.addEventListener("pointerup", j), window.addEventListener("pointerdown", P), window.addEventListener("pointermove", x), window.addEventListener("pointerleave", F)) : (n.value.addEventListener("pointerup", j), n.value.addEventListener("pointerdown", P), n.value.addEventListener("pointermove", x), n.value.addEventListener("pointerleave", F)), pe(() => {
n != null && n.value && (n.value.removeEventListener("pointerup", j), n.value.removeEventListener("pointerdown", P), n.value.removeEventListener("pointermove", x), n.value.removeEventListener("pointerleave", F));
}), {
intersects: m,
onClick: (C) => _.on(C).off,
onPointerMove: (C) => A.on(C).off
};
};
function Dn() {
const { logWarning: e } = U();
function t(n, o, s) {
let d = null;
return n.traverse((l) => {
l[o] === s && (d = l);
}), d || e(`Child with ${o} '${s}' not found.`), d;
}
function u(n, o, s) {
const d = [];
return n.traverse((l) => {
l[o].includes(s) && d.push(l);
}), d.length || e(`Children with ${o} '${s}' not found.`), d;
}
function r(n, o) {
return t(n, "name", o);
}
function a(n, o) {
return u(n, "name", o);
}
return {
seek: t,
seekByName: r,
seekAll: u,
seekAllByName: a
};
}
const cr = ({ scene: e, contextParts: t, isWindow: u }) => {
const r = dt({
click: /* @__PURE__ */ new Map(),
pointerMove: /* @__PURE__ */ new Map(),
pointerEnter: /* @__PURE__ */ new Map(),
pointerLeave: /* @__PURE__ */ new Map()
}), a = V(/* @__PURE__ */ new Set()), n = (f) => {
a.value.add(f);
}, o = (f) => {
a.value.delete(f);
}, s = (f) => {
Object.values(r).forEach((h) => h.delete(f)), o(f);
}, d = (f) => {
const { onClick: h, onPointerMove: p, onPointerEnter: g, onPointerLeave: m } = f;
h && r.click.set(f, h), p && r.pointerMove.set(f, p), g && r.pointerEnter.set(f, g), m && r.pointerLeave.set(f, m);
};
e.userData.tres__registerAtPointerEventHandler = d, e.userData.tres__deregisterAtPointerEventHandler = s, e.userData.tres__registerBlockingObjectAtPointerEventHandler = n, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = o;
const l = z(
() => Qu(
[
...Array.from(a.value),
...Object.values(r).map((f) => Array.from(f.keys())).flat()
],
({ uuid: f }) => f
)
), { onClick: v, onPointerMove: i } = lr(l, t, u);
v(({ intersects: f, event: h }) => {
var p;
f.length && ((p = r.click.get(f[0].object)) == null || p(f[0], h));
});
let c;
return i(({ intersects: f, event: h }) => {
var A, k, x, w;
const p = (A = f == null ? void 0 : f[0]) == null ? void 0 : A.object, { pointerLeave: g, pointerEnter: m, pointerMove: _ } = r;
c && c !== p && ((k = g.get(c)) == null || k(c, h)), p && (c !== p && ((x = m.get(p)) == null || x(f[0], h)), (w = _.get(p)) == null || w(f[0], h)), c = p || null;
}), {
registerObject: d,
deregisterObject: s
};
};
function Dt(e) {
let t = 0;
return e.traverse((u) => {
if (u.isMesh && u.geometry) {
const r = u.geometry, a = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, n = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, o = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, s = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, d = a + n + o + s;
t += d;
}
}), t;
}
function fr(e) {
return (e / 1024).toFixed(2);
}
const Ce = V({}), xe = (e) => Object.assign(Ce.value, e);
function dr(e, t, u = 10) {
const r = O(e) ? gt() : _u(z(() => O(t).parentElement)), a = ye(He(r.width, u)), n = ye(He(r.height, u)), o = z(() => a.value / n.value);
return {
height: n,
width: a,
aspectRatio: o
};
}
function pr({
scene: e,
canvas: t,
windowSize: u,
disableRender: r,
rendererOptions: a
}) {
const n = dr(u, t), o = ee(e), {
camera: s,
cameras: d,
registerCamera: l,
deregisterCamera: v,
setCameraActive: i
} = Vu({ sizes: n, scene: e }), { renderer: c } = or(
{
scene: e,
canvas: t,
options: a,
contextParts: { sizes: n, camera: s },
disableRender: r
}
), f = {
sizes: n,
scene: o,
camera: s,
cameras: ye(d),
renderer: c,
raycaster: ee(new au()),
controls: V(null),
perf: {
maxFrames: 160,
fps: {
value: 0,
accumulator: []
},
memory: {
currentMem: 0,
allocatedMem: 0,
accumulator: []
}
},
extend: xe,
registerCamera: l,
setCameraActive: i,
deregisterCamera: v
};
Ae("useTres", f);
const h = 100, p = Cu({ every: h }), { isSupported: g, memory: m } = Du({ interval: h }), _ = 160;
let A = performance.now();
const k = ({ timestamp: F }) => {
f.scene.value && (f.perf.memory.allocatedMem = Dt(f.scene.value)), F - A >= h && (A = F, f.perf.fps.accumulator.push(p.value), f.perf.fps.accumulator.length > _ && f.perf.fps.accumulator.shift(), f.perf.fps.value = p.value, g.value && m.value && (f.perf.memory.accumulator.push(m.value.usedJSHeapSize / 1024 / 1024), f.perf.memory.accumulator.length > _ && f.perf.memory.accumulator.shift(), f.perf.memory.currentMem = f.perf.memory.accumulator.reduce((C, B) => C + B, 0) / f.perf.memory.accumulator.length));
};
let x = 0;
const w = 1, { pause: P, resume: j } = mt(({ delta: F }) => {
window.__TRES__DEVTOOLS__ && (k({ timestamp: performance.now() }), x += F, x >= w && (window.__TRES__DEVTOOLS__.cb(f), x = 0));
}, { immediate: !0 });
return pe(() => {
P();
}), f;
}
function vr() {
const e = It("useTres");
if (!e)
throw new Error("useTresContext must be used together with useTresContextProvider");
return e;
}
const bn = vr;
let D = null;
const { logError: Ve } = U(), ge = [
"onClick",
"onPointerMove",
"onPointerEnter",
"onPointerLeave"
], hr = {
createElement(e, t, u, r) {
var o, s;
if (r || (r = {}), r.args || (r.args = []), e === "template" || Ju(e))
return null;
let a = e.replace("Tres", ""), n;
if (e === "primitive") {
(r == null ? void 0 : r.object) === void 0 && Ve("Tres primitives need a prop 'object'");
const d = r.object;
a = d.type, n = Object.assign(d, { type: a, attach: r.attach, primitive: !0 });
} else {
const d = Ce.value[a];
d || Ve(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), n = new d(...r.args);
}
return n.isCamera && (r != null && r.position || n.position.set(3, 3, 3), r != null && r.lookAt || n.lookAt(0, 0, 0)), (r == null ? void 0 : r.attach) === void 0 && (n.isMaterial ? n.attach = "material" : n.isBufferGeometry && (n.attach = "geometry")), n.isObject3D && ((o = r == null ? void 0 : r.material) != null && o.isMaterial && (n.userData.tres__materialViaProp = !0), (s = r == null ? void 0 : r.geometry) != null && s.isBufferGeometry && (n.userData.tres__geometryViaProp = !0)), n.userData = {
...n.userData,
tres__name: a
}, n;
},
insert(e, t) {
var r, a, n, o;
t && t.isScene && (D = t);
const u = t || D;
if (e != null && e.isObject3D) {
if (e != null && e.isCamera) {
if (!(D != null && D.userData.tres__registerCamera))
throw "could not find tres__registerCamera on scene's userData";
(a = D == null ? void 0 : (r = D.userData).tres__registerCamera) == null || a.call(r, e);
}
if (e && ge.some((s) => e[s])) {
if (!(D != null && D.userData.tres__registerAtPointerEventHandler))
throw "could not find tres__registerAtPointerEventHandler on scene's userData";
(o = D == null ? void 0 : (n = D.userData).tres__registerAtPointerEventHandler) == null || o.call(n, e);
}
}
e != null && e.isObject3D && (u != null && u.isObject3D) ? (u.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? u.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[u == null ? void 0 : u.attach], u && (u[e.attach] = e));
},
remove(e) {
var t, u;
if (e) {
if (e.isObject3D) {
const r = e, a = (l) => {
var i, c;
const v = l;
l.userData.tres__materialViaProp || ((i = v.material) == null || i.dispose(), v.material = void 0), l.userData.tres__geometryViaProp || ((c = v.geometry) == null || c.dispose(), v.geometry = void 0);
}, n = D == null ? void 0 : D.userData.tres__deregisterAtPointerEventHandler, o = D == null ? void 0 : D.userData.tres__deregisterBlockingObjectAtPointerEventHandler, s = (l) => {
var v, i;
if (!o)
throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData";
if ((i = D == null ? void 0 : (v = D.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || i.call(v, l), !n)
throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
l && ge.some((c) => l[c]) && (n == null || n(l));
}, d = (l) => {
const v = D == null ? void 0 : D.userData.tres__deregisterCamera;
if (!v)
throw "could not find tres__deregisterCamera on scene's userData";
l.isCamera && (v == null || v(l));
};
(t = e.removeFromParent) == null || t.call(e), r.traverse((l) => {
a(l), d(l), s == null || s(l);
}), a(r), d(r), s == null || s(r);
}
(u = e.dispose) == null || u.call(e);
}
},
patchProp(e, t, u, r) {
var a, n, o, s;
if (e) {
let d = e, l = t;
if (e.isObject3D && l === "blocks-pointer-events") {
r || r === "" ? (n = D == null ? void 0 : (a = D.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || n.call(a, e) : (s = D == null ? void 0 : (o = D.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || s.call(o, e);
return;
}
let v = ae(l), i = d == null ? void 0 : d[v];
if (l === "args") {
const f = e, h = u ?? [], p = r ?? [], g = e.userData.tres__name || e.type;
g && h.length && !tr(h, p) && (d = Object.assign(f, new Ce.value[g](...r)));
return;
}
if (d.type === "BufferGeometry") {
if (l === "args")
return;
d.setAttribute(
ae(l),
new ou(...r)
);
return;
}
if (l.includes("-") && i === void 0) {
const f = l.split("-");
i = f.reduce((h, p) => h[ae(p)], d), l = f.pop(), v = l.toLowerCase(), i != null && i.set || (d = f.reduce((h, p) => h[ae(p)], d));
}
let c = r;
if (c === "" && (c = !0), $e(i)) {
ge.includes(t) || (Array.isArray(c) ? e[v](...c) : e[v](c));
return;
}
!(i != null && i.set) && !$e(i) ? d[v] = c : i.constructor === c.constructor && (i != null && i.copy) ? i == null || i.copy(c) : Array.isArray(c) ? i.set(...c) : !i.isColor && i.setScalar ? i.setScalar(c) : i.set(c);
}
},
parentNode(e) {
return (e == null ? void 0 : e.parent) || null;
},
createText: () => void 0,
createComment: () => void 0,
setText: () => void 0,
setElementText: () => void 0,
nextSibling: () => void 0,
querySelector: () => void 0,
setScopeId: () => void 0,
cloneNode: () => void 0,
insertStaticContent: () => void 0
}, { render: mr } = Ht(hr);
xe(pt);
var gr = Object.create, bt = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, ke = Object.getOwnPropertyNames, yr = Object.getPrototypeOf, Ar = Object.prototype.hasOwnProperty, _r = (e, t) => function() {
return e && (t = (0, e[ke(e)[0]])(e = 0)), t;
}, Cr = (e, t) => function() {
return t || (0, e[ke(e)[0]])((t = { exports: {} }).exports, t), t.exports;
}, Dr = (e, t, u, r) => {
if (t && typeof t == "object" || typeof t == "function")
for (let a of ke(t))
!Ar.call(e, a) && a !== u && bt(e, a, { get: () => t[a], enumerable: !(r = Er(t, a)) || r.enumerable });
return e;
}, br = (e, t, u) => (u = e != null ? gr(yr(e)) : {}, Dr(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
t || !e || !e.__esModule ? bt(u, "default", { value: e, enumerable: !0 }) : u,
e
)), ue = _r({
"../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
}
}), wr = Cr({
"../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js"(e, t) {
ue(), t.exports = r;
function u(n) {
return n instanceof Buffer ? Buffer.from(n) : new n.constructor(n.buffer.slice(), n.byteOffset, n.length);
}
function r(n) {
if (n = n || {}, n.circles)
return a(n);
return n.proto ? d : s;
function o(l, v) {
for (var i = Object.keys(l), c = new Array(i.length), f = 0; f < i.length; f++) {
var h = i[f], p = l[h];
typeof p != "object" || p === null ? c[h] = p : p instanceof Date ? c[h] = new Date(p) : ArrayBuffer.isView(p) ? c[h] = u(p) : c[h] = v(p);
}
return c;
}
function s(l) {
if (typeof l != "object" || l === null)
return l;
if (l instanceof Date)
return new Date(l);
if (Array.isArray(l))
return o(l, s);
if (l instanceof Map)
return new Map(o(Array.from(l), s));
if (l instanceof Set)
return new Set(o(Array.from(l), s));
var v = {};
for (var i in l)
if (Object.hasOwnProperty.call(l, i) !== !1) {
var c = l[i];
typeof c != "object" || c === null ? v[i] = c : c instanceof Date ? v[i] = new Date(c) : c instanceof Map ? v[i] = new Map(o(Array.from(c), s)) : c instanceof Set ? v[i] = new Set(o(Array.from(c), s)) : ArrayBuffer.isView(c) ? v[i] = u(c) : v[i] = s(c);
}
return v;
}
function d(l) {
if (typeof l != "object" || l === null)
return l;
if (l instanceof Date)
return new Date(l);
if (Array.isArray(l))
return o(l, d);
if (l instanceof Map)
return new Map(o(Array.from(l), d));
if (l instanceof Set)
return new Set(o(Array.from(l), d));
var v = {};
for (var i in l) {
var c = l[i];
typeof c != "object" || c === null ? v[i] = c : c instanceof Date ? v[i] = new Date(c) : c instanceof Map ? v[i] = new Map(o(Array.from(c), d)) : c instanceof Set ? v[i] = new Set(o(Array.from(c), d)) : ArrayBuffer.isView(c) ? v[i] = u(c) : v[i] = d(c);
}
return v;
}
}
function a(n) {
var o = [], s = [];
return n.proto ? v : l;
function d(i, c) {
for (var f = Object.keys(i), h = new Array(f.length), p = 0; p < f.length; p++) {
var g = f[p], m = i[g];
if (typeof m != "object" || m === null)
h[g] = m;
else if (m instanceof Date)
h[g] = new Date(m);
else if (ArrayBuffer.isView(m))
h[g] = u(m);
else {
var _ = o.indexOf(m);
_ !== -1 ? h[g] = s[_] : h[g] = c(m);
}
}
return h;
}
function l(i) {
if (typeof i != "object" || i === null)
return i;
if (i instanceof Date)
return new Date(i);
if (Array.isArray(i))
return d(i, l);
if (i instanceof Map)
return new Map(d(Array.from(i), l));
if (i instanceof Set)
return new Set(d(Array.from(i), l));
var c = {};
o.push(i), s.push(c);
for (var f in i)
if (Object.hasOwnProperty.call(i, f) !== !1) {
var h = i[f];
if (typeof h != "object" || h === null)
c[f] = h;
else if (h instanceof Date)
c[f] = new Date(h);
else if (h instanceof Map)
c[f] = new Map(d(Array.from(h), l));
else if (h instanceof Set)
c[f] = new Set(d(Array.from(h), l));
else if (ArrayBuffer.isView(h))
c[f] = u(h);
else {
var p = o.indexOf(h);
p !== -1 ? c[f] = s[p] : c[f] = l(h);
}
}
return o.pop(), s.pop(), c;
}
function v(i) {
if (typeof i != "object" || i === null)
return i;
if (i instanceof Date)
return new Date(i);
if (Array.isArray(i))
return d(i, v);
if (i instanceof Map)
return new Map(d(Array.from(i), v));
if (i instanceof Set)
return new Set(d(Array.from(i), v));
var c = {};
o.push(i), s.push(c);
for (var f in i) {
var h = i[f];
if (typeof h != "object" || h === null)
c[f] = h;
else if (h instanceof Date)
c[f] = new Date(h);
else if (h instanceof Map)
c[f] = new Map(d(Array.from(h), v));
else if (h instanceof Set)
c[f] = new Set(d(Array.from(h), v));
else if (ArrayBuffer.isView(h))
c[f] = u(h);
else {
var p = o.indexOf(h);
p !== -1 ? c[f] = s[p] : c[f] = v(h);
}
}
return o.pop(), s.pop(), c;
}
}
}
});
ue();
ue();
var xr = typeof navigator < "u", b = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {};
typeof b.chrome < "u" && b.chrome.devtools;
xr && (b.self, b.top);
typeof navigator < "u" && navigator.userAgent.toLowerCase().includes("electron");
ue();
var kr = br(wr(), 1), We = (0, kr.default)({ circles: !0 });
ue();
function De(e, t = {}, u) {
for (const r in e) {
const a = e[r], n = u ? `${u}:${r}` : r;
typeof a == "object" && a !== null ? De(a, t, n) : typeof a == "function" && (t[n] = a);
}
return t;
}
const Br = { run: (e) => e() }, Or = () => Br, wt = typeof console.createTask < "u" ? console.createTask : Or;
function Fr(e, t) {
const u = t.shift(), r = wt(u);
return e.reduce(
(a, n) => a.then(() => r.run(() => n(...t))),
Promise.resolve()
);
}
function Sr(e, t) {
const u = t.shift(), r = wt(u);
return Promise.all(e.map((a) => r.run(() => a(...t))));
}
function Ee(e, t) {
for (const u of [...e])
u(t);
}
class Pr {
constructor() {
this._hooks = {}, this._before = void 0, this._after = void 0, this._deprecatedMessages = void 0, this._deprecatedHooks = {}, this.hook = this.hook.bind(this), this.callHook = this.callHook.bind(this), this.callHookWith = this.callHookWith.bind(this);
}
hook(t, u, r = {}) {
if (!t || typeof u != "function")
return () => {
};
const a = t;
let n;
for (; this._deprecatedHooks[t]; )
n = this._deprecatedHooks[t], t = n.to;
if (n && !r.allowDeprecated) {
let o = n.message;
o || (o = `${a} hook has been deprecated` + (n.to ? `, please use ${n.to}` : "")), this._deprecatedMessages || (this._deprecatedMessages = /* @__PURE__ */ new Set()), this._deprecatedMessages.has(o) || (console.warn(o), this._deprecatedMessages.add(o));
}
if (!u.name)
try {
Object.defineProperty(u, "name", {
get: () => "_" + t.replace(/\W+/g, "_") + "_hook_cb",
configurable: !0
});
} catch {
}
return this._hooks[t] = this._hooks[t] || [], this._hooks[t].push(u), () => {
u && (this.removeHook(t, u), u = void 0);
};
}
hookOnce(t, u) {
let r, a = (...n) => (typeof r == "function" && r(), r = void 0, a = void 0, u(...n));
return r = this.hook(t, a), r;
}
removeHook(t, u) {
if (this._hooks[t]) {
const r = this._hooks[t].indexOf(u);
r !== -1 && this._hooks[t].splice(r, 1), this._hooks[t].length === 0 && delete this._hooks[t];
}
}
deprecateHook(t, u) {
this._deprecatedHooks[t] = typeof u == "string" ? { to: u } : u;
const r = this._hooks[t] || [];
delete this._hooks[t];
for (const a of r)
this.hook(t, a);
}
deprecateHooks(t) {
Object.assign(this._deprecatedHooks, t);
for (const u in t)
this.deprecateHook(u, t[u]);
}
addHooks(t) {
const u = De(t), r = Object.keys(u).map(
(a) => this.hook(a, u[a])
);
return () => {
for (const a of r.splice(0, r.length))
a();
};
}
removeHooks(t) {
const u = De(t);
for (const r in u)
this.removeHook(r, u[r]);
}
removeAllHooks() {
for (const t in this._hooks)
delete this._hooks[t];
}
callHook(t, ...u) {
return u.unshift(t), this.callHookWith(Fr, t, ...u);
}
callHookParallel(t, ...u) {
return u.unshift(t), this.callHookWith(Sr, t, ...u);
}
callHookWith(t, u, ...r) {
const a = this._before || this._after ? { name: u, args: r, context: {} } : void 0;
this._before && Ee(this._before, a);
const n = t(
u in this._hooks ? [...this._hooks[u]] : [],
r
);
return n instanceof Promise ? n.finally(() => {
this._after && a && Ee(this._after, a);
}) : (this._after && a && Ee(this._after, a), n);
}
beforeEach(t) {
return this._before = this._before || [], this._before.push(t), () => {
if (this._before !== void 0) {
const u = this._before.indexOf(t);
u !== -1 && this._before.splice(u, 1);
}
};
}
afterEach(t) {
return this._after = this._after || [], this._after.push(t), () => {
if (this._after !== void 0) {
const u = this._after.indexOf(t);
u !== -1 && this._after.splice(u, 1);
}
};
}
}
function xt() {
return new Pr();
}
const Mr = {
trailing: !0
};
function Be(e, t = 25, u = {}) {
if (u = { ...Mr, ...u }, !Number.isFinite(t))
throw new TypeError("Expected `wait` to be a finite number");
let r, a, n = [], o, s;
const d = (l, v) => (o = Tr(e, l, v), o.finally(() => {
if (o = null, u.trailing && s && !a) {
const i = d(l, s);
return s = null, i;
}
}), o);
return function(...l) {
return o ? (u.trailing && (s = l), o) : new Promise((v) => {
const i = !a && u.leading;
clearTimeout(a), a = setTimeout(() => {
a = null;
const c = u.leading ? r : d(this, l);
for (const f of n)
f(c);
n = [];
}, t), i ? (r = d(this, l), v(r)) : n.push(v);
});
};
}
async function Tr(e, t, u) {
return await e.apply(t, u);
}
var jr = Object.create, kt = Object.defineProperty, Lr = Object.getOwnPropertyDescriptor, Oe = Object.getOwnPropertyNames, Rr = Object.getPrototypeOf, Ir = Object.prototype.hasOwnProperty, Hr = (e, t) => function() {
return e && (t = (0, e[Oe(e)[0]])(e = 0)), t;
}, Bt = (e, t) => function() {
return t || (0, e[Oe(e)[0]])((t = { exports: {} }).exports, t), t.exports;
}, Nr = (e, t, u, r) => {
if (t && typeof t == "object" || typeof t == "function")
for (let a of Oe(t))
!Ir.call(e, a) && a !== u && kt(e, a, { get: () => t[a], enumerable: !(r = Lr(t, a)) || r.enumerable });
return e;
}, zr = (e, t, u) => (u = e != null ? jr(Rr(e)) : {}, Nr(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
t || !e || !e.__esModule ? kt(u, "default", { value: e, enumerable: !0 }) : u,
e
)), E = Hr({
"../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
}
}), Ur = Bt({
"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js"(e, t) {
E(), function(u) {
var r = {
// latin
À: "A",
Á: "A",
Â: "A",
Ã: "A",
Ä: "Ae",
Å: "A",
Æ: "AE",
Ç: "C",
È: "E",
É: "E",
Ê: "E",
Ë: "E",
Ì: "I",
Í: "I",
Î: "I",
Ï: "I",
Ð: "D",
Ñ: "N",
Ò: "O",
Ó: "O",
Ô: "O",
Õ: "O",
Ö: "Oe",
Ő: "O",
Ø: "O",
Ù: "U",
Ú: "U",
Û: "U",
Ü: "Ue",
Ű: "U",
Ý: "Y",
Þ: "TH",
ß: "ss",
à: "a",
á: "a",
â: "a",
ã: "a",
ä: "ae",
å: "a",
æ: "ae",
ç: "c",
è: "e",
é: "e",
ê: "e",
ë: "e",
ì: "i",
í: "i",
î: "i",
ï: "i",
ð: "d",
ñ: "n",
ò: "o",
ó: "o",
ô: "o",
õ: "o",
ö: "oe",
ő: "o",
ø: "o",
ù: "u",
ú: "u",
û: "u",
ü: "ue",
ű: "u",
ý: "y",
þ: "th",
ÿ: "y",
"ẞ": "SS",
// language specific
// Arabic
ا: "a",
أ: "a",
إ: "i",
آ: "aa",
ؤ: "u",
ئ: "e",
ء: "a",
ب: "b",
ت: "t",
ث: "th",
ج: "j",
ح: "h",
خ: "kh",
د: "d",
ذ: "th",
ر: "r",
ز: "z",
س: "s",
ش: "sh",
ص: "s",
ض: "dh",
ط: "t",
ظ: "z",
ع: "a",
غ: "gh",
ف: "f",
ق: "q",
ك: "k",
ل: "l",
م: "m",
ن: "n",
ه: "h",
و: "w",
ي: "y",
ى: "a",
ة: "h",
ﻻ: "la",
ﻷ: "laa",
ﻹ: "lai",
ﻵ: "laa",
// Persian additional characters than Arabic
گ: "g",
چ: "ch",
پ: "p",
ژ: "zh",
ک: "k",
ی: "y",
// Arabic diactrics
"َ": "a",
"ً": "an",
"ِ": "e",
"ٍ": "en",
"ُ": "u",
"ٌ": "on",
"ْ": "",
// Arabic numbers
"٠": "0",
"١": "1",
"٢": "2",
"٣": "3",
"٤": "4",
"٥": "5",
"٦": "6",
"٧": "7",
"٨": "8",
"٩": "9",
// Persian numbers
"۰": "0",
"۱": "1",
"۲": "2",
"۳": "3",
"۴": "4",
"۵": "5",
"۶": "6",
"۷": "7",
"۸": "8",
"۹": "9",
// Burmese consonants
က: "k",
ခ: "kh",
ဂ: "g",
ဃ: "ga",
င: "ng",
စ: "s",
ဆ: "sa",
ဇ: "z",
"စျ": "za",
ည: "ny",
ဋ: "t",
ဌ: "ta",
ဍ: "d",
ဎ: "da",
ဏ: "na",
တ: "t",
ထ: "ta",
ဒ: "d",
ဓ: "da",
န: "n",
ပ: "p",
ဖ: "pa",
ဗ: "b",
ဘ: "ba",
မ: "m",
ယ: "y",
ရ: "ya",
လ: "l",
ဝ: "w",
သ: "th",
ဟ: "h",
ဠ: "la",
အ: "a",
// consonant character combos
"ြ": "y",
"ျ": "ya",
"ွ": "w",
"ြွ": "yw",
"ျွ": "ywa",
"ှ": "h",
// independent vowels
ဧ: "e",
"၏": "-e",
ဣ: "i",
ဤ: "-i",
ဉ: "u",
ဦ: "-u",
ဩ: "aw",
"သြော": "aw",
ဪ: "aw",
// numbers
"၀": "0",
"၁": "1",
"၂": "2",
"၃": "3",
"၄": "4",
"၅": "5",
"၆": "6",
"၇": "7",
"၈": "8",
"၉": "9",
// virama and tone marks which are silent in transliteration
"္": "",
"့": "",
"း": "",
// Czech
č: "c",
ď: "d",
ě: "e",
ň: "n",
ř: "r",
š: "s",
ť: "t",
ů: "u",
ž: "z",
Č: "C",
Ď: "D",
Ě: "E",
Ň: "N",
Ř: "R",
Š: "S",
Ť: "T",
Ů: "U",
Ž: "Z",
// Dhivehi
ހ: "h",
ށ: "sh",
ނ: "n",
ރ: "r",
ބ: "b",
ޅ: "lh",
ކ: "k",
އ: "a",
ވ: "v",
މ: "m",
ފ: "f",
ދ: "dh",
ތ: "th",
ލ: "l",
ގ: "g",
ޏ: "gn",
ސ: "s",
ޑ: "d",
ޒ: "z",
ޓ: "t",
ޔ: "y",
ޕ: "p",
ޖ: "j",
ޗ: "ch",
ޘ: "tt",
ޙ: "hh",
ޚ: "kh",
ޛ: "th",
ޜ: "z",
ޝ: "sh",
ޞ: "s",
ޟ: "d",
ޠ: "t",
ޡ: "z",
ޢ: "a",
ޣ: "gh",
ޤ: "q",
ޥ: "w",
"ަ": "a",
"ާ": "aa",
"ި": "i",
"ީ": "ee",
"ު": "u",
"ޫ": "oo",
"ެ": "e",
"ޭ": "ey",
"ޮ": "o",
"ޯ": "oa",
"ް": "",
// Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
// National system (2002)
ა: "a",
ბ: "b",
გ: "g",
დ: "d",
ე: "e",
ვ: "v",
ზ: "z",
თ: "t",
ი: "i",
კ: "k",
ლ: "l",
მ: "m",
ნ: "n",
ო: "o",
პ: "p",
ჟ: "zh",
რ: "r",
ს: "s",
ტ: "t",
უ: "u",
ფ: "p",
ქ: "k",
ღ: "gh",
ყ: "q",
შ: "sh",
ჩ: "ch",
ც: "ts",
ძ: "dz",
წ: "ts",
ჭ: "ch",
ხ: "kh",
ჯ: "j",
ჰ: "h",
// Greek
α: "a",
β: "v",
γ: "g",
δ: "d",
ε: "e",
ζ: "z",
η: "i",
θ: "th",
ι: "i",
κ: "k",
λ: "l",
μ: "m",
ν: "n",
ξ: "ks",
ο: "o",
π: "p",
ρ: "r",
σ: "s",
τ: "t",
υ: "y",
φ: "f",
χ: "x",
ψ: "ps",
ω: "o",
ά: "a",
έ: "e",
ί: "i",
ό: "o",
ύ: "y",
ή: "i",
ώ: "o",
ς: "s",
ϊ: "i",
ΰ: "y",
ϋ: "y",
ΐ: "i",
Α: "A",
Β: "B",
Γ: "G",
Δ: "D",
Ε: "E",
Ζ: "Z",
Η: "I",
Θ: "TH",
Ι: "I",
Κ: "K",
Λ: "L",
Μ: "M",
Ν: "N",
Ξ: "KS",
Ο: "O",
Π: "P",
Ρ: "R",
Σ: "S",
Τ: "T",
Υ: "Y",
Φ: "F",
Χ: "X",
Ψ: "PS",
Ω: "O",
Ά: "A",
Έ: "E",
Ί: "I",
Ό: "O",
Ύ: "Y",
Ή: "I",
Ώ: "O",
Ϊ: "I",
Ϋ: "Y",
// Latvian
ā: "a",
// 'č': 'c', // duplicate
ē: "e",
ģ: "g",
ī: "i",
ķ: "k",
ļ: "l",
ņ: "n",
// 'š': 's', // duplicate
ū: "u",
// 'ž': 'z', // duplicate
Ā: "A",
// 'Č': 'C', // duplicate
Ē: "E",
Ģ: "G",
Ī: "I",
Ķ: "k",
Ļ: "L",
Ņ: "N",
// 'Š': 'S', // duplicate
Ū: "U",
// 'Ž': 'Z', // duplicate
// Macedonian
Ќ: "Kj",
ќ: "kj",
Љ: "Lj",
љ: "lj",
Њ: "Nj",
њ: "nj",
Тс: "Ts",
тс: "ts",
// Polish
ą: "a",
ć: "c",
ę: "e",
ł: "l",
ń: "n",
// 'ó': 'o', // duplicate
ś: "s",
ź: "z",
ż: "z",
Ą: "A",
Ć: "C",
Ę: "E",
Ł: "L",
Ń: "N",
Ś: "S",
Ź: "Z",
Ż: "Z",
// Ukranian
Є: "Ye",
І: "I",
Ї: "Yi",
Ґ: "G",
є: "ye",
і: "i",
ї: "yi",
ґ: "g",
// Romanian
ă: "a",
Ă: "A",
ș: "s",
Ș: "S",
// 'ş': 's', // duplicate
// 'Ş': 'S', // duplicate
ț: "t",
Ț: "T",
ţ: "t",
Ţ: "T",
// Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
// ICAO
а: "a",
б: "b",
в: "v",
г: "g",
д: "d",
е: "e",
ё: "yo",
ж: "zh",
з: "z",
и: "i",
й: "i",
к: "k",
л: "l",
м: "m",
н: "n",
о: "o",
п: "p",
р: "r",
с: "s",
т: "t",
у: "u",
ф: "f",
х: "kh",
ц: "c",
ч: "ch",
ш: "sh",
щ: "sh",
ъ: "",
ы: "y",
ь: "",
э: "e",
ю: "yu",
я: "ya",
А: "A",
Б: "B",
В: "V",
Г: "G",
Д: "D",
Е: "E",
Ё: "Yo",
Ж: "Zh",
З: "Z",
И: "I",
Й: "I",
К: "K",
Л: "L",
М: "M",
Н: "N",
О: "O",
П: "P",
Р: "R",
С: "S",
Т: "T",
У: "U",
Ф: "F",
Х: "Kh",
Ц: "C",
Ч: "Ch",
Ш: "Sh",
Щ: "Sh",
Ъ: "",
Ы: "Y",
Ь: "",
Э: "E",
Ю: "Yu",
Я: "Ya",
// Serbian
ђ: "dj",
ј: "j",
// 'љ': 'lj', // duplicate
// 'њ': 'nj', // duplicate
ћ: "c",
џ: "dz",
Ђ: "Dj",
Ј: "j",
// 'Љ': 'Lj', // duplicate
// 'Њ': 'Nj', // duplicate
Ћ: "C",
Џ: "Dz",
// Slovak
ľ: "l",
ĺ: "l",
ŕ: "r",
Ľ: "L",
Ĺ: "L",
Ŕ: "R",
// Turkish
ş: "s",
Ş: "S",
ı: "i",
İ: "I",
// 'ç': 'c', // duplicate
// 'Ç': 'C', // duplicate
// 'ü': 'u', // duplicate, see langCharMap
// 'Ü': 'U', // duplicate, see langCharMap
// 'ö': 'o', // duplicate, see langCharMap
// 'Ö': 'O', // duplicate, see langCharMap
ğ: "g",
Ğ: "G",
// Vietnamese
ả: "a",
Ả: "A",
ẳ: "a",
Ẳ: "A",
ẩ: "a",
Ẩ: "A",
đ: "d",
Đ: "D",
ẹ: "e",
Ẹ: "E",
ẽ: "e",
Ẽ: "E",
ẻ: "e",
Ẻ: "E",
ế: "e",
Ế: "E",
ề: "e",
Ề: "E",
ệ: "e",