mirror of
https://github.com/penpot/penpot.git
synced 2025-06-24 22:27:01 +02:00
⬆️ Updates plugins runtime
This commit is contained in:
parent
b34c161fc3
commit
1d593e1287
1 changed files with 120 additions and 113 deletions
|
@ -45,12 +45,12 @@ const x = globalThis, {
|
||||||
getOwnPropertyNames: Nt,
|
getOwnPropertyNames: Nt,
|
||||||
getPrototypeOf: G,
|
getPrototypeOf: G,
|
||||||
is: Zr,
|
is: Zr,
|
||||||
isFrozen: uu,
|
isFrozen: du,
|
||||||
isSealed: du,
|
isSealed: fu,
|
||||||
isExtensible: fu,
|
isExtensible: pu,
|
||||||
keys: Co,
|
keys: Co,
|
||||||
prototype: zr,
|
prototype: zr,
|
||||||
seal: pu,
|
seal: hu,
|
||||||
preventExtensions: da,
|
preventExtensions: da,
|
||||||
setPrototypeOf: wr,
|
setPrototypeOf: wr,
|
||||||
values: Ro,
|
values: Ro,
|
||||||
|
@ -180,8 +180,8 @@ const { freeze: ut } = Object, { apply: ja } = Reflect, Ln = (t) => (e, ...r) =>
|
||||||
ut(Xo);
|
ut(Xo);
|
||||||
const {
|
const {
|
||||||
getEnvironmentOption: ce,
|
getEnvironmentOption: ce,
|
||||||
getEnvironmentOptionsList: hu,
|
getEnvironmentOptionsList: mu,
|
||||||
environmentOptionsListHas: mu
|
environmentOptionsListHas: gu
|
||||||
} = Xo(globalThis, !0), Ar = (t) => (t = `${t}`, t.length >= 1 && Go("aeiouAEIOU", t[0]) ? `an ${t}` : `a ${t}`);
|
} = Xo(globalThis, !0), Ar = (t) => (t = `${t}`, t.length >= 1 && Go("aeiouAEIOU", t[0]) ? `an ${t}` : `a ${t}`);
|
||||||
y(Ar);
|
y(Ar);
|
||||||
const Qo = (t, e = void 0) => {
|
const Qo = (t, e = void 0) => {
|
||||||
|
@ -5027,16 +5027,19 @@ function jc(t, e, r, n, o) {
|
||||||
), s.setAttribute("title", t), s.setAttribute("iframe-src", e), o && s.setAttribute("allow-downloads", "true"), document.body.appendChild(s), s;
|
), s.setAttribute("title", t), s.setAttribute("iframe-src", e), o && s.setAttribute("allow-downloads", "true"), document.body.appendChild(s), s;
|
||||||
}
|
}
|
||||||
function zs(t, e = 335, r = 590) {
|
function zs(t, e = 335, r = 590) {
|
||||||
const s = e > window.innerWidth ? window.innerWidth - 290 : e, i = parseInt(
|
var d;
|
||||||
t.style.getPropertyValue("--modal-block-start") || "40",
|
let s = (d = t.shadowRoot) == null ? void 0 : d.querySelector(".wrapper"), i = 0, c = 0;
|
||||||
10
|
if (s) {
|
||||||
), c = window.innerHeight - i;
|
let f = s.getBoundingClientRect();
|
||||||
return e = Math.min(e, s), r = Math.min(r, c), e = Math.max(e, 200), r = Math.max(r, 200), t.wrapper.style.width = `${e}px`, t.wrapper.style.minWidth = `${e}px`, t.wrapper.style.height = `${r}px`, t.wrapper.style.minHeight = `${r}px`, { width: e, height: r };
|
i = f.x, c = f.y;
|
||||||
|
}
|
||||||
|
const l = window.innerWidth - i - 40, u = window.innerHeight - c - 40;
|
||||||
|
return e = Math.min(e, l), r = Math.min(r, u), e = Math.max(e, 200), r = Math.max(r, 200), t.wrapper.style.width = `${e}px`, t.wrapper.style.minWidth = `${e}px`, t.wrapper.style.height = `${r}px`, t.wrapper.style.minHeight = `${r}px`, { width: e, height: r };
|
||||||
}
|
}
|
||||||
const Zc = `
|
const Zc = `
|
||||||
<svg width="16" height="16"xmlns="http://www.w3.org/2000/svg" fill="none"><g class="fills"><rect rx="0" ry="0" width="16" height="16" class="frame-background"/></g><g class="frame-children"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" class="fills"/><g class="strokes"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" style="fill: none; stroke-width: 1; stroke: rgb(143, 157, 163); stroke-opacity: 1; stroke-linecap: round;" class="stroke-shape"/></g></g></svg>`;
|
<svg width="16" height="16"xmlns="http://www.w3.org/2000/svg" fill="none"><g class="fills"><rect rx="0" ry="0" width="16" height="16" class="frame-background"/></g><g class="frame-children"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" class="fills"/><g class="strokes"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" style="fill: none; stroke-width: 1; stroke: rgb(143, 157, 163); stroke-opacity: 1; stroke-linecap: round;" class="stroke-shape"/></g></g></svg>`, zc = 3;
|
||||||
var We, Rt;
|
var We, Rt;
|
||||||
class zc extends HTMLElement {
|
class Bc extends HTMLElement {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
tn(this, We);
|
tn(this, We);
|
||||||
|
@ -5054,7 +5057,7 @@ class zc extends HTMLElement {
|
||||||
(r = at(this, Rt)) == null || r.call(this);
|
(r = at(this, Rt)) == null || r.call(this);
|
||||||
}
|
}
|
||||||
calculateZIndex() {
|
calculateZIndex() {
|
||||||
const r = document.querySelectorAll("plugin-modal"), n = Array.from(r).filter((s) => s !== this).map((s) => Number(s.style.zIndex)), o = Math.max(...n, 0);
|
const r = document.querySelectorAll("plugin-modal"), n = Array.from(r).filter((s) => s !== this).map((s) => Number(s.style.zIndex)), o = Math.max(...n, zc);
|
||||||
this.style.zIndex = (o + 1).toString();
|
this.style.zIndex = (o + 1).toString();
|
||||||
}
|
}
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
|
@ -5108,7 +5111,7 @@ class zc extends HTMLElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
We = new WeakMap(), Rt = new WeakMap();
|
We = new WeakMap(), Rt = new WeakMap();
|
||||||
customElements.define("plugin-modal", zc);
|
customElements.define("plugin-modal", Bc);
|
||||||
var F;
|
var F;
|
||||||
(function(t) {
|
(function(t) {
|
||||||
t.assertEqual = (o) => o;
|
t.assertEqual = (o) => o;
|
||||||
|
@ -5212,7 +5215,7 @@ const b = F.arrayToEnum([
|
||||||
"invalid_intersection_types",
|
"invalid_intersection_types",
|
||||||
"not_multiple_of",
|
"not_multiple_of",
|
||||||
"not_finite"
|
"not_finite"
|
||||||
]), Bc = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
]), Gc = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
||||||
class ye extends Error {
|
class ye extends Error {
|
||||||
get errors() {
|
get errors() {
|
||||||
return this.issues;
|
return this.issues;
|
||||||
|
@ -5330,7 +5333,7 @@ const Mt = (t, e) => {
|
||||||
return { message: r };
|
return { message: r };
|
||||||
};
|
};
|
||||||
let Bs = Mt;
|
let Bs = Mt;
|
||||||
function Gc(t) {
|
function Vc(t) {
|
||||||
Bs = t;
|
Bs = t;
|
||||||
}
|
}
|
||||||
function $r() {
|
function $r() {
|
||||||
|
@ -5356,7 +5359,7 @@ const Nr = (t) => {
|
||||||
path: s,
|
path: s,
|
||||||
message: c
|
message: c
|
||||||
};
|
};
|
||||||
}, Vc = [];
|
}, Hc = [];
|
||||||
function v(t, e) {
|
function v(t, e) {
|
||||||
const r = $r(), n = Nr({
|
const r = $r(), n = Nr({
|
||||||
issueData: e,
|
issueData: e,
|
||||||
|
@ -5687,14 +5690,14 @@ class O {
|
||||||
return this.safeParse(null).success;
|
return this.safeParse(null).success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const Hc = /^c[^\s-]{8,}$/i, Wc = /^[0-9a-z]+$/, qc = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Kc = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Yc = /^[a-z0-9_-]{21}$/i, Jc = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Xc = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Qc = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, el = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
const Wc = /^c[^\s-]{8,}$/i, qc = /^[0-9a-z]+$/, Kc = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Yc = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Jc = /^[a-z0-9_-]{21}$/i, Xc = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Qc = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, el = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, tl = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
||||||
let hn;
|
let hn;
|
||||||
const tl = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, rl = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, nl = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ol = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, sl = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, al = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Vs = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", il = new RegExp(`^${Vs}$`);
|
const rl = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, nl = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ol = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, sl = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, al = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, il = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Vs = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", cl = new RegExp(`^${Vs}$`);
|
||||||
function Hs(t) {
|
function Hs(t) {
|
||||||
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
||||||
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
||||||
}
|
}
|
||||||
function cl(t) {
|
function ll(t) {
|
||||||
return new RegExp(`^${Hs(t)}$`);
|
return new RegExp(`^${Hs(t)}$`);
|
||||||
}
|
}
|
||||||
function Ws(t) {
|
function Ws(t) {
|
||||||
|
@ -5702,11 +5705,11 @@ function Ws(t) {
|
||||||
const r = [];
|
const r = [];
|
||||||
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
||||||
}
|
}
|
||||||
function ll(t, e) {
|
|
||||||
return !!((e === "v4" || !e) && tl.test(t) || (e === "v6" || !e) && nl.test(t));
|
|
||||||
}
|
|
||||||
function ul(t, e) {
|
function ul(t, e) {
|
||||||
if (!Jc.test(t))
|
return !!((e === "v4" || !e) && rl.test(t) || (e === "v6" || !e) && ol.test(t));
|
||||||
|
}
|
||||||
|
function dl(t, e) {
|
||||||
|
if (!Xc.test(t))
|
||||||
return !1;
|
return !1;
|
||||||
try {
|
try {
|
||||||
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), o = JSON.parse(atob(n));
|
const [r] = t.split("."), n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), o = JSON.parse(atob(n));
|
||||||
|
@ -5715,8 +5718,8 @@ function ul(t, e) {
|
||||||
return !1;
|
return !1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function dl(t, e) {
|
function fl(t, e) {
|
||||||
return !!((e === "v4" || !e) && rl.test(t) || (e === "v6" || !e) && ol.test(t));
|
return !!((e === "v4" || !e) && nl.test(t) || (e === "v6" || !e) && sl.test(t));
|
||||||
}
|
}
|
||||||
class Re extends O {
|
class Re extends O {
|
||||||
_parse(e) {
|
_parse(e) {
|
||||||
|
@ -5767,43 +5770,43 @@ class Re extends O {
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
} else if (s.kind === "email")
|
} else if (s.kind === "email")
|
||||||
Qc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
el.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "email",
|
validation: "email",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "emoji")
|
else if (s.kind === "emoji")
|
||||||
hn || (hn = new RegExp(el, "u")), hn.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
hn || (hn = new RegExp(tl, "u")), hn.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "emoji",
|
validation: "emoji",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "uuid")
|
else if (s.kind === "uuid")
|
||||||
Kc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
Yc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "uuid",
|
validation: "uuid",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "nanoid")
|
else if (s.kind === "nanoid")
|
||||||
Yc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
Jc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "nanoid",
|
validation: "nanoid",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "cuid")
|
else if (s.kind === "cuid")
|
||||||
Hc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
Wc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "cuid",
|
validation: "cuid",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "cuid2")
|
else if (s.kind === "cuid2")
|
||||||
Wc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
qc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "cuid2",
|
validation: "cuid2",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty());
|
}), n.dirty());
|
||||||
else if (s.kind === "ulid")
|
else if (s.kind === "ulid")
|
||||||
qc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
Kc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "ulid",
|
validation: "ulid",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
|
@ -5838,35 +5841,35 @@ class Re extends O {
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
validation: "datetime",
|
validation: "datetime",
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "date" ? il.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "date" ? cl.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
validation: "date",
|
validation: "date",
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "time" ? cl(s).test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "time" ? ll(s).test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
validation: "time",
|
validation: "time",
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "duration" ? Xc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "duration" ? Qc.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "duration",
|
validation: "duration",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "ip" ? ll(e.data, s.version) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "ip" ? ul(e.data, s.version) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "ip",
|
validation: "ip",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "jwt" ? ul(e.data, s.alg) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "jwt" ? dl(e.data, s.alg) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "jwt",
|
validation: "jwt",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "cidr" ? dl(e.data, s.version) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "cidr" ? fl(e.data, s.version) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "cidr",
|
validation: "cidr",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "base64" ? sl.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "base64" ? al.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "base64",
|
validation: "base64",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), n.dirty()) : s.kind === "base64url" ? al.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
}), n.dirty()) : s.kind === "base64url" ? il.test(e.data) || (o = this._getOrReturnCtx(e, o), v(o, {
|
||||||
validation: "base64url",
|
validation: "base64url",
|
||||||
code: g.invalid_string,
|
code: g.invalid_string,
|
||||||
message: s.message
|
message: s.message
|
||||||
|
@ -6105,7 +6108,7 @@ Re.create = (t) => {
|
||||||
...N(t)
|
...N(t)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
function fl(t, e) {
|
function pl(t, e) {
|
||||||
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, o = r > n ? r : n, s = parseInt(t.toFixed(o).replace(".", "")), i = parseInt(e.toFixed(o).replace(".", ""));
|
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, o = r > n ? r : n, s = parseInt(t.toFixed(o).replace(".", "")), i = parseInt(e.toFixed(o).replace(".", ""));
|
||||||
return s % i / Math.pow(10, o);
|
return s % i / Math.pow(10, o);
|
||||||
}
|
}
|
||||||
|
@ -6144,7 +6147,7 @@ class tt extends O {
|
||||||
inclusive: s.inclusive,
|
inclusive: s.inclusive,
|
||||||
exact: !1,
|
exact: !1,
|
||||||
message: s.message
|
message: s.message
|
||||||
}), o.dirty()) : s.kind === "multipleOf" ? fl(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), v(n, {
|
}), o.dirty()) : s.kind === "multipleOf" ? pl(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), v(n, {
|
||||||
code: g.not_multiple_of,
|
code: g.not_multiple_of,
|
||||||
multipleOf: s.value,
|
multipleOf: s.value,
|
||||||
message: s.message
|
message: s.message
|
||||||
|
@ -7853,7 +7856,7 @@ Dr.create = (t) => new Dr({
|
||||||
typeName: C.ZodNaN,
|
typeName: C.ZodNaN,
|
||||||
...N(t)
|
...N(t)
|
||||||
});
|
});
|
||||||
const pl = Symbol("zod_brand");
|
const hl = Symbol("zod_brand");
|
||||||
class Hn extends O {
|
class Hn extends O {
|
||||||
_parse(e) {
|
_parse(e) {
|
||||||
const { ctx: r } = this._processInputParams(e), n = r.data;
|
const { ctx: r } = this._processInputParams(e), n = r.data;
|
||||||
|
@ -7930,16 +7933,16 @@ function Ks(t, e = {}, r) {
|
||||||
}
|
}
|
||||||
}) : Lt.create();
|
}) : Lt.create();
|
||||||
}
|
}
|
||||||
const hl = {
|
const ml = {
|
||||||
object: V.lazycreate
|
object: V.lazycreate
|
||||||
};
|
};
|
||||||
var C;
|
var C;
|
||||||
(function(t) {
|
(function(t) {
|
||||||
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
||||||
})(C || (C = {}));
|
})(C || (C = {}));
|
||||||
const ml = (t, e = {
|
const gl = (t, e = {
|
||||||
message: `Input not instance of ${t.name}`
|
message: `Input not instance of ${t.name}`
|
||||||
}) => Ks((r) => r instanceof t, e), Ys = Re.create, Js = tt.create, gl = Dr.create, yl = rt.create, Xs = Kt.create, _l = _t.create, vl = Mr.create, bl = Yt.create, wl = Jt.create, Sl = Lt.create, xl = mt.create, El = Ye.create, kl = Lr.create, Pl = Ne.create, Al = V.create, Tl = V.strictCreate, Il = Xt.create, Cl = Qr.create, Rl = Qt.create, $l = Ze.create, Nl = er.create, Ol = Fr.create, Ml = vt.create, Ll = Ct.create, Fl = tr.create, Dl = rr.create, Ul = nt.create, jl = nr.create, Zl = Ft.create, xo = Oe.create, zl = Ue.create, Bl = ot.create, Gl = Oe.createWithPreprocess, Vl = ur.create, Hl = () => Ys().optional(), Wl = () => Js().optional(), ql = () => Xs().optional(), Kl = {
|
}) => Ks((r) => r instanceof t, e), Ys = Re.create, Js = tt.create, yl = Dr.create, _l = rt.create, Xs = Kt.create, vl = _t.create, bl = Mr.create, wl = Yt.create, Sl = Jt.create, xl = Lt.create, El = mt.create, kl = Ye.create, Pl = Lr.create, Al = Ne.create, Tl = V.create, Il = V.strictCreate, Cl = Xt.create, Rl = Qr.create, $l = Qt.create, Nl = Ze.create, Ol = er.create, Ml = Fr.create, Ll = vt.create, Fl = Ct.create, Dl = tr.create, Ul = rr.create, jl = nt.create, Zl = nr.create, zl = Ft.create, xo = Oe.create, Bl = Ue.create, Gl = ot.create, Vl = Oe.createWithPreprocess, Hl = ur.create, Wl = () => Ys().optional(), ql = () => Js().optional(), Kl = () => Xs().optional(), Yl = {
|
||||||
string: (t) => Re.create({ ...t, coerce: !0 }),
|
string: (t) => Re.create({ ...t, coerce: !0 }),
|
||||||
number: (t) => tt.create({ ...t, coerce: !0 }),
|
number: (t) => tt.create({ ...t, coerce: !0 }),
|
||||||
boolean: (t) => Kt.create({
|
boolean: (t) => Kt.create({
|
||||||
|
@ -7948,14 +7951,14 @@ const ml = (t, e = {
|
||||||
}),
|
}),
|
||||||
bigint: (t) => rt.create({ ...t, coerce: !0 }),
|
bigint: (t) => rt.create({ ...t, coerce: !0 }),
|
||||||
date: (t) => _t.create({ ...t, coerce: !0 })
|
date: (t) => _t.create({ ...t, coerce: !0 })
|
||||||
}, Yl = $;
|
}, Jl = $;
|
||||||
var K = /* @__PURE__ */ Object.freeze({
|
var K = /* @__PURE__ */ Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
defaultErrorMap: Mt,
|
defaultErrorMap: Mt,
|
||||||
setErrorMap: Gc,
|
setErrorMap: Vc,
|
||||||
getErrorMap: $r,
|
getErrorMap: $r,
|
||||||
makeIssue: Nr,
|
makeIssue: Nr,
|
||||||
EMPTY_PATH: Vc,
|
EMPTY_PATH: Hc,
|
||||||
addIssueToContext: v,
|
addIssueToContext: v,
|
||||||
ParseStatus: oe,
|
ParseStatus: oe,
|
||||||
INVALID: $,
|
INVALID: $,
|
||||||
|
@ -8009,63 +8012,63 @@ var K = /* @__PURE__ */ Object.freeze({
|
||||||
ZodDefault: or,
|
ZodDefault: or,
|
||||||
ZodCatch: sr,
|
ZodCatch: sr,
|
||||||
ZodNaN: Dr,
|
ZodNaN: Dr,
|
||||||
BRAND: pl,
|
BRAND: hl,
|
||||||
ZodBranded: Hn,
|
ZodBranded: Hn,
|
||||||
ZodPipeline: ur,
|
ZodPipeline: ur,
|
||||||
ZodReadonly: ar,
|
ZodReadonly: ar,
|
||||||
custom: Ks,
|
custom: Ks,
|
||||||
Schema: O,
|
Schema: O,
|
||||||
ZodSchema: O,
|
ZodSchema: O,
|
||||||
late: hl,
|
late: ml,
|
||||||
get ZodFirstPartyTypeKind() {
|
get ZodFirstPartyTypeKind() {
|
||||||
return C;
|
return C;
|
||||||
},
|
},
|
||||||
coerce: Kl,
|
coerce: Yl,
|
||||||
any: Sl,
|
any: xl,
|
||||||
array: Pl,
|
array: Al,
|
||||||
bigint: yl,
|
bigint: _l,
|
||||||
boolean: Xs,
|
boolean: Xs,
|
||||||
date: _l,
|
date: vl,
|
||||||
discriminatedUnion: Cl,
|
discriminatedUnion: Rl,
|
||||||
effect: xo,
|
effect: xo,
|
||||||
enum: Ul,
|
enum: jl,
|
||||||
function: Ll,
|
function: Fl,
|
||||||
instanceof: ml,
|
instanceof: gl,
|
||||||
intersection: Rl,
|
intersection: $l,
|
||||||
lazy: Fl,
|
lazy: Dl,
|
||||||
literal: Dl,
|
literal: Ul,
|
||||||
map: Ol,
|
map: Ml,
|
||||||
nan: gl,
|
nan: yl,
|
||||||
nativeEnum: jl,
|
nativeEnum: Zl,
|
||||||
never: El,
|
never: kl,
|
||||||
null: wl,
|
null: Sl,
|
||||||
nullable: Bl,
|
nullable: Gl,
|
||||||
number: Js,
|
number: Js,
|
||||||
object: Al,
|
object: Tl,
|
||||||
oboolean: ql,
|
oboolean: Kl,
|
||||||
onumber: Wl,
|
onumber: ql,
|
||||||
optional: zl,
|
optional: Bl,
|
||||||
ostring: Hl,
|
ostring: Wl,
|
||||||
pipeline: Vl,
|
pipeline: Hl,
|
||||||
preprocess: Gl,
|
preprocess: Vl,
|
||||||
promise: Zl,
|
promise: zl,
|
||||||
record: Nl,
|
record: Ol,
|
||||||
set: Ml,
|
set: Ll,
|
||||||
strictObject: Tl,
|
strictObject: Il,
|
||||||
string: Ys,
|
string: Ys,
|
||||||
symbol: vl,
|
symbol: bl,
|
||||||
transformer: xo,
|
transformer: xo,
|
||||||
tuple: $l,
|
tuple: Nl,
|
||||||
undefined: bl,
|
undefined: wl,
|
||||||
union: Il,
|
union: Cl,
|
||||||
unknown: xl,
|
unknown: El,
|
||||||
void: kl,
|
void: Pl,
|
||||||
NEVER: Yl,
|
NEVER: Jl,
|
||||||
ZodIssueCode: g,
|
ZodIssueCode: g,
|
||||||
quotelessJson: Bc,
|
quotelessJson: Gc,
|
||||||
ZodError: ye
|
ZodError: ye
|
||||||
});
|
});
|
||||||
const Jl = K.object({
|
const Xl = K.object({
|
||||||
pluginId: K.string(),
|
pluginId: K.string(),
|
||||||
name: K.string(),
|
name: K.string(),
|
||||||
host: K.string().url(),
|
host: K.string().url(),
|
||||||
|
@ -8081,16 +8084,17 @@ const Jl = K.object({
|
||||||
"user:read",
|
"user:read",
|
||||||
"comment:read",
|
"comment:read",
|
||||||
"comment:write",
|
"comment:write",
|
||||||
"allow:downloads"
|
"allow:downloads",
|
||||||
|
"allow:localstorage"
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
function Qs(t, e) {
|
function Qs(t, e) {
|
||||||
return new URL(e, t).toString();
|
return new URL(e, t).toString();
|
||||||
}
|
}
|
||||||
function Xl(t) {
|
function Ql(t) {
|
||||||
return fetch(t).then((e) => e.json()).then((e) => {
|
return fetch(t).then((e) => e.json()).then((e) => {
|
||||||
if (!Jl.safeParse(e).success)
|
if (!Xl.safeParse(e).success)
|
||||||
throw new Error("Invalid plugin manifest");
|
throw new Error("Invalid plugin manifest");
|
||||||
return e;
|
return e;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
|
@ -8107,14 +8111,14 @@ function Eo(t) {
|
||||||
const ea = K.object({
|
const ea = K.object({
|
||||||
width: K.number().positive(),
|
width: K.number().positive(),
|
||||||
height: K.number().positive()
|
height: K.number().positive()
|
||||||
}), Ql = K.function().args(
|
}), eu = K.function().args(
|
||||||
K.string(),
|
K.string(),
|
||||||
K.string(),
|
K.string(),
|
||||||
K.enum(["dark", "light"]),
|
K.enum(["dark", "light"]),
|
||||||
ea.optional(),
|
ea.optional(),
|
||||||
K.boolean().optional()
|
K.boolean().optional()
|
||||||
).implement((t, e, r, n, o) => jc(t, e, r, n, o));
|
).implement((t, e, r, n, o) => jc(t, e, r, n, o));
|
||||||
async function eu(t, e, r, n) {
|
async function tu(t, e, r, n) {
|
||||||
let o = await Eo(e), s = !1, i = !1, c = null, l = [];
|
let o = await Eo(e), s = !1, i = !1, c = null, l = [];
|
||||||
const u = /* @__PURE__ */ new Set(), d = !!e.permissions.find(
|
const u = /* @__PURE__ */ new Set(), d = !!e.permissions.find(
|
||||||
(I) => I === "allow:downloads"
|
(I) => I === "allow:downloads"
|
||||||
|
@ -8138,7 +8142,7 @@ async function eu(t, e, r, n) {
|
||||||
m(), o = await Eo(e), n(o);
|
m(), o = await Eo(e), n(o);
|
||||||
}, w = (I, L, Z) => {
|
}, w = (I, L, Z) => {
|
||||||
const se = t.theme, J = Qs(e.host, L);
|
const se = t.theme, J = Qs(e.host, L);
|
||||||
(c == null ? void 0 : c.getAttribute("iframe-src")) !== J && (c = Ql(I, J, se, Z, d), c.setTheme(se), c.addEventListener("close", A, {
|
(c == null ? void 0 : c.getAttribute("iframe-src")) !== J && (c = eu(I, J, se, Z, d), c.setTheme(se), c.addEventListener("close", A, {
|
||||||
once: !0
|
once: !0
|
||||||
}), c.addEventListener("load", S));
|
}), c.addEventListener("load", S));
|
||||||
}, R = (I) => {
|
}, R = (I) => {
|
||||||
|
@ -8182,7 +8186,7 @@ async function eu(t, e, r, n) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const tu = [
|
const ru = [
|
||||||
"finish",
|
"finish",
|
||||||
"pagechange",
|
"pagechange",
|
||||||
"filechange",
|
"filechange",
|
||||||
|
@ -8191,7 +8195,7 @@ const tu = [
|
||||||
"shapechange",
|
"shapechange",
|
||||||
"contentsave"
|
"contentsave"
|
||||||
];
|
];
|
||||||
function ru(t) {
|
function nu(t) {
|
||||||
const e = (n) => {
|
const e = (n) => {
|
||||||
if (!t.manifest.permissions.includes(n))
|
if (!t.manifest.permissions.includes(n))
|
||||||
throw new Error(`Permission ${n} is not granted`);
|
throw new Error(`Permission ${n} is not granted`);
|
||||||
|
@ -8258,7 +8262,7 @@ function ru(t) {
|
||||||
t.close();
|
t.close();
|
||||||
},
|
},
|
||||||
on(n, o, s) {
|
on(n, o, s) {
|
||||||
return K.enum(tu).parse(n), K.function().parse(o), e("content:read"), t.registerListener(n, o, s);
|
return K.enum(ru).parse(n), K.function().parse(o), e("content:read"), t.registerListener(n, o, s);
|
||||||
},
|
},
|
||||||
off(n) {
|
off(n) {
|
||||||
t.destroyListener(n);
|
t.destroyListener(n);
|
||||||
|
@ -8306,6 +8310,9 @@ function ru(t) {
|
||||||
get theme() {
|
get theme() {
|
||||||
return t.context.theme;
|
return t.context.theme;
|
||||||
},
|
},
|
||||||
|
get localStorage() {
|
||||||
|
return e("allow:localstorage"), t.context.localStorage;
|
||||||
|
},
|
||||||
createBoard() {
|
createBoard() {
|
||||||
return e("content:write"), t.context.createBoard();
|
return e("content:write"), t.context.createBoard();
|
||||||
},
|
},
|
||||||
|
@ -8386,9 +8393,9 @@ const k = {
|
||||||
return t == null ? t : harden(t);
|
return t == null ? t : harden(t);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function nu(t) {
|
function ou(t) {
|
||||||
k.hardenIntrinsics();
|
k.hardenIntrinsics();
|
||||||
const e = ru(t), r = {
|
const e = nu(t), r = {
|
||||||
get(c, l, u) {
|
get(c, l, u) {
|
||||||
const d = Reflect.get(c, l, u);
|
const d = Reflect.get(c, l, u);
|
||||||
return typeof d == "function" ? function(...f) {
|
return typeof d == "function" ? function(...f) {
|
||||||
|
@ -8492,14 +8499,14 @@ function nu(t) {
|
||||||
compartment: i
|
compartment: i
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
async function ou(t, e, r) {
|
async function su(t, e, r) {
|
||||||
const n = async () => {
|
const n = async () => {
|
||||||
try {
|
try {
|
||||||
s.evaluate();
|
s.evaluate();
|
||||||
} catch (i) {
|
} catch (i) {
|
||||||
console.error(i), o.close();
|
console.error(i), o.close();
|
||||||
}
|
}
|
||||||
}, o = await eu(
|
}, o = await tu(
|
||||||
t,
|
t,
|
||||||
e,
|
e,
|
||||||
function() {
|
function() {
|
||||||
|
@ -8508,7 +8515,7 @@ async function ou(t, e, r) {
|
||||||
function() {
|
function() {
|
||||||
n();
|
n();
|
||||||
}
|
}
|
||||||
), s = nu(o);
|
), s = ou(o);
|
||||||
return n(), {
|
return n(), {
|
||||||
plugin: o,
|
plugin: o,
|
||||||
manifest: e,
|
manifest: e,
|
||||||
|
@ -8516,7 +8523,7 @@ async function ou(t, e, r) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
let gt = [], An = null;
|
let gt = [], An = null;
|
||||||
function su(t) {
|
function au(t) {
|
||||||
An = t;
|
An = t;
|
||||||
}
|
}
|
||||||
const Po = () => {
|
const Po = () => {
|
||||||
|
@ -8532,13 +8539,13 @@ window.addEventListener("message", (t) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const au = async function(t, e) {
|
const iu = async function(t, e) {
|
||||||
try {
|
try {
|
||||||
const r = An && An(t.pluginId);
|
const r = An && An(t.pluginId);
|
||||||
if (!r)
|
if (!r)
|
||||||
return;
|
return;
|
||||||
Po();
|
Po();
|
||||||
const n = await ou(
|
const n = await su(
|
||||||
k.harden(r),
|
k.harden(r),
|
||||||
t,
|
t,
|
||||||
() => {
|
() => {
|
||||||
|
@ -8550,11 +8557,11 @@ const au = async function(t, e) {
|
||||||
Po(), console.error(r);
|
Po(), console.error(r);
|
||||||
}
|
}
|
||||||
}, ta = async function(t, e) {
|
}, ta = async function(t, e) {
|
||||||
au(t, e);
|
iu(t, e);
|
||||||
}, iu = async function(t) {
|
}, cu = async function(t) {
|
||||||
const e = await Xl(t);
|
const e = await Ql(t);
|
||||||
ta(e);
|
ta(e);
|
||||||
}, cu = function(t) {
|
}, lu = function(t) {
|
||||||
const e = gt.find((r) => r.manifest.pluginId === t);
|
const e = gt.find((r) => r.manifest.pluginId === t);
|
||||||
e && e.plugin.close();
|
e && e.plugin.close();
|
||||||
};
|
};
|
||||||
|
@ -8570,7 +8577,7 @@ repairIntrinsics({
|
||||||
const Ao = globalThis;
|
const Ao = globalThis;
|
||||||
Ao.initPluginsRuntime = (t) => {
|
Ao.initPluginsRuntime = (t) => {
|
||||||
try {
|
try {
|
||||||
console.log("%c[PLUGINS] Initialize runtime", "color: #008d7c"), su(t), Ao.ɵcontext = t("TEST"), globalThis.ɵloadPlugin = ta, globalThis.ɵloadPluginByUrl = iu, globalThis.ɵunloadPlugin = cu;
|
console.log("%c[PLUGINS] Initialize runtime", "color: #008d7c"), au(t), Ao.ɵcontext = t("TEST"), globalThis.ɵloadPlugin = ta, globalThis.ɵloadPluginByUrl = cu, globalThis.ɵunloadPlugin = lu;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue