ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
65 lines (64 loc) • 1.64 kB
JavaScript
import { t as a } from "./init-1VpIn1S3.js";
var o = class extends Map {
constructor(e, r = g) {
if (super(), Object.defineProperties(this, {
_intern: { value: /* @__PURE__ */ new Map() },
_key: { value: r }
}), e != null) for (const [t, n] of e) this.set(t, n);
}
get(e) {
return super.get(c(this, e));
}
has(e) {
return super.has(c(this, e));
}
set(e, r) {
return super.set(l(this, e), r);
}
delete(e) {
return super.delete(p(this, e));
}
};
function c({ _intern: e, _key: r }, t) {
const n = r(t);
return e.has(n) ? e.get(n) : t;
}
function l({ _intern: e, _key: r }, t) {
const n = r(t);
return e.has(n) ? e.get(n) : (e.set(n, t), t);
}
function p({ _intern: e, _key: r }, t) {
const n = r(t);
return e.has(n) && (t = e.get(n), e.delete(n)), t;
}
function g(e) {
return e !== null && typeof e == "object" ? e.valueOf() : e;
}
var f = /* @__PURE__ */ Symbol("implicit");
function h() {
var e = new o(), r = [], t = [], n = f;
function s(u) {
let i = e.get(u);
if (i === void 0) {
if (n !== f) return n;
e.set(u, i = r.push(u) - 1);
}
return t[i % t.length];
}
return s.domain = function(u) {
if (!arguments.length) return r.slice();
r = [], e = new o();
for (const i of u)
e.has(i) || e.set(i, r.push(i) - 1);
return s;
}, s.range = function(u) {
return arguments.length ? (t = Array.from(u), s) : t.slice();
}, s.unknown = function(u) {
return arguments.length ? (n = u, s) : n;
}, s.copy = function() {
return h(r, t).unknown(n);
}, a.apply(s, arguments), s;
}
export {
h as t
};