@sencha/reext
Version:
ReExt - Sencha Ext JS components in React
1,531 lines • 70 kB
JavaScript
"use client";
import e, { useEffect as t, useRef as n, useState as r } from "react";
import { createPortal as i } from "react-dom";
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
//#region \0rolldown/runtime.js
var c = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
if (typeof require < "u") return require.apply(this, arguments);
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
}), l = "1.2.75";
//#endregion
//#region src/lib/compareOldAndNewProps.js
function u(e, t) {
if (e === t) return !0;
if (e == null || t == null) return e === t;
if (typeof e != typeof t) return !1;
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
if (Array.isArray(e) && Array.isArray(t)) {
if (e.length !== t.length) return !1;
for (let n = 0; n < e.length; n++) if (!u(e[n], t[n])) return !1;
return !0;
}
if (e instanceof Object && t instanceof Object) {
let n = Object.keys(e), r = Object.keys(t);
if (n.length !== r.length) return !1;
for (let r of n) if (!t.hasOwnProperty(r) || !u(e[r], t[r])) return !1;
return !0;
}
return !1;
}
function d(e) {
try {
let t = [], n = JSON.stringify(e, function(e, n) {
if (typeof n == "object" && n) {
if (t.indexOf(n) !== -1) return;
t.push(n);
}
return n;
});
return t = null, n;
} catch (e) {
return console.log("stringify error", e), "";
}
}
var f = (e) => {
var t = null;
return e.slice(0, 2) === "on" && e.charAt(2) === e.charAt(2).toUpperCase() && (t = e.slice(2).toLowerCase()), window.Ext.isClassic === !0 && t === "tap" && (t = "click"), t;
}, p = (e, t, n) => {
if (!(typeof window > "u")) {
var r = (e) => "set" + (e.charAt(0).toUpperCase() + e.slice(1)), i;
window.Ext.isClassic === !0 ? t === "items" ? (e.removeAll(!0), e.add(n)) : t !== "layout" && (i = r(t), e[i] === void 0 ? e[t] = n : e[i](n)) : (i = r(t), e[i] !== void 0 && e[i](n));
}
};
function m(e, t, n, r, i) {
try {
delete t.children, delete n.children;
for (let [e] of Object.entries(t)) {
if (f(e) != null || e === "xtype" || e === "items") return;
n[e] !== void 0 && n[e] !== null && n[e].listeners !== void 0 && delete n[e].listeners, t[e] !== void 0 && t[e] !== null && t[e].listeners !== void 0 && delete t[e].listeners;
let i;
if (e === "series") i = !0;
else {
var a = d(n[e]);
i = u(d(t[e]), a);
}
i === !1 && (e === "store" ? r.reconfigure && r.reconfigure(n[e]) : p(r, e, n[e]));
}
} catch (e) {
console.log("compareOldAndNewProps error", e);
}
}
//#endregion
//#region src/lib/getconfig.js
var h = (e) => {
var t = null;
return e.slice(0, 2) === "on" && e.charAt(2) === e.charAt(2).toUpperCase() && (t = e.slice(2).toLowerCase()), window.Ext.isClassic === !0 && t === "tap" && (t = "click"), t;
}, g = (e, t, n, r) => {
if (!(typeof window > "u")) {
var i = {};
if (i.xtype = e, t !== void 0) for (let [e, n] of Object.entries(t)) i[e] = n;
if (n.references === !0 && (i.controller = window.Ext.create("Ext.app.ViewController")), i.store !== void 0 && (i.store.listeners === void 0 ? i.store.listeners = { load: (e) => {
n.storeloaded !== void 0 && n.storeloaded(e, r()), n.onStoreloaded !== void 0 && n.onStoreloaded(e, r());
} } : i.store.listeners.load === void 0 && (i.store.listeners.load = (e) => {
n.storeloaded !== void 0 && n.storeloaded(e, r()), n.onStoreloaded !== void 0 && n.onStoreloaded(e, r());
})), i.listeners === void 0) {
i.listeners = {};
for (let [e, t] of Object.entries(n)) {
var a = h(e);
a !== null && (i.listeners[a] = function() {
t(...arguments);
});
}
Object.keys(i.listeners).length === 0 && delete i.listeners;
}
return i;
}
}, _ = (e, t, n, r, i) => {
var a = [];
if (!(typeof window > "u")) {
var o = [], s = [], c = [];
if (e === void 0) return { childarray: [] };
e.length === void 0 ? o.push(e) : o = e, t.length === void 0 ? s.push(t) : s = t;
var l = 0;
try {
return o.forEach((e, t) => {
if (s[t], n.xtype !== "tabpanel") {
var u = e.props.childHeight, d = e.props.childWidth, f = e.props.childFlex, p = e.props.childRegion, m = e.props.childSplit;
let t = {};
t.xtype = "container", t.layout = "fit", t.name = "portalcontainer", t.cls = "portalcontainer";
var h = !1;
u !== void 0 && (t.height = u, h = !0), d !== void 0 && (t.width = d, h = !0), h === !1 && (f === void 0 ? t.flex = 1 : t.flex = f), p !== void 0 && (t.region = p), m !== void 0 && (t.split = m), t.items = [{
xtype: "container",
layout: "fit",
name: "portalroot",
cls: "portalroot",
style: {
flex: 1,
display: "flex",
height: "100%",
width: "100%"
},
listeners: { render: (e) => {
c.push(e.el.dom), l++, l === o.length && i(c);
var t = e.el.dom.parentNode;
r.observe(t);
} }
}], a.push(t);
}
if (n.xtype == "tabpanel") {
var g = window.Ext.ReExtTheme === "classic" ? "Ext.panel.Panel" : "Ext.Panel", _ = window.Ext.create(g, {
layout: "fit",
title: e.props.title,
cls: "ReExtTabChildRoot",
items: [{
xtype: "component",
listeners: {
activate: (e) => {
c.push(e.el.dom), l++, l === o.length && i(c);
var t = e.el.dom.parentNode;
r.observe(t);
},
render: (e) => {
c.push(e.el.dom), l++, l === o.length && i(c);
var t = e.el.dom.parentNode;
r.observe(t);
}
},
style: {
display: "flex",
height: "100%",
width: "100%"
}
}]
});
a.push(_);
}
}), a.length > 0 && (n.removeAll(), n.add(a)), { childarray: a };
} catch (e) {
return console.error("iteratechildren:", e.toString()), [];
}
}
}, v = () => {
var e;
return typeof ResizeObserver < "u" ? (e = new ResizeObserver((e) => {
if (!(typeof window > "u")) for (let r of e) {
var t = r.target.children.item(0);
if (t !== null && r.contentBoxSize) {
let e = r.contentBoxSize[0];
var n = e.inlineSize;
window.Ext.getCmp(t.id) === void 0 ? t.classList.contains("wm") || (console.log("child not found", t.id), t.getAttribute("w") !== "w" && console.warn("child not resized", t)) : (window.Ext.getCmp(t.id).setWidth(n), window.Ext.getCmp(t.id).setHeight(e.blockSize));
}
}
}), e) : null;
};
//#endregion
//#region src/lib/untilextloaded.js
async function y() {
return await new Promise((e) => {
function t() {
window.Ext !== void 0 && window.Ext.onReady(function() {
return clearInterval(n), e(1);
});
}
var n = setInterval(t, 5);
});
}
//#endregion
//#region src/lib/watermark.js
var b = (e, t, n) => {
if (typeof window > "u") return;
let r = document.createElement("div");
r.style.display = "block !important", r.style.zIndex = 2e4, r.style.position = "absolute", r.style.bottom = "0px", r.style.right = "0px", r.style.color = "white", r.style.fontSize = "10px", r.style.fontWeight = "bold", r.style.fontStyle = "italic", r.style.background = "#B87333", r.style.padding = "1px 3px 1px 1px", r.style.border = "1px solid lightgray", r.style.borderRadius = "3px 3px 3px 3px", r.innerText = "ReExt " + t, n === null ? e.el !== void 0 && e.el.dom.appendChild(r) : n.appendChild(r);
};
//#endregion
//#region src/lib/doLogo.jsx
function x(e, t, n, r) {
var i = null;
try {
i = c("next/package.json").version;
} catch {}
var a = "", l = "", u = "", d = "";
return window.Ext !== void 0 && window.Ext.versions !== null && window.Ext.versions !== void 0 && (l = window.Ext.versions.core.version, d = window.Ext.ReExtTheme, a = window.Ext.ReExtLocation, u = window.Ext.isClassic === !0 ? "classic" : "modern"), n === "trial" && `${n}`, /* @__PURE__ */ s("div", {
name: "ReExtRootLogo",
"data-rid": e.rid,
style: {
display: "flex",
flexDirection: e.flexdirection,
alignItems: "center",
color: "black",
padding: 5,
...e.style
},
children: [/* @__PURE__ */ o("img", {
alt: "ReExt",
style: {
height: 40,
width: 80
},
src: "./ReExt.png"
}), /* @__PURE__ */ s("div", {
style: { margin: "0 0 0 3px" },
children: [
/* @__PURE__ */ o("div", {
style: {
margin: "0 0 0 1px",
fontSize: 12,
color: "black"
},
children: /* @__PURE__ */ o("a", {
xstyle: e.style,
target: "_blank",
rel: "noreferrer",
href: "https://www.npmjs.com/package/@sencha/reext",
children: /* @__PURE__ */ s("i", { children: ["ReExt ", t] })
})
}),
/* @__PURE__ */ o("div", { style: {
fontSize: "10px",
margin: "2px 0 0 0"
} }),
/* @__PURE__ */ o("div", {
style: {
fontSize: "10px",
margin: "2px 0 0 0"
},
children: /* @__PURE__ */ s("span", {
style: { margin: "0 0 0 0" },
children: ["React: ", /* @__PURE__ */ o("b", { children: r.version })]
})
}),
/* @__PURE__ */ o("div", {
style: {
fontSize: "10px",
margin: "2px 0 0 0"
},
children: /* @__PURE__ */ s("span", {
style: { margin: "0 0 0 0" },
children: [
"ExtJS:",
" ",
/* @__PURE__ */ s("b", { children: [
l,
" (",
a,
")"
] })
]
})
}),
i !== null && /* @__PURE__ */ o("div", {
style: {
fontSize: "10px",
margin: "2px 0 0 0"
},
children: /* @__PURE__ */ s("span", {
style: { margin: "0 0 0 0" },
children: ["Next.js: ", /* @__PURE__ */ o("b", { children: i })]
})
}),
/* @__PURE__ */ s("div", {
style: {
fontSize: "10px",
margin: "2px 0 0 0"
},
children: [/* @__PURE__ */ s("span", {
style: { margin: "0 0 0 0" },
children: ["toolkit: ", /* @__PURE__ */ o("b", { children: u })]
}), /* @__PURE__ */ s("span", {
style: { margin: "0 0 0 5px" },
children: ["theme: ", /* @__PURE__ */ o("b", { children: d })]
})]
})
]
})]
});
}
//#endregion
//#region src/lib/getProps.js
function S(e) {
var t = [];
t = Array.isArray(e) ? e : [e];
var n = [];
for (let e of t) {
var r = { ...e.props };
if (delete r.listeners, e.type.name === void 0 ? r.name = e.type : r.name = e.type.name, r.name.startsWith("ReExt")) {
if (r.children !== void 0) {
var i = [];
i = Array.isArray(r.children) ? r.children : [r.children], r.children = S(i);
}
n.push(r);
} else delete r.children, n.push(r);
}
return n;
}
//#endregion
//#region src/lib/stringify.js
function C(e) {
try {
let t = [], n = JSON.stringify(e, function(e, n) {
if (typeof n == "object" && n) {
if (t.indexOf(n) !== -1) return;
t.push(n);
}
return n;
});
return t = null, n;
} catch (e) {
return console.log("stringify error", e), "";
}
}
//#endregion
//#region src/lib/isEqual.js
function w(e, t) {
if (e === t) return !0;
if (e == null || t == null) return e === t;
if (typeof e != typeof t) return !1;
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
if (Array.isArray(e) && Array.isArray(t)) {
if (e.length !== t.length) return !1;
for (let n = 0; n < e.length; n++) if (!w(e[n], t[n])) return !1;
return !0;
}
if (e instanceof Object && t instanceof Object) {
let n = Object.keys(e), r = Object.keys(t);
if (n.length !== r.length) return !1;
for (let r of n) if (!t.hasOwnProperty(r) || !w(e[r], t[r])) return !1;
return !0;
}
return !1;
}
//#endregion
//#region src/lib/ReExt.jsx
var T = (a) => {
if (typeof window > "u") return;
if (a.xtype === "window") return null;
var s = window.tt;
let [c, u] = r(null), [d, f] = r(null), [p, h] = r(null), [T, E] = r(null), D = n(null);
D.current = T;
let O = () => D.current, [k, A] = r(null), [j, M] = r(null), [N, P] = r(null), F = n(null);
F.current = j;
let I = () => F.current, L = n(null);
var R = v();
if (a.xtype === "logo") return x(a, l, s, e);
if (t(() => {
P(a.style), M(a.config), A(a.children);
var e, t = "false";
if (!(typeof window > "u")) return (async () => {
if (await y(), t === "false" && a.xtype !== "logo") {
var n = I() == null ? a.config : I();
try {
var r = g(a.xtype, n, a, O);
if (Ext.ClassManager.getByAlias("widget." + r.xtype) === void 0 && (r = {
xtype: "label",
text: "ReExt " + r.xtype + " could not be created",
style: {
color: "red",
background: "lightgray"
}
}), r.height === void 0 && r.xtype !== "window" && (window.Ext.isClassic === !0 && r.xtype === "grid" ? r.height = 0 : r.height = "100%"), r.width === void 0 && r.xtype !== "window" && (window.Ext.isClassic === !0 && r.xtype === "grid" ? r.width = 0 : r.width = "100%"), window.Ext.isClassic === !0) {
let e = (e) => {
var t = e.el.dom.parentNode;
R.observe(t);
};
r.listeners === void 0 ? r.listeners = { boxready: e } : r.listeners.boxready = e;
}
if (r.xtype !== "window" && (r.renderTo = L.current), r.xtype === "tabpanel" && (r.deferredRender = !1), (r.xtype === "panel" || r.xtype === "container") && r.layout === void 0 && (r.layout = {
type: "vbox",
align: "stretch"
}), e = window.Ext.create(r), E(e), D.current = e, r.xtype.startsWith("d3-")) {
var i = L.current;
R.observe(i);
}
a.config !== void 0 && a.config.reference !== void 0 && a.ReExtParent !== void 0 && (a.ReExtParent.ReExtChildren === void 0 && (a.ReExtParent.ReExtChildren = []), a.ReExtParent.ReExtChildren.push(e)), s !== null && s !== "licensed" && b(e, r.xtype, L.current), _(a.children, {}, D.current, R, u), A(a.children), a.ready !== void 0 && a.ready(e);
} catch (e) {
console.error("ReExt.jsx:", e);
}
}
})(), () => {
t = "true", !(typeof window > "u") && window.Ext !== void 0 && window.Ext.destroy !== void 0 && e != null && (E(null), window.Ext.destroy(e));
};
}, []), t(() => {
if (!(typeof window > "u") && (M(a.config), a.config !== void 0 && D.current !== null)) {
var e = F.current, t = a.config, n = D.current;
m("config", e, t, n, a.xtype);
}
}, [a.config, D.current]), t(() => {
if (!(typeof window > "u") && a.children !== void 0 && k !== null && D.current !== null) {
if (a.children.length !== k.length) _(a.children, k, D.current, R, u);
else {
var e = S(a.children), t = S(k);
function r(e, t) {
let n = [];
function r(e, t, i = "") {
new Set([...Object.keys(e), ...Object.keys(t)]).forEach((a) => {
let o = e[a], s = t[a], c = i ? `${i}.${a}` : a;
typeof o == "object" && o && typeof s == "object" && s ? r(o, s, c) : o !== s && n.push(c);
});
}
return e.forEach((e, n) => {
let i = t[n];
r(e, i, `index${n}`);
}), n;
}
var n = C(e);
w(C(t), n) || r(e, t).some((e) => e.includes("childRegion") || e.includes("childSplit") || e.includes("childHeight") || e.includes("childWidth")) && _(a.children, k, D.current, R, u);
}
A(a.children);
}
}, [a.children, D.current]), t(() => {
if (!(typeof window > "u")) {
var e = {};
a.flex === void 0 ? a.rootStyle === void 0 || a.rootStyle.flex === void 0 ? e.flex = 1 : e.flex = a.rootStyle.flex : e.flex = a.flex;
var t = {};
a.style !== void 0 && (t = a.style), a.rootStyle !== void 0 && (t = a.rootStyle), t.width !== void 0 && delete e.flex, f({
...e,
...t,
position: "relative",
display: "flex",
overflow: "hidden"
});
var n = "";
a.className !== void 0 && (n = a.className), a.rootClassName !== void 0 && (n = a.rootClassName), h(n);
}
}, [
c,
a.style,
a.rootStyle,
a.className,
a.rootClassName
]), d !== null && p !== null) return /* @__PURE__ */ o("div", {
name: "ReExtRoot-" + a.xtype,
"data-rid": a.rid,
className: p,
style: d,
ref: L,
children: c !== null && c.map((t, n) => {
if (c.length === 1) {
if (a.children.length !== void 0) return;
var r = a.children, o = {};
o = r.props === void 0 || r.props.style === void 0 ? {
display: "flex",
flex: 1
} : {
...r.props.style,
flex: 1
};
var s = e.cloneElement(r, { style: o }), l = i(s, t);
return l;
} else {
if (c.length !== a.children.length) return;
var r = a.children[n], o = {};
o = r.props === void 0 || r.props.style === void 0 ? {
display: "flex",
flex: 1
} : {
...r.props.style,
flex: 1
};
var s = e.cloneElement(r, { style: o }), l = i(s, t);
return l;
}
})
});
}, E = Object.defineProperty, D = (e, t) => E(e, "name", {
value: t,
configurable: !0
});
async function O() {
if (typeof window > "u") return;
function e(e) {
e.style.width = "100%", e.style.height = "100%", e.style.margin = "0", e.style.padding = "0", e.style.padding = "0", e.style.boxSizing = "border-box", e.style.overflow = "hidden";
}
D(e, "doFill"), document.documentElement && e(document.documentElement), document.body && e(document.body), document.getElementById("root") && e(document.getElementById("root"));
}
D(O, "Fill");
//#endregion
//#region src/lib/ReExtSplash.jsx
function k() {
return /* @__PURE__ */ o("div", {
className: "splash",
style: {
fontSize: "36px",
border: "10px solid #0960a5",
width: "100%",
height: "100%",
margin: 0,
padding: 0,
boxSizing: "border-box",
overflow: "hidden",
display: "flex",
flexDirection: "column",
flex: 1,
justifyContent: "center",
alignItems: "center"
},
children: /* @__PURE__ */ o("img", {
alt: "ReExt",
style: {
height: 500,
width: 1e3
},
src: "./ReExt.png"
})
});
}
var A = ((e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports))(() => {}), j = crypto, M = (e) => e instanceof CryptoKey, N = new TextEncoder(), P = new TextDecoder();
function F(...e) {
let t = e.reduce((e, { length: t }) => e + t, 0), n = new Uint8Array(t), r = 0;
for (let t of e) n.set(t, r), r += t.length;
return n;
}
var I = (e) => {
let t = atob(e), n = new Uint8Array(t.length);
for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
return n;
}, L = (e) => {
let t = e;
t instanceof Uint8Array && (t = P.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
try {
return I(t);
} catch {
throw TypeError("The input to be decoded is not correctly encoded.");
}
}, R = class extends Error {
static get code() {
return "ERR_JOSE_GENERIC";
}
constructor(e) {
super(e), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
}
}, z = class extends R {
static get code() {
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
}
constructor(e, t, n = "unspecified", r = "unspecified") {
super(e), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = n, this.reason = r, this.payload = t;
}
}, ee = class extends R {
static get code() {
return "ERR_JWT_EXPIRED";
}
constructor(e, t, n = "unspecified", r = "unspecified") {
super(e), this.code = "ERR_JWT_EXPIRED", this.claim = n, this.reason = r, this.payload = t;
}
}, te = class extends R {
constructor() {
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
}
static get code() {
return "ERR_JOSE_ALG_NOT_ALLOWED";
}
}, B = class extends R {
constructor() {
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
}
static get code() {
return "ERR_JOSE_NOT_SUPPORTED";
}
}, V = class extends R {
constructor() {
super(...arguments), this.code = "ERR_JWS_INVALID";
}
static get code() {
return "ERR_JWS_INVALID";
}
}, H = class extends R {
constructor() {
super(...arguments), this.code = "ERR_JWT_INVALID";
}
static get code() {
return "ERR_JWT_INVALID";
}
}, ne = class extends R {
constructor() {
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
}
static get code() {
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
}
};
function U(e, t = "algorithm.name") {
return /* @__PURE__ */ TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
}
function W(e, t) {
return e.name === t;
}
function G(e) {
return parseInt(e.name.slice(4), 10);
}
function re(e) {
switch (e) {
case "ES256": return "P-256";
case "ES384": return "P-384";
case "ES512": return "P-521";
default: throw Error("unreachable");
}
}
function ie(e, t) {
if (t.length && !t.some((t) => e.usages.includes(t))) {
let e = "CryptoKey does not support this operation, its usages must include ";
if (t.length > 2) {
let n = t.pop();
e += `one of ${t.join(", ")}, or ${n}.`;
} else t.length === 2 ? e += `one of ${t[0]} or ${t[1]}.` : e += `${t[0]}.`;
throw TypeError(e);
}
}
function ae(e, t, ...n) {
switch (t) {
case "HS256":
case "HS384":
case "HS512": {
if (!W(e.algorithm, "HMAC")) throw U("HMAC");
let n = parseInt(t.slice(2), 10);
if (G(e.algorithm.hash) !== n) throw U(`SHA-${n}`, "algorithm.hash");
break;
}
case "RS256":
case "RS384":
case "RS512": {
if (!W(e.algorithm, "RSASSA-PKCS1-v1_5")) throw U("RSASSA-PKCS1-v1_5");
let n = parseInt(t.slice(2), 10);
if (G(e.algorithm.hash) !== n) throw U(`SHA-${n}`, "algorithm.hash");
break;
}
case "PS256":
case "PS384":
case "PS512": {
if (!W(e.algorithm, "RSA-PSS")) throw U("RSA-PSS");
let n = parseInt(t.slice(2), 10);
if (G(e.algorithm.hash) !== n) throw U(`SHA-${n}`, "algorithm.hash");
break;
}
case "EdDSA":
if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448") throw U("Ed25519 or Ed448");
break;
case "ES256":
case "ES384":
case "ES512": {
if (!W(e.algorithm, "ECDSA")) throw U("ECDSA");
let n = re(t);
if (e.algorithm.namedCurve !== n) throw U(n, "algorithm.namedCurve");
break;
}
default: throw TypeError("CryptoKey does not support this operation");
}
ie(e, n);
}
function oe(e, t, ...n) {
if (n.length > 2) {
let t = n.pop();
e += `one of type ${n.join(", ")}, or ${t}.`;
} else n.length === 2 ? e += `one of type ${n[0]} or ${n[1]}.` : e += `of type ${n[0]}.`;
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t && t.constructor?.name && (e += ` Received an instance of ${t.constructor.name}`), e;
}
var se = (e, ...t) => oe("Key must be ", e, ...t);
function ce(e, t, ...n) {
return oe(`Key for the ${e} algorithm must be `, t, ...n);
}
var le = (e) => M(e) ? !0 : e?.[Symbol.toStringTag] === "KeyObject", K = ["CryptoKey"], ue = (...e) => {
let t = e.filter(Boolean);
if (t.length === 0 || t.length === 1) return !0;
let n;
for (let e of t) {
let t = Object.keys(e);
if (!n || n.size === 0) {
n = new Set(t);
continue;
}
for (let e of t) {
if (n.has(e)) return !1;
n.add(e);
}
}
return !0;
};
function de(e) {
return typeof e == "object" && !!e;
}
function q(e) {
if (!de(e) || Object.prototype.toString.call(e) !== "[object Object]") return !1;
if (Object.getPrototypeOf(e) === null) return !0;
let t = e;
for (; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
return Object.getPrototypeOf(e) === t;
}
var fe = (e, t) => {
if (e.startsWith("RS") || e.startsWith("PS")) {
let { modulusLength: n } = t.algorithm;
if (typeof n != "number" || n < 2048) throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
}
};
function pe(e) {
let t, n;
switch (e.kty) {
case "RSA":
switch (e.alg) {
case "PS256":
case "PS384":
case "PS512":
t = {
name: "RSA-PSS",
hash: `SHA-${e.alg.slice(-3)}`
}, n = e.d ? ["sign"] : ["verify"];
break;
case "RS256":
case "RS384":
case "RS512":
t = {
name: "RSASSA-PKCS1-v1_5",
hash: `SHA-${e.alg.slice(-3)}`
}, n = e.d ? ["sign"] : ["verify"];
break;
case "RSA-OAEP":
case "RSA-OAEP-256":
case "RSA-OAEP-384":
case "RSA-OAEP-512":
t = {
name: "RSA-OAEP",
hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
}, n = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
break;
default: throw new B("Invalid or unsupported JWK \"alg\" (Algorithm) Parameter value");
}
break;
case "EC":
switch (e.alg) {
case "ES256":
t = {
name: "ECDSA",
namedCurve: "P-256"
}, n = e.d ? ["sign"] : ["verify"];
break;
case "ES384":
t = {
name: "ECDSA",
namedCurve: "P-384"
}, n = e.d ? ["sign"] : ["verify"];
break;
case "ES512":
t = {
name: "ECDSA",
namedCurve: "P-521"
}, n = e.d ? ["sign"] : ["verify"];
break;
case "ECDH-ES":
case "ECDH-ES+A128KW":
case "ECDH-ES+A192KW":
case "ECDH-ES+A256KW":
t = {
name: "ECDH",
namedCurve: e.crv
}, n = e.d ? ["deriveBits"] : [];
break;
default: throw new B("Invalid or unsupported JWK \"alg\" (Algorithm) Parameter value");
}
break;
case "OKP":
switch (e.alg) {
case "EdDSA":
t = { name: e.crv }, n = e.d ? ["sign"] : ["verify"];
break;
case "ECDH-ES":
case "ECDH-ES+A128KW":
case "ECDH-ES+A192KW":
case "ECDH-ES+A256KW":
t = { name: e.crv }, n = e.d ? ["deriveBits"] : [];
break;
default: throw new B("Invalid or unsupported JWK \"alg\" (Algorithm) Parameter value");
}
break;
default: throw new B("Invalid or unsupported JWK \"kty\" (Key Type) Parameter value");
}
return {
algorithm: t,
keyUsages: n
};
}
var me = async (e) => {
if (!e.alg) throw TypeError("\"alg\" argument is required when \"jwk.alg\" is not present");
let { algorithm: t, keyUsages: n } = pe(e), r = [
t,
e.ext ?? !1,
e.key_ops ?? n
], i = { ...e };
return delete i.alg, delete i.use, j.subtle.importKey("jwk", i, ...r);
}, he = (e) => L(e), ge, _e, ve = (e) => e?.[Symbol.toStringTag] === "KeyObject", ye = async (e, t, n, r) => {
let i = e.get(t);
if (i?.[r]) return i[r];
let a = await me({
...n,
alg: r
});
return i ? i[r] = a : e.set(t, { [r]: a }), a;
}, be = {
normalizePublicKey: (e, t) => {
if (ve(e)) {
let n = e.export({ format: "jwk" });
return delete n.d, delete n.dp, delete n.dq, delete n.p, delete n.q, delete n.qi, n.k ? he(n.k) : (_e ||= /* @__PURE__ */ new WeakMap(), ye(_e, e, n, t));
}
return e;
},
normalizePrivateKey: (e, t) => {
if (ve(e)) {
let n = e.export({ format: "jwk" });
return n.k ? he(n.k) : (ge ||= /* @__PURE__ */ new WeakMap(), ye(ge, e, n, t));
}
return e;
}
}, J = (e) => e?.[Symbol.toStringTag], xe = (e, t) => {
if (!(t instanceof Uint8Array)) {
if (!le(t)) throw TypeError(ce(e, t, ...K, "Uint8Array"));
if (t.type !== "secret") throw TypeError(`${J(t)} instances for symmetric algorithms must be of type "secret"`);
}
}, Se = (e, t, n) => {
if (!le(t)) throw TypeError(ce(e, t, ...K));
if (t.type === "secret") throw TypeError(`${J(t)} instances for asymmetric algorithms must not be of type "secret"`);
if (n === "sign" && t.type === "public") throw TypeError(`${J(t)} instances for asymmetric algorithm signing must be of type "private"`);
if (n === "decrypt" && t.type === "public") throw TypeError(`${J(t)} instances for asymmetric algorithm decryption must be of type "private"`);
if (t.algorithm && n === "verify" && t.type === "private") throw TypeError(`${J(t)} instances for asymmetric algorithm verifying must be of type "public"`);
if (t.algorithm && n === "encrypt" && t.type === "private") throw TypeError(`${J(t)} instances for asymmetric algorithm encryption must be of type "public"`);
}, Ce = (e, t, n) => {
e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? xe(e, t) : Se(e, t, n);
};
function we(e, t, n, r, i) {
if (i.crit !== void 0 && r?.crit === void 0) throw new e("\"crit\" (Critical) Header Parameter MUST be integrity protected");
if (!r || r.crit === void 0) return /* @__PURE__ */ new Set();
if (!Array.isArray(r.crit) || r.crit.length === 0 || r.crit.some((e) => typeof e != "string" || e.length === 0)) throw new e("\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present");
let a;
a = n === void 0 ? t : new Map([...Object.entries(n), ...t.entries()]);
for (let t of r.crit) {
if (!a.has(t)) throw new B(`Extension Header Parameter "${t}" is not recognized`);
if (i[t] === void 0) throw new e(`Extension Header Parameter "${t}" is missing`);
if (a.get(t) && r[t] === void 0) throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`);
}
return new Set(r.crit);
}
var Te = we, Ee = (e, t) => {
if (t !== void 0 && (!Array.isArray(t) || t.some((e) => typeof e != "string"))) throw TypeError(`"${e}" option must be an array of strings`);
if (t) return new Set(t);
};
function De(e, t) {
let n = `SHA-${e.slice(-3)}`;
switch (e) {
case "HS256":
case "HS384":
case "HS512": return {
hash: n,
name: "HMAC"
};
case "PS256":
case "PS384":
case "PS512": return {
hash: n,
name: "RSA-PSS",
saltLength: e.slice(-3) >> 3
};
case "RS256":
case "RS384":
case "RS512": return {
hash: n,
name: "RSASSA-PKCS1-v1_5"
};
case "ES256":
case "ES384":
case "ES512": return {
hash: n,
name: "ECDSA",
namedCurve: t.namedCurve
};
case "EdDSA": return { name: t.name };
default: throw new B(`alg ${e} is not supported either by JOSE or your javascript runtime`);
}
}
async function Oe(e, t, n) {
if (n === "sign" && (t = await be.normalizePrivateKey(t, e)), n === "verify" && (t = await be.normalizePublicKey(t, e)), M(t)) return ae(t, e, n), t;
if (t instanceof Uint8Array) {
if (!e.startsWith("HS")) throw TypeError(se(t, ...K));
return j.subtle.importKey("raw", t, {
hash: `SHA-${e.slice(-3)}`,
name: "HMAC"
}, !1, [n]);
}
throw TypeError(se(t, ...K, "Uint8Array"));
}
var ke = async (e, t, n, r) => {
let i = await Oe(e, t, "verify");
fe(e, i);
let a = De(e, i.algorithm);
try {
return await j.subtle.verify(a, i, n, r);
} catch {
return !1;
}
};
async function Ae(e, t, n) {
if (!q(e)) throw new V("Flattened JWS must be an object");
if (e.protected === void 0 && e.header === void 0) throw new V("Flattened JWS must have either of the \"protected\" or \"header\" members");
if (e.protected !== void 0 && typeof e.protected != "string") throw new V("JWS Protected Header incorrect type");
if (e.payload === void 0) throw new V("JWS Payload missing");
if (typeof e.signature != "string") throw new V("JWS Signature missing or incorrect type");
if (e.header !== void 0 && !q(e.header)) throw new V("JWS Unprotected Header incorrect type");
let r = {};
if (e.protected) try {
let t = L(e.protected);
r = JSON.parse(P.decode(t));
} catch {
throw new V("JWS Protected Header is invalid");
}
if (!ue(r, e.header)) throw new V("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
let i = {
...r,
...e.header
}, a = Te(V, new Map([["b64", !0]]), n?.crit, r, i), o = !0;
if (a.has("b64") && (o = r.b64, typeof o != "boolean")) throw new V("The \"b64\" (base64url-encode payload) Header Parameter must be a boolean");
let { alg: s } = i;
if (typeof s != "string" || !s) throw new V("JWS \"alg\" (Algorithm) Header Parameter missing or invalid");
let c = n && Ee("algorithms", n.algorithms);
if (c && !c.has(s)) throw new te("\"alg\" (Algorithm) Header Parameter value not allowed");
if (o) {
if (typeof e.payload != "string") throw new V("JWS Payload must be a string");
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array)) throw new V("JWS Payload must be a string or an Uint8Array instance");
let l = !1;
typeof t == "function" && (t = await t(r, e), l = !0), Ce(s, t, "verify");
let u = F(N.encode(e.protected ?? ""), N.encode("."), typeof e.payload == "string" ? N.encode(e.payload) : e.payload), d;
try {
d = L(e.signature);
} catch {
throw new V("Failed to base64url decode the signature");
}
if (!await ke(s, t, d, u)) throw new ne();
let f;
if (o) try {
f = L(e.payload);
} catch {
throw new V("Failed to base64url decode the payload");
}
else f = typeof e.payload == "string" ? N.encode(e.payload) : e.payload;
let p = { payload: f };
return e.protected !== void 0 && (p.protectedHeader = r), e.header !== void 0 && (p.unprotectedHeader = e.header), l ? {
...p,
key: t
} : p;
}
async function je(e, t, n) {
if (e instanceof Uint8Array && (e = P.decode(e)), typeof e != "string") throw new V("Compact JWS must be a string or Uint8Array");
let { 0: r, 1: i, 2: a, length: o } = e.split(".");
if (o !== 3) throw new V("Invalid Compact JWS");
let s = await Ae({
payload: i,
protected: r,
signature: a
}, t, n), c = {
payload: s.payload,
protectedHeader: s.protectedHeader
};
return typeof t == "function" ? {
...c,
key: s.key
} : c;
}
var Me = (e) => Math.floor(e.getTime() / 1e3), Ne = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, Pe = (e) => {
let t = Ne.exec(e);
if (!t || t[4] && t[1]) throw TypeError("Invalid time period format");
let n = parseFloat(t[2]), r = t[3].toLowerCase(), i;
switch (r) {
case "sec":
case "secs":
case "second":
case "seconds":
case "s":
i = Math.round(n);
break;
case "minute":
case "minutes":
case "min":
case "mins":
case "m":
i = Math.round(n * 60);
break;
case "hour":
case "hours":
case "hr":
case "hrs":
case "h":
i = Math.round(n * 3600);
break;
case "day":
case "days":
case "d":
i = Math.round(n * 86400);
break;
case "week":
case "weeks":
case "w":
i = Math.round(n * 604800);
break;
default:
i = Math.round(n * 31557600);
break;
}
return t[1] === "-" || t[4] === "ago" ? -i : i;
}, Fe = (e) => e.toLowerCase().replace(/^application\//, ""), Ie = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, Le = (e, t, n = {}) => {
let r;
try {
r = JSON.parse(P.decode(t));
} catch {}
if (!q(r)) throw new H("JWT Claims Set must be a top-level JSON object");
let { typ: i } = n;
if (i && (typeof e.typ != "string" || Fe(e.typ) !== Fe(i))) throw new z("unexpected \"typ\" JWT header value", r, "typ", "check_failed");
let { requiredClaims: a = [], issuer: o, subject: s, audience: c, maxTokenAge: l } = n, u = [...a];
l !== void 0 && u.push("iat"), c !== void 0 && u.push("aud"), s !== void 0 && u.push("sub"), o !== void 0 && u.push("iss");
for (let e of new Set(u.reverse())) if (!(e in r)) throw new z(`missing required "${e}" claim`, r, e, "missing");
if (o && !(Array.isArray(o) ? o : [o]).includes(r.iss)) throw new z("unexpected \"iss\" claim value", r, "iss", "check_failed");
if (s && r.sub !== s) throw new z("unexpected \"sub\" claim value", r, "sub", "check_failed");
if (c && !Ie(r.aud, typeof c == "string" ? [c] : c)) throw new z("unexpected \"aud\" claim value", r, "aud", "check_failed");
let d;
switch (typeof n.clockTolerance) {
case "string":
d = Pe(n.clockTolerance);
break;
case "number":
d = n.clockTolerance;
break;
case "undefined":
d = 0;
break;
default: throw TypeError("Invalid clockTolerance option type");
}
let { currentDate: f } = n, p = Me(f || /* @__PURE__ */ new Date());
if ((r.iat !== void 0 || l) && typeof r.iat != "number") throw new z("\"iat\" claim must be a number", r, "iat", "invalid");
if (r.nbf !== void 0) {
if (typeof r.nbf != "number") throw new z("\"nbf\" claim must be a number", r, "nbf", "invalid");
if (r.nbf > p + d) throw new z("\"nbf\" claim timestamp check failed", r, "nbf", "check_failed");
}
if (r.exp !== void 0) {
if (typeof r.exp != "number") throw new z("\"exp\" claim must be a number", r, "exp", "invalid");
if (r.exp <= p - d) throw new ee("\"exp\" claim timestamp check failed", r, "exp", "check_failed");
}
if (l) {
let e = p - r.iat, t = typeof l == "number" ? l : Pe(l);
if (e - d > t) throw new ee("\"iat\" claim timestamp check failed (too far in the past)", r, "iat", "check_failed");
if (e < 0 - d) throw new z("\"iat\" claim timestamp check failed (it should be in the past)", r, "iat", "check_failed");
}
return r;
};
async function Re(e, t, n) {
let r = await je(e, t, n);
if (r.protectedHeader.crit?.includes("b64") && r.protectedHeader.b64 === !1) throw new H("JWTs MUST NOT use unencoded payload");
let i = {
payload: Le(r.protectedHeader, r.payload, n),
protectedHeader: r.protectedHeader
};
return typeof t == "function" ? {
...i,
key: r.key
} : i;
}
var ze = L;
function Be(e) {
if (typeof e != "string") throw new H("JWTs must use Compact JWS serialization, JWT must be a string");
let { 1: t, length: n } = e.split(".");
if (n === 5) throw new H("Only JWTs using Compact JWS serialization can be decoded");
if (n !== 3) throw new H("Invalid JWT");
if (!t) throw new H("JWTs must contain a payload");
let r;
try {
r = ze(t);
} catch {
throw new H("Failed to base64url decode the payload");
}
let i;
try {
i = JSON.parse(P.decode(r));
} catch {
throw new H("Failed to parse the decoded payload as JSON");
}
if (!q(i)) throw new H("Invalid JWT Claims Set");
return i;
}
function Y(e) {
var t = Error(e);
return t.source = "ulid", t;
}
var X = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Z = X.length, Ve = 2 ** 48 - 1, He = 10, Ue = 16;
function We(e) {
var t = Math.floor(e() * Z);
return t === Z && (t = Z - 1), X.charAt(t);
}
function Ge(e, t) {
if (isNaN(e)) throw Error(e + " must be a number");
if (e > Ve) throw Y("cannot encode time greater than " + Ve);
if (e < 0) throw Y("time must be positive");
if (Number.isInteger(e) === !1) throw Y("time must be an integer");
for (var n = void 0, r = ""; t > 0; t--) n = e % Z, r = X.charAt(n) + r, e = (e - n) / Z;
return r;
}
function Ke(e, t) {
for (var n = ""; e > 0; e--) n = We(t) + n;
return n;
}
function qe() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = arguments[1];
t ||= typeof window < "u" ? window : null;
var n = t && (t.crypto || t.msCrypto);
if (n) return function() {
var e = new Uint8Array(1);
return n.getRandomValues(e), e[0] / 255;
};
try {
var r = A();
return function() {
return r.randomBytes(1).readUInt8() / 255;
};
} catch {}
if (e) {
try {
console.error("secure crypto unusable, falling back to insecure Math.random()!");
} catch {}
return function() {
return Math.random();
};
}
throw Y("secure crypto unusable, insecure Math.random not allowed");
}
function Je(e) {
return e ||= qe(), function(t) {
return isNaN(t) && (t = Date.now()), Ge(t, He) + Ke(Ue, e);
};
}
Je();
var Ye;
function Xe(e) {
return Ye?.get(e);
}
var Ze;
function Qe(e) {
return Ze?.get(e);
}
var $e;
function et(e, t) {
return $e?.get(e)?.get(t);
}
function tt(e) {
let t = typeof e;
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
}
function nt(e, t, n, r, i) {
let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? tt(a), c = {
kind: e.kind,
type: e.type,
input: a,
expected: o,
received: s,
message: `Invalid ${t}: ${o ? `Expected ${o} but r` : "R"}eceived ${s}`,
requirement: e.requirement,
path: i?.path,
issues: i?.issues,
lang: r.lang,
abortEarly: r.abortEarly,
abortPipeEarly: r.abortPipeEarly
}, l = e.kind === "schema", u = i?.message ?? e.message ?? et(e.reference, c.lang) ?? (l ? Qe(c.lang) : null) ?? r.message ?? Xe(c.lang);
u && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
}
function rt(e) {
return {
kind: "transformation",
type: "brand",
reference: rt,
async: !1,
name: e,
_run(e) {
return e;
}
};
}
function it(e, t, n) {
return typeof e.default == "function" ? e.default(t, n) : e.default;
}
function at(e) {
return {
kind: "schema",
type: "number",
reference: at,
expects: "number",
async: !1,
message: e,
_run(e, t) {
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : nt(this, "type", e, t), e;
}
};
}
function ot(e, ...t) {
let n = {
kind: "schema",
type: "optional",
reference: ot,
expects: `${e.expects} | undefined`,
async: !1,
wrapped: e,
_run(e, t) {
return e.value === void 0 && ("default" in this && (e.value = it(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped._run(e, t);
}
};
return 0 in t && (n.default = t[0]), n;
}
function st(e) {
return {
kind: "schema",
type: "string",
reference: st,
expects: "string",
async: !1,
message: e,
_run(e, t) {
return typeof e.value == "string" ? e.typed = !0 : nt(this, "type", e, t), e;
}
};
}
function ct(...e) {
return {
...e[0],
pipe: e,
_run(t, n) {
for (let r of e) if (r.kind !== "metadata") {
if (t.issues && (r.kind === "schema" || r.kind === "transformation")) {
t.typed = !1;
break;
}
(!t.issues || !n.abortEarly && !n.abortPipeEarly) && (t = r._run(t, n));
}
return t;
}
};
}
ct(st(), rt("lid")), ot(at());
var lt = (e) => () => e * 48271 % 2147483647 / 2147483647, ut = (e) => typeof Buffer < "u" ? Buffer.from(e).toString("base64") : btoa(typeof e == "string" ? e : String.fromCharCode(...e)), dt = (e) => typeof Buffer < "u" ? Buffer.from(e, "base64").toString() : atob(e), ft = (e, t) => {
let n = lt(t);
return ut(new TextEncoder().encode(e).map((e) => e ^ Math.floor(n() * 256)));
}, pt = (e) => e.split("").reverse().join(""), mt = (e) => typeof e == "object" && !!e && "sub" in e && "exp" in e && typeof e.sub == "string" && typeof e.exp == "number", ht = async (e) => {
let t = pt(dt(e));
return {
decoded: Be(t),
jwt: t
};
}, gt = async (e) => {
let { decoded: t, jwt: n } = await ht(e);
if (!mt(t)) throw Error("Invalid license key");
let { sub: r, exp: i } = t;
return await Re(n, new TextEncoder().encode(ft(r, i))), t;
};
//#endregion
//#region src/lib/ReExtTrial.jsx
function _t({ reextkey: e, version: n, daysleft: i, setDaysLeft: c }) {
let [l, u] = r(null), [d, f] = r(!1);
if (t(() => {
let t = async (e) => {
if (e === void 0) return {
type: "nokey",
daysleft: 0
};
if (e.toLowerCase().includes("testkey")) return {
type: "trial",
daysleft: 10
};
if (e.toLowerCase().includes("expiredkey")) return {
type: "expired",
daysleft: 0
};
try {
let t = await gt(e), n = /* @__PURE__ */ new Date(t.exp * 1e3) - /* @__PURE__ */ new Date(), r = Math.floor(n / (1e3 * 60 * 60 * 24));
return r > 0 ? {
type: "trial",
daysleft: r
} : {
type: "expired",
daysleft: 0
};
} catch (e) {
return e.message.includes("claim timestamp check failed") ? {
type: "expired",
daysleft: 0
} : {
type: "invalidkey",
daysleft: 0
};
}
};
(async () => {
var n = await t(e);
u(n.type), c(n.daysleft), window && (window.dl = n.daysleft);
})();
}, []), d === !0 || l === "trial" && i > 0) return null;
if (l !== null) return /* @__PURE__ */ o("div", {
style: {
zIndex: 2e5,
fontSize: "22px",
background: "rgb(211,211,211,.4)",
color: "black",
display: "flex",
flexDirection: "column",
position: "absolute",
left: "50%",
width: "100%",
height: "100%",
transform: "translateX(-50%)",
padding: "10px 10px 10px 10px",
border: "1px solid black"
},
children: /* @__PURE__ */ s("div", {
style: {
height: "100%",
display: "flex",
padding: "10px 10px 10px 10px",
flexDirection: "column",
margin: "40px",
borderRadius: "5px",
border: "1px solid gray",
background: "white"
},
children: [
/* @__PURE__ */ s("div", {
style: {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
children: [/* @__PURE__ */ o("img", {
alt: "ReExt",
style: { width: 160 },
src: "./ReExt.png"
}), /* @__PURE__ */ s("div", {
style: { margin: "0 0 0 20px" },
children: [
"Welcome to the ReExt v",
n,
" Trial"
]
})]
}),
l === "nokey" && /* @__PURE__ */ s(a, { children: [
/* @__PURE__ */ s("div", {
style: {
margin: "10px 0 10px 0",
fontSize: "18px"
},
children: [
"This is a 30 day trial version of ReExt.",
/* @__PURE__ */ o("br", {}),
"Without a valid trial key, this dialog will appear.",
/* @__PURE__ */ o("br", {}),
/* @__PURE__ */ o("br", {}),
"To have a trial key emailed to you, fill in this form and click 'Get Trial Key'."
]
}),
/* @__PURE__ */ o("div", {
style: {
xwidth: "100%",
flex: 1,
display: "flex",
border: "0px solid red"
},
children: /* @__PURE__ */ o("iframe", {
style: {
width: "100%",
margin: "0 0 10px 0",
flex: 1,
border: "0px solid lightgray"
},
src: "https://www.sencha.com/forms/reext/trial-reext.php"
})
}),
/* @__PURE__ */ s("div", {
style: {
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
alignItems: "flex-end"
},
children: [/* @__PURE__ */ o("div", {
style: { fontSize: "12px" },
children: l
}), /* @__PURE__ */ o("button", {
style: {
fontSize: "18px",
padding: "5px 5px 5px 5px"
},
onClick: () => {
f(!0);
},
children: "Close"
})]
})
] }),
l === "expired" && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s("div", {
style: {
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
margin: "10px 0 10px 0",
fontSize: "18px",
height: "100%"
},
children: [
/* @__PURE__ */ o("div", {
style: {
margin: "0 0 20px 0",
fontSize: "24px"
},
children: "Your ReExt trial key has expired"
}),
/* @__PURE__ */ o("div", { children: "Contact Sencha Sales" }),
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("a", {
href: "https://www.sencha.com/company/contact/",
target: "_blank",
rel: "noopener noreferrer",
children: "https://www.sencha.com/company/contact/"
}) })
]
}) }),
l === "invalidkey" && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ s("div", {
style: {
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
margin: "10px 0 10px 0",
fontSize: "18px",
height: "100%"
},
children: [
/* @__PURE__ */ o("div", {
style: {
margin: "0 0 20px 0",
fontSize: "24px"
},
children: "Your ReExt trial key is invalid"
}),
/* @__PURE__ */ o("div", { children: "Contact Sencha Sales" }),
/* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("a", {
href: "https://www.sencha.com/company/contact/",
target: "_blank",
rel: "noopener noreferrer",
children: "https://www.sencha.com/company/contact/"
}) })
]
}) })
]
})
});
}
//#endregion
//#region src/lib/ReExtPlugin.jsx
function vt() {
return /* @__PURE__ */ s("div", {
style: {
padding: "30px",
boxSizing: "border-box",
flexDirection: "column",
height: "90vh",
fontSize: 24,
fontWeight: "bold",
color: "black"
},
children: [
/* @__PURE__ */ o("div", {
style: { margin: "0 0 10px 0" },
children: "A ReExt plugin is needed to run this ReExt app"
}),
/* @__PURE__ */ o("div", {
style: { margin: "30px 0 0 0" },
children: "For Vite, modify vite.config.js like this:"
}),
/* @__PURE__ */ o("pre", {
style: {
fontSize: "18px",
color: "green",
textAlign: "left"
},
children: "import { defineConfig } from 'vite';\n\nimport reext from './node_modules/@sencha/reext/dist/ReExt/vite-plugin-reext.js';\nexport default defineConfig({\n plugins: [\n \n reext()\n ]\n})"
}),
/* @__PURE__ */ o("div", { children: "For Next.js, modify next.config.mjs like this:" }),
/* @__PURE__ */ o("pre", {
style: {
fontSize: "18px",
color: "green",
textAlign: "left"
},
children: "/** @type {import('next').NextConfig} */\nimport withReExtPlugin from './node_modules/@sencha/reext/dist/ReExt/next-plugin-reext.js';\nconst nextConfig = {};\nexport default withReExtPlugin(nextConfig);"
})
]
});
}
//#endregion
//#region src/lib/loadextjsfiles.js
var yt = Object.create, bt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, St = Object.getOwnPropertyNames, Ct = Object.getPrototypeOf, wt = Object.prototype.hasOwnProperty, Tt = ((e) => typeof c < "u" ? c : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof c < "u" ? c : e)[t] }) : e)(function(e) {
if (typeof c < "u") return c.apply(this, arguments);
throw Error("Dynamic require of \"" + e + "\" is not supported");
}), Et = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Dt = (e, t, n, r) => {
if (t && typeof t == "object" || typeof t == "function") for (let i of St(t)) !wt.call(e, i) && i !== n && bt(e, i, {
get: () => t[i],
enumerable: !(r = xt(t, i)) || r.enumerable
});
return e;
}, Q = ((e, t, n) => (n = e == null ? {} : yt(Ct(e)), Dt(t || !e || !e.__esModule ? bt(n, "default", {
value: e,
enumerable: !0
}) : n, e)))(Et((e, t) => {
var n = {
yellow: (e) => `\x1B[33m${e}\x1B[0m`,
green: (e) => `\x1B[32m$