@glasshome/widget-sdk 1.32.4 → 1.33.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/dist/export-history.json +150 -0
- package/dist/framework/dialogs/WidgetDialog.d.ts +6 -2
- package/dist/framework/dialogs/index.d.ts +1 -1
- package/dist/framework/dialogs/warm-dialogs.d.ts +8 -0
- package/dist/framework/index.d.ts +1 -1
- package/dist/index.js +825 -791
- package/dist/vite/index.d.ts +4 -15
- package/dist/vite/index.js +860 -126
- package/guide/widgets.md +1 -1
- package/package.json +6 -3
package/dist/vite/index.js
CHANGED
|
@@ -5,35 +5,753 @@ import { existsSync as s, mkdirSync as c, readFileSync as l, readdirSync as u, r
|
|
|
5
5
|
import { createRequire as m } from "node:module";
|
|
6
6
|
import { dirname as h, join as g, relative as _, resolve as v, sep as y } from "node:path";
|
|
7
7
|
import { fileURLToPath as b } from "node:url";
|
|
8
|
-
import { sdkImportsOf as
|
|
9
|
-
import
|
|
10
|
-
import { spawn as
|
|
11
|
-
//#region
|
|
12
|
-
var
|
|
8
|
+
import { sdkImportsOf as x } from "@glasshome/widget-contract/sdk-floor";
|
|
9
|
+
import ee from "@tailwindcss/vite";
|
|
10
|
+
import { spawn as te, spawnSync as ne } from "node:child_process";
|
|
11
|
+
//#region \0rolldown/runtime.js
|
|
12
|
+
var S = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), C = /* @__PURE__ */ S(((e, t) => {
|
|
13
|
+
t.exports = {
|
|
14
|
+
MAX_LENGTH: 256,
|
|
15
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
16
|
+
MAX_SAFE_BUILD_LENGTH: 250,
|
|
17
|
+
MAX_SAFE_INTEGER: 2 ** 53 - 1 ||
|
|
18
|
+
/* istanbul ignore next */ 9007199254740991,
|
|
19
|
+
RELEASE_TYPES: [
|
|
20
|
+
"major",
|
|
21
|
+
"premajor",
|
|
22
|
+
"minor",
|
|
23
|
+
"preminor",
|
|
24
|
+
"patch",
|
|
25
|
+
"prepatch",
|
|
26
|
+
"prerelease"
|
|
27
|
+
],
|
|
28
|
+
SEMVER_SPEC_VERSION: "2.0.0",
|
|
29
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
30
|
+
FLAG_LOOSE: 2
|
|
31
|
+
};
|
|
32
|
+
})), w = /* @__PURE__ */ S(((e, t) => {
|
|
33
|
+
t.exports = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {};
|
|
34
|
+
})), T = /* @__PURE__ */ S(((e, t) => {
|
|
35
|
+
var { MAX_SAFE_COMPONENT_LENGTH: n, MAX_SAFE_BUILD_LENGTH: r, MAX_LENGTH: i } = C(), a = w();
|
|
36
|
+
e = t.exports = {};
|
|
37
|
+
var o = e.re = [], s = e.safeRe = [], c = e.src = [], l = e.safeSrc = [], u = e.t = {}, d = 0, f = "[a-zA-Z0-9-]", p = [
|
|
38
|
+
["\\s", 1],
|
|
39
|
+
["\\d", i],
|
|
40
|
+
[f, r]
|
|
41
|
+
], m = (e) => {
|
|
42
|
+
for (let [t, n] of p) e = e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);
|
|
43
|
+
return e;
|
|
44
|
+
}, h = (e, t, n) => {
|
|
45
|
+
let r = m(t), i = d++;
|
|
46
|
+
a(e, i, t), u[e] = i, c[i] = t, l[i] = r, o[i] = new RegExp(t, n ? "g" : void 0), s[i] = new RegExp(r, n ? "g" : void 0);
|
|
47
|
+
};
|
|
48
|
+
h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), h("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${f}+`), h("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h("FULL", `^${c[u.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h("LOOSE", `^${c[u.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`), h("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", c[u.COERCE], !0), h("COERCERTLFULL", c[u.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", h("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", h("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
49
|
+
})), E = /* @__PURE__ */ S(((e, t) => {
|
|
50
|
+
var n = Object.freeze({ loose: !0 }), r = Object.freeze({});
|
|
51
|
+
t.exports = (e) => e ? typeof e == "object" ? e : n : r;
|
|
52
|
+
})), D = /* @__PURE__ */ S(((e, t) => {
|
|
53
|
+
var n = /^[0-9]+$/, r = (e, t) => {
|
|
54
|
+
if (typeof e == "number" && typeof t == "number") return e === t ? 0 : e < t ? -1 : 1;
|
|
55
|
+
let r = n.test(e), i = n.test(t);
|
|
56
|
+
return r && i && (e = +e, t = +t), e === t ? 0 : r && !i ? -1 : i && !r ? 1 : e < t ? -1 : 1;
|
|
57
|
+
};
|
|
58
|
+
t.exports = {
|
|
59
|
+
compareIdentifiers: r,
|
|
60
|
+
rcompareIdentifiers: (e, t) => r(t, e)
|
|
61
|
+
};
|
|
62
|
+
})), O = /* @__PURE__ */ S(((e, t) => {
|
|
63
|
+
var n = w(), { MAX_LENGTH: r, MAX_SAFE_INTEGER: i } = C(), { safeRe: a, t: o } = T(), s = E(), { compareIdentifiers: c } = D(), l = (e, t) => {
|
|
64
|
+
let n = t.split(".");
|
|
65
|
+
if (n.length > e.length) return !1;
|
|
66
|
+
for (let t = 0; t < n.length; t++) if (c(e[t], n[t]) !== 0) return !1;
|
|
67
|
+
return !0;
|
|
68
|
+
};
|
|
69
|
+
t.exports = class e {
|
|
70
|
+
constructor(t, c) {
|
|
71
|
+
if (c = s(c), t instanceof e) {
|
|
72
|
+
if (t.loose === !!c.loose && t.includePrerelease === !!c.includePrerelease) return t;
|
|
73
|
+
t = t.version;
|
|
74
|
+
} else if (typeof t != "string") throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);
|
|
75
|
+
if (t.length > r) throw TypeError(`version is longer than ${r} characters`);
|
|
76
|
+
n("SemVer", t, c), this.options = c, this.loose = !!c.loose, this.includePrerelease = !!c.includePrerelease;
|
|
77
|
+
let l = t.trim().match(c.loose ? a[o.LOOSE] : a[o.FULL]);
|
|
78
|
+
if (!l) throw TypeError(`Invalid Version: ${t}`);
|
|
79
|
+
if (this.raw = t, this.major = +l[1], this.minor = +l[2], this.patch = +l[3], this.major > i || this.major < 0) throw TypeError("Invalid major version");
|
|
80
|
+
if (this.minor > i || this.minor < 0) throw TypeError("Invalid minor version");
|
|
81
|
+
if (this.patch > i || this.patch < 0) throw TypeError("Invalid patch version");
|
|
82
|
+
this.prerelease = l[4] ? l[4].split(".").map((e) => {
|
|
83
|
+
if (/^[0-9]+$/.test(e)) {
|
|
84
|
+
let t = +e;
|
|
85
|
+
if (t >= 0 && t < i) return t;
|
|
86
|
+
}
|
|
87
|
+
return e;
|
|
88
|
+
}) : [], this.build = l[5] ? l[5].split(".") : [], this.format();
|
|
89
|
+
}
|
|
90
|
+
format() {
|
|
91
|
+
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
92
|
+
}
|
|
93
|
+
toString() {
|
|
94
|
+
return this.version;
|
|
95
|
+
}
|
|
96
|
+
compare(t) {
|
|
97
|
+
if (n("SemVer.compare", this.version, this.options, t), !(t instanceof e)) {
|
|
98
|
+
if (typeof t == "string" && t === this.version) return 0;
|
|
99
|
+
t = new e(t, this.options);
|
|
100
|
+
}
|
|
101
|
+
return t.version === this.version ? 0 : this.compareMain(t) || this.comparePre(t);
|
|
102
|
+
}
|
|
103
|
+
compareMain(t) {
|
|
104
|
+
return t instanceof e || (t = new e(t, this.options)), this.major < t.major ? -1 : this.major > t.major ? 1 : this.minor < t.minor ? -1 : this.minor > t.minor ? 1 : this.patch < t.patch ? -1 : +(this.patch > t.patch);
|
|
105
|
+
}
|
|
106
|
+
comparePre(t) {
|
|
107
|
+
if (t instanceof e || (t = new e(t, this.options)), this.prerelease.length && !t.prerelease.length) return -1;
|
|
108
|
+
if (!this.prerelease.length && t.prerelease.length) return 1;
|
|
109
|
+
if (!this.prerelease.length && !t.prerelease.length) return 0;
|
|
110
|
+
let r = 0;
|
|
111
|
+
do {
|
|
112
|
+
let e = this.prerelease[r], i = t.prerelease[r];
|
|
113
|
+
if (n("prerelease compare", r, e, i), e === void 0 && i === void 0) return 0;
|
|
114
|
+
if (i === void 0) return 1;
|
|
115
|
+
if (e === void 0) return -1;
|
|
116
|
+
if (e !== i) return c(e, i);
|
|
117
|
+
} while (++r);
|
|
118
|
+
}
|
|
119
|
+
compareBuild(t) {
|
|
120
|
+
t instanceof e || (t = new e(t, this.options));
|
|
121
|
+
let r = 0;
|
|
122
|
+
do {
|
|
123
|
+
let e = this.build[r], i = t.build[r];
|
|
124
|
+
if (n("build compare", r, e, i), e === void 0 && i === void 0) return 0;
|
|
125
|
+
if (i === void 0) return 1;
|
|
126
|
+
if (e === void 0) return -1;
|
|
127
|
+
if (e !== i) return c(e, i);
|
|
128
|
+
} while (++r);
|
|
129
|
+
}
|
|
130
|
+
inc(e, t, n) {
|
|
131
|
+
if (e.startsWith("pre")) {
|
|
132
|
+
if (!t && n === !1) throw Error("invalid increment argument: identifier is empty");
|
|
133
|
+
if (t) {
|
|
134
|
+
let e = `-${t}`.match(this.options.loose ? a[o.PRERELEASELOOSE] : a[o.PRERELEASE]);
|
|
135
|
+
if (!e || e[1] !== t) throw Error(`invalid identifier: ${t}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
switch (e) {
|
|
139
|
+
case "premajor":
|
|
140
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, n);
|
|
141
|
+
break;
|
|
142
|
+
case "preminor":
|
|
143
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, n);
|
|
144
|
+
break;
|
|
145
|
+
case "prepatch":
|
|
146
|
+
this.prerelease.length = 0, this.inc("patch", t, n), this.inc("pre", t, n);
|
|
147
|
+
break;
|
|
148
|
+
case "prerelease":
|
|
149
|
+
this.prerelease.length === 0 && this.inc("patch", t, n), this.inc("pre", t, n);
|
|
150
|
+
break;
|
|
151
|
+
case "release":
|
|
152
|
+
if (this.prerelease.length === 0) throw Error(`version ${this.raw} is not a prerelease`);
|
|
153
|
+
this.prerelease.length = 0;
|
|
154
|
+
break;
|
|
155
|
+
case "major":
|
|
156
|
+
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
157
|
+
break;
|
|
158
|
+
case "minor":
|
|
159
|
+
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
160
|
+
break;
|
|
161
|
+
case "patch":
|
|
162
|
+
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
163
|
+
break;
|
|
164
|
+
case "pre": {
|
|
165
|
+
let e = +!!Number(n);
|
|
166
|
+
if (this.prerelease.length === 0) this.prerelease = [e];
|
|
167
|
+
else {
|
|
168
|
+
let r = this.prerelease.length;
|
|
169
|
+
for (; --r >= 0;) typeof this.prerelease[r] == "number" && (this.prerelease[r]++, r = -2);
|
|
170
|
+
if (r === -1) {
|
|
171
|
+
if (t === this.prerelease.join(".") && n === !1) throw Error("invalid increment argument: identifier already exists");
|
|
172
|
+
this.prerelease.push(e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (t) {
|
|
176
|
+
let r = [t, e];
|
|
177
|
+
if (n === !1 && (r = [t]), l(this.prerelease, t)) {
|
|
178
|
+
let e = this.prerelease[t.split(".").length];
|
|
179
|
+
isNaN(e) && (this.prerelease = r);
|
|
180
|
+
} else this.prerelease = r;
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
default: throw Error(`invalid increment argument: ${e}`);
|
|
185
|
+
}
|
|
186
|
+
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
})), k = /* @__PURE__ */ S(((e, t) => {
|
|
190
|
+
var n = O();
|
|
191
|
+
t.exports = (e, t, r = !1) => {
|
|
192
|
+
if (e instanceof n) return e;
|
|
193
|
+
try {
|
|
194
|
+
return new n(e, t);
|
|
195
|
+
} catch (e) {
|
|
196
|
+
if (!r) return null;
|
|
197
|
+
throw e;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
})), re = /* @__PURE__ */ S(((e, t) => {
|
|
201
|
+
var n = k();
|
|
202
|
+
t.exports = (e, t) => {
|
|
203
|
+
let r = n(e, t);
|
|
204
|
+
return r ? r.version : null;
|
|
205
|
+
};
|
|
206
|
+
})), A = /* @__PURE__ */ S(((e, t) => {
|
|
207
|
+
var n = k();
|
|
208
|
+
t.exports = (e, t) => {
|
|
209
|
+
let r = n(e.trim().replace(/^[=v]+/, ""), t);
|
|
210
|
+
return r ? r.version : null;
|
|
211
|
+
};
|
|
212
|
+
})), j = /* @__PURE__ */ S(((e, t) => {
|
|
213
|
+
var n = O();
|
|
214
|
+
t.exports = (e, t, r, i, a) => {
|
|
215
|
+
typeof r == "string" && (a = i, i = r, r = void 0);
|
|
216
|
+
try {
|
|
217
|
+
return new n(e instanceof n ? e.version : e, r).inc(t, i, a).version;
|
|
218
|
+
} catch {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
})), M = /* @__PURE__ */ S(((e, t) => {
|
|
223
|
+
var n = k();
|
|
224
|
+
t.exports = (e, t) => {
|
|
225
|
+
let r = n(e, null, !0), i = n(t, null, !0), a = r.compare(i);
|
|
226
|
+
if (a === 0) return null;
|
|
227
|
+
let o = a > 0, s = o ? r : i, c = o ? i : r, l = !!s.prerelease.length;
|
|
228
|
+
if (c.prerelease.length && !l) {
|
|
229
|
+
if (!c.patch && !c.minor) return "major";
|
|
230
|
+
if (c.compareMain(s) === 0) return c.minor && !c.patch ? "minor" : "patch";
|
|
231
|
+
}
|
|
232
|
+
let u = l ? "pre" : "";
|
|
233
|
+
return r.major === i.major ? r.minor === i.minor ? r.patch === i.patch ? "prerelease" : u + "patch" : u + "minor" : u + "major";
|
|
234
|
+
};
|
|
235
|
+
})), ie = /* @__PURE__ */ S(((e, t) => {
|
|
236
|
+
var n = O();
|
|
237
|
+
t.exports = (e, t) => new n(e, t).major;
|
|
238
|
+
})), ae = /* @__PURE__ */ S(((e, t) => {
|
|
239
|
+
var n = O();
|
|
240
|
+
t.exports = (e, t) => new n(e, t).minor;
|
|
241
|
+
})), oe = /* @__PURE__ */ S(((e, t) => {
|
|
242
|
+
var n = O();
|
|
243
|
+
t.exports = (e, t) => new n(e, t).patch;
|
|
244
|
+
})), se = /* @__PURE__ */ S(((e, t) => {
|
|
245
|
+
var n = k();
|
|
246
|
+
t.exports = (e, t) => {
|
|
247
|
+
let r = n(e, t);
|
|
248
|
+
return r && r.prerelease.length ? r.prerelease : null;
|
|
249
|
+
};
|
|
250
|
+
})), N = /* @__PURE__ */ S(((e, t) => {
|
|
251
|
+
var n = O();
|
|
252
|
+
t.exports = (e, t, r) => new n(e, r).compare(new n(t, r));
|
|
253
|
+
})), ce = /* @__PURE__ */ S(((e, t) => {
|
|
254
|
+
var n = N();
|
|
255
|
+
t.exports = (e, t, r) => n(t, e, r);
|
|
256
|
+
})), le = /* @__PURE__ */ S(((e, t) => {
|
|
257
|
+
var n = N();
|
|
258
|
+
t.exports = (e, t) => n(e, t, !0);
|
|
259
|
+
})), P = /* @__PURE__ */ S(((e, t) => {
|
|
260
|
+
var n = O();
|
|
261
|
+
t.exports = (e, t, r) => {
|
|
262
|
+
let i = new n(e, r), a = new n(t, r);
|
|
263
|
+
return i.compare(a) || i.compareBuild(a);
|
|
264
|
+
};
|
|
265
|
+
})), ue = /* @__PURE__ */ S(((e, t) => {
|
|
266
|
+
var n = P();
|
|
267
|
+
t.exports = (e, t) => e.sort((e, r) => n(e, r, t));
|
|
268
|
+
})), de = /* @__PURE__ */ S(((e, t) => {
|
|
269
|
+
var n = P();
|
|
270
|
+
t.exports = (e, t) => e.sort((e, r) => n(r, e, t));
|
|
271
|
+
})), F = /* @__PURE__ */ S(((e, t) => {
|
|
272
|
+
var n = N();
|
|
273
|
+
t.exports = (e, t, r) => n(e, t, r) > 0;
|
|
274
|
+
})), I = /* @__PURE__ */ S(((e, t) => {
|
|
275
|
+
var n = N();
|
|
276
|
+
t.exports = (e, t, r) => n(e, t, r) < 0;
|
|
277
|
+
})), fe = /* @__PURE__ */ S(((e, t) => {
|
|
278
|
+
var n = N();
|
|
279
|
+
t.exports = (e, t, r) => n(e, t, r) === 0;
|
|
280
|
+
})), L = /* @__PURE__ */ S(((e, t) => {
|
|
281
|
+
var n = N();
|
|
282
|
+
t.exports = (e, t, r) => n(e, t, r) !== 0;
|
|
283
|
+
})), R = /* @__PURE__ */ S(((e, t) => {
|
|
284
|
+
var n = N();
|
|
285
|
+
t.exports = (e, t, r) => n(e, t, r) >= 0;
|
|
286
|
+
})), z = /* @__PURE__ */ S(((e, t) => {
|
|
287
|
+
var n = N();
|
|
288
|
+
t.exports = (e, t, r) => n(e, t, r) <= 0;
|
|
289
|
+
})), B = /* @__PURE__ */ S(((e, t) => {
|
|
290
|
+
var n = fe(), r = L(), i = F(), a = R(), o = I(), s = z();
|
|
291
|
+
t.exports = (e, t, c, l) => {
|
|
292
|
+
switch (t) {
|
|
293
|
+
case "===": return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e === c;
|
|
294
|
+
case "!==": return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e !== c;
|
|
295
|
+
case "":
|
|
296
|
+
case "=":
|
|
297
|
+
case "==": return n(e, c, l);
|
|
298
|
+
case "!=": return r(e, c, l);
|
|
299
|
+
case ">": return i(e, c, l);
|
|
300
|
+
case ">=": return a(e, c, l);
|
|
301
|
+
case "<": return o(e, c, l);
|
|
302
|
+
case "<=": return s(e, c, l);
|
|
303
|
+
default: throw TypeError(`Invalid operator: ${t}`);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
})), pe = /* @__PURE__ */ S(((e, t) => {
|
|
307
|
+
var n = O(), r = k(), { safeRe: i, t: a } = T();
|
|
308
|
+
t.exports = (e, t) => {
|
|
309
|
+
if (e instanceof n) return e;
|
|
310
|
+
if (typeof e == "number" && (e = String(e)), typeof e != "string") return null;
|
|
311
|
+
t ||= {};
|
|
312
|
+
let o = null;
|
|
313
|
+
if (!t.rtl) o = e.match(t.includePrerelease ? i[a.COERCEFULL] : i[a.COERCE]);
|
|
314
|
+
else {
|
|
315
|
+
let n = t.includePrerelease ? i[a.COERCERTLFULL] : i[a.COERCERTL], r;
|
|
316
|
+
for (; (r = n.exec(e)) && (!o || o.index + o[0].length !== e.length);) (!o || r.index + r[0].length !== o.index + o[0].length) && (o = r), n.lastIndex = r.index + r[1].length + r[2].length;
|
|
317
|
+
n.lastIndex = -1;
|
|
318
|
+
}
|
|
319
|
+
if (o === null) return null;
|
|
320
|
+
let s = o[2];
|
|
321
|
+
return r(`${s}.${o[3] || "0"}.${o[4] || "0"}${t.includePrerelease && o[5] ? `-${o[5]}` : ""}${t.includePrerelease && o[6] ? `+${o[6]}` : ""}`, t);
|
|
322
|
+
};
|
|
323
|
+
})), me = /* @__PURE__ */ S(((e, t) => {
|
|
324
|
+
var n = k(), r = C(), i = O(), a = (e, t, n) => {
|
|
325
|
+
if (!r.RELEASE_TYPES.includes(t)) return null;
|
|
326
|
+
let i = o(e, n);
|
|
327
|
+
return i && s(i, t);
|
|
328
|
+
}, o = (e, t) => n(e instanceof i ? e.version : e, t), s = (e, t) => {
|
|
329
|
+
if (c(t)) return e.version;
|
|
330
|
+
switch (e.prerelease = [], t) {
|
|
331
|
+
case "major":
|
|
332
|
+
e.minor = 0, e.patch = 0;
|
|
333
|
+
break;
|
|
334
|
+
case "minor": e.patch = 0;
|
|
335
|
+
}
|
|
336
|
+
return e.format();
|
|
337
|
+
}, c = (e) => e.startsWith("pre");
|
|
338
|
+
t.exports = a;
|
|
339
|
+
})), he = /* @__PURE__ */ S(((e, t) => {
|
|
340
|
+
t.exports = class {
|
|
341
|
+
constructor() {
|
|
342
|
+
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
343
|
+
}
|
|
344
|
+
get(e) {
|
|
345
|
+
let t = this.map.get(e);
|
|
346
|
+
if (t !== void 0) return this.map.delete(e), this.map.set(e, t), t;
|
|
347
|
+
}
|
|
348
|
+
delete(e) {
|
|
349
|
+
return this.map.delete(e);
|
|
350
|
+
}
|
|
351
|
+
set(e, t) {
|
|
352
|
+
if (!this.delete(e) && t !== void 0) {
|
|
353
|
+
if (this.map.size >= this.max) {
|
|
354
|
+
let e = this.map.keys().next().value;
|
|
355
|
+
this.delete(e);
|
|
356
|
+
}
|
|
357
|
+
this.map.set(e, t);
|
|
358
|
+
}
|
|
359
|
+
return this;
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
})), V = /* @__PURE__ */ S(((e, t) => {
|
|
363
|
+
var n = /\s+/g;
|
|
364
|
+
t.exports = class e {
|
|
365
|
+
constructor(t, r) {
|
|
366
|
+
if (r = i(r), t instanceof e) return t.loose === !!r.loose && t.includePrerelease === !!r.includePrerelease ? t : new e(t.raw, r);
|
|
367
|
+
if (t instanceof a) return this.raw = t.value, this.set = [[t]], this.formatted = void 0, this;
|
|
368
|
+
if (this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease, this.raw = t.trim().replace(n, " "), this.set = this.raw.split("||").map((e) => this.parseRange(e.trim())).filter((e) => e.length), !this.set.length) throw TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
369
|
+
if (this.set.length > 1) {
|
|
370
|
+
let e = this.set[0];
|
|
371
|
+
if (this.set = this.set.filter((e) => !_(e[0])), this.set.length === 0) this.set = [e];
|
|
372
|
+
else if (this.set.length > 1) {
|
|
373
|
+
for (let e of this.set) if (e.length === 1 && v(e[0])) {
|
|
374
|
+
this.set = [e];
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
this.formatted = void 0;
|
|
380
|
+
}
|
|
381
|
+
get range() {
|
|
382
|
+
if (this.formatted === void 0) {
|
|
383
|
+
this.formatted = "";
|
|
384
|
+
for (let e = 0; e < this.set.length; e++) {
|
|
385
|
+
e > 0 && (this.formatted += "||");
|
|
386
|
+
let t = this.set[e];
|
|
387
|
+
for (let e = 0; e < t.length; e++) e > 0 && (this.formatted += " "), this.formatted += t[e].toString().trim();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return this.formatted;
|
|
391
|
+
}
|
|
392
|
+
format() {
|
|
393
|
+
return this.range;
|
|
394
|
+
}
|
|
395
|
+
toString() {
|
|
396
|
+
return this.range;
|
|
397
|
+
}
|
|
398
|
+
parseRange(e) {
|
|
399
|
+
e = e.replace(g, "");
|
|
400
|
+
let t = ((this.options.includePrerelease && m) | (this.options.loose && h)) + ":" + e, n = r.get(t);
|
|
401
|
+
if (n) return n;
|
|
402
|
+
let i = this.options.loose, s = i ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
|
|
403
|
+
e = e.replace(s, M(this.options.includePrerelease)), o("hyphen replace", e), e = e.replace(c[u.COMPARATORTRIM], d), o("comparator trim", e), e = e.replace(c[u.TILDETRIM], f), o("tilde trim", e), e = e.replace(c[u.CARETTRIM], p), o("caret trim", e);
|
|
404
|
+
let l = e.split(" ").map((e) => b(e, this.options)).join(" ").split(/\s+/).map((e) => j(e, this.options));
|
|
405
|
+
i && (l = l.filter((e) => (o("loose invalid filter", e, this.options), !!e.match(c[u.COMPARATORLOOSE])))), o("range list", l);
|
|
406
|
+
let v = /* @__PURE__ */ new Map(), y = l.map((e) => new a(e, this.options));
|
|
407
|
+
for (let e of y) {
|
|
408
|
+
if (_(e)) return [e];
|
|
409
|
+
v.set(e.value, e);
|
|
410
|
+
}
|
|
411
|
+
v.size > 1 && v.has("") && v.delete("");
|
|
412
|
+
let x = [...v.values()];
|
|
413
|
+
return r.set(t, x), x;
|
|
414
|
+
}
|
|
415
|
+
intersects(t, n) {
|
|
416
|
+
if (!(t instanceof e)) throw TypeError("a Range is required");
|
|
417
|
+
return this.set.some((e) => y(e, n) && t.set.some((t) => y(t, n) && e.every((e) => t.every((t) => e.intersects(t, n)))));
|
|
418
|
+
}
|
|
419
|
+
test(e) {
|
|
420
|
+
if (!e) return !1;
|
|
421
|
+
if (typeof e == "string") try {
|
|
422
|
+
e = new s(e, this.options);
|
|
423
|
+
} catch {
|
|
424
|
+
return !1;
|
|
425
|
+
}
|
|
426
|
+
for (let t = 0; t < this.set.length; t++) if (ie(this.set[t], e, this.options)) return !0;
|
|
427
|
+
return !1;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
var r = new (he())(), i = E(), a = H(), o = w(), s = O(), { safeRe: c, src: l, t: u, comparatorTrimReplace: d, tildeTrimReplace: f, caretTrimReplace: p } = T(), { FLAG_INCLUDE_PRERELEASE: m, FLAG_LOOSE: h } = C(), g = new RegExp(l[u.BUILD], "g"), _ = (e) => e.value === "<0.0.0-0", v = (e) => e.value === "", y = (e, t) => {
|
|
431
|
+
let n = !0, r = e.slice(), i = r.pop();
|
|
432
|
+
for (; n && r.length;) n = r.every((e) => i.intersects(e, t)), i = r.pop();
|
|
433
|
+
return n;
|
|
434
|
+
}, b = (e, t) => (e = e.replace(c[u.BUILD], ""), o("comp", e, t), e = S(e, t), o("caret", e), e = te(e, t), o("tildes", e), e = k(e, t), o("xrange", e), e = A(e, t), o("stars", e), e), x = (e) => !e || e.toLowerCase() === "x" || e === "*", ee = (e, t, n) => x(e) && !x(t) || x(t) && n && !x(n), te = (e, t) => e.trim().split(/\s+/).map((e) => ne(e, t)).join(" "), ne = (e, t) => {
|
|
435
|
+
let n = t.loose ? c[u.TILDELOOSE] : c[u.TILDE], r = t.includePrerelease ? "-0" : "";
|
|
436
|
+
return e.replace(n, (t, n, i, a, s) => {
|
|
437
|
+
o("tilde", e, t, n, i, a, s);
|
|
438
|
+
let c;
|
|
439
|
+
return x(n) ? c = "" : x(i) ? c = `>=${n}.0.0${r} <${+n + 1}.0.0-0` : x(a) ? c = `>=${n}.${i}.0${r} <${n}.${+i + 1}.0-0` : s ? (o("replaceTilde pr", s), c = `>=${n}.${i}.${a}-${s} <${n}.${+i + 1}.0-0`) : c = `>=${n}.${i}.${a} <${n}.${+i + 1}.0-0`, o("tilde return", c), c;
|
|
440
|
+
});
|
|
441
|
+
}, S = (e, t) => e.trim().split(/\s+/).map((e) => D(e, t)).join(" "), D = (e, t) => {
|
|
442
|
+
o("caret", e, t);
|
|
443
|
+
let n = t.loose ? c[u.CARETLOOSE] : c[u.CARET], r = t.includePrerelease ? "-0" : "";
|
|
444
|
+
return e.replace(n, (t, n, i, a, s) => {
|
|
445
|
+
o("caret", e, t, n, i, a, s);
|
|
446
|
+
let c;
|
|
447
|
+
return x(n) ? c = "" : x(i) ? c = `>=${n}.0.0${r} <${+n + 1}.0.0-0` : x(a) ? c = n === "0" ? `>=${n}.${i}.0${r} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.0${r} <${+n + 1}.0.0-0` : s ? (o("replaceCaret pr", s), c = n === "0" ? i === "0" ? `>=${n}.${i}.${a}-${s} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a}-${s} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a}-${s} <${+n + 1}.0.0-0`) : (o("no pr"), c = n === "0" ? i === "0" ? `>=${n}.${i}.${a} <${n}.${i}.${+a + 1}-0` : `>=${n}.${i}.${a} <${n}.${+i + 1}.0-0` : `>=${n}.${i}.${a} <${+n + 1}.0.0-0`), o("caret return", c), c;
|
|
448
|
+
});
|
|
449
|
+
}, k = (e, t) => (o("replaceXRanges", e, t), e.split(/\s+/).map((e) => re(e, t)).join(" ")), re = (e, t) => {
|
|
450
|
+
e = e.trim();
|
|
451
|
+
let n = t.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
452
|
+
return e.replace(n, (n, r, i, a, s, c) => {
|
|
453
|
+
if (o("xRange", e, n, r, i, a, s, c), ee(i, a, s)) return e;
|
|
454
|
+
let l = x(i), u = l || x(a), d = u || x(s), f = d;
|
|
455
|
+
return r === "=" && f && (r = ""), c = t.includePrerelease ? "-0" : "", l ? n = r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && f ? (u && (a = 0), s = 0, r === ">" ? (r = ">=", u ? (i = +i + 1, a = 0, s = 0) : (a = +a + 1, s = 0)) : r === "<=" && (r = "<", u ? i = +i + 1 : a = +a + 1), r === "<" && (c = "-0"), n = `${r + i}.${a}.${s}${c}`) : u ? n = `>=${i}.0.0${c} <${+i + 1}.0.0-0` : d && (n = `>=${i}.${a}.0${c} <${i}.${+a + 1}.0-0`), o("xRange return", n), n;
|
|
456
|
+
});
|
|
457
|
+
}, A = (e, t) => (o("replaceStars", e, t), e.trim().replace(c[u.STAR], "")), j = (e, t) => (o("replaceGTE0", e, t), e.trim().replace(c[t.includePrerelease ? u.GTE0PRE : u.GTE0], "")), M = (e) => (t, n, r, i, a, o, s, c, l, u, d, f) => (n = x(r) ? "" : x(i) ? `>=${r}.0.0${e ? "-0" : ""}` : x(a) ? `>=${r}.${i}.0${e ? "-0" : ""}` : o ? `>=${n}` : `>=${n}${e ? "-0" : ""}`, c = x(l) ? "" : x(u) ? `<${+l + 1}.0.0-0` : x(d) ? `<${l}.${+u + 1}.0-0` : f ? `<=${l}.${u}.${d}-${f}` : e ? `<${l}.${u}.${+d + 1}-0` : `<=${c}`, `${n} ${c}`.trim()), ie = (e, t, n) => {
|
|
458
|
+
for (let n = 0; n < e.length; n++) if (!e[n].test(t)) return !1;
|
|
459
|
+
if (t.prerelease.length && !n.includePrerelease) {
|
|
460
|
+
for (let n = 0; n < e.length; n++) if (o(e[n].semver), e[n].semver !== a.ANY && e[n].semver.prerelease.length > 0) {
|
|
461
|
+
let r = e[n].semver;
|
|
462
|
+
if (r.major === t.major && r.minor === t.minor && r.patch === t.patch) return !0;
|
|
463
|
+
}
|
|
464
|
+
return !1;
|
|
465
|
+
}
|
|
466
|
+
return !0;
|
|
467
|
+
};
|
|
468
|
+
})), H = /* @__PURE__ */ S(((e, t) => {
|
|
469
|
+
var n = Symbol("SemVer ANY");
|
|
470
|
+
t.exports = class e {
|
|
471
|
+
static get ANY() {
|
|
472
|
+
return n;
|
|
473
|
+
}
|
|
474
|
+
constructor(t, i) {
|
|
475
|
+
if (i = r(i), t instanceof e) {
|
|
476
|
+
if (t.loose === !!i.loose) return t;
|
|
477
|
+
t = t.value;
|
|
478
|
+
}
|
|
479
|
+
t = t.trim().split(/\s+/).join(" "), s("comparator", t, i), this.options = i, this.loose = !!i.loose, this.parse(t), this.value = this.semver === n ? "" : this.operator + this.semver.version, s("comp", this);
|
|
480
|
+
}
|
|
481
|
+
parse(e) {
|
|
482
|
+
let t = this.options.loose ? i[a.COMPARATORLOOSE] : i[a.COMPARATOR], r = e.match(t);
|
|
483
|
+
if (!r) throw TypeError(`Invalid comparator: ${e}`);
|
|
484
|
+
this.operator = r[1] === void 0 ? "" : r[1], this.operator === "=" && (this.operator = ""), this.semver = r[2] ? new c(r[2], this.options.loose) : n;
|
|
485
|
+
}
|
|
486
|
+
toString() {
|
|
487
|
+
return this.value;
|
|
488
|
+
}
|
|
489
|
+
test(e) {
|
|
490
|
+
if (s("Comparator.test", e, this.options.loose), this.semver === n || e === n) return !0;
|
|
491
|
+
if (typeof e == "string") try {
|
|
492
|
+
e = new c(e, this.options);
|
|
493
|
+
} catch {
|
|
494
|
+
return !1;
|
|
495
|
+
}
|
|
496
|
+
return o(e, this.operator, this.semver, this.options);
|
|
497
|
+
}
|
|
498
|
+
intersects(t, n) {
|
|
499
|
+
if (!(t instanceof e)) throw TypeError("a Comparator is required");
|
|
500
|
+
return this.operator === "" ? this.value === "" || new l(t.value, n).test(this.value) : t.operator === "" ? t.value === "" || new l(this.value, n).test(t.semver) : (n = r(n), n.includePrerelease && (this.value === "<0.0.0-0" || t.value === "<0.0.0-0") || !n.includePrerelease && (this.value.startsWith("<0.0.0") || t.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && t.operator.startsWith(">") || this.operator.startsWith("<") && t.operator.startsWith("<") || this.semver.version === t.semver.version && this.operator.includes("=") && t.operator.includes("=") || o(this.semver, "<", t.semver, n) && this.operator.startsWith(">") && t.operator.startsWith("<") || o(this.semver, ">", t.semver, n) && this.operator.startsWith("<") && t.operator.startsWith(">")));
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
var r = E(), { safeRe: i, t: a } = T(), o = B(), s = w(), c = O(), l = V();
|
|
504
|
+
})), U = /* @__PURE__ */ S(((e, t) => {
|
|
505
|
+
var n = V();
|
|
506
|
+
t.exports = (e, t, r) => {
|
|
507
|
+
try {
|
|
508
|
+
t = new n(t, r);
|
|
509
|
+
} catch {
|
|
510
|
+
return !1;
|
|
511
|
+
}
|
|
512
|
+
return t.test(e);
|
|
513
|
+
};
|
|
514
|
+
})), ge = /* @__PURE__ */ S(((e, t) => {
|
|
515
|
+
var n = V();
|
|
516
|
+
t.exports = (e, t) => new n(e, t).set.map((e) => e.map((e) => e.value).join(" ").trim().split(" "));
|
|
517
|
+
})), _e = /* @__PURE__ */ S(((e, t) => {
|
|
518
|
+
var n = O(), r = V();
|
|
519
|
+
t.exports = (e, t, i) => {
|
|
520
|
+
let a = null, o = null, s = null;
|
|
521
|
+
try {
|
|
522
|
+
s = new r(t, i);
|
|
523
|
+
} catch {
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
return e.forEach((e) => {
|
|
527
|
+
s.test(e) && (!a || o.compare(e) === -1) && (a = e, o = new n(a, i));
|
|
528
|
+
}), a;
|
|
529
|
+
};
|
|
530
|
+
})), ve = /* @__PURE__ */ S(((e, t) => {
|
|
531
|
+
var n = O(), r = V();
|
|
532
|
+
t.exports = (e, t, i) => {
|
|
533
|
+
let a = null, o = null, s = null;
|
|
534
|
+
try {
|
|
535
|
+
s = new r(t, i);
|
|
536
|
+
} catch {
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
return e.forEach((e) => {
|
|
540
|
+
s.test(e) && (!a || o.compare(e) === 1) && (a = e, o = new n(a, i));
|
|
541
|
+
}), a;
|
|
542
|
+
};
|
|
543
|
+
})), ye = /* @__PURE__ */ S(((e, t) => {
|
|
544
|
+
var n = O(), r = V(), i = F();
|
|
545
|
+
t.exports = (e, t) => {
|
|
546
|
+
e = new r(e, t);
|
|
547
|
+
let a = new n("0.0.0");
|
|
548
|
+
if (e.test(a) || (a = new n("0.0.0-0"), e.test(a))) return a;
|
|
549
|
+
a = null;
|
|
550
|
+
for (let t = 0; t < e.set.length; ++t) {
|
|
551
|
+
let r = e.set[t], o = null;
|
|
552
|
+
r.forEach((e) => {
|
|
553
|
+
let t = new n(e.semver.version);
|
|
554
|
+
switch (e.operator) {
|
|
555
|
+
case ">": t.prerelease.length === 0 ? t.patch++ : t.prerelease.push(0), t.raw = t.format();
|
|
556
|
+
case "":
|
|
557
|
+
case ">=":
|
|
558
|
+
(!o || i(t, o)) && (o = t);
|
|
559
|
+
break;
|
|
560
|
+
case "<":
|
|
561
|
+
case "<=": break;
|
|
562
|
+
/* istanbul ignore next */
|
|
563
|
+
default: throw Error(`Unexpected operation: ${e.operator}`);
|
|
564
|
+
}
|
|
565
|
+
}), o && (!a || i(a, o)) && (a = o);
|
|
566
|
+
}
|
|
567
|
+
return a && e.test(a) ? a : null;
|
|
568
|
+
};
|
|
569
|
+
})), be = /* @__PURE__ */ S(((e, t) => {
|
|
570
|
+
var n = V();
|
|
571
|
+
t.exports = (e, t) => {
|
|
572
|
+
try {
|
|
573
|
+
return new n(e, t).range || "*";
|
|
574
|
+
} catch {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
})), W = /* @__PURE__ */ S(((e, t) => {
|
|
579
|
+
var n = O(), r = H(), { ANY: i } = r, a = V(), o = U(), s = F(), c = I(), l = z(), u = R();
|
|
580
|
+
t.exports = (e, t, d, f) => {
|
|
581
|
+
e = new n(e, f), t = new a(t, f);
|
|
582
|
+
let p, m, h, g, _;
|
|
583
|
+
switch (d) {
|
|
584
|
+
case ">":
|
|
585
|
+
p = s, m = l, h = c, g = ">", _ = ">=";
|
|
586
|
+
break;
|
|
587
|
+
case "<":
|
|
588
|
+
p = c, m = u, h = s, g = "<", _ = "<=";
|
|
589
|
+
break;
|
|
590
|
+
default: throw TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
591
|
+
}
|
|
592
|
+
if (o(e, t, f)) return !1;
|
|
593
|
+
for (let n = 0; n < t.set.length; ++n) {
|
|
594
|
+
let a = t.set[n], o = null, s = null;
|
|
595
|
+
if (a.forEach((e) => {
|
|
596
|
+
e.semver === i && (e = new r(">=0.0.0")), o ||= e, s ||= e, p(e.semver, o.semver, f) ? o = e : h(e.semver, s.semver, f) && (s = e);
|
|
597
|
+
}), o.operator === g || o.operator === _ || (!s.operator || s.operator === g) && m(e, s.semver) || s.operator === _ && h(e, s.semver)) return !1;
|
|
598
|
+
}
|
|
599
|
+
return !0;
|
|
600
|
+
};
|
|
601
|
+
})), xe = /* @__PURE__ */ S(((e, t) => {
|
|
602
|
+
var n = W();
|
|
603
|
+
t.exports = (e, t, r) => n(e, t, ">", r);
|
|
604
|
+
})), Se = /* @__PURE__ */ S(((e, t) => {
|
|
605
|
+
var n = W();
|
|
606
|
+
t.exports = (e, t, r) => n(e, t, "<", r);
|
|
607
|
+
})), Ce = /* @__PURE__ */ S(((e, t) => {
|
|
608
|
+
var n = V();
|
|
609
|
+
t.exports = (e, t, r) => (e = new n(e, r), t = new n(t, r), e.intersects(t, r));
|
|
610
|
+
})), we = /* @__PURE__ */ S(((e, t) => {
|
|
611
|
+
var n = U(), r = N();
|
|
612
|
+
t.exports = (e, t, i) => {
|
|
613
|
+
let a = [], o = null, s = null, c = e.sort((e, t) => r(e, t, i));
|
|
614
|
+
for (let e of c) n(e, t, i) ? (s = e, o ||= e) : (s && a.push([o, s]), s = null, o = null);
|
|
615
|
+
o && a.push([o, null]);
|
|
616
|
+
let l = [];
|
|
617
|
+
for (let [e, t] of a) e === t ? l.push(e) : !t && e === c[0] ? l.push("*") : t ? e === c[0] ? l.push(`<=${t}`) : l.push(`${e} - ${t}`) : l.push(`>=${e}`);
|
|
618
|
+
let u = l.join(" || "), d = typeof t.raw == "string" ? t.raw : String(t);
|
|
619
|
+
return u.length < d.length ? u : t;
|
|
620
|
+
};
|
|
621
|
+
})), Te = /* @__PURE__ */ S(((e, t) => {
|
|
622
|
+
var n = V(), r = H(), { ANY: i } = r, a = U(), o = N(), s = (e, t, r = {}) => {
|
|
623
|
+
if (e === t) return !0;
|
|
624
|
+
e = new n(e, r), t = new n(t, r);
|
|
625
|
+
let i = !1;
|
|
626
|
+
OUTER: for (let n of e.set) {
|
|
627
|
+
for (let e of t.set) {
|
|
628
|
+
let t = u(n, e, r);
|
|
629
|
+
if (i ||= t !== null, t) continue OUTER;
|
|
630
|
+
}
|
|
631
|
+
if (i) return !1;
|
|
632
|
+
}
|
|
633
|
+
return !0;
|
|
634
|
+
}, c = [new r(">=0.0.0-0")], l = [new r(">=0.0.0")], u = (e, t, n) => {
|
|
635
|
+
if (e === t) return !0;
|
|
636
|
+
if (e.length === 1 && e[0].semver === i) {
|
|
637
|
+
if (t.length === 1 && t[0].semver === i) return !0;
|
|
638
|
+
e = n.includePrerelease ? c : l;
|
|
639
|
+
}
|
|
640
|
+
if (t.length === 1 && t[0].semver === i) {
|
|
641
|
+
if (n.includePrerelease) return !0;
|
|
642
|
+
t = l;
|
|
643
|
+
}
|
|
644
|
+
let r = /* @__PURE__ */ new Set(), s, u;
|
|
645
|
+
for (let t of e) t.operator === ">" || t.operator === ">=" ? s = d(s, t, n) : t.operator === "<" || t.operator === "<=" ? u = f(u, t, n) : r.add(t.semver);
|
|
646
|
+
if (r.size > 1) return null;
|
|
647
|
+
let p;
|
|
648
|
+
if (s && u && (p = o(s.semver, u.semver, n), p > 0 || p === 0 && (s.operator !== ">=" || u.operator !== "<="))) return null;
|
|
649
|
+
for (let e of r) {
|
|
650
|
+
if (s && !a(e, String(s), n) || u && !a(e, String(u), n)) return null;
|
|
651
|
+
for (let r of t) if (!a(e, String(r), n)) return !1;
|
|
652
|
+
return !0;
|
|
653
|
+
}
|
|
654
|
+
let m, h, g, _, v = u && !n.includePrerelease && u.semver.prerelease.length ? u.semver : !1, y = s && !n.includePrerelease && s.semver.prerelease.length ? s.semver : !1;
|
|
655
|
+
v && v.prerelease.length === 1 && u.operator === "<" && v.prerelease[0] === 0 && (v = !1);
|
|
656
|
+
for (let e of t) {
|
|
657
|
+
if (_ = _ || e.operator === ">" || e.operator === ">=", g = g || e.operator === "<" || e.operator === "<=", s) {
|
|
658
|
+
if (y && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === y.major && e.semver.minor === y.minor && e.semver.patch === y.patch && (y = !1), e.operator === ">" || e.operator === ">=") {
|
|
659
|
+
if (m = d(s, e, n), m === e && m !== s) return !1;
|
|
660
|
+
} else if (s.operator === ">=" && !e.test(s.semver)) return !1;
|
|
661
|
+
}
|
|
662
|
+
if (u) {
|
|
663
|
+
if (v && e.semver.prerelease && e.semver.prerelease.length && e.semver.major === v.major && e.semver.minor === v.minor && e.semver.patch === v.patch && (v = !1), e.operator === "<" || e.operator === "<=") {
|
|
664
|
+
if (h = f(u, e, n), h === e && h !== u) return !1;
|
|
665
|
+
} else if (u.operator === "<=" && !e.test(u.semver)) return !1;
|
|
666
|
+
}
|
|
667
|
+
if (!e.operator && (u || s) && p !== 0) return !1;
|
|
668
|
+
}
|
|
669
|
+
return !(s && g && !u && p !== 0 || u && _ && !s && p !== 0 || y || v);
|
|
670
|
+
}, d = (e, t, n) => {
|
|
671
|
+
if (!e) return t;
|
|
672
|
+
let r = o(e.semver, t.semver, n);
|
|
673
|
+
return r > 0 ? e : r < 0 || t.operator === ">" && e.operator === ">=" ? t : e;
|
|
674
|
+
}, f = (e, t, n) => {
|
|
675
|
+
if (!e) return t;
|
|
676
|
+
let r = o(e.semver, t.semver, n);
|
|
677
|
+
return r < 0 ? e : r > 0 || t.operator === "<" && e.operator === "<=" ? t : e;
|
|
678
|
+
};
|
|
679
|
+
t.exports = s;
|
|
680
|
+
})), Ee = (/* @__PURE__ */ S(((e, t) => {
|
|
681
|
+
var n = T(), r = C(), i = O(), a = D();
|
|
682
|
+
t.exports = {
|
|
683
|
+
parse: k(),
|
|
684
|
+
valid: re(),
|
|
685
|
+
clean: A(),
|
|
686
|
+
inc: j(),
|
|
687
|
+
diff: M(),
|
|
688
|
+
major: ie(),
|
|
689
|
+
minor: ae(),
|
|
690
|
+
patch: oe(),
|
|
691
|
+
prerelease: se(),
|
|
692
|
+
compare: N(),
|
|
693
|
+
rcompare: ce(),
|
|
694
|
+
compareLoose: le(),
|
|
695
|
+
compareBuild: P(),
|
|
696
|
+
sort: ue(),
|
|
697
|
+
rsort: de(),
|
|
698
|
+
gt: F(),
|
|
699
|
+
lt: I(),
|
|
700
|
+
eq: fe(),
|
|
701
|
+
neq: L(),
|
|
702
|
+
gte: R(),
|
|
703
|
+
lte: z(),
|
|
704
|
+
cmp: B(),
|
|
705
|
+
coerce: pe(),
|
|
706
|
+
truncate: me(),
|
|
707
|
+
Comparator: H(),
|
|
708
|
+
Range: V(),
|
|
709
|
+
satisfies: U(),
|
|
710
|
+
toComparators: ge(),
|
|
711
|
+
maxSatisfying: _e(),
|
|
712
|
+
minSatisfying: ve(),
|
|
713
|
+
minVersion: ye(),
|
|
714
|
+
validRange: be(),
|
|
715
|
+
outside: W(),
|
|
716
|
+
gtr: xe(),
|
|
717
|
+
ltr: Se(),
|
|
718
|
+
intersects: Ce(),
|
|
719
|
+
simplifyRange: we(),
|
|
720
|
+
subset: Te(),
|
|
721
|
+
SemVer: i,
|
|
722
|
+
re: n.re,
|
|
723
|
+
src: n.src,
|
|
724
|
+
tokens: n.t,
|
|
725
|
+
SEMVER_SPEC_VERSION: r.SEMVER_SPEC_VERSION,
|
|
726
|
+
RELEASE_TYPES: r.RELEASE_TYPES,
|
|
727
|
+
compareIdentifiers: a.compareIdentifiers,
|
|
728
|
+
rcompareIdentifiers: a.rcompareIdentifiers
|
|
729
|
+
};
|
|
730
|
+
})))(), De = (e) => e, Oe = (e) => e, ke = {
|
|
13
731
|
now: () => Date.now(),
|
|
14
|
-
setTimeout: (e, t) =>
|
|
15
|
-
clearTimeout: (e) => globalThis.clearTimeout(
|
|
16
|
-
setInterval: (e, t) =>
|
|
17
|
-
clearInterval: (e) => globalThis.clearInterval(
|
|
18
|
-
},
|
|
19
|
-
function
|
|
732
|
+
setTimeout: (e, t) => De(globalThis.setTimeout(e, t)),
|
|
733
|
+
clearTimeout: (e) => globalThis.clearTimeout(Oe(e)),
|
|
734
|
+
setInterval: (e, t) => De(globalThis.setInterval(e, t)),
|
|
735
|
+
clearInterval: (e) => globalThis.clearInterval(Oe(e))
|
|
736
|
+
}, Ae = 262144e3, je = 3e4, Me = 3e3;
|
|
737
|
+
function Ne(e) {
|
|
20
738
|
let t = h(b(import.meta.url));
|
|
21
739
|
return [g(t, `${e}.js`), g(t, `${e}.ts`)].find((e) => s(e)) ?? null;
|
|
22
740
|
}
|
|
23
|
-
function
|
|
24
|
-
let n =
|
|
741
|
+
function G(e, t) {
|
|
742
|
+
let n = Ne("introspect");
|
|
25
743
|
if (!n) return {
|
|
26
744
|
ok: !1,
|
|
27
745
|
reason: "introspect not found next to the sdk"
|
|
28
746
|
};
|
|
29
|
-
let r =
|
|
747
|
+
let r = ne(process.execPath, [
|
|
30
748
|
"--conditions",
|
|
31
749
|
"browser",
|
|
32
750
|
n,
|
|
33
751
|
e
|
|
34
752
|
], {
|
|
35
753
|
encoding: "utf-8",
|
|
36
|
-
timeout: t?.timeoutMs ??
|
|
754
|
+
timeout: t?.timeoutMs ?? je
|
|
37
755
|
});
|
|
38
756
|
if (r.error) return {
|
|
39
757
|
ok: !1,
|
|
@@ -55,8 +773,8 @@ function E(e, t) {
|
|
|
55
773
|
};
|
|
56
774
|
}
|
|
57
775
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
776
|
+
function Pe(e) {
|
|
777
|
+
let t = te(process.execPath, [
|
|
60
778
|
"--conditions",
|
|
61
779
|
"browser",
|
|
62
780
|
e
|
|
@@ -91,16 +809,16 @@ function D(e) {
|
|
|
91
809
|
}
|
|
92
810
|
};
|
|
93
811
|
}
|
|
94
|
-
function
|
|
812
|
+
function Fe(e) {
|
|
95
813
|
return {
|
|
96
|
-
introspect: async (t) =>
|
|
814
|
+
introspect: async (t) => G(t, { timeoutMs: e }),
|
|
97
815
|
dispose: async () => {},
|
|
98
816
|
childPid: null
|
|
99
817
|
};
|
|
100
818
|
}
|
|
101
|
-
function
|
|
102
|
-
if (process.env.GLASSHOME_WIDGET_NO_WORKER === "1") return
|
|
103
|
-
let t = e?.rssLimitBytes ??
|
|
819
|
+
function Ie(e) {
|
|
820
|
+
if (process.env.GLASSHOME_WIDGET_NO_WORKER === "1") return Fe(e?.timeoutMs);
|
|
821
|
+
let t = e?.rssLimitBytes ?? Ae, n = e?.timeoutMs ?? je, r = e?.slowMs ?? Me, i = e?.clock ?? ke, a = e?.spawnWorker ?? Pe, o = null, s = !1, c = 0, l = Promise.resolve();
|
|
104
822
|
function u(e, t) {
|
|
105
823
|
for (let n of e.pending.values()) n({
|
|
106
824
|
ok: !1,
|
|
@@ -153,7 +871,7 @@ function se(e) {
|
|
|
153
871
|
ok: !1,
|
|
154
872
|
reason: "introspect session disposed"
|
|
155
873
|
};
|
|
156
|
-
let t =
|
|
874
|
+
let t = Ne("introspect-worker");
|
|
157
875
|
if (!t) return {
|
|
158
876
|
ok: !1,
|
|
159
877
|
reason: "introspect-worker not found next to the sdk"
|
|
@@ -207,20 +925,20 @@ function se(e) {
|
|
|
207
925
|
}
|
|
208
926
|
//#endregion
|
|
209
927
|
//#region src/vite/index.ts
|
|
210
|
-
var
|
|
211
|
-
function
|
|
212
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
928
|
+
var K = 2;
|
|
929
|
+
function q(e) {
|
|
930
|
+
if (Array.isArray(e)) return `[${e.map(q).join(",")}]`;
|
|
213
931
|
if (typeof e == "object" && e) {
|
|
214
932
|
let t = e;
|
|
215
|
-
return `{${Object.keys(t).sort().filter((e) => t[e] !== void 0).map((e) => `${JSON.stringify(e)}:${
|
|
933
|
+
return `{${Object.keys(t).sort().filter((e) => t[e] !== void 0).map((e) => `${JSON.stringify(e)}:${q(t[e])}`).join(",")}}`;
|
|
216
934
|
}
|
|
217
935
|
return JSON.stringify(e) ?? "null";
|
|
218
936
|
}
|
|
219
|
-
function
|
|
220
|
-
return o("sha256").update(
|
|
937
|
+
function Le(e) {
|
|
938
|
+
return o("sha256").update(q(e)).digest("hex").slice(0, 16);
|
|
221
939
|
}
|
|
222
|
-
var
|
|
223
|
-
async function
|
|
940
|
+
var Re = 20;
|
|
941
|
+
async function ze(e, t) {
|
|
224
942
|
if (e === void 0) return;
|
|
225
943
|
let n;
|
|
226
944
|
try {
|
|
@@ -240,7 +958,7 @@ async function ue(e, t) {
|
|
|
240
958
|
let a = i.error.issues.map((e) => ` examples${e.path.length ? `[${e.path.join("][")}]` : ""}: ${e.message}`).join("\n");
|
|
241
959
|
throw Error(`[widget-sdk] Invalid \`examples\` for "${t}":\n${a}\nEach example needs a \`config\` object and a \`size\` of whole positive tiles, and at most 20 are rendered.`);
|
|
242
960
|
}
|
|
243
|
-
function
|
|
961
|
+
function Be(e, t) {
|
|
244
962
|
if (!e?.length) return;
|
|
245
963
|
let n = e.map((e) => {
|
|
246
964
|
let t = e.label ? `"${e.label}"` : `#${e.index}`;
|
|
@@ -248,7 +966,7 @@ function de(e, t) {
|
|
|
248
966
|
}).join("\n");
|
|
249
967
|
throw Error(`[widget-sdk] Example config rejected by "${t}"'s own configSchema:\n${n}\nEach example's \`config\` must be a config the widget would actually accept, or its preview renders empty.`);
|
|
250
968
|
}
|
|
251
|
-
var
|
|
969
|
+
var Ve = [
|
|
252
970
|
"schema",
|
|
253
971
|
"defaultConfig",
|
|
254
972
|
"examples",
|
|
@@ -261,36 +979,36 @@ var fe = [
|
|
|
261
979
|
"minSize",
|
|
262
980
|
"maxSize"
|
|
263
981
|
];
|
|
264
|
-
function
|
|
982
|
+
function He(e, t, n) {
|
|
265
983
|
let r = l(e, "utf-8"), i = JSON.parse(r), a = {
|
|
266
984
|
...t.manifest ?? {},
|
|
267
985
|
schema: n
|
|
268
986
|
};
|
|
269
|
-
for (let e of
|
|
987
|
+
for (let e of Ve) a[e] !== void 0 && (i[e] = a[e]);
|
|
270
988
|
let o = `${JSON.stringify(i, null, 2)}\n`;
|
|
271
989
|
o !== r && p(e, o);
|
|
272
990
|
}
|
|
273
|
-
var
|
|
274
|
-
function
|
|
275
|
-
let r =
|
|
276
|
-
for (let [e, a] of Object.entries(
|
|
991
|
+
var Ue = { useDaylight: "sun.sun" };
|
|
992
|
+
function We(e, t, n) {
|
|
993
|
+
let r = x(e);
|
|
994
|
+
for (let [e, a] of Object.entries(Ue)) {
|
|
277
995
|
if (!r.has(e) && !r.has("*") || i(t, a)) continue;
|
|
278
996
|
let o = a.split(".")[0];
|
|
279
997
|
throw Error(`[widget-sdk] "${n}" uses ${e}(), which reads ${a}, but its capabilities grant no read of it.\n Add { "domain": "${o}", "access": "read" } to capabilities, so the homeowner is told before installing.`);
|
|
280
998
|
}
|
|
281
999
|
}
|
|
282
|
-
async function
|
|
1000
|
+
async function J(e) {
|
|
283
1001
|
if (!s(e.outFile)) return;
|
|
284
|
-
let t = e.session ? await e.session.introspect(e.outFile) : await (e.introspect ??
|
|
1002
|
+
let t = e.session ? await e.session.introspect(e.outFile) : await (e.introspect ?? G)(e.outFile);
|
|
285
1003
|
if (!t.ok) throw Error(`[widget-sdk] Could not read "${e.widgetName}" to check it: ${t.reason}\n Its examples and config schema could not be validated, so the build cannot continue.
|
|
286
1004
|
This usually means the bundle throws while being imported.`);
|
|
287
1005
|
let n = t.value, r = n.manifest?.name ?? e.widgetName;
|
|
288
|
-
await
|
|
1006
|
+
await ze(n.manifest?.examples, r), Be(n.exampleConfigIssues, r);
|
|
289
1007
|
let i = n.jsonSchema, a = e.manifestPath && s(e.manifestPath) ? e.manifestPath : null;
|
|
290
|
-
i && a &&
|
|
1008
|
+
i && a && He(a, n, i);
|
|
291
1009
|
let o = a ? JSON.parse(l(a, "utf-8")).capabilities : n.manifest?.capabilities;
|
|
292
|
-
if (
|
|
293
|
-
let c =
|
|
1010
|
+
if (We(l(e.outFile, "utf-8"), o ?? [], r), !i) return;
|
|
1011
|
+
let c = Le(i), u = n.manifest?.configVersion ?? null, d = n.manifest?.name ?? e.widgetName, f = s(e.hashFile) ? l(e.hashFile, "utf-8") : null;
|
|
294
1012
|
if (f !== null) {
|
|
295
1013
|
let t = f.trim(), n = null;
|
|
296
1014
|
if (t.startsWith("{")) try {
|
|
@@ -298,55 +1016,55 @@ async function M(e) {
|
|
|
298
1016
|
} catch {
|
|
299
1017
|
n = null;
|
|
300
1018
|
}
|
|
301
|
-
if (n && n.hashVersion ===
|
|
1019
|
+
if (n && n.hashVersion === K) {
|
|
302
1020
|
if (n.hash !== c && n.configVersion === u) throw Error(`[widget-sdk] Config schema shape changed for "${d}" without a configVersion bump. Bump configVersion in defineWidget (currently ${u ?? "unset"}) or revert the schema change, then rebuild. Recorded in ${e.hashFile}`);
|
|
303
|
-
} else console.warn(`[widget-sdk] Schema shape record for "${d}" was written by an older SDK, so it cannot be compared. Re-recording it under hash format ${
|
|
1021
|
+
} else console.warn(`[widget-sdk] Schema shape record for "${d}" was written by an older SDK, so it cannot be compared. Re-recording it under hash format ${K}. This build is not checked for a missing configVersion bump; the next one is. (${e.hashFile})`);
|
|
304
1022
|
}
|
|
305
1023
|
let m = `${JSON.stringify({
|
|
306
1024
|
hash: c,
|
|
307
1025
|
configVersion: u,
|
|
308
|
-
hashVersion:
|
|
1026
|
+
hashVersion: K
|
|
309
1027
|
})}\n`;
|
|
310
1028
|
m !== f && p(e.hashFile, m);
|
|
311
1029
|
}
|
|
312
|
-
var
|
|
313
|
-
function
|
|
1030
|
+
var Ge = "virtual:glasshome-widget", Ke = "\0virtual:glasshome-widget", qe = "/@glasshome/preview";
|
|
1031
|
+
function Y(e) {
|
|
314
1032
|
return y === "\\" ? e.split(y).join("/") : e;
|
|
315
1033
|
}
|
|
316
|
-
function
|
|
1034
|
+
function X() {
|
|
317
1035
|
let e = b(import.meta.url);
|
|
318
1036
|
return v(h(e), "../../preview");
|
|
319
1037
|
}
|
|
320
|
-
function
|
|
1038
|
+
function Z(e) {
|
|
321
1039
|
return r(e);
|
|
322
1040
|
}
|
|
323
|
-
var
|
|
324
|
-
function
|
|
325
|
-
let n =
|
|
326
|
-
return n.includes("/node_modules/") || !
|
|
1041
|
+
var Je = /\.(ts|tsx|js|jsx)$/, Ye = /from\s+["']@glasshome\/sync-layer(\/[^"']*)?["']/;
|
|
1042
|
+
function Xe(e, t) {
|
|
1043
|
+
let n = Y(e).split("?")[0] ?? "";
|
|
1044
|
+
return n.includes("/node_modules/") || !Je.test(n) ? !1 : Ye.test(t);
|
|
327
1045
|
}
|
|
328
|
-
function
|
|
1046
|
+
function Ze() {
|
|
329
1047
|
return {
|
|
330
1048
|
name: "glasshome-widget:sync-layer-guard",
|
|
331
1049
|
apply: "build",
|
|
332
1050
|
enforce: "pre",
|
|
333
1051
|
transform(e, t) {
|
|
334
|
-
if (
|
|
1052
|
+
if (Xe(t, e)) throw Error(`Widgets must not import "@glasshome/sync-layer" directly (imported by ${Y(_(process.cwd(), t.split("?")[0] ?? t))}). Import the equivalent hook from "@glasshome/widget-sdk" instead (e.g. useEntity, useEntities, useService).`);
|
|
335
1053
|
return null;
|
|
336
1054
|
}
|
|
337
1055
|
};
|
|
338
1056
|
}
|
|
339
|
-
function
|
|
340
|
-
let r =
|
|
341
|
-
if (r.includes("/node_modules/") || !
|
|
1057
|
+
function Qe(t, n) {
|
|
1058
|
+
let r = Y(t).split("?")[0] ?? "";
|
|
1059
|
+
if (r.includes("/node_modules/") || !Je.test(r)) return !1;
|
|
342
1060
|
let i = e.find((e) => e.id === "direct-ui-import");
|
|
343
1061
|
return i?.sourcePattern ? new RegExp(i.sourcePattern).test(n) : !1;
|
|
344
1062
|
}
|
|
345
|
-
function
|
|
1063
|
+
function Q(e = /* @__PURE__ */ new Set()) {
|
|
346
1064
|
let t = /* @__PURE__ */ new Set();
|
|
347
1065
|
return {
|
|
348
1066
|
scan(e, n) {
|
|
349
|
-
|
|
1067
|
+
Qe(e, n) && t.add(Y(_(process.cwd(), e.split("?")[0] ?? e)));
|
|
350
1068
|
},
|
|
351
1069
|
take() {
|
|
352
1070
|
let n = [...t].filter((t) => !e.has(t));
|
|
@@ -355,8 +1073,8 @@ function H(e = /* @__PURE__ */ new Set()) {
|
|
|
355
1073
|
}
|
|
356
1074
|
};
|
|
357
1075
|
}
|
|
358
|
-
function
|
|
359
|
-
let r =
|
|
1076
|
+
function $e(n) {
|
|
1077
|
+
let r = Q(n);
|
|
360
1078
|
return {
|
|
361
1079
|
name: "glasshome-widget:ui-import-guard",
|
|
362
1080
|
apply: "build",
|
|
@@ -372,15 +1090,15 @@ function U(n) {
|
|
|
372
1090
|
}
|
|
373
1091
|
};
|
|
374
1092
|
}
|
|
375
|
-
var
|
|
376
|
-
function
|
|
1093
|
+
var et = "node_modules/.cache/glasshome-widgets";
|
|
1094
|
+
function tt(e) {
|
|
377
1095
|
try {
|
|
378
1096
|
return m(g(process.cwd(), "package.json")).resolve(e);
|
|
379
1097
|
} catch {
|
|
380
1098
|
return null;
|
|
381
1099
|
}
|
|
382
1100
|
}
|
|
383
|
-
var
|
|
1101
|
+
var nt = [
|
|
384
1102
|
"--radius",
|
|
385
1103
|
"--background",
|
|
386
1104
|
"--foreground",
|
|
@@ -390,62 +1108,78 @@ var _e = [
|
|
|
390
1108
|
"--muted",
|
|
391
1109
|
"--accent"
|
|
392
1110
|
];
|
|
393
|
-
function
|
|
1111
|
+
function rt(e) {
|
|
394
1112
|
return e.replace(/(?<=[{;])\s*(--[\w-]+)\s*:\s*var\(\s*\1\s*\)\s*(;|(?=\}))/g, "");
|
|
395
1113
|
}
|
|
396
|
-
function
|
|
1114
|
+
function it(e, t) {
|
|
397
1115
|
let n = g(e, `${t}.css`);
|
|
398
1116
|
if (!s(n)) return;
|
|
399
|
-
let r = l(n, "utf-8"), i =
|
|
1117
|
+
let r = l(n, "utf-8"), i = rt(r);
|
|
400
1118
|
i !== r && p(n, i);
|
|
401
1119
|
for (let e of i.matchAll(/:host[^{]*\{([^}]*)\}/g)) {
|
|
402
|
-
let n = e[1] ?? "", r =
|
|
1120
|
+
let n = e[1] ?? "", r = nt.find((e) => n.includes(`${e}:`));
|
|
403
1121
|
if (r) throw Error(`[glasshome-widget] "${t}.css" defines theme variable "${r}" on :host. Theme variables must inherit from the document so widgets follow the household theme — never re-scope them into the widget's shadow root.`);
|
|
404
1122
|
}
|
|
405
1123
|
}
|
|
406
|
-
function
|
|
407
|
-
let n = v(e), r = h(t), i = new Set(
|
|
1124
|
+
function at(e, t) {
|
|
1125
|
+
let n = v(e), r = h(t), i = new Set($(n).map((e) => h(e.entry)));
|
|
408
1126
|
return [r, ...u(n, { withFileTypes: !0 }).filter((e) => e.isDirectory()).map((e) => g(n, e.name)).filter((e) => !i.has(e))];
|
|
409
1127
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
"@import \"tailwindcss\"
|
|
1128
|
+
var ot = "1.24.0";
|
|
1129
|
+
function st(e) {
|
|
1130
|
+
return !e || (0, Ee.validRange)(e) === null ? !1 : !(0, Ee.intersects)(e, `<${ot}`, { includePrerelease: !0 });
|
|
1131
|
+
}
|
|
1132
|
+
function ct(e) {
|
|
1133
|
+
if (!s(e)) return;
|
|
1134
|
+
let t = JSON.parse(l(e, "utf-8"));
|
|
1135
|
+
if (typeof t == "object" && t && "sdkVersion" in t) return typeof t.sdkVersion == "string" ? t.sdkVersion : void 0;
|
|
1136
|
+
}
|
|
1137
|
+
function lt(e, t) {
|
|
1138
|
+
let n = t ? ["@import \"tailwindcss\" source(none);"] : [
|
|
1139
|
+
"@layer theme, base, components, utilities;",
|
|
1140
|
+
"@import \"tailwindcss/theme.css\" layer(theme);",
|
|
1141
|
+
"@import \"tailwindcss/utilities.css\" layer(utilities) source(none);"
|
|
1142
|
+
], r = t ? [
|
|
1143
|
+
g(t, "src"),
|
|
1144
|
+
g(t, "dist"),
|
|
1145
|
+
...e
|
|
1146
|
+
] : e;
|
|
1147
|
+
return [
|
|
1148
|
+
...n,
|
|
423
1149
|
"@import \"tw-animate-css\";",
|
|
424
|
-
"@import \"@glasshome/ui/styles/theme\";",
|
|
425
|
-
...
|
|
1150
|
+
t ? "@import \"@glasshome/ui/styles/theme\";" : "@reference \"@glasshome/ui/styles/theme\";",
|
|
1151
|
+
...r.filter((e) => s(e)).map((e) => `@source "${Y(e)}";`),
|
|
426
1152
|
"@custom-variant dark {",
|
|
427
1153
|
" &:is(.dark *) { @slot }",
|
|
428
1154
|
" :host(.dark) & { @slot }",
|
|
429
1155
|
"}",
|
|
430
1156
|
""
|
|
431
|
-
].join("\n")
|
|
432
|
-
|
|
1157
|
+
].join("\n");
|
|
1158
|
+
}
|
|
1159
|
+
function ut(e, t, n, r, i) {
|
|
1160
|
+
let a = v(e, et);
|
|
1161
|
+
c(a, { recursive: !0 });
|
|
1162
|
+
let o = tt("@glasshome/ui/styles");
|
|
1163
|
+
if (!o) throw Error("[widget-sdk] @glasshome/ui is required to build widgets (it provides the theme every GlassHome widget ships with). Add it to your widget's dependencies.");
|
|
1164
|
+
let s = tt("@glasshome/widget-sdk/tailwind-sources"), l = s ? h(s) : null, u = [...l ? [g(l, "src"), g(l, "dist")] : [], ...at(r, n)], d = st(ct(i)) ? null : v(h(o), "../.."), f = v(a, `${t}.tailwind.css`);
|
|
1165
|
+
p(f, lt(u, d));
|
|
1166
|
+
let m = v(a, `${t}.entry.ts`);
|
|
433
1167
|
return p(m, [
|
|
434
|
-
`import "${
|
|
435
|
-
`export { default } from "${
|
|
1168
|
+
`import "${Y(f)}";`,
|
|
1169
|
+
`export { default } from "${Y(n)}";`,
|
|
436
1170
|
""
|
|
437
1171
|
].join("\n")), m;
|
|
438
1172
|
}
|
|
439
|
-
function
|
|
1173
|
+
function dt() {
|
|
440
1174
|
let { Features: e } = m(import.meta.url)("lightningcss");
|
|
441
1175
|
return { lightningcss: { include: e.HexAlphaColors } };
|
|
442
1176
|
}
|
|
443
|
-
function
|
|
444
|
-
let e =
|
|
1177
|
+
function ft() {
|
|
1178
|
+
let e = ee();
|
|
445
1179
|
for (let t of e) t.apply ??= "build";
|
|
446
1180
|
return e;
|
|
447
1181
|
}
|
|
448
|
-
function
|
|
1182
|
+
function $(e) {
|
|
449
1183
|
let t = [];
|
|
450
1184
|
if (!s(e)) return t;
|
|
451
1185
|
for (let n of u(e)) {
|
|
@@ -459,7 +1193,7 @@ function Z(e) {
|
|
|
459
1193
|
}
|
|
460
1194
|
return t;
|
|
461
1195
|
}
|
|
462
|
-
function
|
|
1196
|
+
function pt(e, t) {
|
|
463
1197
|
let r = [];
|
|
464
1198
|
if (s(e)) for (let i of u(e)) {
|
|
465
1199
|
if (!f(g(e, i)).isDirectory()) continue;
|
|
@@ -482,8 +1216,8 @@ function Q(e, t) {
|
|
|
482
1216
|
};
|
|
483
1217
|
s(t) || c(t, { recursive: !0 }), p(g(t, "registry.json"), JSON.stringify(i, null, 2)), console.log(`[registry] Generated registry.json with ${r.length} widget(s)`);
|
|
484
1218
|
}
|
|
485
|
-
async function
|
|
486
|
-
let { build: t } = await import("vite"), n = process.cwd(), r = v(n, e?.srcDir ?? "src"), i = v(n, e?.outDir ?? "dist"), a =
|
|
1219
|
+
async function mt(e) {
|
|
1220
|
+
let { build: t } = await import("vite"), n = process.cwd(), r = v(n, e?.srcDir ?? "src"), i = v(n, e?.outDir ?? "dist"), a = $(r);
|
|
487
1221
|
if (a.length === 0) {
|
|
488
1222
|
console.warn("[glasshome-widgets] No widgets found in", r);
|
|
489
1223
|
return;
|
|
@@ -498,55 +1232,55 @@ async function $(e) {
|
|
|
498
1232
|
configFile: !1,
|
|
499
1233
|
root: n,
|
|
500
1234
|
plugins: [
|
|
501
|
-
...
|
|
1235
|
+
...ft(),
|
|
502
1236
|
...e?.plugins ?? [],
|
|
503
|
-
|
|
504
|
-
|
|
1237
|
+
Ze(),
|
|
1238
|
+
$e(o)
|
|
505
1239
|
],
|
|
506
1240
|
...e?.viteConfig,
|
|
507
1241
|
css: {
|
|
508
1242
|
...e?.viteConfig?.css,
|
|
509
|
-
...
|
|
1243
|
+
...dt()
|
|
510
1244
|
},
|
|
511
1245
|
build: {
|
|
512
1246
|
lib: {
|
|
513
|
-
entry:
|
|
1247
|
+
entry: ut(n, s.name, s.entry, r, g(h(s.entry), "manifest.json")),
|
|
514
1248
|
formats: ["es"],
|
|
515
1249
|
fileName: s.name,
|
|
516
1250
|
cssFileName: s.name
|
|
517
1251
|
},
|
|
518
|
-
rollupOptions: { external:
|
|
1252
|
+
rollupOptions: { external: Z },
|
|
519
1253
|
outDir: i,
|
|
520
1254
|
emptyOutDir: !1,
|
|
521
1255
|
copyPublicDir: !1,
|
|
522
1256
|
...e?.viteConfig?.build
|
|
523
1257
|
},
|
|
524
1258
|
logLevel: "warn"
|
|
525
|
-
}),
|
|
1259
|
+
}), it(i, s.name), await J({
|
|
526
1260
|
outFile: g(i, `${s.name}.js`),
|
|
527
1261
|
hashFile: g(h(s.entry), ".schema-hash"),
|
|
528
1262
|
widgetName: s.name,
|
|
529
1263
|
manifestPath: g(h(s.entry), "manifest.json"),
|
|
530
1264
|
session: e?.session
|
|
531
1265
|
});
|
|
532
|
-
|
|
1266
|
+
pt(r, i);
|
|
533
1267
|
}
|
|
534
|
-
function
|
|
1268
|
+
function ht(e) {
|
|
535
1269
|
let t = e?.entry ?? "src/index.tsx", n = {
|
|
536
1270
|
name: "glasshome-widget:build",
|
|
537
1271
|
apply: "build",
|
|
538
1272
|
config() {
|
|
539
1273
|
let e = process.cwd();
|
|
540
1274
|
return {
|
|
541
|
-
css:
|
|
1275
|
+
css: dt(),
|
|
542
1276
|
build: {
|
|
543
1277
|
lib: {
|
|
544
|
-
entry:
|
|
1278
|
+
entry: ut(e, "index", v(e, t), h(v(e, t)), v(e, "manifest.json")),
|
|
545
1279
|
formats: ["es"],
|
|
546
1280
|
fileName: "index",
|
|
547
1281
|
cssFileName: "index"
|
|
548
1282
|
},
|
|
549
|
-
rollupOptions: { external:
|
|
1283
|
+
rollupOptions: { external: Z }
|
|
550
1284
|
}
|
|
551
1285
|
};
|
|
552
1286
|
}
|
|
@@ -555,7 +1289,7 @@ function ve(e) {
|
|
|
555
1289
|
apply: "serve",
|
|
556
1290
|
enforce: "pre",
|
|
557
1291
|
config() {
|
|
558
|
-
let e =
|
|
1292
|
+
let e = X(), t = process.cwd();
|
|
559
1293
|
return { server: { fs: { allow: [
|
|
560
1294
|
e,
|
|
561
1295
|
t,
|
|
@@ -563,7 +1297,7 @@ function ve(e) {
|
|
|
563
1297
|
] } } };
|
|
564
1298
|
},
|
|
565
1299
|
configureServer(e) {
|
|
566
|
-
let t =
|
|
1300
|
+
let t = X(), n = g(t, "preview.html");
|
|
567
1301
|
e.middlewares.use(async (t, r, i) => {
|
|
568
1302
|
if (t.url === "/" || t.url === "/index.html") try {
|
|
569
1303
|
let i = l(n, "utf-8");
|
|
@@ -575,20 +1309,20 @@ function ve(e) {
|
|
|
575
1309
|
});
|
|
576
1310
|
},
|
|
577
1311
|
resolveId(e) {
|
|
578
|
-
if (e ===
|
|
579
|
-
let e =
|
|
580
|
-
return
|
|
1312
|
+
if (e === qe) {
|
|
1313
|
+
let e = X();
|
|
1314
|
+
return Y(g(e, "host.tsx"));
|
|
581
1315
|
}
|
|
582
|
-
if (e ===
|
|
1316
|
+
if (e === Ge) return Ke;
|
|
583
1317
|
},
|
|
584
1318
|
load(e) {
|
|
585
|
-
if (e ===
|
|
1319
|
+
if (e === Ke) return `export { default } from "${Y(v(process.cwd(), t))}";`;
|
|
586
1320
|
}
|
|
587
1321
|
}, i = {
|
|
588
1322
|
name: "glasshome-widget:schema",
|
|
589
1323
|
apply: "build",
|
|
590
1324
|
async closeBundle() {
|
|
591
|
-
|
|
1325
|
+
it(v(process.cwd(), "dist"), "index"), await J({
|
|
592
1326
|
outFile: v(process.cwd(), "dist", "index.js"),
|
|
593
1327
|
hashFile: v(process.cwd(), ".schema-hash"),
|
|
594
1328
|
widgetName: "index",
|
|
@@ -597,15 +1331,15 @@ function ve(e) {
|
|
|
597
1331
|
}
|
|
598
1332
|
};
|
|
599
1333
|
return [
|
|
600
|
-
...
|
|
1334
|
+
...ft(),
|
|
601
1335
|
n,
|
|
602
|
-
|
|
603
|
-
|
|
1336
|
+
Ze(),
|
|
1337
|
+
$e(),
|
|
604
1338
|
i,
|
|
605
1339
|
r
|
|
606
1340
|
];
|
|
607
1341
|
}
|
|
608
|
-
function
|
|
1342
|
+
function gt(e) {
|
|
609
1343
|
let t = e?.srcDir ?? "src", n = e?.outDir ?? "dist", r = [];
|
|
610
1344
|
return [{
|
|
611
1345
|
name: "glasshome-widgets:build",
|
|
@@ -624,7 +1358,7 @@ function ye(e) {
|
|
|
624
1358
|
if (e === "\0glasshome-noop") return "export {}";
|
|
625
1359
|
},
|
|
626
1360
|
async closeBundle() {
|
|
627
|
-
await
|
|
1361
|
+
await mt({
|
|
628
1362
|
srcDir: t,
|
|
629
1363
|
outDir: n,
|
|
630
1364
|
plugins: r
|
|
@@ -633,4 +1367,4 @@ function ye(e) {
|
|
|
633
1367
|
}];
|
|
634
1368
|
}
|
|
635
1369
|
//#endregion
|
|
636
|
-
export {
|
|
1370
|
+
export { Ue as HOOK_READS, Re as MAX_EXAMPLES, We as assertHookReadsDeclared, mt as buildWidgets, Ie as createIntrospectSession, Q as createUiImportTracker, $ as discoverWidgets, rt as dropSelfReferencingVars, pt as generateRegistry, ht as glasshomeWidget, gt as glasshomeWidgets, st as hostStylesUi, G as introspectOnce, Xe as isDirectSyncLayerImportSource, Qe as isDirectUiImportSource, Z as isWidgetExternal, J as runSchemaGuard, at as widgetProjectScanDirs, lt as widgetTailwindEntry };
|