useblocks 1.1.53 → 1.1.60
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/iframe/js/amp.BP7EklKo.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/npm-publish.manifest.json +7 -7
- package/package.json +1 -7
- package/runtime/THIRD_PARTY_LICENSES.txt +0 -235
- package/runtime/index.js +0 -2
- package/runtime/package.json +0 -6
- package/runtime/plugin-dev-manifest.json +0 -4
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{5318562c.js → 161d1254.js} +268 -257
- package/static/core/{b9f47840.js → 17d3ee0b.js} +8 -8
- package/static/core/{6895dd352.js → 195ca4a32.js} +15 -15
- package/static/core/{dc1f9e4f.js → 2569fac8.js} +26 -26
- package/static/core/{4ca527032.js → 26ddf93e2.js} +2 -2
- package/static/core/{9929a348.js → 30c5fe5f.js} +90 -90
- package/static/core/{e93d55b92.js → 3af8f3592.js} +4 -4
- package/static/core/{ebd852b6.js → 40f73dfb.js} +1019 -1032
- package/static/core/{c3058168.js → 43c3f160.js} +3283 -3189
- package/static/core/{542ea53f2.js → 4a27bba92.js} +8 -8
- package/static/core/4c39852e.js +3150 -0
- package/static/core/{e5e07f1d.js → 4e75b331.js} +13 -13
- package/static/core/{e1d239ab.js → 5345bef8.js} +42 -42
- package/static/core/{31e98e6e.js → 53463a60.js} +707 -712
- package/static/core/{27544e7e.js → 581ce428.js} +37 -19
- package/static/core/{d8daf1142.js → 6156301b2.js} +3 -3
- package/static/core/{c3849484.js → 64bea1a9.js} +5 -5
- package/static/core/{ce4fc17f2.js → 680236f4.js} +1 -1
- package/static/core/{4b75d16c2.js → 687795b52.js} +4 -4
- package/static/core/{70407ac0.js → 72f86b2d.js} +3 -3
- package/static/core/{139e4380.js → 7a15fa8b.js} +3 -3
- package/static/core/{b77f0769.js → 8432f11e.js} +5 -5
- package/static/core/{d1eb3c68.js → 8815eb5b.js} +15670 -15289
- package/static/core/{f3cff4c9.js → 8a496b64.js} +158 -158
- package/static/core/{4e1b970f.js → 8ba13f332.js} +1 -1
- package/static/core/{75737a9d.js → 951903fb.js} +9096 -9074
- package/static/core/{a95c02bb.js → a1355a35.js} +5 -5
- package/static/core/{7c6fb2162.js → a36c3ab62.js} +3 -3
- package/static/core/{2da1d66b.js → abd3f34c.js} +5 -5
- package/static/core/{528ad9282.js → ae20f0992.js} +16 -16
- package/static/core/ba6c356e.js +466 -0
- package/static/core/{ee0ddb51.js → c9e59b34.js} +6884 -4960
- package/static/core/{f96d2049.js → d1a1d4902.js} +1 -1
- package/static/core/{5b48fd69.js → d8d6485e.js} +5 -5
- package/static/core/{59e92cc3.js → d9398296.js} +5 -5
- package/static/core/{b408f33a.js → d9baa55e.js} +25 -25
- package/static/core/dbf19c2e.js +811 -0
- package/static/core/{bc7e3d2b.js → f953827c.js} +10 -10
- package/static/core/{1e5bf73c.js → ffee9a77.js} +7 -7
- package/static/esm/2474de05.js +131 -0
- package/static/esm/{d180c108.js → 53b688bd.js} +66 -85
- package/two_step_headless_plugin.html +1 -1
- package/useblocks-core.f6bb8947.js +673 -0
- package/useblocks-esm.js +875 -552
- package/useblocks.d.ts +8 -0
- package/useblocks.js +691 -408
- package/runtime/prop-types/index.js +0 -4
- package/runtime/react-router-dom/index.js +0 -2
- package/static/core/1995fb0a2.js +0 -602
- package/static/core/1f5e1fc9.js +0 -3097
- package/static/core/ce0410b1.js +0 -467
- package/static/esm/448d4bb0.js +0 -127
- package/static/runtime/dom-export-CHgQ7Ws9.js +0 -8069
- package/static/runtime/prop-types-p_yYKrF7.js +0 -47
- package/useblocks-core.2a5dade1.js +0 -643
- /package/iframe/{iframe-eblock.2a5dade1.html → iframe-eblock.f6bb8947.html} +0 -0
- /package/iframe/{iframe.2a5dade1.html → iframe.f6bb8947.html} +0 -0
package/useblocks.js
CHANGED
|
@@ -689,7 +689,7 @@ var __amdEnv = window.__useblocks__ || (window.__useblocks__ = {});
|
|
|
689
689
|
|
|
690
690
|
|
|
691
691
|
// Configure AMD loader
|
|
692
|
-
__amdEnv.require.config({ baseUrl: "./", paths: {"core":"useblocks-core.
|
|
692
|
+
__amdEnv.require.config({ baseUrl: "./", paths: {"core":"useblocks-core.f6bb8947.js"} });
|
|
693
693
|
|
|
694
694
|
// PublicPath (script detection: entry script lookup → document.currentScript)
|
|
695
695
|
if (!__useblocks__.publicPath) {
|
|
@@ -1037,7 +1037,7 @@ if (!ns.assetUrl) {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
1039
|
if (!ns.version) {
|
|
1040
|
-
ns.version = "1.1.
|
|
1040
|
+
ns.version = "1.1.60";
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
1043
|
var modules = ns.modules = Object.create(null);
|
|
@@ -1050,8 +1050,6 @@ if (!ns.version) {
|
|
|
1050
1050
|
modules["ReactDomClient"] = runtimePromise.then(function(m) { return m["ReactDomClient"]; });
|
|
1051
1051
|
modules["ReactJsxRuntime"] = runtimePromise.then(function(m) { return m["ReactJsxRuntime"]; });
|
|
1052
1052
|
modules["ReactJsxDevRuntime"] = runtimePromise.then(function(m) { return m["ReactJsxDevRuntime"]; });
|
|
1053
|
-
modules["PropTypes"] = runtimePromise.then(function(m) { return m["PropTypes"]; });
|
|
1054
|
-
modules["ReactRouterDom"] = runtimePromise.then(function(m) { return m["ReactRouterDom"]; });
|
|
1055
1053
|
modules["Antd"] = runtimePromise.then(function(m) { return m["Antd"]; });
|
|
1056
1054
|
modules["AntDesignIcons"] = runtimePromise.then(function(m) { return m["AntDesignIcons"]; });
|
|
1057
1055
|
modules["AntDesignCssinjs"] = runtimePromise.then(function(m) { return m["AntDesignCssinjs"]; });
|
|
@@ -1291,70 +1289,6 @@ if (typeof ns.define === 'function') {
|
|
|
1291
1289
|
return __toSharedEsModule(originalValue);
|
|
1292
1290
|
});
|
|
1293
1291
|
});
|
|
1294
|
-
ns.define("prop-types", [], function() {
|
|
1295
|
-
var value = _modules["PropTypes"];
|
|
1296
|
-
if (value && typeof value.then === 'function') {
|
|
1297
|
-
return _modulesPromise.then(function(barrel) {
|
|
1298
|
-
var originalValue = barrel["PropTypes"];
|
|
1299
|
-
return __toSharedEsModule(originalValue);
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
if (value !== undefined) {
|
|
1303
|
-
return __toSharedEsModule(value);
|
|
1304
|
-
}
|
|
1305
|
-
return _modulesPromise.then(function(barrel) {
|
|
1306
|
-
var originalValue = barrel["PropTypes"];
|
|
1307
|
-
return __toSharedEsModule(originalValue);
|
|
1308
|
-
});
|
|
1309
|
-
});
|
|
1310
|
-
ns.define("useblocks/runtime/prop-types", [], function() {
|
|
1311
|
-
var value = _modules["PropTypes"];
|
|
1312
|
-
if (value && typeof value.then === 'function') {
|
|
1313
|
-
return _modulesPromise.then(function(barrel) {
|
|
1314
|
-
var originalValue = barrel["PropTypes"];
|
|
1315
|
-
return __toSharedEsModule(originalValue);
|
|
1316
|
-
});
|
|
1317
|
-
}
|
|
1318
|
-
if (value !== undefined) {
|
|
1319
|
-
return __toSharedEsModule(value);
|
|
1320
|
-
}
|
|
1321
|
-
return _modulesPromise.then(function(barrel) {
|
|
1322
|
-
var originalValue = barrel["PropTypes"];
|
|
1323
|
-
return __toSharedEsModule(originalValue);
|
|
1324
|
-
});
|
|
1325
|
-
});
|
|
1326
|
-
ns.define("react-router-dom", [], function() {
|
|
1327
|
-
var value = _modules["ReactRouterDom"];
|
|
1328
|
-
if (value && typeof value.then === 'function') {
|
|
1329
|
-
return _modulesPromise.then(function(barrel) {
|
|
1330
|
-
var originalValue = barrel["ReactRouterDom"];
|
|
1331
|
-
return __toSharedEsModule(originalValue);
|
|
1332
|
-
});
|
|
1333
|
-
}
|
|
1334
|
-
if (value !== undefined) {
|
|
1335
|
-
return __toSharedEsModule(value);
|
|
1336
|
-
}
|
|
1337
|
-
return _modulesPromise.then(function(barrel) {
|
|
1338
|
-
var originalValue = barrel["ReactRouterDom"];
|
|
1339
|
-
return __toSharedEsModule(originalValue);
|
|
1340
|
-
});
|
|
1341
|
-
});
|
|
1342
|
-
ns.define("useblocks/runtime/react-router-dom", [], function() {
|
|
1343
|
-
var value = _modules["ReactRouterDom"];
|
|
1344
|
-
if (value && typeof value.then === 'function') {
|
|
1345
|
-
return _modulesPromise.then(function(barrel) {
|
|
1346
|
-
var originalValue = barrel["ReactRouterDom"];
|
|
1347
|
-
return __toSharedEsModule(originalValue);
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
if (value !== undefined) {
|
|
1351
|
-
return __toSharedEsModule(value);
|
|
1352
|
-
}
|
|
1353
|
-
return _modulesPromise.then(function(barrel) {
|
|
1354
|
-
var originalValue = barrel["ReactRouterDom"];
|
|
1355
|
-
return __toSharedEsModule(originalValue);
|
|
1356
|
-
});
|
|
1357
|
-
});
|
|
1358
1292
|
ns.define("antd", [], function() {
|
|
1359
1293
|
var value = _modules["Antd"];
|
|
1360
1294
|
if (value && typeof value.then === 'function') {
|
|
@@ -1589,26 +1523,33 @@ __useblocks__.define("useblocks.js", [
|
|
|
1589
1523
|
"require",
|
|
1590
1524
|
"exports",
|
|
1591
1525
|
"module"
|
|
1592
|
-
], function(
|
|
1526
|
+
], function(ln, E, fn) {
|
|
1593
1527
|
Object.defineProperties(E, {
|
|
1594
1528
|
__esModule: { value: !0 },
|
|
1595
1529
|
[Symbol.toStringTag]: { value: "Module" }
|
|
1596
1530
|
});
|
|
1597
|
-
var
|
|
1531
|
+
var ae = Object.defineProperty, ce = (e, t, r) => () => {
|
|
1532
|
+
if (r) throw r[0];
|
|
1533
|
+
try {
|
|
1534
|
+
return e && (t = e(e = 0)), t;
|
|
1535
|
+
} catch (n) {
|
|
1536
|
+
throw r = [n], n;
|
|
1537
|
+
}
|
|
1538
|
+
}, ue = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), le = (e, t) => {
|
|
1598
1539
|
let r = {};
|
|
1599
|
-
for (var n in e)
|
|
1540
|
+
for (var n in e) ae(r, n, {
|
|
1600
1541
|
get: e[n],
|
|
1601
1542
|
enumerable: !0
|
|
1602
1543
|
});
|
|
1603
|
-
return t ||
|
|
1604
|
-
},
|
|
1544
|
+
return t || ae(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
1545
|
+
}, N = class lt {
|
|
1605
1546
|
_inner;
|
|
1606
1547
|
_isDisposed = !1;
|
|
1607
1548
|
constructor(t = []) {
|
|
1608
1549
|
this._inner = t;
|
|
1609
1550
|
}
|
|
1610
1551
|
addDisposable(t) {
|
|
1611
|
-
return this._inner.push(t), t instanceof
|
|
1552
|
+
return this._inner.push(t), t instanceof lt && t.addDispose(() => {
|
|
1612
1553
|
this.removeDisposable(t);
|
|
1613
1554
|
}), t;
|
|
1614
1555
|
}
|
|
@@ -1629,10 +1570,10 @@ __useblocks__.define("useblocks.js", [
|
|
|
1629
1570
|
}
|
|
1630
1571
|
}
|
|
1631
1572
|
};
|
|
1632
|
-
function
|
|
1573
|
+
function W(e) {
|
|
1633
1574
|
return `service_container_${e}`;
|
|
1634
1575
|
}
|
|
1635
|
-
var
|
|
1576
|
+
var dt = class se extends N {
|
|
1636
1577
|
_parent;
|
|
1637
1578
|
_injectCallbacks = [];
|
|
1638
1579
|
_injections = Object.create(null);
|
|
@@ -1658,7 +1599,7 @@ __useblocks__.define("useblocks.js", [
|
|
|
1658
1599
|
_find(t, r = !0) {
|
|
1659
1600
|
return this._injections[t] || r && this._parent?._find(t);
|
|
1660
1601
|
}
|
|
1661
|
-
_onInject(t, r, n = new
|
|
1602
|
+
_onInject(t, r, n = new N()) {
|
|
1662
1603
|
return n.addDisposable(this.onInject((o) => {
|
|
1663
1604
|
t === o && (n.dispose(), r(this.getInstance(o)));
|
|
1664
1605
|
})), this._parent && n.addDisposable(this._parent._onInject(t, r, n)), this.addDisposable(n), n;
|
|
@@ -1678,137 +1619,118 @@ __useblocks__.define("useblocks.js", [
|
|
|
1678
1619
|
return typeof r == "function" ? Promise.resolve(r()) : new Promise((n) => this._onInject(t, () => n(this.getInstance(t))));
|
|
1679
1620
|
}
|
|
1680
1621
|
addService(t, r) {
|
|
1681
|
-
const n =
|
|
1622
|
+
const n = W(t);
|
|
1682
1623
|
this.injectFactory(n, (i, s = []) => s.indexOf(r) < 0 ? [...s, r] : s);
|
|
1683
|
-
const o = new
|
|
1624
|
+
const o = new N();
|
|
1684
1625
|
return o.addDispose(() => {
|
|
1685
|
-
this.injectFactory(n, (i, s = []) => s.filter((
|
|
1626
|
+
this.injectFactory(n, (i, s = []) => s.filter((l) => l !== r));
|
|
1686
1627
|
}), o;
|
|
1687
1628
|
}
|
|
1688
1629
|
addServiceFactory(t, r, n) {
|
|
1689
|
-
const o =
|
|
1630
|
+
const o = W(t);
|
|
1690
1631
|
let i;
|
|
1691
|
-
this.injectFactory(o, (
|
|
1692
|
-
const s = new
|
|
1632
|
+
this.injectFactory(o, (l, f = []) => (i = r(l, i), i === void 0 ? f : f.indexOf(i) < 0 ? [...f, i] : f), n);
|
|
1633
|
+
const s = new N();
|
|
1693
1634
|
return s.addDispose(() => {
|
|
1694
|
-
this.injectFactory(o, (
|
|
1635
|
+
this.injectFactory(o, (l, f = []) => i === void 0 ? f : f.filter((c) => c !== i));
|
|
1695
1636
|
}), s;
|
|
1696
1637
|
}
|
|
1697
1638
|
getServices(t) {
|
|
1698
|
-
const r =
|
|
1639
|
+
const r = W(t);
|
|
1699
1640
|
return [...this.getInstance(r, !1) || [], ...this._parent?.getServices(t) || []];
|
|
1700
1641
|
}
|
|
1701
1642
|
createChild() {
|
|
1702
|
-
return new
|
|
1643
|
+
return new se(this);
|
|
1703
1644
|
}
|
|
1704
1645
|
getOrCreateIsolatedContainer(t) {
|
|
1705
1646
|
return this.getOrCreateInstance(t, () => {
|
|
1706
1647
|
const r = this._parent?.getOrCreateIsolatedContainer(t);
|
|
1707
|
-
return new
|
|
1648
|
+
return new se(r);
|
|
1708
1649
|
});
|
|
1709
1650
|
}
|
|
1710
1651
|
dispose() {
|
|
1711
1652
|
this._injections = Object.create(null);
|
|
1712
1653
|
}
|
|
1713
1654
|
};
|
|
1714
|
-
function
|
|
1655
|
+
function V(e) {
|
|
1715
1656
|
return e.startsWith("__") ? e : `__${e}__`;
|
|
1716
1657
|
}
|
|
1717
|
-
function
|
|
1658
|
+
function pt(e) {
|
|
1718
1659
|
if (typeof globalThis > "u") throw new Error("[di] globalThis is required for namespace container access.");
|
|
1719
|
-
const t =
|
|
1660
|
+
const t = V(e), r = globalThis;
|
|
1720
1661
|
return r[t] ??= {};
|
|
1721
1662
|
}
|
|
1722
|
-
function
|
|
1663
|
+
function _t(e) {
|
|
1723
1664
|
return e != null && typeof e == "object" && typeof e.inject == "function" && typeof e.getInstance == "function";
|
|
1724
1665
|
}
|
|
1725
|
-
function
|
|
1726
|
-
if (e) return
|
|
1727
|
-
return
|
|
1666
|
+
function ht(e) {
|
|
1667
|
+
if (e) return V(e);
|
|
1668
|
+
return V("useblocks".trim());
|
|
1728
1669
|
}
|
|
1729
|
-
function
|
|
1730
|
-
const t =
|
|
1731
|
-
if (
|
|
1732
|
-
const r = new
|
|
1670
|
+
function fe(e) {
|
|
1671
|
+
const t = pt(ht(e));
|
|
1672
|
+
if (_t(t.container)) return t.container;
|
|
1673
|
+
const r = new dt(null);
|
|
1733
1674
|
return t.container = r, r;
|
|
1734
1675
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return
|
|
1676
|
+
function Et(e) {
|
|
1677
|
+
return fe(e);
|
|
1737
1678
|
}
|
|
1738
|
-
function
|
|
1679
|
+
function gt() {
|
|
1739
1680
|
let e = new Date().getTime(), t = typeof performance < "u" && performance.now && performance.now() * 1e3 || 0;
|
|
1740
1681
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(r) {
|
|
1741
1682
|
let n = Math.random() * 16;
|
|
1742
1683
|
return e > 0 ? (n = (e + n) % 16 | 0, e = Math.floor(e / 16)) : (n = (t + n) % 16 | 0, t = Math.floor(t / 16)), (r === "x" ? n : n & 3 | 8).toString(16);
|
|
1743
1684
|
});
|
|
1744
1685
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() :
|
|
1686
|
+
function mt() {
|
|
1687
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : gt();
|
|
1747
1688
|
}
|
|
1748
|
-
function
|
|
1689
|
+
function d(e = mt()) {
|
|
1749
1690
|
return e;
|
|
1750
1691
|
}
|
|
1751
|
-
function
|
|
1692
|
+
function de() {
|
|
1752
1693
|
return "umd".trim();
|
|
1753
1694
|
}
|
|
1754
|
-
function
|
|
1695
|
+
function yt(e) {
|
|
1755
1696
|
if (typeof globalThis > "u") return;
|
|
1756
|
-
const t =
|
|
1697
|
+
const t = de(), r = globalThis[e] ?? {};
|
|
1757
1698
|
globalThis[e] = r;
|
|
1758
1699
|
const n = r.__diagnostics ??= {}, o = n.diModuleEval ??= {
|
|
1759
1700
|
evalCount: 0,
|
|
1760
|
-
records: []
|
|
1761
|
-
duplicateWarned: !1
|
|
1701
|
+
records: []
|
|
1762
1702
|
};
|
|
1763
|
-
|
|
1703
|
+
o.records.push({
|
|
1764
1704
|
buildSource: t,
|
|
1765
1705
|
timestamp: Date.now(),
|
|
1766
1706
|
stack: new Error().stack
|
|
1767
|
-
}), o.evalCount += 1
|
|
1768
|
-
o.duplicateWarned = !0;
|
|
1769
|
-
o.evalCount, o.records;
|
|
1707
|
+
}), o.evalCount += 1;
|
|
1770
1708
|
}
|
|
1771
|
-
function
|
|
1709
|
+
function At() {
|
|
1772
1710
|
return `__${"useblocks".trim()}__`;
|
|
1773
1711
|
}
|
|
1774
|
-
function
|
|
1775
|
-
if (
|
|
1776
|
-
const r =
|
|
1777
|
-
entries: [],
|
|
1778
|
-
warnings: []
|
|
1779
|
-
}, d = {
|
|
1712
|
+
function It(e, t) {
|
|
1713
|
+
if (yt(t), typeof globalThis > "u") return e;
|
|
1714
|
+
const r = de(), n = globalThis, o = n[t] = n[t] || {}, i = o.__diagnostics = o.__diagnostics || {}, s = i.dependencyResolver = i.dependencyResolver || { entries: [] }, l = {
|
|
1780
1715
|
container: e,
|
|
1781
1716
|
source: "packages/runtime-core/di/index.ts",
|
|
1782
1717
|
buildSource: r,
|
|
1783
1718
|
timestamp: Date.now(),
|
|
1784
1719
|
stack: new Error().stack
|
|
1785
1720
|
};
|
|
1786
|
-
|
|
1787
|
-
const f = s.entries[0];
|
|
1788
|
-
if (s.entries.some((c) => c.container !== f.container) && !s.duplicateWarningShown) {
|
|
1789
|
-
s.duplicateWarningShown = !0;
|
|
1790
|
-
const c = {
|
|
1791
|
-
message: "[di] Multiple DependencyResolver instances detected on namespace",
|
|
1792
|
-
namespaceKey: t,
|
|
1793
|
-
buildSource: r,
|
|
1794
|
-
entries: s.entries
|
|
1795
|
-
};
|
|
1796
|
-
s.warnings.push(c);
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
return e;
|
|
1721
|
+
return s.entries.push(l), e;
|
|
1800
1722
|
}
|
|
1801
|
-
var
|
|
1802
|
-
function
|
|
1803
|
-
if (
|
|
1804
|
-
const e =
|
|
1805
|
-
return
|
|
1723
|
+
var F;
|
|
1724
|
+
function Tt() {
|
|
1725
|
+
if (F) return F;
|
|
1726
|
+
const e = At();
|
|
1727
|
+
return F = It(fe(e), e), F;
|
|
1806
1728
|
}
|
|
1807
1729
|
new Proxy({}, { get(e, t, r) {
|
|
1808
|
-
const n =
|
|
1730
|
+
const n = Tt(), o = Reflect.get(n, t, r);
|
|
1809
1731
|
return typeof o == "function" ? o.bind(n) : o;
|
|
1810
1732
|
} });
|
|
1811
|
-
function
|
|
1733
|
+
function St(e, t = "BackendError") {
|
|
1812
1734
|
switch (e) {
|
|
1813
1735
|
case 400: return "ValidationError";
|
|
1814
1736
|
case 401: return "AuthenticationFailed";
|
|
@@ -1823,7 +1745,7 @@ __useblocks__.define("useblocks.js", [
|
|
|
1823
1745
|
default: return t;
|
|
1824
1746
|
}
|
|
1825
1747
|
}
|
|
1826
|
-
var
|
|
1748
|
+
var vt = class {
|
|
1827
1749
|
_plugins = new Map();
|
|
1828
1750
|
_listeners = new Map();
|
|
1829
1751
|
_getOrCreateEntry(e) {
|
|
@@ -1936,7 +1858,7 @@ __useblocks__.define("useblocks.js", [
|
|
|
1936
1858
|
e.add(t, r);
|
|
1937
1859
|
} };
|
|
1938
1860
|
}
|
|
1939
|
-
},
|
|
1861
|
+
}, wt = class {
|
|
1940
1862
|
resolveRegistry;
|
|
1941
1863
|
constructor(e) {
|
|
1942
1864
|
this.resolveRegistry = e;
|
|
@@ -1983,86 +1905,86 @@ __useblocks__.define("useblocks.js", [
|
|
|
1983
1905
|
forContext() {
|
|
1984
1906
|
return this.target().forContext();
|
|
1985
1907
|
}
|
|
1986
|
-
},
|
|
1987
|
-
function
|
|
1908
|
+
}, q = null, Ot = "core";
|
|
1909
|
+
function Dt() {
|
|
1988
1910
|
return typeof __useblocks__?.require != "function" ? Promise.reject(new Error("[loadEngine] AMD loader is unavailable")) : new Promise((e, t) => {
|
|
1989
|
-
__useblocks__.require([
|
|
1911
|
+
__useblocks__.require([Ot], (r) => e(r), (r) => t(r instanceof Error ? r : new Error("[loadEngine] Failed to require core module")));
|
|
1990
1912
|
});
|
|
1991
1913
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return
|
|
1914
|
+
function $() {
|
|
1915
|
+
return q || (q = Dt()), q;
|
|
1994
1916
|
}
|
|
1995
|
-
var
|
|
1996
|
-
async function
|
|
1917
|
+
var K = null, X = null;
|
|
1918
|
+
async function bt(e) {
|
|
1997
1919
|
typeof e?.prefetch == "function" && await e.prefetch();
|
|
1998
1920
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return
|
|
1921
|
+
function pe() {
|
|
1922
|
+
return K || (K = $().then(() => {})), K;
|
|
2001
1923
|
}
|
|
2002
|
-
function
|
|
2003
|
-
return
|
|
1924
|
+
function z(e) {
|
|
1925
|
+
return X || (X = bt(e)), X;
|
|
2004
1926
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return Promise.all([
|
|
1927
|
+
function _e(e) {
|
|
1928
|
+
return Promise.all([pe(), z(e)]).then(() => {});
|
|
2007
1929
|
}
|
|
2008
|
-
function
|
|
1930
|
+
function Nt(e) {
|
|
2009
1931
|
const t = e?.startupPrefetchMode;
|
|
2010
1932
|
return t === "eager" || t === "idle" || t === "manual" || t === "off" ? t : "eager";
|
|
2011
1933
|
}
|
|
2012
|
-
function
|
|
2013
|
-
Promise.resolve().then(() =>
|
|
1934
|
+
function J(e) {
|
|
1935
|
+
Promise.resolve().then(() => _e(e)).catch(() => {});
|
|
2014
1936
|
}
|
|
2015
|
-
function
|
|
2016
|
-
Promise.resolve().then(() =>
|
|
1937
|
+
function Ct(e) {
|
|
1938
|
+
Promise.resolve().then(() => z(e)).catch(() => {});
|
|
2017
1939
|
}
|
|
2018
|
-
function
|
|
2019
|
-
const t =
|
|
2020
|
-
if (t === "eager")
|
|
1940
|
+
function Pt(e) {
|
|
1941
|
+
const t = Nt(e);
|
|
1942
|
+
if (t === "eager") J(e);
|
|
2021
1943
|
else if (t === "idle") {
|
|
2022
1944
|
const r = window.requestIdleCallback;
|
|
2023
|
-
typeof r == "function" ? r(() =>
|
|
1945
|
+
typeof r == "function" ? r(() => J(e), { timeout: 1500 }) : setTimeout(() => J(e), 0);
|
|
2024
1946
|
}
|
|
2025
1947
|
}
|
|
2026
|
-
var
|
|
2027
|
-
function
|
|
2028
|
-
return e.getOrCreateInstance(
|
|
1948
|
+
var Lt = "PluginRegistry";
|
|
1949
|
+
function Rt(e = Et()) {
|
|
1950
|
+
return e.getOrCreateInstance(Lt, () => new vt());
|
|
2029
1951
|
}
|
|
2030
|
-
var
|
|
2031
|
-
function
|
|
1952
|
+
var Mt = new wt(() => Rt()), P = new WeakMap(), xt = "data-useblocks-config-styles";
|
|
1953
|
+
function kt(e) {
|
|
2032
1954
|
return typeof e == "string" ? e.trim() : "";
|
|
2033
1955
|
}
|
|
2034
|
-
function
|
|
1956
|
+
function he(e, t) {
|
|
2035
1957
|
if (e.firstChild) {
|
|
2036
1958
|
e.insertBefore(t, e.firstChild);
|
|
2037
1959
|
return;
|
|
2038
1960
|
}
|
|
2039
1961
|
e.appendChild(t);
|
|
2040
1962
|
}
|
|
2041
|
-
function
|
|
1963
|
+
function Ut(e, t, r) {
|
|
2042
1964
|
if (!e || typeof document > "u") return null;
|
|
2043
|
-
const n =
|
|
2044
|
-
if (!n) return o && (o.remove(),
|
|
2045
|
-
if (o) return o.textContent !== n && (o.textContent = n), (o.parentNode !== i || o !== i.firstChild) &&
|
|
1965
|
+
const n = kt(t), o = P.get(e), i = r || e;
|
|
1966
|
+
if (!n) return o && (o.remove(), P.delete(e)), null;
|
|
1967
|
+
if (o) return o.textContent !== n && (o.textContent = n), (o.parentNode !== i || o !== i.firstChild) && he(i, o), o;
|
|
2046
1968
|
const s = document.createElement("style");
|
|
2047
|
-
return s.setAttribute(
|
|
1969
|
+
return s.setAttribute(xt, "true"), s.textContent = n, he(i, s), P.set(e, s), s;
|
|
2048
1970
|
}
|
|
2049
|
-
function
|
|
1971
|
+
function Ft(e) {
|
|
2050
1972
|
if (!e) return;
|
|
2051
|
-
const t =
|
|
2052
|
-
t && (t.remove(),
|
|
1973
|
+
const t = P.get(e);
|
|
1974
|
+
t && (t.remove(), P.delete(e));
|
|
2053
1975
|
}
|
|
2054
|
-
function
|
|
1976
|
+
function T(e) {
|
|
2055
1977
|
if (e instanceof DOMException && e.name === "AbortError") return e;
|
|
2056
1978
|
const t = e === void 0 ? "The operation was aborted." : typeof e == "string" ? e : e instanceof Error ? e.message : String(e);
|
|
2057
1979
|
return new DOMException(t, "AbortError");
|
|
2058
1980
|
}
|
|
2059
|
-
function
|
|
2060
|
-
if (e?.aborted) throw
|
|
1981
|
+
function h(e) {
|
|
1982
|
+
if (e?.aborted) throw T(e.reason);
|
|
2061
1983
|
}
|
|
2062
|
-
function
|
|
2063
|
-
return t ? (
|
|
1984
|
+
function jt(e, t) {
|
|
1985
|
+
return t ? (h(t), new Promise((r, n) => {
|
|
2064
1986
|
const o = () => {
|
|
2065
|
-
i(), n(
|
|
1987
|
+
i(), n(T(t.reason));
|
|
2066
1988
|
}, i = () => {
|
|
2067
1989
|
t.removeEventListener("abort", o);
|
|
2068
1990
|
};
|
|
@@ -2073,10 +1995,10 @@ __useblocks__.define("useblocks.js", [
|
|
|
2073
1995
|
});
|
|
2074
1996
|
})) : e;
|
|
2075
1997
|
}
|
|
2076
|
-
function
|
|
1998
|
+
function Bt(e) {
|
|
2077
1999
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/([^a-zA-Z0-9_-])/g, "\\$1");
|
|
2078
2000
|
}
|
|
2079
|
-
function
|
|
2001
|
+
function Y(e, t = document) {
|
|
2080
2002
|
try {
|
|
2081
2003
|
const n = t.querySelector(e);
|
|
2082
2004
|
if (n) return n;
|
|
@@ -2087,75 +2009,75 @@ __useblocks__.define("useblocks.js", [
|
|
|
2087
2009
|
for (let n = 0; n < r.length; n++) {
|
|
2088
2010
|
const o = r[n]?.shadowRoot;
|
|
2089
2011
|
if (!o) continue;
|
|
2090
|
-
const i =
|
|
2012
|
+
const i = Y(e, o);
|
|
2091
2013
|
if (i) return i;
|
|
2092
2014
|
}
|
|
2093
2015
|
return null;
|
|
2094
2016
|
}
|
|
2095
|
-
function
|
|
2017
|
+
function Ee(e, t = []) {
|
|
2096
2018
|
const r = e.querySelectorAll("*");
|
|
2097
2019
|
for (let n = 0; n < r.length; n++) {
|
|
2098
2020
|
const o = r[n]?.shadowRoot;
|
|
2099
|
-
o && (t.push(o),
|
|
2021
|
+
o && (t.push(o), Ee(o, t));
|
|
2100
2022
|
}
|
|
2101
2023
|
return t;
|
|
2102
2024
|
}
|
|
2103
|
-
function
|
|
2025
|
+
function Ht(e, t, r) {
|
|
2104
2026
|
if (e.isConnected) return e;
|
|
2105
2027
|
const n = e.id?.trim();
|
|
2106
|
-
return n ?
|
|
2028
|
+
return n ? ge(`#${Bt(n)}`, t, r) : Promise.reject(T("Editor mount element was disconnected and has no id — pass a CSS selector or call init() again after the host remounts the container."));
|
|
2107
2029
|
}
|
|
2108
|
-
function
|
|
2109
|
-
if (
|
|
2030
|
+
function ge(e, t, r) {
|
|
2031
|
+
if (h(r), typeof e < "u") {
|
|
2110
2032
|
if (typeof e == "string") {
|
|
2111
|
-
const n = e, o =
|
|
2033
|
+
const n = e, o = Y(n);
|
|
2112
2034
|
if (o) return o;
|
|
2113
|
-
const i = t.addDisposable(new
|
|
2114
|
-
return new Promise((s,
|
|
2115
|
-
const f = (
|
|
2116
|
-
i.dispose(),
|
|
2035
|
+
const i = t.addDisposable(new N());
|
|
2036
|
+
return new Promise((s, l) => {
|
|
2037
|
+
const f = (m) => {
|
|
2038
|
+
i.dispose(), m();
|
|
2117
2039
|
}, c = () => {
|
|
2118
|
-
f(() =>
|
|
2040
|
+
f(() => l(T(r?.reason)));
|
|
2119
2041
|
};
|
|
2120
2042
|
if (r?.aborted) {
|
|
2121
2043
|
c();
|
|
2122
2044
|
return;
|
|
2123
2045
|
}
|
|
2124
2046
|
r?.addEventListener("abort", c), i.addDispose(() => r?.removeEventListener("abort", c));
|
|
2125
|
-
const
|
|
2126
|
-
if (!
|
|
2127
|
-
f(() =>
|
|
2047
|
+
const u = document.body ?? document.documentElement;
|
|
2048
|
+
if (!u) {
|
|
2049
|
+
f(() => l(T("Document is not ready to observe mount element")));
|
|
2128
2050
|
return;
|
|
2129
2051
|
}
|
|
2130
|
-
const p = new Set(),
|
|
2131
|
-
const
|
|
2132
|
-
if (
|
|
2133
|
-
f(() => s(
|
|
2052
|
+
const p = new Set(), b = new MutationObserver(() => {
|
|
2053
|
+
const m = Y(n);
|
|
2054
|
+
if (m) {
|
|
2055
|
+
f(() => s(m));
|
|
2134
2056
|
return;
|
|
2135
2057
|
}
|
|
2136
|
-
|
|
2137
|
-
}),
|
|
2138
|
-
p.has(
|
|
2058
|
+
U();
|
|
2059
|
+
}), g = (m) => {
|
|
2060
|
+
p.has(m) || (p.add(m), b.observe(m, {
|
|
2139
2061
|
attributes: !0,
|
|
2140
2062
|
childList: !0,
|
|
2141
2063
|
subtree: !0
|
|
2142
2064
|
}));
|
|
2143
|
-
},
|
|
2144
|
-
const
|
|
2145
|
-
if (
|
|
2065
|
+
}, U = () => {
|
|
2066
|
+
const m = document.documentElement;
|
|
2067
|
+
if (m) for (const un of Ee(m)) g(un);
|
|
2146
2068
|
};
|
|
2147
|
-
|
|
2069
|
+
g(u), U(), i.addDispose(() => b.disconnect());
|
|
2148
2070
|
});
|
|
2149
2071
|
}
|
|
2150
|
-
return e instanceof Element ?
|
|
2072
|
+
return e instanceof Element ? Ht(e, t, r) : e;
|
|
2151
2073
|
}
|
|
2152
2074
|
return e;
|
|
2153
2075
|
}
|
|
2154
|
-
var
|
|
2155
|
-
function
|
|
2076
|
+
var S = new Map();
|
|
2077
|
+
function me() {
|
|
2156
2078
|
return !1;
|
|
2157
2079
|
}
|
|
2158
|
-
var
|
|
2080
|
+
var Gt = `
|
|
2159
2081
|
.blocks-app-initial-spinner-wrapper {
|
|
2160
2082
|
width: 100%;
|
|
2161
2083
|
height: 100%;
|
|
@@ -2185,11 +2107,11 @@ __useblocks__.define("useblocks.js", [
|
|
|
2185
2107
|
transform: rotate(360deg);
|
|
2186
2108
|
}
|
|
2187
2109
|
}`;
|
|
2188
|
-
function
|
|
2110
|
+
function Wt() {
|
|
2189
2111
|
return () => {};
|
|
2190
2112
|
}
|
|
2191
|
-
function
|
|
2192
|
-
if (!
|
|
2113
|
+
function Vt(e, t) {
|
|
2114
|
+
if (!me() || !e || typeof document > "u") return Wt();
|
|
2193
2115
|
e.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((s) => {
|
|
2194
2116
|
s.remove();
|
|
2195
2117
|
});
|
|
@@ -2198,21 +2120,329 @@ __useblocks__.define("useblocks.js", [
|
|
|
2198
2120
|
const n = document.createElement("div");
|
|
2199
2121
|
n.classList.add("blocks-app-initial-spinner"), r.appendChild(n);
|
|
2200
2122
|
const o = document.createElement("style");
|
|
2201
|
-
o.setAttribute(t, "true"), o.textContent =
|
|
2123
|
+
o.setAttribute(t, "true"), o.textContent = Gt, document.head?.appendChild(o), e.appendChild(r);
|
|
2202
2124
|
let i = !1;
|
|
2203
2125
|
return () => {
|
|
2204
2126
|
i || (i = !0, r.remove(), o.remove());
|
|
2205
2127
|
};
|
|
2206
2128
|
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2129
|
+
var C, ye = ce((() => {
|
|
2130
|
+
ye(), C = typeof C < "u" ? C : typeof self < "u" ? self : typeof window < "u" ? window : {};
|
|
2131
|
+
}));
|
|
2132
|
+
function Ae() {
|
|
2133
|
+
throw new Error("setTimeout has not been defined");
|
|
2134
|
+
}
|
|
2135
|
+
function Ie() {
|
|
2136
|
+
throw new Error("clearTimeout has not been defined");
|
|
2209
2137
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2138
|
+
function Te(e) {
|
|
2139
|
+
if (A === setTimeout) return setTimeout(e, 0);
|
|
2140
|
+
if ((A === Ae || !A) && setTimeout) return A = setTimeout, setTimeout(e, 0);
|
|
2141
|
+
try {
|
|
2142
|
+
return A(e, 0);
|
|
2143
|
+
} catch {
|
|
2144
|
+
try {
|
|
2145
|
+
return A.call(null, e, 0);
|
|
2146
|
+
} catch {
|
|
2147
|
+
return A.call(this, e, 0);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
function qt(e) {
|
|
2152
|
+
if (I === clearTimeout) return clearTimeout(e);
|
|
2153
|
+
if ((I === Ie || !I) && clearTimeout) return I = clearTimeout, clearTimeout(e);
|
|
2154
|
+
try {
|
|
2155
|
+
return I(e);
|
|
2156
|
+
} catch {
|
|
2157
|
+
try {
|
|
2158
|
+
return I.call(null, e);
|
|
2159
|
+
} catch {
|
|
2160
|
+
return I.call(this, e);
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
function $t() {
|
|
2165
|
+
!w || !O || (w = !1, O.length ? y = O.concat(y) : L = -1, y.length && Se());
|
|
2166
|
+
}
|
|
2167
|
+
function Se() {
|
|
2168
|
+
if (!w) {
|
|
2169
|
+
var e = Te($t);
|
|
2170
|
+
w = !0;
|
|
2171
|
+
for (var t = y.length; t;) {
|
|
2172
|
+
for (O = y, y = []; ++L < t;) O && O[L].run();
|
|
2173
|
+
L = -1, t = y.length;
|
|
2174
|
+
}
|
|
2175
|
+
O = null, w = !1, qt(e);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
function Kt(e) {
|
|
2179
|
+
var t = new Array(arguments.length - 1);
|
|
2180
|
+
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
|
|
2181
|
+
y.push(new ve(e, t)), y.length === 1 && !w && Te(Se);
|
|
2182
|
+
}
|
|
2183
|
+
function ve(e, t) {
|
|
2184
|
+
this.fun = e, this.array = t;
|
|
2185
|
+
}
|
|
2186
|
+
function v() {}
|
|
2187
|
+
function Xt(e) {
|
|
2188
|
+
throw new Error("process.binding is not supported");
|
|
2189
|
+
}
|
|
2190
|
+
function zt() {
|
|
2191
|
+
return "/";
|
|
2192
|
+
}
|
|
2193
|
+
function Jt(e) {
|
|
2194
|
+
throw new Error("process.chdir is not supported");
|
|
2195
|
+
}
|
|
2196
|
+
function Yt() {
|
|
2197
|
+
return 0;
|
|
2198
|
+
}
|
|
2199
|
+
function Qt(e) {
|
|
2200
|
+
var t = je.call(D) * .001, r = Math.floor(t), n = Math.floor(t % 1 * 1e9);
|
|
2201
|
+
return e && (r = r - e[0], n = n - e[1], n < 0 && (r--, n += 1e9)), [r, n];
|
|
2202
|
+
}
|
|
2203
|
+
function Zt() {
|
|
2204
|
+
return (new Date() - Be) / 1e3;
|
|
2205
|
+
}
|
|
2206
|
+
var A, I, y, w, O, L, we, Oe, De, be, Ne, Ce, Pe, Le, Re, Me, xe, ke, Ue, Fe, D, je, Be, j;
|
|
2207
|
+
ce((() => {
|
|
2208
|
+
ye(), A = Ae, I = Ie, typeof C.setTimeout == "function" && (A = setTimeout), typeof C.clearTimeout == "function" && (I = clearTimeout), y = [], w = !1, L = -1, ve.prototype.run = function() {
|
|
2209
|
+
this.fun.apply(null, this.array);
|
|
2210
|
+
}, we = "browser", Oe = "browser", De = {}, be = [], Ne = {}, Ce = {}, Pe = {}, Le = v, Re = v, Me = v, xe = v, ke = v, Ue = v, Fe = v, D = C.performance || {}, je = D.now || D.mozNow || D.msNow || D.oNow || D.webkitNow || function() {
|
|
2211
|
+
return new Date().getTime();
|
|
2212
|
+
}, Be = new Date(), j = {
|
|
2213
|
+
nextTick: Kt,
|
|
2214
|
+
title: we,
|
|
2215
|
+
browser: !0,
|
|
2216
|
+
env: De,
|
|
2217
|
+
argv: be,
|
|
2218
|
+
version: "",
|
|
2219
|
+
versions: Ne,
|
|
2220
|
+
on: Le,
|
|
2221
|
+
addListener: Re,
|
|
2222
|
+
once: Me,
|
|
2223
|
+
off: xe,
|
|
2224
|
+
removeListener: ke,
|
|
2225
|
+
removeAllListeners: Ue,
|
|
2226
|
+
emit: Fe,
|
|
2227
|
+
binding: Xt,
|
|
2228
|
+
cwd: zt,
|
|
2229
|
+
chdir: Jt,
|
|
2230
|
+
umask: Yt,
|
|
2231
|
+
hrtime: Qt,
|
|
2232
|
+
platform: Oe,
|
|
2233
|
+
release: Ce,
|
|
2234
|
+
config: Pe,
|
|
2235
|
+
uptime: Zt
|
|
2236
|
+
};
|
|
2237
|
+
}))();
|
|
2238
|
+
function R(e) {
|
|
2239
|
+
for (; e.endsWith("/");) e = e.slice(0, e.length - 1);
|
|
2240
|
+
return /\/wp-json$/i.test(e) ? e : `${e}/wp-json`;
|
|
2241
|
+
}
|
|
2242
|
+
function Q(...e) {
|
|
2243
|
+
const t = e.filter((i) => i != null);
|
|
2244
|
+
if (t.length === 0) return;
|
|
2245
|
+
if (t.length === 1) return t[0];
|
|
2246
|
+
const r = t.find((i) => i.aborted);
|
|
2247
|
+
if (r) return r;
|
|
2248
|
+
if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(t);
|
|
2249
|
+
const n = new AbortController(), o = (i) => {
|
|
2250
|
+
n.signal.aborted || n.abort(i.reason);
|
|
2251
|
+
};
|
|
2252
|
+
for (const i of t) i.addEventListener("abort", () => o(i), { once: !0 });
|
|
2253
|
+
return n.signal;
|
|
2254
|
+
}
|
|
2255
|
+
var He = 3e5, Ge = 15e3, _ = null, We = !1;
|
|
2256
|
+
function nr() {
|
|
2257
|
+
return !0;
|
|
2258
|
+
}
|
|
2259
|
+
function or() {
|
|
2260
|
+
const e = String(j.env.REACT_APP_OPENAPI_FAILOVER_TTL_MS || "").trim();
|
|
2261
|
+
if (!e) return He;
|
|
2262
|
+
const t = Number(e);
|
|
2263
|
+
return Number.isFinite(t) && t > 0 ? t : He;
|
|
2264
|
+
}
|
|
2265
|
+
function ir() {
|
|
2266
|
+
const e = String(j.env.REACT_APP_OPENAPI_FAILOVER_ATTEMPT_TIMEOUT_MS || "").trim();
|
|
2267
|
+
if (!e) return Ge;
|
|
2268
|
+
const t = Number(e);
|
|
2269
|
+
return Number.isFinite(t) && t > 0 ? t : Ge;
|
|
2270
|
+
}
|
|
2271
|
+
function sr() {
|
|
2272
|
+
return R("https://app.useblocks.io/api".trim());
|
|
2273
|
+
}
|
|
2274
|
+
function ar(e) {
|
|
2275
|
+
const t = e.trim();
|
|
2276
|
+
if (!t) return [];
|
|
2277
|
+
if (t.startsWith("[")) try {
|
|
2278
|
+
const r = JSON.parse(t);
|
|
2279
|
+
if (!Array.isArray(r)) throw new Error("expected JSON array");
|
|
2280
|
+
return r.map((n) => String(n).trim()).filter(Boolean);
|
|
2281
|
+
} catch {
|
|
2282
|
+
return We || (We = !0), [];
|
|
2283
|
+
}
|
|
2284
|
+
return t.split(",").map((r) => r.trim()).filter(Boolean);
|
|
2285
|
+
}
|
|
2286
|
+
function cr(e) {
|
|
2287
|
+
const t = new Set(), r = [];
|
|
2288
|
+
for (const n of e) {
|
|
2289
|
+
const o = R(n);
|
|
2290
|
+
t.has(o) || (t.add(o), r.push(o));
|
|
2291
|
+
}
|
|
2292
|
+
return r;
|
|
2293
|
+
}
|
|
2294
|
+
function Ve(e) {
|
|
2295
|
+
const t = String(e || "").trim();
|
|
2296
|
+
return t ? R(t) : sr();
|
|
2297
|
+
}
|
|
2298
|
+
function qe(e, t = []) {
|
|
2299
|
+
return e ? cr([e, ...t]).slice(0, 3) : [];
|
|
2300
|
+
}
|
|
2301
|
+
function $e() {
|
|
2302
|
+
return ar(String(j.env.REACT_APP_OPENAPI_FAILOVER_BASE_URLS || "").trim());
|
|
2303
|
+
}
|
|
2304
|
+
function ur(e = Date.now()) {
|
|
2305
|
+
return _ ? e - _.switchedAt >= or() : !0;
|
|
2306
|
+
}
|
|
2307
|
+
function Ke(e = Date.now()) {
|
|
2308
|
+
_ && ur(e) && (_ = null);
|
|
2309
|
+
}
|
|
2310
|
+
function M(e) {
|
|
2311
|
+
if (!nr()) return !1;
|
|
2312
|
+
const t = Ve(e);
|
|
2313
|
+
if (!t) return !1;
|
|
2314
|
+
const r = $e();
|
|
2315
|
+
return r.length === 0 ? !1 : qe(t, r).length > 1;
|
|
2316
|
+
}
|
|
2317
|
+
function x(e) {
|
|
2318
|
+
const t = Ve(e);
|
|
2319
|
+
if (!t) return [];
|
|
2320
|
+
const r = $e();
|
|
2321
|
+
return r.length === 0 ? [t] : qe(t, r);
|
|
2322
|
+
}
|
|
2323
|
+
function Xe(e) {
|
|
2324
|
+
const t = x(e);
|
|
2325
|
+
if (t.length === 0) return "";
|
|
2326
|
+
if (Ke(), _) {
|
|
2327
|
+
const r = t.indexOf(_.activeUrl);
|
|
2328
|
+
if (r >= 0) return t[r];
|
|
2329
|
+
}
|
|
2330
|
+
return t[0];
|
|
2331
|
+
}
|
|
2332
|
+
function lr(e) {
|
|
2333
|
+
const t = x(e);
|
|
2334
|
+
if (t.length <= 1 || (Ke(), !_ || !t.includes(_.activeUrl))) return t;
|
|
2335
|
+
const r = _.activeUrl;
|
|
2336
|
+
return [r, ...t.filter((n) => n !== r)];
|
|
2337
|
+
}
|
|
2338
|
+
function fr(e) {
|
|
2339
|
+
return Xe(e) || void 0;
|
|
2340
|
+
}
|
|
2341
|
+
function dr(e) {
|
|
2342
|
+
const t = e || void 0;
|
|
2343
|
+
if (typeof AbortController > "u") return {
|
|
2344
|
+
signal: t,
|
|
2345
|
+
timeoutError: () => {},
|
|
2346
|
+
done: () => {}
|
|
2347
|
+
};
|
|
2348
|
+
const r = ir(), n = new AbortController();
|
|
2349
|
+
let o;
|
|
2350
|
+
const i = setTimeout(() => {
|
|
2351
|
+
o = pr(r), n.abort(o);
|
|
2352
|
+
}, r);
|
|
2353
|
+
return {
|
|
2354
|
+
signal: Q(t, n.signal),
|
|
2355
|
+
timeoutError: () => o,
|
|
2356
|
+
done: () => clearTimeout(i)
|
|
2357
|
+
};
|
|
2358
|
+
}
|
|
2359
|
+
function pr(e) {
|
|
2360
|
+
const t = `[apiOriginFailover] origin attempt timed out after ${e}ms`;
|
|
2361
|
+
if (typeof DOMException == "function") return new DOMException(t, "TimeoutError");
|
|
2362
|
+
const r = new Error(t);
|
|
2363
|
+
return r.name = "TimeoutError", r;
|
|
2364
|
+
}
|
|
2365
|
+
function _r(e) {
|
|
2366
|
+
return e === 502 || e === 503 || e === 504;
|
|
2367
|
+
}
|
|
2368
|
+
function hr(e) {
|
|
2369
|
+
return !(e instanceof Error) && !(e instanceof DOMException) ? !1 : e.name === "TimeoutError" ? !0 : e instanceof TypeError;
|
|
2370
|
+
}
|
|
2371
|
+
var ze;
|
|
2372
|
+
function Er(e) {
|
|
2373
|
+
ze = e;
|
|
2374
|
+
}
|
|
2375
|
+
function Je(e, t) {
|
|
2376
|
+
if (!M(t)) return;
|
|
2377
|
+
const r = x(t);
|
|
2378
|
+
if (r.length <= 1) return;
|
|
2379
|
+
const n = r.indexOf(R(e));
|
|
2380
|
+
if (n < 0) return;
|
|
2381
|
+
const o = n + 1;
|
|
2382
|
+
if (o >= r.length) return;
|
|
2383
|
+
const i = r[o], s = _?.activeUrl;
|
|
2384
|
+
_ = {
|
|
2385
|
+
activeUrl: i,
|
|
2386
|
+
switchedAt: Date.now()
|
|
2387
|
+
}, s !== i && ze?.();
|
|
2388
|
+
}
|
|
2389
|
+
function gr(e, t) {
|
|
2390
|
+
if (!M(t)) return;
|
|
2391
|
+
const r = R(e), n = x(t);
|
|
2392
|
+
if (n.includes(r)) {
|
|
2393
|
+
if (r === n[0]) {
|
|
2394
|
+
_ = null;
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
_?.activeUrl !== r && (_ = {
|
|
2398
|
+
activeUrl: r,
|
|
2399
|
+
switchedAt: Date.now()
|
|
2400
|
+
});
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
function mr() {
|
|
2404
|
+
_ = null;
|
|
2405
|
+
}
|
|
2406
|
+
async function yr(e, t, r, n) {
|
|
2407
|
+
const o = n?.attemptTimeout ?? M(r), i = M(r) ? lr(r) : x(r).length > 0 ? [Xe(r)] : [];
|
|
2408
|
+
if (i.length === 0) throw new Error("[apiOriginFailover] no API base URL configured");
|
|
2409
|
+
const s = e.startsWith("/") ? e : `/${e}`;
|
|
2410
|
+
let l, f;
|
|
2411
|
+
for (let c = 0; c < i.length; c++) {
|
|
2412
|
+
const u = i[c], p = c === i.length - 1, b = o ? dr(t.signal) : void 0;
|
|
2413
|
+
try {
|
|
2414
|
+
const g = await fetch(`${u}${s}`, {
|
|
2415
|
+
...t,
|
|
2416
|
+
...b ? { signal: b.signal } : {}
|
|
2417
|
+
});
|
|
2418
|
+
if (!g.ok && _r(g.status)) {
|
|
2419
|
+
if (l = g, !p) {
|
|
2420
|
+
Je(u, r);
|
|
2421
|
+
continue;
|
|
2422
|
+
}
|
|
2423
|
+
break;
|
|
2424
|
+
}
|
|
2425
|
+
return g.ok && gr(u, r), g;
|
|
2426
|
+
} catch (g) {
|
|
2427
|
+
const U = b?.timeoutError();
|
|
2428
|
+
if (!U && !hr(g)) throw g;
|
|
2429
|
+
f = U || g, p || Je(u, r);
|
|
2430
|
+
} finally {
|
|
2431
|
+
b?.done();
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
if (M(r) && mr(), l) return l;
|
|
2435
|
+
throw f instanceof Error ? f : new Error("[apiOriginFailover] fetch chain failed");
|
|
2436
|
+
}
|
|
2437
|
+
function k(e) {
|
|
2438
|
+
return d(e);
|
|
2439
|
+
}
|
|
2440
|
+
k("HANDLE_ATOM_INSERT");
|
|
2441
|
+
k("SETTINGS_PANEL_EVENT");
|
|
2442
|
+
k("MODAL_SHOW_EVENT");
|
|
2443
|
+
k("MODAL_CLOSE_EVENT");
|
|
2444
|
+
k("MODAL_UPDATE_EVENT");
|
|
2445
|
+
var Ar = ue(((e) => {
|
|
2216
2446
|
var t = {
|
|
2217
2447
|
isMounted: function() {
|
|
2218
2448
|
return !1;
|
|
@@ -2221,168 +2451,221 @@ __useblocks__.define("useblocks.js", [
|
|
|
2221
2451
|
enqueueReplaceState: function() {},
|
|
2222
2452
|
enqueueSetState: function() {}
|
|
2223
2453
|
}, r = Object.assign, n = {};
|
|
2224
|
-
function o(c,
|
|
2225
|
-
this.props = c, this.context =
|
|
2454
|
+
function o(c, u, p) {
|
|
2455
|
+
this.props = c, this.context = u, this.refs = n, this.updater = p || t;
|
|
2226
2456
|
}
|
|
2227
|
-
o.prototype.isReactComponent = {}, o.prototype.setState = function(c,
|
|
2457
|
+
o.prototype.isReactComponent = {}, o.prototype.setState = function(c, u) {
|
|
2228
2458
|
if (typeof c != "object" && typeof c != "function" && c != null) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
2229
|
-
this.updater.enqueueSetState(this, c,
|
|
2459
|
+
this.updater.enqueueSetState(this, c, u, "setState");
|
|
2230
2460
|
}, o.prototype.forceUpdate = function(c) {
|
|
2231
2461
|
this.updater.enqueueForceUpdate(this, c, "forceUpdate");
|
|
2232
2462
|
};
|
|
2233
2463
|
function i() {}
|
|
2234
2464
|
i.prototype = o.prototype;
|
|
2235
|
-
function s(c,
|
|
2236
|
-
this.props = c, this.context =
|
|
2465
|
+
function s(c, u, p) {
|
|
2466
|
+
this.props = c, this.context = u, this.refs = n, this.updater = p || t;
|
|
2237
2467
|
}
|
|
2238
|
-
var
|
|
2239
|
-
|
|
2468
|
+
var l = s.prototype = new i();
|
|
2469
|
+
l.constructor = s, r(l, o.prototype), l.isPureReactComponent = !0;
|
|
2240
2470
|
Array.isArray;
|
|
2241
2471
|
}));
|
|
2242
|
-
|
|
2243
|
-
t.exports =
|
|
2472
|
+
ue(((e, t) => {
|
|
2473
|
+
t.exports = Ar();
|
|
2244
2474
|
}))();
|
|
2245
2475
|
function a(e) {
|
|
2246
|
-
return
|
|
2476
|
+
return d(e);
|
|
2247
2477
|
}
|
|
2248
|
-
var
|
|
2478
|
+
var Ye;
|
|
2249
2479
|
(function(e) {
|
|
2250
2480
|
e.BEFORE_SAVE_EMAIL = a(), e.ON_SAVEBUTTON_CLICK_ID = a(), e.ON_NEXTBUTTON_CLICK_ID = a(), e.ON_PREVIOUSBUTTON_CLICK_ID = a(), e.ON_MODEL_CHANGE = a(), e.WILL_EMAIL_INIT_ID = a(), e.ON_EMAIL_INIT_ID = a(), e.ON_BLOCK_INIT_ID = a(), e.ON_CONTENT_CHANGED_ID = a(), e.ON_PREHEADER_CHANGED_ID = a(), e.ON_SUBJECT_CHANGED_ID = a(), e.ON_EMAIL_CHANGED_ID = a(), e.ON_BLOCK_CHANGED_ID = a(), e.ON_CHUNKS_LOADED = a(), e.ON_SEND_TESTEMAIL_ID = a(), e.ON_SEND_LIVEPREVIEW_ID = a(), e.ON_SHARE_ID = a(), e.ON_SHOW_PREVIEW_ID = a(), e.ON_EMAIL_CLONE_ID = a(), e.ON_SEND_EMAIL_MODAL_ID = a(), e.ON_NOTIFICATION = a(), e.READ_LOCALE = a(), e.ON_TRANSLATE_ID = a(), e.ON_CODE_VALIDATE_ID = a(), e.UPLOAD_EVENT_ID = a(), e.PROXY_URL_EVENT_ID = a(), e.FILE_PROXY_EVENT_ID = a(), e.ON_LIMIT_ID = a(), e.ON_BROWSER_EXTENSION_DETECTED_ID = a(), e.ON_LAYOUT_CONVERT_REQUEST_ID = a(), e.ON_BROWSER_TRANSLATE_DETECTED_ID = a(), e.AI_TEXT_REQUEST_ID = a(), e.AI_IMAGE_REQUEST_ID = a(), e.AI_TEXT_PROGRESS_ID = a(), e.AI_IMAGE_PROGRESS_ID = a(), e.AI_TEXT_STREAM_ID = a();
|
|
2251
|
-
})(
|
|
2481
|
+
})(Ye || (Ye = {}));
|
|
2252
2482
|
a("APP_LOAD_EVENT");
|
|
2253
2483
|
a("CONFIG_CHANGED_EVENT");
|
|
2254
|
-
function
|
|
2255
|
-
|
|
2256
|
-
return /\/wp-json$/i.test(e) ? e : `${e}/wp-json`;
|
|
2484
|
+
function Qe(e) {
|
|
2485
|
+
return String(e.standaloneKey || "").trim() || void 0;
|
|
2257
2486
|
}
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
Accept: "application/json"
|
|
2280
|
-
},
|
|
2281
|
-
body: `{"filter":{},"limit":${i}}`
|
|
2282
|
-
};
|
|
2283
|
-
return await (await fetch(`${t}/get?resource=${o}&dataset=${document.location.hostname}`, s)).json();
|
|
2284
|
-
}
|
|
2285
|
-
e.getAll = n;
|
|
2286
|
-
})(Z || (Z = {}));
|
|
2287
|
-
var x = new Map(), ee = new WeakMap();
|
|
2487
|
+
function Tr(e) {
|
|
2488
|
+
return e.standaloneOnAuthFailure === !0 ? !0 : e.config?.standaloneOnAuthFailure === !0;
|
|
2489
|
+
}
|
|
2490
|
+
function Ze(e) {
|
|
2491
|
+
return Tr(e) ? !!Qe(e) : !1;
|
|
2492
|
+
}
|
|
2493
|
+
function Sr(e) {
|
|
2494
|
+
return !!Qe(e) && !Ze(e);
|
|
2495
|
+
}
|
|
2496
|
+
function et(e) {
|
|
2497
|
+
return Sr(e);
|
|
2498
|
+
}
|
|
2499
|
+
var B = new Map(), Z = new Set();
|
|
2500
|
+
function vr(e, t) {
|
|
2501
|
+
Z.has(e) || Z.add(e);
|
|
2502
|
+
}
|
|
2503
|
+
function ee() {
|
|
2504
|
+
B.clear(), Z.clear();
|
|
2505
|
+
}
|
|
2506
|
+
Er(ee);
|
|
2507
|
+
var tt = new WeakMap();
|
|
2288
2508
|
function te(e) {
|
|
2289
|
-
|
|
2290
|
-
if (t) return M(t);
|
|
2291
|
-
return M("https://app.useblocks.io/api".trim());
|
|
2509
|
+
return fr(e);
|
|
2292
2510
|
}
|
|
2293
|
-
|
|
2511
|
+
function wr(e, t) {
|
|
2512
|
+
const r = new Error(`[Loader] appInit request failed: ${e} ${t}`);
|
|
2513
|
+
return r.status = e, r;
|
|
2514
|
+
}
|
|
2515
|
+
function Or() {
|
|
2516
|
+
const e = new Error("[Loader] appInit skipped: empty auth token");
|
|
2517
|
+
return e.terminal = !0, e;
|
|
2518
|
+
}
|
|
2519
|
+
async function Dr(e) {
|
|
2294
2520
|
if (!e.getAuthToken) return;
|
|
2295
|
-
const t = await e.getAuthToken(e.user, e.project, void 0);
|
|
2296
|
-
return
|
|
2521
|
+
const t = await e.getAuthToken(e.user, e.project, void 0), r = String(t || "").trim();
|
|
2522
|
+
return r ? `Bearer ${r}` : void 0;
|
|
2297
2523
|
}
|
|
2298
|
-
function
|
|
2524
|
+
async function br(e) {
|
|
2525
|
+
if (!e.getAuthToken) return !0;
|
|
2526
|
+
try {
|
|
2527
|
+
const t = await e.getAuthToken(e.user, e.project, void 0);
|
|
2528
|
+
return !!String(t || "").trim();
|
|
2529
|
+
} catch {
|
|
2530
|
+
return !1;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
function Nr(e) {
|
|
2299
2534
|
return async ({ baseUrl: t }) => {
|
|
2300
2535
|
const r = te(t);
|
|
2301
2536
|
if (!r) throw new Error("[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL");
|
|
2302
2537
|
const n = new Headers({
|
|
2303
2538
|
Accept: "application/json",
|
|
2304
2539
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
|
2305
|
-
}), o = await
|
|
2540
|
+
}), o = await Dr(e);
|
|
2541
|
+
if (e.getAuthToken && !o) throw Or();
|
|
2306
2542
|
o && n.set("authorization", o);
|
|
2307
|
-
const i = await
|
|
2543
|
+
const i = await yr("/app/v1/app_init", {
|
|
2308
2544
|
method: "POST",
|
|
2309
2545
|
headers: n,
|
|
2310
2546
|
body: new URLSearchParams(),
|
|
2311
2547
|
credentials: "same-origin"
|
|
2312
|
-
});
|
|
2313
|
-
if (!i.ok) throw
|
|
2548
|
+
}, r, { attemptTimeout: Ze(e) || void 0 });
|
|
2549
|
+
if (!i.ok) throw wr(i.status, i.statusText);
|
|
2314
2550
|
return i.json();
|
|
2315
2551
|
};
|
|
2316
2552
|
}
|
|
2317
|
-
function
|
|
2553
|
+
function Cr(e) {
|
|
2318
2554
|
return JSON.stringify({
|
|
2319
2555
|
baseUrl: te(e.baseUrl) || "",
|
|
2320
2556
|
project: e.project ?? "",
|
|
2321
2557
|
userId: e.user?.id ?? ""
|
|
2322
2558
|
});
|
|
2323
2559
|
}
|
|
2324
|
-
function
|
|
2560
|
+
function Pr(e) {
|
|
2561
|
+
if (!(e instanceof Error)) return !1;
|
|
2562
|
+
const t = e;
|
|
2563
|
+
return t.terminal ? !0 : t.status === 403 || t.status === 404;
|
|
2564
|
+
}
|
|
2565
|
+
function Lr(e) {
|
|
2566
|
+
return e.appInit ? !0 : !(e.jwtAuth && !e.getAuthToken);
|
|
2567
|
+
}
|
|
2568
|
+
function Rr(e) {
|
|
2325
2569
|
return async (t) => {
|
|
2326
|
-
const r =
|
|
2570
|
+
const r = Cr(t), n = B.get(r);
|
|
2327
2571
|
if (n) return n;
|
|
2328
2572
|
const o = Promise.resolve(e(t)).catch((i) => {
|
|
2329
|
-
throw
|
|
2573
|
+
throw vr(r, i), Pr(i) || B.delete(r), i;
|
|
2330
2574
|
});
|
|
2331
|
-
return
|
|
2575
|
+
return B.set(r, o), o;
|
|
2332
2576
|
};
|
|
2333
2577
|
}
|
|
2334
|
-
function
|
|
2335
|
-
if (e.
|
|
2336
|
-
const t = e.appInit ||
|
|
2337
|
-
let r =
|
|
2338
|
-
return r || (r =
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2578
|
+
function Mr(e) {
|
|
2579
|
+
if (et(e) || !e.appInit && !te(e.baseUrl) || !Lr(e)) return e;
|
|
2580
|
+
const t = e.appInit || Nr(e);
|
|
2581
|
+
let r = tt.get(t);
|
|
2582
|
+
return r || (r = Rr(t), tt.set(t, r)), (async () => {
|
|
2583
|
+
await br(e) && await r({
|
|
2584
|
+
baseUrl: e.baseUrl,
|
|
2585
|
+
user: e.user,
|
|
2586
|
+
project: e.project,
|
|
2587
|
+
prevApp: void 0
|
|
2588
|
+
});
|
|
2589
|
+
})().catch(() => {}), {
|
|
2344
2590
|
...e,
|
|
2345
2591
|
appInit: r
|
|
2346
2592
|
};
|
|
2347
2593
|
}
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
let
|
|
2351
|
-
return
|
|
2352
|
-
|
|
2353
|
-
|
|
2594
|
+
function xr(e) {
|
|
2595
|
+
const t = e.replace(/-/g, "+").replace(/_/g, "/").padEnd(e.length + (4 - e.length % 4) % 4, "="), r = atob(t), n = new Uint8Array(r.length);
|
|
2596
|
+
for (let o = 0; o < r.length; o++) n[o] = r.charCodeAt(o);
|
|
2597
|
+
return new TextDecoder().decode(n);
|
|
2598
|
+
}
|
|
2599
|
+
function kr(e) {
|
|
2600
|
+
const [t, r, n] = e.split("."), o = JSON.parse(xr(r));
|
|
2601
|
+
return {
|
|
2602
|
+
exp: o.exp,
|
|
2603
|
+
createdAt: o.iat,
|
|
2604
|
+
data: o
|
|
2605
|
+
};
|
|
2606
|
+
}
|
|
2607
|
+
var rt = 0;
|
|
2608
|
+
function Ur() {
|
|
2609
|
+
return rt;
|
|
2610
|
+
}
|
|
2611
|
+
function Fr() {
|
|
2612
|
+
rt += 1, ee();
|
|
2613
|
+
}
|
|
2614
|
+
var nt = new WeakMap(), ot = new WeakMap(), jr = 3e4;
|
|
2615
|
+
function Br(e, t) {
|
|
2616
|
+
return JSON.stringify({
|
|
2617
|
+
userId: e?.id ?? "",
|
|
2618
|
+
project: t ?? ""
|
|
2619
|
+
});
|
|
2354
2620
|
}
|
|
2355
|
-
function
|
|
2356
|
-
|
|
2621
|
+
function Hr(e, t) {
|
|
2622
|
+
try {
|
|
2623
|
+
const r = kr(e)?.exp;
|
|
2624
|
+
if (typeof r == "number" && Number.isFinite(r) && r > 0) return r * 1e3;
|
|
2625
|
+
} catch {}
|
|
2626
|
+
return t + jr;
|
|
2627
|
+
}
|
|
2628
|
+
function Gr(e) {
|
|
2629
|
+
const t = new Map(), r = new Map();
|
|
2630
|
+
return async (n, o, i) => {
|
|
2631
|
+
const s = Br(n, o);
|
|
2632
|
+
if (i) return r.delete(s), t.delete(s), ee(), e(n, o, i);
|
|
2633
|
+
const l = r.get(s);
|
|
2634
|
+
if (l && !t.has(s)) {
|
|
2635
|
+
if (l.expiresAtMs > Date.now()) return l.token;
|
|
2636
|
+
r.delete(s);
|
|
2637
|
+
}
|
|
2638
|
+
let f = t.get(s);
|
|
2639
|
+
return f || (f = Promise.resolve(e(n, o, i)).then((c) => {
|
|
2640
|
+
const u = String(c || "").trim();
|
|
2641
|
+
return u && r.set(s, {
|
|
2642
|
+
token: c,
|
|
2643
|
+
expiresAtMs: Hr(u, Date.now())
|
|
2644
|
+
}), c;
|
|
2645
|
+
}).finally(() => {
|
|
2646
|
+
t.delete(s);
|
|
2647
|
+
}), t.set(s, f)), f;
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
function Wr(e) {
|
|
2651
|
+
if (et(e)) return e;
|
|
2357
2652
|
const t = e.getAuthToken;
|
|
2358
2653
|
if (!t) return e;
|
|
2359
|
-
let r =
|
|
2360
|
-
|
|
2654
|
+
let r = nt.get(t);
|
|
2655
|
+
const n = Ur();
|
|
2656
|
+
return (!r || ot.get(t) !== n) && (r = Gr(t), nt.set(t, r), ot.set(t, n)), Promise.resolve(r(e.user, e.project, void 0)).catch((o) => {}), {
|
|
2361
2657
|
...e,
|
|
2362
2658
|
getAuthToken: r
|
|
2363
2659
|
};
|
|
2364
2660
|
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
if (t.length === 1) return t[0];
|
|
2369
|
-
const r = t.find((i) => i.aborted);
|
|
2370
|
-
if (r) return r;
|
|
2371
|
-
if (typeof AbortSignal < "u" && typeof AbortSignal.any == "function") return AbortSignal.any(t);
|
|
2372
|
-
const n = new AbortController(), o = (i) => {
|
|
2373
|
-
n.signal.aborted || n.abort(i.reason);
|
|
2374
|
-
};
|
|
2375
|
-
for (const i of t) i.addEventListener("abort", () => o(i), { once: !0 });
|
|
2376
|
-
return n.signal;
|
|
2377
|
-
}
|
|
2378
|
-
var k = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
|
|
2379
|
-
function rt() {
|
|
2380
|
-
return g(k);
|
|
2661
|
+
var re = "Editor mount element was removed from the document. Call instance.destroy() on host unmount.";
|
|
2662
|
+
function Vr() {
|
|
2663
|
+
return T(re);
|
|
2381
2664
|
}
|
|
2382
|
-
function
|
|
2383
|
-
return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message ===
|
|
2665
|
+
function it(e) {
|
|
2666
|
+
return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === re;
|
|
2384
2667
|
}
|
|
2385
|
-
function
|
|
2668
|
+
function qr(e, t, r) {
|
|
2386
2669
|
if (typeof document > "u") return;
|
|
2387
2670
|
let n = !1, o;
|
|
2388
2671
|
const i = () => {
|
|
@@ -2397,44 +2680,44 @@ __useblocks__.define("useblocks.js", [
|
|
|
2397
2680
|
o = new MutationObserver(() => {
|
|
2398
2681
|
e.isConnected || s();
|
|
2399
2682
|
});
|
|
2400
|
-
let
|
|
2401
|
-
for (;
|
|
2683
|
+
let l = e.parentNode;
|
|
2684
|
+
for (; l;) o.observe(l, { childList: !0 }), l = l.parentNode;
|
|
2402
2685
|
}
|
|
2403
|
-
function
|
|
2686
|
+
function $r(e) {
|
|
2404
2687
|
const { hostElementOption: t, resolvedElement: r, externalSignal: n, disposable: o } = e;
|
|
2405
2688
|
if (t === void 0 || !(r instanceof Element)) return n;
|
|
2406
2689
|
const i = new AbortController();
|
|
2407
|
-
return
|
|
2408
|
-
r.id, i.abort(
|
|
2409
|
-
}, o),
|
|
2690
|
+
return qr(r, () => {
|
|
2691
|
+
r.id, i.abort(Vr());
|
|
2692
|
+
}, o), Q(n, i.signal);
|
|
2410
2693
|
}
|
|
2411
|
-
var
|
|
2412
|
-
function
|
|
2413
|
-
return
|
|
2694
|
+
var ne = "Superseded by newer init() on the same mount element";
|
|
2695
|
+
function st() {
|
|
2696
|
+
return T(ne);
|
|
2414
2697
|
}
|
|
2415
|
-
function
|
|
2416
|
-
return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message ===
|
|
2698
|
+
function at(e) {
|
|
2699
|
+
return !(e instanceof DOMException) || e.name !== "AbortError" ? !1 : e.message === ne;
|
|
2417
2700
|
}
|
|
2418
|
-
var
|
|
2419
|
-
function
|
|
2701
|
+
var H = new Map(), G = new WeakMap();
|
|
2702
|
+
function Kr(e) {
|
|
2420
2703
|
if (e instanceof Element) {
|
|
2421
2704
|
const t = e.id?.trim();
|
|
2422
2705
|
if (t) return `#${t}`;
|
|
2423
2706
|
}
|
|
2424
2707
|
}
|
|
2425
|
-
function
|
|
2708
|
+
function Xr(e) {
|
|
2426
2709
|
if (!(e instanceof Element)) return { release: () => {} };
|
|
2427
|
-
const t =
|
|
2428
|
-
|
|
2710
|
+
const t = Kr(e);
|
|
2711
|
+
G.get(e)?.abort(st()), t && H.get(t)?.abort(st());
|
|
2429
2712
|
const r = new AbortController();
|
|
2430
|
-
return
|
|
2713
|
+
return G.set(e, r), t && H.set(t, r), {
|
|
2431
2714
|
signal: r.signal,
|
|
2432
2715
|
release: () => {
|
|
2433
|
-
|
|
2716
|
+
G.get(e) === r && G.delete(e), t && H.get(t) === r && H.delete(t);
|
|
2434
2717
|
}
|
|
2435
2718
|
};
|
|
2436
2719
|
}
|
|
2437
|
-
var
|
|
2720
|
+
var zr = le({ FileManagerApiError: () => Jr }), Jr = class ft extends Error {
|
|
2438
2721
|
code;
|
|
2439
2722
|
status;
|
|
2440
2723
|
details;
|
|
@@ -2442,38 +2725,38 @@ __useblocks__.define("useblocks.js", [
|
|
|
2442
2725
|
return this.status;
|
|
2443
2726
|
}
|
|
2444
2727
|
constructor(t, r, n, o) {
|
|
2445
|
-
super(t), this.name = "FileManagerApiError", this.code = r, this.status = n, this.details = o, Error.captureStackTrace && Error.captureStackTrace(this,
|
|
2728
|
+
super(t), this.name = "FileManagerApiError", this.code = r, this.status = n, this.details = o, Error.captureStackTrace && Error.captureStackTrace(this, ft);
|
|
2446
2729
|
}
|
|
2447
|
-
},
|
|
2448
|
-
function
|
|
2730
|
+
}, Yr = le({ mapHttpStatusToErrorCode: () => St });
|
|
2731
|
+
function Qr(e, t) {
|
|
2449
2732
|
return {
|
|
2450
2733
|
...e,
|
|
2451
2734
|
element: t
|
|
2452
2735
|
};
|
|
2453
2736
|
}
|
|
2454
|
-
function
|
|
2737
|
+
function oe() {
|
|
2455
2738
|
return () => {};
|
|
2456
2739
|
}
|
|
2457
|
-
function
|
|
2740
|
+
function Zr(e) {
|
|
2458
2741
|
const t = e.element;
|
|
2459
|
-
return !t || typeof t == "string" || typeof document > "u" ?
|
|
2460
|
-
|
|
2742
|
+
return !t || typeof t == "string" || typeof document > "u" ? oe() : (Ut(t, e.config?.styles, t), () => {
|
|
2743
|
+
Ft(t);
|
|
2461
2744
|
});
|
|
2462
2745
|
}
|
|
2463
|
-
function
|
|
2464
|
-
if (!
|
|
2746
|
+
function en(e) {
|
|
2747
|
+
if (!me() || e.initialSpinner === !1 || typeof document > "u") return {
|
|
2465
2748
|
options: e,
|
|
2466
|
-
cleanup:
|
|
2749
|
+
cleanup: oe()
|
|
2467
2750
|
};
|
|
2468
2751
|
const t = e.element;
|
|
2469
2752
|
if (!t || typeof t == "string") return {
|
|
2470
2753
|
options: e,
|
|
2471
|
-
cleanup:
|
|
2754
|
+
cleanup: oe()
|
|
2472
2755
|
};
|
|
2473
2756
|
t.querySelectorAll(".blocks-app-initial-spinner-wrapper").forEach((o) => {
|
|
2474
2757
|
o.remove();
|
|
2475
2758
|
});
|
|
2476
|
-
const r =
|
|
2759
|
+
const r = Vt(t, "data-useblocks"), n = e.handleChunkLoaded;
|
|
2477
2760
|
return {
|
|
2478
2761
|
options: {
|
|
2479
2762
|
...e,
|
|
@@ -2484,103 +2767,103 @@ __useblocks__.define("useblocks.js", [
|
|
|
2484
2767
|
cleanup: r
|
|
2485
2768
|
};
|
|
2486
2769
|
}
|
|
2487
|
-
function
|
|
2770
|
+
function tn(e) {
|
|
2488
2771
|
return e?.length ? e.some((t) => Array.isArray(t) ? !1 : !!(t && typeof t == "object" && "url" in t)) : !1;
|
|
2489
2772
|
}
|
|
2490
|
-
function
|
|
2773
|
+
function ct(e) {
|
|
2491
2774
|
return e instanceof DOMException && e.name === "AbortError";
|
|
2492
2775
|
}
|
|
2493
|
-
function
|
|
2776
|
+
function ut(e) {
|
|
2494
2777
|
try {
|
|
2495
2778
|
e.destroy();
|
|
2496
2779
|
} catch {}
|
|
2497
2780
|
}
|
|
2498
|
-
function
|
|
2499
|
-
const r =
|
|
2500
|
-
t.some((n) => n !== void 0 && n === r) &&
|
|
2781
|
+
function ie(e, ...t) {
|
|
2782
|
+
const r = S.get(e);
|
|
2783
|
+
t.some((n) => n !== void 0 && n === r) && S.delete(e);
|
|
2501
2784
|
}
|
|
2502
|
-
var
|
|
2503
|
-
async function
|
|
2504
|
-
await
|
|
2785
|
+
var rn = "1.1.60";
|
|
2786
|
+
async function nn(e) {
|
|
2787
|
+
await _e(typeof __useblocks__ < "u" ? __useblocks__ : void 0);
|
|
2505
2788
|
}
|
|
2506
|
-
async function
|
|
2507
|
-
return
|
|
2789
|
+
async function on(e) {
|
|
2790
|
+
return sn(e);
|
|
2508
2791
|
}
|
|
2509
|
-
async function
|
|
2510
|
-
|
|
2511
|
-
const t = new
|
|
2792
|
+
async function sn(e) {
|
|
2793
|
+
h(e.signal);
|
|
2794
|
+
const t = new N();
|
|
2512
2795
|
let r;
|
|
2513
2796
|
try {
|
|
2514
|
-
const n = await
|
|
2797
|
+
const n = await ge(e.element, t, e.signal), o = $r({
|
|
2515
2798
|
hostElementOption: e.element,
|
|
2516
2799
|
resolvedElement: n,
|
|
2517
2800
|
externalSignal: e.signal,
|
|
2518
2801
|
disposable: t
|
|
2519
|
-
}), i =
|
|
2802
|
+
}), i = Xr(n);
|
|
2520
2803
|
r = i.release;
|
|
2521
|
-
const s =
|
|
2522
|
-
return await
|
|
2804
|
+
const s = Q(o, i.signal);
|
|
2805
|
+
return await jt(an(e, n, s), s);
|
|
2523
2806
|
} finally {
|
|
2524
2807
|
r?.(), t.dispose();
|
|
2525
2808
|
}
|
|
2526
2809
|
}
|
|
2527
|
-
async function
|
|
2528
|
-
|
|
2529
|
-
const n =
|
|
2810
|
+
async function an(e, t, r) {
|
|
2811
|
+
h(r), Fr();
|
|
2812
|
+
const n = Mr(Wr(Qr(e, t))), o = r != null ? {
|
|
2530
2813
|
...n,
|
|
2531
2814
|
signal: r
|
|
2532
2815
|
} : n;
|
|
2533
2816
|
if (t) {
|
|
2534
|
-
const c =
|
|
2817
|
+
const c = S.get(t);
|
|
2535
2818
|
if (c) {
|
|
2536
|
-
let
|
|
2819
|
+
let u;
|
|
2537
2820
|
try {
|
|
2538
|
-
|
|
2821
|
+
u = await c, h(r);
|
|
2539
2822
|
} catch (p) {
|
|
2540
|
-
if (
|
|
2541
|
-
|
|
2823
|
+
if (h(r), ie(t, c), ct(p)) throw p;
|
|
2824
|
+
u = void 0;
|
|
2542
2825
|
}
|
|
2543
|
-
if (
|
|
2544
|
-
return await
|
|
2826
|
+
if (u) if (u.getElement() === t) try {
|
|
2827
|
+
return await u.reset(o);
|
|
2545
2828
|
} catch (p) {
|
|
2546
|
-
if (
|
|
2547
|
-
|
|
2829
|
+
if (h(r), at(p) || it(p) || ct(p) && r?.aborted) throw p;
|
|
2830
|
+
ie(t, c, u), ut(u);
|
|
2548
2831
|
}
|
|
2549
|
-
else
|
|
2832
|
+
else ie(t, c, u), ut(u);
|
|
2550
2833
|
}
|
|
2551
2834
|
}
|
|
2552
|
-
|
|
2553
|
-
const i =
|
|
2835
|
+
h(r);
|
|
2836
|
+
const i = Zr(n), s = en(n), l = r != null ? {
|
|
2554
2837
|
...s.options,
|
|
2555
2838
|
signal: r
|
|
2556
2839
|
} : s.options;
|
|
2557
2840
|
let f;
|
|
2558
2841
|
try {
|
|
2559
|
-
await
|
|
2842
|
+
await pe(), h(r);
|
|
2560
2843
|
const c = typeof __useblocks__ < "u" ? __useblocks__ : void 0;
|
|
2561
|
-
|
|
2562
|
-
const
|
|
2563
|
-
if (r?.aborted && (
|
|
2564
|
-
else throw
|
|
2565
|
-
return
|
|
2844
|
+
tn(l.plugins) ? (await z(c), h(r)) : Ct(c), h(r), f = $().then((p) => p.init(l)), t && S.set(t, f);
|
|
2845
|
+
const u = await f;
|
|
2846
|
+
if (r?.aborted && (u.destroy(), h(r)), t) if (S.get(t) === f) S.set(t, u);
|
|
2847
|
+
else throw u.destroy(), h(r), T(r?.reason);
|
|
2848
|
+
return u;
|
|
2566
2849
|
} catch (c) {
|
|
2567
|
-
throw i(), s.cleanup(), t && f &&
|
|
2850
|
+
throw i(), s.cleanup(), t && f && S.get(t) === f && S.delete(t), c;
|
|
2568
2851
|
}
|
|
2569
2852
|
}
|
|
2570
|
-
async function
|
|
2571
|
-
return (await
|
|
2853
|
+
async function cn(e) {
|
|
2854
|
+
return (await $()).parseAMP(e);
|
|
2572
2855
|
}
|
|
2573
|
-
typeof window < "u" &&
|
|
2856
|
+
typeof window < "u" && Pt(typeof __useblocks__ < "u" ? __useblocks__ : void 0), E.ELEMENT_DETACHED_ABORT_MESSAGE = re, E.SUPERSEDED_INIT_ABORT_MESSAGE = ne, Object.defineProperty(E, "errors", {
|
|
2574
2857
|
enumerable: !0,
|
|
2575
2858
|
get: function() {
|
|
2576
|
-
return
|
|
2859
|
+
return zr;
|
|
2577
2860
|
}
|
|
2578
2861
|
}), Object.defineProperty(E, "helpers", {
|
|
2579
2862
|
enumerable: !0,
|
|
2580
2863
|
get: function() {
|
|
2581
|
-
return
|
|
2864
|
+
return Yr;
|
|
2582
2865
|
}
|
|
2583
|
-
}), E.init =
|
|
2866
|
+
}), E.init = on, E.isElementDetachedError = it, E.isSupersededInitError = at, E.parseAMP = cn, E.pluginRegistry = Mt, E.preload = nn, E.version = rn;
|
|
2584
2867
|
});
|
|
2585
2868
|
|
|
2586
2869
|
|