useblocks 1.1.81 → 1.1.84
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/CHANGELOG.md +35 -0
- package/README.md +17 -6
- package/iframe/css/sandbox-dark.css +1 -1
- package/iframe/css/sandbox-darktheme.css +3 -3
- package/iframe/css/sandbox-light.css +1 -1
- package/iframe/css/sandbox.css +2 -2
- package/iframe/js/amp.D1dkO3ub.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/package.json +1 -1
- package/static/core/{dfbad00e.js → 16c7408a.js} +4 -4
- package/static/core/{909c874d2.js → 278c19282.js} +982 -974
- package/static/core/{87de8255.js → 27b7d154.js} +3 -3
- package/static/core/{cc4c61c42.js → 7877b5712.js} +135 -135
- package/static/core/{ace7c2d1.js → 86acf537.js} +7 -7
- package/static/core/{6fc5508e2.js → 95074b4e2.js} +53 -53
- package/static/core/{f2b0c97b2.js → 9a1229572.js} +849 -836
- package/static/core/{6a3ea43c.js → ab3c035c.js} +6 -6
- package/static/core/{496a28e52.js → b8fa83f82.js} +562 -562
- package/static/core/{7cff1d56.js → bb8665a8.js} +77 -4
- package/static/core/{fc514220.js → c013e7cc.js} +73 -73
- package/static/core/{5cc21a00.js → c871702e.js} +608 -603
- package/static/core/{4296ff4b.js → cf26b064.js} +240 -240
- package/static/core/{d2293148.js → d15a988b.js} +7 -7
- package/static/core/{f7e3905a.js → d4962564.js} +3 -3
- package/static/core/{1ab52017.js → dc948de7.js} +7 -7
- package/static/core/{c287f8b6.js → e9b6fbb9.js} +36 -36
- package/static/core/{d70b5c31.js → ec6e74e5.js} +12965 -12545
- package/static/umd-runtime/{n8zqoGYh.js → D80ABE1O.js} +7 -1
- package/static/umd-runtime/runtime.js +2 -2
- package/static/umd-runtime/ui-kit.js +1742 -1734
- package/ui-kit/index.js +1859 -1851
- package/{useblocks-core.0a682f7d.js → useblocks-core.2fa005e8.js} +6 -6
- package/useblocks-esm.js +4 -4
- package/{useblocks-po.0a682f7d.js → useblocks-po.2fa005e8.js} +1 -1
- package/useblocks.d.ts +51 -24
- package/useblocks.js +3 -3
- package/iframe/js/amp.Da_6yDxX.js +0 -1
- /package/iframe/{iframe-eblock.0a682f7d.html → iframe-eblock.2fa005e8.html} +0 -0
- /package/iframe/{iframe.0a682f7d.html → iframe.2fa005e8.html} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode('@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-container{border-radius:calc(var(--ub-borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--ub-borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--ub-borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--ub-borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .trial-suggest-modal{max-width:calc(100vw - 24px)}.blocks-app .trial-suggest-modal .ant-modal-container{border-radius:16px;padding:0;overflow:hidden}.blocks-app .trial-suggest-modal__layout{align-items:stretch;display:flex}.blocks-app .trial-suggest-modal__gallery{background:var(--ub-colorFillQuaternary);flex:0 0 300px;width:300px;max-width:300px;position:relative;overflow:hidden}.blocks-app .trial-suggest-modal__slide-image{border-right:1px solid var(--ub-colorFillSecondary);background-repeat:no-repeat;background-size:cover;transition:opacity .4s;position:absolute;inset:0}.blocks-app .trial-suggest-modal__content{flex:auto;min-width:0;max-width:100%;padding:32px}.blocks-app .trial-suggest-modal__badge{background:var(--ub-colorPrimaryBg);color:var(--ub-colorPrimary);border-radius:12px;margin-bottom:12px;padding:2px 10px;font-size:12px;font-weight:600;line-height:20px;display:inline-block}.blocks-app .trial-suggest-modal__title{color:var(--ub-colorText);margin:0 0 8px;font-size:22px;font-weight:600;line-height:1.25}.blocks-app .trial-suggest-modal__intro{color:var(--ub-colorTextSecondary);margin:0 0 16px}.blocks-app .trial-suggest-modal__features{margin:0 0 20px;padding:0;list-style:none}.blocks-app .trial-suggest-modal__features li{color:var(--ub-colorText);align-items:flex-start;gap:10px;margin-bottom:10px;display:flex}.blocks-app .trial-suggest-modal__feature-icon,.blocks-app .trial-suggest-modal__promise-icon{flex:none;width:20px;height:20px;margin-top:2px;font-size:20px;line-height:20px}.blocks-app .trial-suggest-modal__feature-icon svg,.blocks-app .trial-suggest-modal__promise-icon svg{width:100%;height:100%}.blocks-app .trial-suggest-modal__feature-icon{color:var(--ub-colorPrimary)}.blocks-app .trial-suggest-modal__promise{background:var(--ub-colorFillQuaternary);color:var(--ub-colorText);border-radius:8px;align-items:flex-start;gap:10px;margin:0 0 8px;padding:12px;display:flex}.blocks-app .trial-suggest-modal__promise-icon{color:var(--ub-colorSuccess)}.blocks-app .trial-suggest-modal__note{color:var(--ub-colorTextTertiary);margin:0 0 24px;font-size:12px;line-height:140%}.blocks-app .trial-suggest-modal__buttons{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .trial-suggest-modal__decline.ant-btn{box-shadow:none;color:var(--ub-colorTextSecondary);border:1px solid #0000}.blocks-app .trial-suggest-modal__decline.ant-btn:hover,.blocks-app .trial-suggest-modal__decline.ant-btn:focus,.blocks-app .trial-suggest-modal__decline.ant-btn:focus-visible,.blocks-app .trial-suggest-modal__decline.ant-btn:active{box-shadow:none;border:1px solid #0000;transform:none}.blocks-app .trial-suggest-modal__decline.ant-btn:hover:not(:disabled){background:var(--ub-colorFillTertiary);color:var(--ub-colorText)}@media (width<=720px){.blocks-app .trial-suggest-modal__layout{flex-direction:column}.blocks-app .trial-suggest-modal__gallery{flex:none;width:auto;max-width:none;height:180px}.blocks-app .trial-suggest-modal__content{padding:24px}}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--ub-colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{z-index:1;box-sizing:border-box;justify-content:flex-end;align-items:center;display:flex;position:absolute;top:20px;right:20px}.blocks-app .limit-upgrade-modal__close{background:var(--ub-colorBgContainer);width:34px;height:34px;color:var(--ub-colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--ub-colorFillTertiary);color:var(--ub-colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:44px 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--ub-colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--ub-colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--ub-colorText);width:34px;height:34px;color:var(--ub-colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--ub-colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--ub-colorBorder);min-width:147px;height:32px;color:var(--ub-colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}')),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
__useblocks__.define("static/core/
|
|
2
|
+
__useblocks__.define("static/core/b8fa83f82.js", [
|
|
3
3
|
"require",
|
|
4
4
|
"exports",
|
|
5
5
|
"module",
|
|
6
6
|
"static/core/df237243.js",
|
|
7
|
-
"static/core/
|
|
8
|
-
"static/core/
|
|
9
|
-
"static/core/
|
|
10
|
-
"static/core/
|
|
11
|
-
"static/core/
|
|
7
|
+
"static/core/bb8665a8.js",
|
|
8
|
+
"static/core/27b7d154.js",
|
|
9
|
+
"static/core/9a1229572.js",
|
|
10
|
+
"static/core/278c19282.js",
|
|
11
|
+
"static/core/95074b4e2.js",
|
|
12
12
|
"static/core/92871f5a2.js",
|
|
13
13
|
"static/core/e199fd0a.js",
|
|
14
14
|
"react",
|
|
@@ -19,10 +19,10 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
19
19
|
"react-dom/client",
|
|
20
20
|
"@ant-design/cssinjs"
|
|
21
21
|
], function(ze, me, vo) {
|
|
22
|
-
const
|
|
23
|
-
let d = ze("react"), De =
|
|
24
|
-
d =
|
|
25
|
-
let
|
|
22
|
+
const Ht = ze("./df237243.js"), fe = ze("./bb8665a8.js"), gt = ze("./27b7d154.js"), m = ze("./9a1229572.js"), _e = ze("./278c19282.js"), se = ze("./95074b4e2.js"), Pt = ze("./92871f5a2.js"), dt = ze("./e199fd0a.js");
|
|
23
|
+
let d = ze("react"), De = Ht.__toESM(d, 1);
|
|
24
|
+
d = Ht.__toESM(d);
|
|
25
|
+
let Kt = ze("react-dom"), g = ze("antd"), l = ze("react/jsx-runtime"), qe = ze("@ant-design/icons");
|
|
26
26
|
ze("react-dom/client");
|
|
27
27
|
let Ji = ze("@ant-design/cssinjs");
|
|
28
28
|
var Yt = ({ size: e = 24, color: t = "currentColor", ...r }) => De.createElement("svg", {
|
|
@@ -998,7 +998,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
998
998
|
function Ta(e) {
|
|
999
999
|
return e.error instanceof Error && e.error.message ? e.error : typeof e.error == "string" && e.error ? new Error(e.error) : new Error(Sa);
|
|
1000
1000
|
}
|
|
1001
|
-
var Ma = () => (0, l.jsx)(
|
|
1001
|
+
var Ma = () => (0, l.jsx)(qe.LoadingOutlined, {
|
|
1002
1002
|
style: {
|
|
1003
1003
|
fontSize: 48,
|
|
1004
1004
|
height: "100%"
|
|
@@ -1082,33 +1082,33 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1082
1082
|
function Ua(e) {
|
|
1083
1083
|
return e.flat();
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Ga(e) {
|
|
1086
1086
|
return new Set(pr(e));
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function Va(e) {
|
|
1089
1089
|
return new Map(pr(e));
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function Wa(e) {
|
|
1092
1092
|
return e.at(-1);
|
|
1093
1093
|
}
|
|
1094
1094
|
var bt = {
|
|
1095
1095
|
mergeRecords: za,
|
|
1096
1096
|
mergeArrays: Ua,
|
|
1097
|
-
mergeSets:
|
|
1098
|
-
mergeMaps:
|
|
1099
|
-
mergeOthers:
|
|
1097
|
+
mergeSets: Ga,
|
|
1098
|
+
mergeMaps: Va,
|
|
1099
|
+
mergeOthers: Wa
|
|
1100
1100
|
};
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1101
|
+
function $a(...e) {
|
|
1102
|
+
return qa({})(...e);
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
let r =
|
|
1104
|
+
function qa(e, t) {
|
|
1105
|
+
let r = Ha(e, a);
|
|
1106
1106
|
function a(...i) {
|
|
1107
1107
|
return vr(i, r, t);
|
|
1108
1108
|
}
|
|
1109
1109
|
return a;
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Ha(e, t) {
|
|
1112
1112
|
return {
|
|
1113
1113
|
defaultMergeFunctions: bt,
|
|
1114
1114
|
mergeFunctions: {
|
|
@@ -1131,14 +1131,14 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1131
1131
|
for (let s = 1; s < a.length; s++) if (fr(a[s]) !== i) return Et(a, t, r);
|
|
1132
1132
|
}
|
|
1133
1133
|
switch (i) {
|
|
1134
|
-
case 1: return
|
|
1134
|
+
case 1: return Ka(a, t, r);
|
|
1135
1135
|
case 2: return Ya(a, t, r);
|
|
1136
1136
|
case 3: return Qa(a, t, r);
|
|
1137
1137
|
case 4: return Za(a, t, r);
|
|
1138
1138
|
default: return Et(a, t, r);
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function Ka(e, t, r) {
|
|
1142
1142
|
let a = t.mergeFunctions.mergeRecords(e, t, r);
|
|
1143
1143
|
return a === it.defaultMerge || t.useImplicitDefaultMerging && a === void 0 && t.mergeFunctions.mergeRecords !== t.defaultMergeFunctions.mergeRecords ? t.defaultMergeFunctions.mergeRecords(e, t, r) : a;
|
|
1144
1144
|
}
|
|
@@ -1231,7 +1231,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1231
1231
|
return (0, d.useEffect)(() => {
|
|
1232
1232
|
o(i);
|
|
1233
1233
|
}, [i]), (0, d.useEffect)(() => {
|
|
1234
|
-
let n = s === "light" ? yr : wr, h = r, y = h ?
|
|
1234
|
+
let n = s === "light" ? yr : wr, h = r, y = h ? $a(n.token, h) : n.token;
|
|
1235
1235
|
u({
|
|
1236
1236
|
...n,
|
|
1237
1237
|
token: y
|
|
@@ -1284,10 +1284,10 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1284
1284
|
i18n: e,
|
|
1285
1285
|
defaultNS: t
|
|
1286
1286
|
}), [e, t]);
|
|
1287
|
-
return (0, d.createElement)(m.
|
|
1287
|
+
return (0, d.createElement)(m.Pn.Provider, { value: a }, r);
|
|
1288
1288
|
}
|
|
1289
|
-
var Xa = m.
|
|
1290
|
-
let { t: a } = m.
|
|
1289
|
+
var Xa = m.tr(), el = ({ onSearch: e, placeholder: t, className: r }) => {
|
|
1290
|
+
let { t: a } = m.zn(), [i, s] = (0, d.useState)(""), o = (0, d.useRef)(null), { options: c } = m.B(), { config: u } = c, n = t || a("Search files...");
|
|
1291
1291
|
return (0, d.useEffect)(() => (o.current = (0, Xa.debounce)((h) => {
|
|
1292
1292
|
e(h);
|
|
1293
1293
|
}, 500), () => {
|
|
@@ -1420,16 +1420,16 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1420
1420
|
let t = e.extension || (e.name && e.name.includes(".") ? e.name.split(".").pop() : void 0) || (e.type?.startsWith("image/") ? e.type.split("/")[1]?.split(";")[0]?.trim() : void 0);
|
|
1421
1421
|
return !!(t && m.A.includes(t.toLowerCase()));
|
|
1422
1422
|
}
|
|
1423
|
-
var Cr = d.default.memo(({ files: e, filesById: t, currentSortOption: r, isSmallScreen: a, iconStrokeWidth: i, multiSelectEnabled: s = !0, features: o, viewMode: c, setViewMode: u, handleSearch: n, handleSortOptionChange: h, sortOptions: y, onClearSelection: f, onRename: w, onDelete: I, onCopy: _, onMove: F, onEdit:
|
|
1424
|
-
let v = (0, d.useMemo)(() => y?.length ? Nt.filter((
|
|
1425
|
-
let Z = t.get(
|
|
1423
|
+
var Cr = d.default.memo(({ files: e, filesById: t, currentSortOption: r, isSmallScreen: a, iconStrokeWidth: i, multiSelectEnabled: s = !0, features: o, viewMode: c, setViewMode: u, handleSearch: n, handleSortOptionChange: h, sortOptions: y, onClearSelection: f, onRename: w, onDelete: I, onCopy: _, onMove: F, onEdit: V, t: b }) => {
|
|
1424
|
+
let v = (0, d.useMemo)(() => y?.length ? Nt.filter((W) => y.includes(W.value)) : Nt, [y]), C = (0, d.useMemo)(() => v.map((W) => W.value).join("|") || "all", [v]), O = m.sa((W) => W.selectedFiles), R = m.sa((W) => W.selectedFiles.size), oe = m.sa((W) => W.selectAllVisible), k = e.length > 0 && R === e.length, U = (0, d.useMemo)(() => Array.from(O)[0], [O]), D = (0, d.useMemo)(() => U ? t.get(U) : void 0, [t, U]), Q = D?.isFolder ? o?.enableRenameFolder !== !1 : o?.enableRenameFile !== !1, $ = (0, d.useMemo)(() => Array.from(O).every((W) => {
|
|
1425
|
+
let Z = t.get(W);
|
|
1426
1426
|
return Z ? Z.isFolder ? o?.enableMoveFolder !== !1 : o?.enableMoveItem !== !1 : !1;
|
|
1427
1427
|
}), [
|
|
1428
1428
|
o,
|
|
1429
1429
|
t,
|
|
1430
1430
|
O
|
|
1431
|
-
]),
|
|
1432
|
-
let Z = t.get(
|
|
1431
|
+
]), K = (0, d.useMemo)(() => Array.from(O).every((W) => {
|
|
1432
|
+
let Z = t.get(W);
|
|
1433
1433
|
return Z ? Z.isFolder ? o?.enableCopyFolder !== !1 : o?.enableCopyItem !== !1 : !1;
|
|
1434
1434
|
}), [
|
|
1435
1435
|
o,
|
|
@@ -1477,12 +1477,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1477
1477
|
size: 16,
|
|
1478
1478
|
strokeWidth: i
|
|
1479
1479
|
}),
|
|
1480
|
-
onClick: () =>
|
|
1480
|
+
onClick: () => V(D),
|
|
1481
1481
|
disabled: !M,
|
|
1482
1482
|
children: b("Edit")
|
|
1483
1483
|
})
|
|
1484
1484
|
}),
|
|
1485
|
-
|
|
1485
|
+
$ && (0, l.jsx)(g.Tooltip, {
|
|
1486
1486
|
title: a ? b("Move to") : null,
|
|
1487
1487
|
children: (0, l.jsx)(g.Button, {
|
|
1488
1488
|
icon: (0, l.jsx)(jt, {
|
|
@@ -1493,7 +1493,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1493
1493
|
children: b("Move to")
|
|
1494
1494
|
})
|
|
1495
1495
|
}),
|
|
1496
|
-
|
|
1496
|
+
K && (0, l.jsx)(g.Tooltip, {
|
|
1497
1497
|
title: a ? b("Copy") : null,
|
|
1498
1498
|
children: (0, l.jsx)(g.Button, {
|
|
1499
1499
|
icon: (0, l.jsx)(se.a$1, {
|
|
@@ -1524,8 +1524,8 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1524
1524
|
size: 16,
|
|
1525
1525
|
strokeWidth: i
|
|
1526
1526
|
}),
|
|
1527
|
-
onClick: (
|
|
1528
|
-
|
|
1527
|
+
onClick: (W) => {
|
|
1528
|
+
W.stopPropagation(), W.preventDefault(), I();
|
|
1529
1529
|
},
|
|
1530
1530
|
children: b("Delete")
|
|
1531
1531
|
})
|
|
@@ -1553,10 +1553,10 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1553
1553
|
size: 16,
|
|
1554
1554
|
strokeWidth: i
|
|
1555
1555
|
}),
|
|
1556
|
-
children: v.map(({ value:
|
|
1557
|
-
value:
|
|
1556
|
+
children: v.map(({ value: W, labelKey: Z }) => (0, l.jsx)(il, {
|
|
1557
|
+
value: W,
|
|
1558
1558
|
children: b(Z)
|
|
1559
|
-
},
|
|
1559
|
+
}, W))
|
|
1560
1560
|
}, C)
|
|
1561
1561
|
}), (0, l.jsx)("div", {
|
|
1562
1562
|
className: T.actionsContainer,
|
|
@@ -1575,7 +1575,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1575
1575
|
})
|
|
1576
1576
|
}],
|
|
1577
1577
|
value: c,
|
|
1578
|
-
onChange: (
|
|
1578
|
+
onChange: (W) => u(W)
|
|
1579
1579
|
})
|
|
1580
1580
|
})]
|
|
1581
1581
|
})]
|
|
@@ -1583,7 +1583,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1583
1583
|
});
|
|
1584
1584
|
Cr.displayName = "FileContentHeader";
|
|
1585
1585
|
var Tt = d.default.memo(({ fileId: e, style: t }) => {
|
|
1586
|
-
let r = m.
|
|
1586
|
+
let r = m.sa((i) => i.selectedFiles.has(e)), a = m.sa((i) => i.toggleFileSelection);
|
|
1587
1587
|
return (0, l.jsx)(g.Checkbox, {
|
|
1588
1588
|
checked: r,
|
|
1589
1589
|
style: t,
|
|
@@ -1603,7 +1603,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1603
1603
|
});
|
|
1604
1604
|
Tt.displayName = "FileSelectionCheckbox";
|
|
1605
1605
|
var Fr = d.default.memo(({ className: e, ...t }) => {
|
|
1606
|
-
let r = t["data-row-key"], a = r == null ? "" : String(r), i = [e, m.
|
|
1606
|
+
let r = t["data-row-key"], a = r == null ? "" : String(r), i = [e, m.sa((s) => a ? s.selectedFiles.has(a) : !1) ? T.selectedRow : ""].filter(Boolean).join(" ");
|
|
1607
1607
|
return (0, l.jsx)("tr", {
|
|
1608
1608
|
...t,
|
|
1609
1609
|
className: i
|
|
@@ -1731,11 +1731,11 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1731
1731
|
r,
|
|
1732
1732
|
t,
|
|
1733
1733
|
e
|
|
1734
|
-
]), h = m.
|
|
1734
|
+
]), h = m.Ia(u), y = m.Ia(n), { handleError: f, handleLoad: w } = y, I = h.src ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+", _ = y.src ?? h.src, F = (0, d.useRef)(!1);
|
|
1735
1735
|
(0, d.useEffect)(() => {
|
|
1736
1736
|
F.current = !1;
|
|
1737
1737
|
}, [_]);
|
|
1738
|
-
let
|
|
1738
|
+
let V = (0, d.useCallback)((b) => d.default.cloneElement(b, {
|
|
1739
1739
|
key: _ ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",
|
|
1740
1740
|
src: _ ?? "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",
|
|
1741
1741
|
fallback: void 0,
|
|
@@ -1762,12 +1762,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1762
1762
|
src: _,
|
|
1763
1763
|
actionsRender: () => null,
|
|
1764
1764
|
destroyOnHidden: !0,
|
|
1765
|
-
cover: (0, l.jsx)(
|
|
1766
|
-
imageRender:
|
|
1765
|
+
cover: (0, l.jsx)(qe.EyeOutlined, { style: { fontSize: "20px" } }),
|
|
1766
|
+
imageRender: V
|
|
1767
1767
|
} : !1, [
|
|
1768
1768
|
c,
|
|
1769
1769
|
_,
|
|
1770
|
-
|
|
1770
|
+
V
|
|
1771
1771
|
]),
|
|
1772
1772
|
onLoad: h.handleLoad,
|
|
1773
1773
|
onError: () => {
|
|
@@ -1817,9 +1817,9 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
1817
1817
|
return typeof e.type == "string" && e.type.startsWith("image/") || typeof a == "string" && m.ne.includes(a);
|
|
1818
1818
|
}
|
|
1819
1819
|
var kr = d.default.memo(({ item: e, t, iconStrokeWidth: r, FolderIcon: a, handleItemClick: i, setCurrentMenuFile: s, showMoveModal: o, showCopyModal: c, showRenameModal: u, showDeleteConfirm: n, onEdit: h, onEditorOk: y, getFileData: f, showSelectionCheckbox: w = !0 }) => {
|
|
1820
|
-
let I = m.
|
|
1821
|
-
let
|
|
1822
|
-
if (!(
|
|
1820
|
+
let I = m.sa((F) => F.selectedFiles.has(e.id)), _ = (0, d.useCallback)((F) => {
|
|
1821
|
+
let V = F.target;
|
|
1822
|
+
if (!(V.closest(".gridFileMenuButton") || V.closest(".ant-dropdown-menu")) && !xr(V) && F.detail === 1) {
|
|
1823
1823
|
if (e.isFolder) {
|
|
1824
1824
|
i(e.file);
|
|
1825
1825
|
return;
|
|
@@ -2116,7 +2116,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2116
2116
|
getId: (e) => e.id,
|
|
2117
2117
|
buildSignature: (e, t) => ml(e, t),
|
|
2118
2118
|
buildRowModel: (e, t, r) => {
|
|
2119
|
-
let a = !!e.isFolder, i = a ? Mr(e, t.folderFileCounts) : null, s = a && i === null ? cl : a ? `${i} ${i === 1 ? t.t("item") : t.t("items")}` : "", o = e.dimensions || "", c = !a && e.size ? m.
|
|
2119
|
+
let a = !!e.isFolder, i = a ? Mr(e, t.folderFileCounts) : null, s = a && i === null ? cl : a ? `${i} ${i === 1 ? t.t("item") : t.t("items")}` : "", o = e.dimensions || "", c = !a && e.size ? m.Jn(e.size) : "", u = a ? t.t("Folder") : ul(e), n = Lr(e.date, t.t), h = a ? s : [
|
|
2120
2120
|
o,
|
|
2121
2121
|
c,
|
|
2122
2122
|
u
|
|
@@ -2185,8 +2185,8 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2185
2185
|
options: h
|
|
2186
2186
|
}), I = (0, d.useMemo)(() => f.some((F) => !!F.dateText), [f]), _ = (0, d.useCallback)((F) => {
|
|
2187
2187
|
if (i === "grid") {
|
|
2188
|
-
let
|
|
2189
|
-
u((b) => b ===
|
|
2188
|
+
let V = Math.max(1, Math.floor(F.viewportWidth / Or));
|
|
2189
|
+
u((b) => b === V ? b : V);
|
|
2190
2190
|
}
|
|
2191
2191
|
y(F);
|
|
2192
2192
|
}, [y, i]);
|
|
@@ -2198,20 +2198,20 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2198
2198
|
handleViewportChange: _
|
|
2199
2199
|
};
|
|
2200
2200
|
}
|
|
2201
|
-
var Dr = d.default.memo(({ files: e, searchTerm: t, handleSearch: r, sortBy: a, sortOrder: i, handleSortOptionChange: s, pagination: o, setPagination: c, loading: u, handleItemClick: n, onClearSelection: h, onRename: y, onDelete: f, onCopy: w, onMove: I, showRenameModal: _, showDeleteConfirm: F, showCopyModal:
|
|
2202
|
-
let { t: R } = m.
|
|
2201
|
+
var Dr = d.default.memo(({ files: e, searchTerm: t, handleSearch: r, sortBy: a, sortOrder: i, handleSortOptionChange: s, pagination: o, setPagination: c, loading: u, handleItemClick: n, onClearSelection: h, onRename: y, onDelete: f, onCopy: w, onMove: I, showRenameModal: _, showDeleteConfirm: F, showCopyModal: V, showMoveModal: b, onEdit: v, getFileData: C, handleAddFile: O }) => {
|
|
2202
|
+
let { t: R } = m.zn(), oe = m.mr(), { DropZoneFileIcon: k, BigStockIcon: U, BigAIIcon: D, FolderIcon: Q } = se.K(), { options: $, actions: K, state: M } = m.B(), { dataProviders: W, config: Z } = $, ae = Z?.disablePagination, { setCurrentMenuFile: pe, setActiveLibraryItem: te } = K, Ne = M?.selectedFolder === "Trash", E = M?.multiSelect !== !1, { viewMode: we, setViewMode: Be } = ol(), [Fe, S] = (0, d.useState)({}), [q, B] = (0, d.useState)(!1), ue = (0, d.useRef)(0), ve = (0, d.useRef)(null);
|
|
2203
2203
|
(0, d.useEffect)(() => {
|
|
2204
|
-
let z = window.matchMedia("(max-width: 1199px)"),
|
|
2204
|
+
let z = window.matchMedia("(max-width: 1199px)"), G = (Se) => {
|
|
2205
2205
|
B(Se.matches);
|
|
2206
2206
|
};
|
|
2207
|
-
|
|
2208
|
-
let ce = (Se) =>
|
|
2207
|
+
G(z);
|
|
2208
|
+
let ce = (Se) => G(Se);
|
|
2209
2209
|
return typeof z.addEventListener == "function" ? (z.addEventListener("change", ce), () => z.removeEventListener("change", ce)) : (z.addListener(ce), () => z.removeListener(ce));
|
|
2210
2210
|
}, []);
|
|
2211
|
-
let
|
|
2211
|
+
let H = (0, d.useMemo)(() => Z?.features || {}, [Z?.features]), x = Z?.iconStrokeWidth, j = Z?.sortOptions, ne = (0, d.useMemo)(() => j?.length ? new Set(j) : null, [j]), J = `${a}-${i}`;
|
|
2212
2212
|
(0, d.useEffect)(() => {
|
|
2213
2213
|
if (ne && !ne.has(J)) {
|
|
2214
|
-
let z = Nt.find((
|
|
2214
|
+
let z = Nt.find((G) => ne.has(G.value))?.value;
|
|
2215
2215
|
z && s(z);
|
|
2216
2216
|
}
|
|
2217
2217
|
}, [
|
|
@@ -2222,30 +2222,30 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2222
2222
|
let xe = (0, d.useMemo)(() => new Map(e.map((z) => [z.id, z])), [e]), { renderRows: he, renderWindow: L, hasAnyValidDate: re, handleViewportChange: X } = Il({
|
|
2223
2223
|
files: e,
|
|
2224
2224
|
folderFileCounts: Fe,
|
|
2225
|
-
features:
|
|
2225
|
+
features: H,
|
|
2226
2226
|
t: R,
|
|
2227
2227
|
viewMode: we,
|
|
2228
2228
|
previewFallbackToFileUrl: Z?.previewFallbackToFileUrl
|
|
2229
2229
|
}), Pe = (0, d.useCallback)(async (z) => {
|
|
2230
2230
|
try {
|
|
2231
|
-
if (
|
|
2232
|
-
if (
|
|
2233
|
-
let { files:
|
|
2231
|
+
if (W?.getChildrenCount) return await W.getChildrenCount(z === "folders" ? void 0 : z);
|
|
2232
|
+
if (W?.getFiles) {
|
|
2233
|
+
let { files: G, pagination: ce } = await W.getFiles({
|
|
2234
2234
|
folderId: z === "folders" ? void 0 : z,
|
|
2235
2235
|
itemType: "all",
|
|
2236
2236
|
page: ae ? void 0 : 1,
|
|
2237
2237
|
limit: ae ? void 0 : 1
|
|
2238
2238
|
});
|
|
2239
|
-
return ae ? Array.isArray(
|
|
2239
|
+
return ae ? Array.isArray(G) ? G.length : 0 : ce?.total ?? (Array.isArray(G) ? G.length : 0);
|
|
2240
2240
|
}
|
|
2241
2241
|
return 0;
|
|
2242
|
-
} catch (
|
|
2243
|
-
if (
|
|
2244
|
-
let ce =
|
|
2242
|
+
} catch (G) {
|
|
2243
|
+
if (G?.name === "StaleLoad") return 0;
|
|
2244
|
+
let ce = G;
|
|
2245
2245
|
if (ce?.status === 404 || ce?.code === "FileNotFound" || ce?.code === "path_folder_not_found" || ce?.data?.code === "path_folder_not_found" || ce?.data?.data?.status === 404) return 0;
|
|
2246
|
-
let Se = await m.
|
|
2246
|
+
let Se = await m.Ci({
|
|
2247
2247
|
folderId: z,
|
|
2248
|
-
dataProviders:
|
|
2248
|
+
dataProviders: W,
|
|
2249
2249
|
folders: Array.isArray(M.folders) ? M.folders : [],
|
|
2250
2250
|
pathHistory: M.pathHistory,
|
|
2251
2251
|
t: R
|
|
@@ -2254,17 +2254,17 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2254
2254
|
id: "FOLDER_CHILDREN_COUNT_FAILED",
|
|
2255
2255
|
message: R("Failed to load folder items count in folder", { folderName: Se }),
|
|
2256
2256
|
placement: "bottomRight",
|
|
2257
|
-
innerException:
|
|
2257
|
+
innerException: G,
|
|
2258
2258
|
notificationDedupe: !0,
|
|
2259
2259
|
data: {
|
|
2260
2260
|
folderId: z === "folders" ? null : z,
|
|
2261
2261
|
folderName: Se,
|
|
2262
|
-
reason:
|
|
2262
|
+
reason: G instanceof Error ? G.message : String(G)
|
|
2263
2263
|
}
|
|
2264
2264
|
}), null;
|
|
2265
2265
|
}
|
|
2266
2266
|
}, [
|
|
2267
|
-
|
|
2267
|
+
W,
|
|
2268
2268
|
ae,
|
|
2269
2269
|
oe,
|
|
2270
2270
|
M.folders,
|
|
@@ -2273,12 +2273,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2273
2273
|
]), Oe = (0, d.useCallback)(async () => {
|
|
2274
2274
|
let z = ue.current + 1;
|
|
2275
2275
|
ue.current = z;
|
|
2276
|
-
let
|
|
2277
|
-
if (
|
|
2276
|
+
let G = e.filter((Te) => Te.isFolder);
|
|
2277
|
+
if (G.length === 0) {
|
|
2278
2278
|
S((Te) => Object.keys(Te).length === 0 ? Te : {});
|
|
2279
2279
|
return;
|
|
2280
2280
|
}
|
|
2281
|
-
let ce = {}, Se =
|
|
2281
|
+
let ce = {}, Se = G.map(async (Te) => {
|
|
2282
2282
|
if (typeof Te.childCount == "number") {
|
|
2283
2283
|
ce[Te.id] = Te.childCount;
|
|
2284
2284
|
return;
|
|
@@ -2287,41 +2287,41 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2287
2287
|
});
|
|
2288
2288
|
await Promise.all(Se), ue.current === z && S((Te) => {
|
|
2289
2289
|
let Ee = Object.keys(Te), tt = Object.keys(ce);
|
|
2290
|
-
return Ee.length === tt.length && Ee.every((
|
|
2290
|
+
return Ee.length === tt.length && Ee.every(($e) => Te[$e] === ce[$e]) ? Te : ce;
|
|
2291
2291
|
});
|
|
2292
2292
|
}, [e, Pe]);
|
|
2293
2293
|
(0, d.useEffect)(() => {
|
|
2294
2294
|
Oe();
|
|
2295
2295
|
}, [Oe]), (0, d.useEffect)(() => {
|
|
2296
|
-
ve.current && X(m.
|
|
2296
|
+
ve.current && X(m.Ya(ve.current));
|
|
2297
2297
|
}, [
|
|
2298
2298
|
e.length,
|
|
2299
2299
|
X,
|
|
2300
2300
|
we
|
|
2301
2301
|
]), (0, d.useEffect)(() => {
|
|
2302
2302
|
if (!ve.current || typeof ResizeObserver > "u") return;
|
|
2303
|
-
let z = ve.current,
|
|
2304
|
-
X(m.
|
|
2303
|
+
let z = ve.current, G = new ResizeObserver(() => {
|
|
2304
|
+
X(m.Ya(z));
|
|
2305
2305
|
});
|
|
2306
|
-
return
|
|
2307
|
-
|
|
2306
|
+
return G.observe(z), () => {
|
|
2307
|
+
G.disconnect();
|
|
2308
2308
|
};
|
|
2309
2309
|
}, [X]);
|
|
2310
2310
|
let Ue = (0, d.useCallback)((z) => {
|
|
2311
|
-
let
|
|
2312
|
-
X(
|
|
2311
|
+
let G = m.Ya(z);
|
|
2312
|
+
X(G);
|
|
2313
2313
|
}, [X]);
|
|
2314
2314
|
(0, d.useEffect)(() => {
|
|
2315
2315
|
let z = ve.current;
|
|
2316
2316
|
if (!z) return;
|
|
2317
|
-
let
|
|
2317
|
+
let G = () => {
|
|
2318
2318
|
Ue(z);
|
|
2319
|
-
}, ce = m.
|
|
2319
|
+
}, ce = m.Wa(z);
|
|
2320
2320
|
return ce.forEach((Se) => {
|
|
2321
|
-
Se.addEventListener("scroll",
|
|
2321
|
+
Se.addEventListener("scroll", G, { passive: !0 });
|
|
2322
2322
|
}), () => {
|
|
2323
2323
|
ce.forEach((Se) => {
|
|
2324
|
-
Se.removeEventListener("scroll",
|
|
2324
|
+
Se.removeEventListener("scroll", G);
|
|
2325
2325
|
});
|
|
2326
2326
|
};
|
|
2327
2327
|
}, [
|
|
@@ -2329,19 +2329,19 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2329
2329
|
Ue,
|
|
2330
2330
|
we
|
|
2331
2331
|
]);
|
|
2332
|
-
let Ae = (0, d.useCallback)((z,
|
|
2332
|
+
let Ae = (0, d.useCallback)((z, G) => z !== G, []), at = (0, d.useMemo)(() => [
|
|
2333
2333
|
...E ? [{
|
|
2334
2334
|
key: "selection",
|
|
2335
2335
|
width: 46,
|
|
2336
2336
|
shouldCellUpdate: Ae,
|
|
2337
|
-
render: (z,
|
|
2337
|
+
render: (z, G) => (0, l.jsx)(Tt, { fileId: G.id })
|
|
2338
2338
|
}] : [],
|
|
2339
2339
|
{
|
|
2340
2340
|
key: "preview",
|
|
2341
2341
|
width: 60,
|
|
2342
2342
|
shouldCellUpdate: Ae,
|
|
2343
|
-
render: (z,
|
|
2344
|
-
item:
|
|
2343
|
+
render: (z, G) => (0, l.jsx)(At, {
|
|
2344
|
+
item: G,
|
|
2345
2345
|
variant: "table",
|
|
2346
2346
|
FolderIcon: Q,
|
|
2347
2347
|
getFileData: C,
|
|
@@ -2357,16 +2357,16 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2357
2357
|
key: "name",
|
|
2358
2358
|
className: T.fileNameCol,
|
|
2359
2359
|
shouldCellUpdate: Ae,
|
|
2360
|
-
render: (z,
|
|
2360
|
+
render: (z, G) => (0, l.jsx)(Nr, { item: G })
|
|
2361
2361
|
},
|
|
2362
2362
|
{
|
|
2363
2363
|
title: R("Dimensions"),
|
|
2364
2364
|
key: "dimensions",
|
|
2365
2365
|
width: 100,
|
|
2366
2366
|
shouldCellUpdate: Ae,
|
|
2367
|
-
render: (z,
|
|
2367
|
+
render: (z, G) => G.dimensionsText && (0, l.jsx)("div", {
|
|
2368
2368
|
className: T.fileSize,
|
|
2369
|
-
children:
|
|
2369
|
+
children: G.dimensionsText
|
|
2370
2370
|
})
|
|
2371
2371
|
},
|
|
2372
2372
|
{
|
|
@@ -2374,9 +2374,9 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2374
2374
|
key: "size",
|
|
2375
2375
|
width: 90,
|
|
2376
2376
|
shouldCellUpdate: Ae,
|
|
2377
|
-
render: (z,
|
|
2377
|
+
render: (z, G) => G.sizeText ? (0, l.jsx)("div", {
|
|
2378
2378
|
className: T.fileSize,
|
|
2379
|
-
children:
|
|
2379
|
+
children: G.sizeText
|
|
2380
2380
|
}) : null
|
|
2381
2381
|
},
|
|
2382
2382
|
{
|
|
@@ -2384,9 +2384,9 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2384
2384
|
key: "type",
|
|
2385
2385
|
width: 90,
|
|
2386
2386
|
shouldCellUpdate: Ae,
|
|
2387
|
-
render: (z,
|
|
2387
|
+
render: (z, G) => (0, l.jsx)("div", {
|
|
2388
2388
|
className: T.fileSize,
|
|
2389
|
-
children:
|
|
2389
|
+
children: G.typeText
|
|
2390
2390
|
})
|
|
2391
2391
|
},
|
|
2392
2392
|
...re ? [{
|
|
@@ -2395,7 +2395,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2395
2395
|
key: "date",
|
|
2396
2396
|
width: 200,
|
|
2397
2397
|
shouldCellUpdate: Ae,
|
|
2398
|
-
render: (z,
|
|
2398
|
+
render: (z, G) => (0, l.jsx)(Er, { item: G })
|
|
2399
2399
|
}] : [],
|
|
2400
2400
|
{
|
|
2401
2401
|
width: 40,
|
|
@@ -2404,14 +2404,14 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2404
2404
|
key: "x",
|
|
2405
2405
|
onCell: () => ({ style: { padding: 0 } }),
|
|
2406
2406
|
shouldCellUpdate: Ae,
|
|
2407
|
-
render: (z,
|
|
2408
|
-
item:
|
|
2407
|
+
render: (z, G) => (0, l.jsx)(Mt, {
|
|
2408
|
+
item: G,
|
|
2409
2409
|
variant: "table",
|
|
2410
2410
|
t: R,
|
|
2411
2411
|
iconStrokeWidth: x,
|
|
2412
2412
|
setCurrentMenuFile: pe,
|
|
2413
2413
|
showMoveModal: b,
|
|
2414
|
-
showCopyModal:
|
|
2414
|
+
showCopyModal: V,
|
|
2415
2415
|
showRenameModal: _,
|
|
2416
2416
|
showDeleteConfirm: F,
|
|
2417
2417
|
onEdit: v
|
|
@@ -2426,22 +2426,22 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2426
2426
|
v,
|
|
2427
2427
|
pe,
|
|
2428
2428
|
Ae,
|
|
2429
|
-
|
|
2429
|
+
V,
|
|
2430
2430
|
F,
|
|
2431
2431
|
b,
|
|
2432
2432
|
_,
|
|
2433
2433
|
R
|
|
2434
|
-
]), be = (0, d.useMemo)(() => ({ body: { row: Fr } }), []), et = (0, d.useCallback)((z) => ({ onClick: (
|
|
2435
|
-
if (
|
|
2436
|
-
let ce =
|
|
2434
|
+
]), be = (0, d.useMemo)(() => ({ body: { row: Fr } }), []), et = (0, d.useCallback)((z) => ({ onClick: (G) => {
|
|
2435
|
+
if (G.stopPropagation(), G.preventDefault(), G.detail !== 1) return;
|
|
2436
|
+
let ce = G.target, Se = !!ce.closest(".ant-checkbox-wrapper"), Te = !!ce.closest(".tableMenuButton"), Ee = !!ce.closest(".ant-dropdown-menu");
|
|
2437
2437
|
if (!(Se || xr(ce) || Te || Ee)) {
|
|
2438
2438
|
if (z.isFolder) {
|
|
2439
2439
|
n(z.file);
|
|
2440
2440
|
return;
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
$.onEditorOk && Pr(z.file) && $.onEditorOk(z.file);
|
|
2443
2443
|
}
|
|
2444
|
-
} }), [n,
|
|
2444
|
+
} }), [n, $]), ht = we === "table" ? (0, l.jsx)(Sr, {
|
|
2445
2445
|
rows: he,
|
|
2446
2446
|
columns: at,
|
|
2447
2447
|
topOffset: L.topOffset,
|
|
@@ -2458,11 +2458,11 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2458
2458
|
handleItemClick: n,
|
|
2459
2459
|
setCurrentMenuFile: pe,
|
|
2460
2460
|
showMoveModal: b,
|
|
2461
|
-
showCopyModal:
|
|
2461
|
+
showCopyModal: V,
|
|
2462
2462
|
showRenameModal: _,
|
|
2463
2463
|
showDeleteConfirm: F,
|
|
2464
2464
|
onEdit: v,
|
|
2465
|
-
onEditorOk:
|
|
2465
|
+
onEditorOk: $.onEditorOk,
|
|
2466
2466
|
getFileData: C,
|
|
2467
2467
|
showSelectionCheckbox: E
|
|
2468
2468
|
});
|
|
@@ -2555,10 +2555,10 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2555
2555
|
files: e,
|
|
2556
2556
|
filesById: xe,
|
|
2557
2557
|
currentSortOption: J,
|
|
2558
|
-
isSmallScreen:
|
|
2558
|
+
isSmallScreen: q,
|
|
2559
2559
|
iconStrokeWidth: x,
|
|
2560
2560
|
multiSelectEnabled: E,
|
|
2561
|
-
features:
|
|
2561
|
+
features: H,
|
|
2562
2562
|
viewMode: we,
|
|
2563
2563
|
setViewMode: Be,
|
|
2564
2564
|
handleSearch: r,
|
|
@@ -2588,9 +2588,9 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2588
2588
|
current: o.current,
|
|
2589
2589
|
pageSize: o.pageSize,
|
|
2590
2590
|
total: o.total,
|
|
2591
|
-
onChange: (z,
|
|
2591
|
+
onChange: (z, G) => c({
|
|
2592
2592
|
current: z,
|
|
2593
|
-
pageSize:
|
|
2593
|
+
pageSize: G,
|
|
2594
2594
|
total: o.total
|
|
2595
2595
|
}),
|
|
2596
2596
|
showSizeChanger: !0,
|
|
@@ -2635,11 +2635,11 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2635
2635
|
});
|
|
2636
2636
|
});
|
|
2637
2637
|
bl.displayName = "CustomFolderInput";
|
|
2638
|
-
var _l = ({ isModalVisible: e, handleModalOk: t, handleModalCancel: r, form: a, selectedFolder: i, folders: s, isUrlModalVisible: o, setIsUrlModalVisible: c, handleAddFileByUrl: u, urlForm: n, isRenameModalVisible: h, handleRenameOk: y, handleRenameCancel: f, renameForm: w, fileToRename: I, files: _, isMoveModalVisible: F, handleMoveOk:
|
|
2639
|
-
let { t: E } = m.
|
|
2638
|
+
var _l = ({ isModalVisible: e, handleModalOk: t, handleModalCancel: r, form: a, selectedFolder: i, folders: s, isUrlModalVisible: o, setIsUrlModalVisible: c, handleAddFileByUrl: u, urlForm: n, isRenameModalVisible: h, handleRenameOk: y, handleRenameCancel: f, renameForm: w, fileToRename: I, files: _, isMoveModalVisible: F, handleMoveOk: V, handleMoveCancel: b, moveForm: v, selectedFiles: C, isRenameFolderModalVisible: O, handleRenameFolderOk: R, handleRenameFolderCancel: oe, renameFolderForm: k, folderToRename: U, isCopyModalVisible: D, handleCopyOk: Q, handleCopyCancel: $, copyForm: K, isDeleteConfirmVisible: M, handleDeleteConfirmOk: W, handleDeleteConfirmCancel: Z, isClearTrashConfirmVisible: ae, handleClearTrashConfirm: pe, handleClearTrashCancel: te, fetchChildFolders: Ne }) => {
|
|
2639
|
+
let { t: E } = m.zn(), { state: we, actions: Be, options: Fe } = m.B(), { setCurrentMenuFile: S } = Be, { config: q, getModalContainer: B } = Fe, { currentMenuFile: ue } = we, ve = g.Form.useWatch("folderName", a), { EmptyFolderIcon: H } = se.K(), [x, j] = (0, d.useState)(!1), ne = (0, d.useMemo)(() => q?.defaultFolderName?.trim() || E("New folder"), [q?.defaultFolderName, E]), J = !ve || String(ve).trim().length === 0, xe = (0, d.useMemo)(() => Array.isArray(_) ? _ : [], [_]), he = I ? xe.find((ie) => ie.id === I)?.name : "", L = Array.isArray(s) ? s : [], re = U ? L.find((ie) => ie.id === U)?.name : "", { activeFormField: X, setActiveFormField: Pe, generateMenuItemsFromFolders: Oe } = se.oe({
|
|
2640
2640
|
folders: L,
|
|
2641
2641
|
selectedFolder: i,
|
|
2642
|
-
EmptyFolderIcon:
|
|
2642
|
+
EmptyFolderIcon: H,
|
|
2643
2643
|
handleCreateFolderModalOk: t,
|
|
2644
2644
|
setIsLoading: (ie) => j(!!ie),
|
|
2645
2645
|
t: E
|
|
@@ -2651,8 +2651,8 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2651
2651
|
if (ge) {
|
|
2652
2652
|
let z = ge.querySelector(".ant-modal-footer");
|
|
2653
2653
|
if (z) {
|
|
2654
|
-
let
|
|
2655
|
-
|
|
2654
|
+
let G = z.querySelector(".ant-btn-primary");
|
|
2655
|
+
G && G.focus();
|
|
2656
2656
|
}
|
|
2657
2657
|
}
|
|
2658
2658
|
}, 100);
|
|
@@ -2666,19 +2666,19 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2666
2666
|
X,
|
|
2667
2667
|
Pe
|
|
2668
2668
|
]), at = (0, d.useCallback)(async (ie) => {
|
|
2669
|
-
ie.length > 0 && (
|
|
2669
|
+
ie.length > 0 && (K.setFieldsValue({ targetFolder: ie[0] }), X !== ie[0].toString() && Pe(""));
|
|
2670
2670
|
}, [
|
|
2671
2671
|
X,
|
|
2672
|
-
|
|
2672
|
+
K,
|
|
2673
2673
|
Pe
|
|
2674
2674
|
]), be = (0, d.useCallback)(async (ie) => {
|
|
2675
2675
|
j(!0);
|
|
2676
2676
|
try {
|
|
2677
|
-
await
|
|
2677
|
+
await V(ie);
|
|
2678
2678
|
} finally {
|
|
2679
2679
|
j(!1);
|
|
2680
2680
|
}
|
|
2681
|
-
}, [
|
|
2681
|
+
}, [V]), et = (0, d.useCallback)(async (ie) => {
|
|
2682
2682
|
j(!0);
|
|
2683
2683
|
try {
|
|
2684
2684
|
await Q(ie);
|
|
@@ -2795,7 +2795,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2795
2795
|
}, { validator: (ie, ge) => {
|
|
2796
2796
|
if (!ge || !String(ge).trim()) return Promise.resolve();
|
|
2797
2797
|
try {
|
|
2798
|
-
return m.
|
|
2798
|
+
return m.Hr(String(ge), E), Promise.resolve();
|
|
2799
2799
|
} catch (z) {
|
|
2800
2800
|
return Promise.reject(Error(z instanceof Error ? z.message : E("The specified URL is not valid.")));
|
|
2801
2801
|
}
|
|
@@ -2888,7 +2888,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2888
2888
|
loading: x,
|
|
2889
2889
|
children: [(0, l.jsx)(Pt.s, {
|
|
2890
2890
|
size: 18,
|
|
2891
|
-
strokeWidth:
|
|
2891
|
+
strokeWidth: q?.iconStrokeWidth
|
|
2892
2892
|
}), E("Create folder")]
|
|
2893
2893
|
}), (0, l.jsx)(g.Button, {
|
|
2894
2894
|
type: "primary",
|
|
@@ -2967,14 +2967,14 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2967
2967
|
children: E("Copy to folder")
|
|
2968
2968
|
}),
|
|
2969
2969
|
open: D,
|
|
2970
|
-
onCancel:
|
|
2970
|
+
onCancel: $,
|
|
2971
2971
|
footer: (0, l.jsxs)("div", {
|
|
2972
2972
|
className: se.Q.formFooter,
|
|
2973
2973
|
children: [(0, l.jsxs)(g.Button, {
|
|
2974
2974
|
className: se.Q.folderButton,
|
|
2975
2975
|
onClick: () => {
|
|
2976
2976
|
let ie = i ?? "folders";
|
|
2977
|
-
Pe(ie),
|
|
2977
|
+
Pe(ie), K.setFieldsValue({
|
|
2978
2978
|
folderName: ne,
|
|
2979
2979
|
targetFolder: ie
|
|
2980
2980
|
});
|
|
@@ -2982,12 +2982,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
2982
2982
|
loading: x,
|
|
2983
2983
|
children: [(0, l.jsx)(Pt.s, {
|
|
2984
2984
|
size: 18,
|
|
2985
|
-
strokeWidth:
|
|
2985
|
+
strokeWidth: q?.iconStrokeWidth
|
|
2986
2986
|
}), E("Create folder")]
|
|
2987
2987
|
}), (0, l.jsx)(g.Button, {
|
|
2988
2988
|
type: "primary",
|
|
2989
2989
|
className: se.Q.folderButton,
|
|
2990
|
-
onClick:
|
|
2990
|
+
onClick: $,
|
|
2991
2991
|
loading: x,
|
|
2992
2992
|
children: E("Done")
|
|
2993
2993
|
})]
|
|
@@ -3004,7 +3004,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3004
3004
|
className: se.Q.modalLoaderOverlay,
|
|
3005
3005
|
children: (0, l.jsx)(dt.r, {})
|
|
3006
3006
|
}), (0, l.jsx)(g.Form, {
|
|
3007
|
-
form:
|
|
3007
|
+
form: K,
|
|
3008
3008
|
layout: "vertical",
|
|
3009
3009
|
initialValues: {
|
|
3010
3010
|
targetFolder: "folders",
|
|
@@ -3024,7 +3024,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3024
3024
|
children: (0, l.jsx)(se.ie, {
|
|
3025
3025
|
onSelect: at,
|
|
3026
3026
|
generateMenuItems: () => Oe({
|
|
3027
|
-
targetForm:
|
|
3027
|
+
targetForm: K,
|
|
3028
3028
|
onTreeSelect: at,
|
|
3029
3029
|
onComplete: et,
|
|
3030
3030
|
actionButtonText: E("Copy here")
|
|
@@ -3110,43 +3110,43 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3110
3110
|
className: `${se.Q.deleteModal} deleteModal`,
|
|
3111
3111
|
title: (0, l.jsx)("div", {
|
|
3112
3112
|
className: "modal-title",
|
|
3113
|
-
children:
|
|
3113
|
+
children: q?.enableTrashFolder && i === "Trash" || !q?.enableTrashFolder ? E("Permanently delete") : E("Move to Trash")
|
|
3114
3114
|
}),
|
|
3115
3115
|
open: !!M,
|
|
3116
3116
|
onOk: () => {
|
|
3117
3117
|
j(!0);
|
|
3118
3118
|
try {
|
|
3119
|
-
|
|
3119
|
+
W && W();
|
|
3120
3120
|
} catch {
|
|
3121
3121
|
j(!1);
|
|
3122
3122
|
}
|
|
3123
3123
|
},
|
|
3124
3124
|
onCancel: () => Z && Z(),
|
|
3125
|
-
okText:
|
|
3125
|
+
okText: q?.enableTrashFolder && i === "Trash" ? E("Delete permanently") : q?.enableTrashFolder ? E("Move to Trash") : E("Delete"),
|
|
3126
3126
|
cancelText: E("Cancel"),
|
|
3127
3127
|
okButtonProps: {
|
|
3128
|
-
danger:
|
|
3128
|
+
danger: !q?.enableTrashFolder || i === "Trash",
|
|
3129
3129
|
loading: x
|
|
3130
3130
|
},
|
|
3131
3131
|
cancelButtonProps: { disabled: x },
|
|
3132
3132
|
afterClose: () => {
|
|
3133
3133
|
j(!1), S && S("");
|
|
3134
3134
|
},
|
|
3135
|
-
closeIcon: (0, l.jsx)(
|
|
3135
|
+
closeIcon: (0, l.jsx)(qe.CloseOutlined, { className: se.Q.closeIcon }),
|
|
3136
3136
|
centered: !0,
|
|
3137
3137
|
getContainer: B,
|
|
3138
3138
|
children: (() => {
|
|
3139
|
-
let ie = (ue ? [ue] : Array.from(C || [])).map((Ee) => xe.find((tt) => tt.id === Ee)).filter((Ee) => !!Ee), ge = ie.filter((Ee) => Ee.isFolder || Ee.id.startsWith("folder_")), z = ie.filter((Ee) => !(Ee.isFolder || Ee.id.startsWith("folder_"))),
|
|
3139
|
+
let ie = (ue ? [ue] : Array.from(C || [])).map((Ee) => xe.find((tt) => tt.id === Ee)).filter((Ee) => !!Ee), ge = ie.filter((Ee) => Ee.isFolder || Ee.id.startsWith("folder_")), z = ie.filter((Ee) => !(Ee.isFolder || Ee.id.startsWith("folder_"))), G = ie.length, ce = ge.length, Se = z.length, Te = !!q?.enableTrashFolder;
|
|
3140
3140
|
if (!Te || Te && i === "Trash") {
|
|
3141
3141
|
let Ee;
|
|
3142
|
-
if (
|
|
3143
|
-
let tt = ge[0],
|
|
3142
|
+
if (G === 1 && ce === 1) {
|
|
3143
|
+
let tt = ge[0], $e = tt?.name || "", xt = tt?.childCount ?? 0;
|
|
3144
3144
|
Ee = E("delete_folder_permanent", {
|
|
3145
|
-
name:
|
|
3145
|
+
name: $e,
|
|
3146
3146
|
count: xt
|
|
3147
3147
|
});
|
|
3148
3148
|
} else Ee = ce === 0 && Se > 0 ? E("delete_files_permanent", { count: Se }) : E("delete_mixed_permanent", {
|
|
3149
|
-
total:
|
|
3149
|
+
total: G,
|
|
3150
3150
|
folders: ce,
|
|
3151
3151
|
images: Se
|
|
3152
3152
|
});
|
|
@@ -3155,15 +3155,15 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3155
3155
|
children: E("permanent_delete_warning")
|
|
3156
3156
|
})] });
|
|
3157
3157
|
}
|
|
3158
|
-
if (
|
|
3159
|
-
let Ee = ge[0], tt = Ee?.name || "",
|
|
3158
|
+
if (G === 1 && ce === 1) {
|
|
3159
|
+
let Ee = ge[0], tt = Ee?.name || "", $e = Ee?.childCount ?? 0;
|
|
3160
3160
|
return (0, l.jsx)("div", { children: E("move_folder_to_trash", {
|
|
3161
3161
|
name: tt,
|
|
3162
|
-
count:
|
|
3162
|
+
count: $e
|
|
3163
3163
|
}) });
|
|
3164
3164
|
}
|
|
3165
3165
|
return ce === 0 && Se > 0 ? (0, l.jsx)("div", { children: E("move_files_to_trash", { count: Se }) }) : (0, l.jsx)("div", { children: E("move_mixed_to_trash", {
|
|
3166
|
-
total:
|
|
3166
|
+
total: G,
|
|
3167
3167
|
folders: ce,
|
|
3168
3168
|
images: Se
|
|
3169
3169
|
}) });
|
|
@@ -3190,7 +3190,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3190
3190
|
afterClose: () => {
|
|
3191
3191
|
j(!1);
|
|
3192
3192
|
},
|
|
3193
|
-
closeIcon: (0, l.jsx)(
|
|
3193
|
+
closeIcon: (0, l.jsx)(qe.CloseOutlined, { className: se.Q.closeIcon }),
|
|
3194
3194
|
centered: !0,
|
|
3195
3195
|
getContainer: B,
|
|
3196
3196
|
children: [(0, l.jsx)("div", { children: E("Are you sure you want to permanently delete all items from Trash?") }), x && (0, l.jsxs)("div", {
|
|
@@ -3236,30 +3236,30 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3236
3236
|
lockedTabLock: "lockedTabLock",
|
|
3237
3237
|
lockedTabLabel: "lockedTabLabel"
|
|
3238
3238
|
}, Br = (0, d.memo)((0, d.forwardRef)(({ selectedFolder: e, generateMenuItems: t, onFolderSelect: r, folders: a, fetchChildFolders: i, handleAddFile: s, setIsUrlModalVisible: o, handleCreateFolder: c, activeLibraryItem: u, setActiveLibraryItem: n }, h) => {
|
|
3239
|
-
let y = (0, d.useMemo)(() => Array.isArray(a) ? a : [], [a]), { t: f } = m.
|
|
3239
|
+
let y = (0, d.useMemo)(() => Array.isArray(a) ? a : [], [a]), { t: f } = m.zn(), w = m.mr(), [I, _] = (0, d.useState)({}), { options: F, state: V } = m.B(), { dataProviders: b, config: v } = F, C = V.pathHistory, O = v?.features?.enableGif !== !1 && (!v?.enabledTabs || v.enabledTabs.includes("gif")), R = v?.features?.enableStockImages !== !1 && (!v?.enabledTabs || v.enabledTabs.includes("stock")), oe = v?.features?.enableIconStock !== !1 && (!v?.enabledTabs || v.enabledTabs.includes("icons")), k = v?.features?.enableQrBarcodeTab !== !1 && (!v?.enabledTabs || v.enabledTabs.includes("codes")), U = (0, d.useCallback)((S, q) => m.Qn(q, v) ? (0, l.jsxs)("span", {
|
|
3240
3240
|
className: Je.lockedTabIcon,
|
|
3241
3241
|
children: [S, (0, l.jsx)(_e.i, {
|
|
3242
3242
|
size: 12,
|
|
3243
3243
|
strokeWidth: 2.5,
|
|
3244
3244
|
className: Je.lockedTabLock
|
|
3245
3245
|
})]
|
|
3246
|
-
}) : S, [v]), D = (0, d.useCallback)((S,
|
|
3246
|
+
}) : S, [v]), D = (0, d.useCallback)((S, q) => m.Qn(q, v) ? (0, l.jsx)("span", {
|
|
3247
3247
|
className: Je.lockedTabLabel,
|
|
3248
3248
|
children: S
|
|
3249
3249
|
}) : S, [v]), Q = (0, d.useCallback)((S) => {
|
|
3250
|
-
let
|
|
3250
|
+
let q = [], B = (ue) => {
|
|
3251
3251
|
ue.forEach((ve) => {
|
|
3252
|
-
|
|
3252
|
+
q.push(ve.key), ve.children && B(ve.children);
|
|
3253
3253
|
});
|
|
3254
3254
|
};
|
|
3255
|
-
return B(S),
|
|
3256
|
-
}, []), [K
|
|
3255
|
+
return B(S), q;
|
|
3256
|
+
}, []), [$, K] = (0, d.useState)(() => {
|
|
3257
3257
|
if (v?.expandAllFoldersOnInit === !0 && v?.folderTreeLoading !== "lazy") {
|
|
3258
3258
|
let S = t();
|
|
3259
3259
|
return Q(S);
|
|
3260
3260
|
}
|
|
3261
3261
|
return v?.expandRootFolderOnInit === !0 ? ["folders"] : [];
|
|
3262
|
-
}), M = (0, d.useRef)(!1),
|
|
3262
|
+
}), M = (0, d.useRef)(!1), W = (0, d.useRef)(!1);
|
|
3263
3263
|
(0, d.useEffect)(() => {
|
|
3264
3264
|
M.current || v?.folderTreeLoading === "lazy" && v?.expandRootFolderOnInit === !0 && (M.current = !0, (async () => {
|
|
3265
3265
|
try {
|
|
@@ -3271,18 +3271,18 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3271
3271
|
v?.expandRootFolderOnInit,
|
|
3272
3272
|
i
|
|
3273
3273
|
]), (0, d.useEffect)(() => {
|
|
3274
|
-
v?.expandRootFolderOnInit === !0 && Array.isArray(y) && y.length > 0 && !
|
|
3274
|
+
v?.expandRootFolderOnInit === !0 && Array.isArray(y) && y.length > 0 && !W.current && (!$ || $.length === 0) && (W.current = !0, K(["folders"]));
|
|
3275
3275
|
}, [
|
|
3276
3276
|
v?.expandRootFolderOnInit,
|
|
3277
3277
|
y,
|
|
3278
|
-
|
|
3278
|
+
$
|
|
3279
3279
|
]), (0, d.useEffect)(() => {
|
|
3280
3280
|
if (v?.expandAllFoldersOnInit === !0 && v?.folderTreeLoading !== "lazy") {
|
|
3281
|
-
let S = t(),
|
|
3282
|
-
|
|
3281
|
+
let S = t(), q = Q(S);
|
|
3282
|
+
K(q);
|
|
3283
3283
|
return;
|
|
3284
3284
|
}
|
|
3285
|
-
v?.expandRootFolderOnInit === !0 &&
|
|
3285
|
+
v?.expandRootFolderOnInit === !0 && K((S) => S && S.length > 0 ? [...S] : ["folders"]);
|
|
3286
3286
|
}, [
|
|
3287
3287
|
y,
|
|
3288
3288
|
t,
|
|
@@ -3295,20 +3295,20 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3295
3295
|
try {
|
|
3296
3296
|
if (b?.getChildrenCount) return await b.getChildrenCount(S === "folders" ? void 0 : S);
|
|
3297
3297
|
if (b?.getFiles) {
|
|
3298
|
-
let { files:
|
|
3298
|
+
let { files: q, pagination: B } = await b.getFiles({
|
|
3299
3299
|
folderId: S === "folders" ? void 0 : S,
|
|
3300
3300
|
itemType: "all",
|
|
3301
3301
|
page: Z ? void 0 : 1,
|
|
3302
3302
|
limit: Z ? void 0 : 1
|
|
3303
3303
|
});
|
|
3304
|
-
return Z ? Array.isArray(
|
|
3304
|
+
return Z ? Array.isArray(q) ? q.length : 0 : B?.total ?? (Array.isArray(q) ? q.length : 0);
|
|
3305
3305
|
}
|
|
3306
3306
|
return 0;
|
|
3307
|
-
} catch (
|
|
3308
|
-
if (
|
|
3309
|
-
let B =
|
|
3307
|
+
} catch (q) {
|
|
3308
|
+
if (q?.name === "StaleLoad") return 0;
|
|
3309
|
+
let B = q;
|
|
3310
3310
|
if (B?.status === 404 || B?.code === "FileNotFound" || B?.code === "path_folder_not_found" || B?.data?.code === "path_folder_not_found" || B?.data?.data?.status === 404) return 0;
|
|
3311
|
-
let ue = await m.
|
|
3311
|
+
let ue = await m.Ci({
|
|
3312
3312
|
folderId: S,
|
|
3313
3313
|
dataProviders: b,
|
|
3314
3314
|
folders: y,
|
|
@@ -3319,12 +3319,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3319
3319
|
id: "FOLDER_CHILDREN_COUNT_FAILED",
|
|
3320
3320
|
message: f("Failed to load folder items count in folder", { folderName: ue }),
|
|
3321
3321
|
placement: "bottomRight",
|
|
3322
|
-
innerException:
|
|
3322
|
+
innerException: q,
|
|
3323
3323
|
notificationDedupe: !0,
|
|
3324
3324
|
data: {
|
|
3325
3325
|
folderId: S === "folders" ? null : S,
|
|
3326
3326
|
folderName: ue,
|
|
3327
|
-
reason:
|
|
3327
|
+
reason: q instanceof Error ? q.message : String(q)
|
|
3328
3328
|
}
|
|
3329
3329
|
}), null;
|
|
3330
3330
|
}
|
|
@@ -3339,19 +3339,19 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3339
3339
|
if (y.length === 0) return;
|
|
3340
3340
|
let S = {};
|
|
3341
3341
|
S.folders = await ae("folders");
|
|
3342
|
-
let
|
|
3342
|
+
let q = y.map(async (B) => {
|
|
3343
3343
|
if (typeof B.childCount == "number") {
|
|
3344
3344
|
S[B.id] = B.childCount;
|
|
3345
3345
|
return;
|
|
3346
3346
|
}
|
|
3347
3347
|
S[B.id] = await ae(B.id);
|
|
3348
3348
|
});
|
|
3349
|
-
await Promise.all(
|
|
3349
|
+
await Promise.all(q), _(S);
|
|
3350
3350
|
}, [y, ae]), te = (0, d.useCallback)(async (S) => {
|
|
3351
|
-
let
|
|
3351
|
+
let q = await ae(S);
|
|
3352
3352
|
_((B) => ({
|
|
3353
3353
|
...B,
|
|
3354
|
-
[S]:
|
|
3354
|
+
[S]: q
|
|
3355
3355
|
}));
|
|
3356
3356
|
}, [ae]);
|
|
3357
3357
|
(0, d.useImperativeHandle)(h, () => ({ refreshFileCounts: pe }), [pe]), (0, d.useEffect)(() => {
|
|
@@ -3362,13 +3362,13 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3362
3362
|
if (ue.has(B)) return [];
|
|
3363
3363
|
let ve = y.find((x) => x.id === B);
|
|
3364
3364
|
if (!ve || !ve.parentId) return [];
|
|
3365
|
-
let
|
|
3366
|
-
return
|
|
3367
|
-
},
|
|
3368
|
-
|
|
3365
|
+
let H = new Set(ue);
|
|
3366
|
+
return H.add(B), [...S(ve.parentId, H), ve.parentId];
|
|
3367
|
+
}, q = S(e);
|
|
3368
|
+
q.length > 0 ? K((B) => {
|
|
3369
3369
|
let ue = new Set(B);
|
|
3370
|
-
return
|
|
3371
|
-
}) :
|
|
3370
|
+
return q.forEach((ve) => ue.add(ve)), ue.add("folders"), Array.from(ue);
|
|
3371
|
+
}) : K((B) => B.includes("folders") ? B : [...B, "folders"]);
|
|
3372
3372
|
}, [e, y]);
|
|
3373
3373
|
let Ne = (0, d.useCallback)(async () => {
|
|
3374
3374
|
await s(), e ? await te(e) : await te("folders");
|
|
@@ -3431,26 +3431,26 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3431
3431
|
disabled: !v?.sseQuery
|
|
3432
3432
|
}
|
|
3433
3433
|
].filter((S) => !S.disabled), we = (0, d.useCallback)(async (S) => {
|
|
3434
|
-
let
|
|
3435
|
-
|
|
3434
|
+
let q = S[0];
|
|
3435
|
+
!q || q === "empty" || (u !== "my_files" && n("my_files"), r?.(q), await i?.(q === "folders" ? null : q));
|
|
3436
3436
|
}, [
|
|
3437
3437
|
r,
|
|
3438
3438
|
u,
|
|
3439
3439
|
n,
|
|
3440
3440
|
i
|
|
3441
3441
|
]), Be = (0, d.useCallback)(({ key: S }) => {
|
|
3442
|
-
if (m.
|
|
3442
|
+
if (m.Qn(S, v)) {
|
|
3443
3443
|
v?.onLockedTabClick?.(S);
|
|
3444
3444
|
return;
|
|
3445
3445
|
}
|
|
3446
3446
|
n(S);
|
|
3447
|
-
}, [v, n]), Fe = (0, d.useCallback)(async (S,
|
|
3448
|
-
if (
|
|
3449
|
-
let B =
|
|
3447
|
+
}, [v, n]), Fe = (0, d.useCallback)(async (S, q) => {
|
|
3448
|
+
if (K(S), v?.folderTreeLoading !== "lazy") return;
|
|
3449
|
+
let B = q?.node?.key || void 0;
|
|
3450
3450
|
if (!(!B || B === "folders")) try {
|
|
3451
3451
|
await i?.(B);
|
|
3452
3452
|
} catch (ue) {
|
|
3453
|
-
let ve = await m.
|
|
3453
|
+
let ve = await m.Ci({
|
|
3454
3454
|
folderId: B,
|
|
3455
3455
|
dataProviders: b,
|
|
3456
3456
|
folders: y,
|
|
@@ -3530,8 +3530,8 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3530
3530
|
fetchChildFolders: i,
|
|
3531
3531
|
showFileCounts: !0,
|
|
3532
3532
|
folderFileCounts: I,
|
|
3533
|
-
expandedKeys:
|
|
3534
|
-
setExpandedKeys:
|
|
3533
|
+
expandedKeys: $,
|
|
3534
|
+
setExpandedKeys: K,
|
|
3535
3535
|
showTrashFolder: v?.enableTrashFolder
|
|
3536
3536
|
}), (0, l.jsx)("div", {
|
|
3537
3537
|
className: Je.folderActions,
|
|
@@ -3552,7 +3552,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3552
3552
|
});
|
|
3553
3553
|
}));
|
|
3554
3554
|
Br.displayName = "FolderSidebar";
|
|
3555
|
-
var Cl = d.default.lazy(async () => ({ default: (await Promise.resolve().then(() => ze("./
|
|
3555
|
+
var Cl = d.default.lazy(async () => ({ default: (await Promise.resolve().then(() => ze("./c013e7cc.js"))).PixieEditor })), Fl = {
|
|
3556
3556
|
position: "fixed",
|
|
3557
3557
|
inset: 0,
|
|
3558
3558
|
display: "flex",
|
|
@@ -3633,16 +3633,16 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3633
3633
|
uploadProgressFileList: "uploadProgress__file-list",
|
|
3634
3634
|
slideInFromLeft: "slideInFromLeft"
|
|
3635
3635
|
}, { Text: ut } = g.Typography, xl = ({ visible: e, files: t, totalFiles: r, completedFiles: a, onClose: i, onMinimize: s, onInsert: o, minimized: c = !1 }) => {
|
|
3636
|
-
let { token: u } = g.theme.useToken(), { t: n } = m.
|
|
3636
|
+
let { token: u } = g.theme.useToken(), { t: n } = m.zn();
|
|
3637
3637
|
if (!e) return null;
|
|
3638
3638
|
let h = (v) => {
|
|
3639
3639
|
switch (v) {
|
|
3640
3640
|
case "success": return (0, l.jsx)("div", {
|
|
3641
3641
|
className: Ce["uploadProgress__status-icon"],
|
|
3642
|
-
children: (0, l.jsx)(
|
|
3642
|
+
children: (0, l.jsx)(qe.CheckCircleOutlined, { style: { color: u.colorSuccess } })
|
|
3643
3643
|
});
|
|
3644
|
-
case "error": return (0, l.jsx)(
|
|
3645
|
-
default: return (0, l.jsx)(
|
|
3644
|
+
case "error": return (0, l.jsx)(qe.ExclamationCircleOutlined, { style: { color: u.colorError } });
|
|
3645
|
+
default: return (0, l.jsx)(qe.FileImageOutlined, { style: { color: "#1890ff" } });
|
|
3646
3646
|
}
|
|
3647
3647
|
}, y = (v) => {
|
|
3648
3648
|
if (!v) return null;
|
|
@@ -3667,7 +3667,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3667
3667
|
})
|
|
3668
3668
|
})
|
|
3669
3669
|
});
|
|
3670
|
-
let w = t.filter((v) => v.status === "uploading").length, I = t.filter((v) => v.status === "success").length, _ = t.filter((v) => v.status === "error").length, F = t.filter((v) => v.status === "error"),
|
|
3670
|
+
let w = t.filter((v) => v.status === "uploading").length, I = t.filter((v) => v.status === "success").length, _ = t.filter((v) => v.status === "error").length, F = t.filter((v) => v.status === "error"), V = F.length > 1 && F.every((v) => v.error && v.error === F[0]?.error), b = V ? F[0]?.error : null;
|
|
3671
3671
|
return (0, l.jsx)("div", {
|
|
3672
3672
|
className: Ce.uploadProgress + " fm-upload-progress",
|
|
3673
3673
|
children: (0, l.jsxs)("div", {
|
|
@@ -3689,7 +3689,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3689
3689
|
children: (0, l.jsx)(g.Button, {
|
|
3690
3690
|
type: "text",
|
|
3691
3691
|
size: "small",
|
|
3692
|
-
icon: (0, l.jsx)(
|
|
3692
|
+
icon: (0, l.jsx)(qe.CloseOutlined, { className: Ce["uploadProgress__close-icon"] }),
|
|
3693
3693
|
onClick: i,
|
|
3694
3694
|
className: Ce["uploadProgress__header-button"]
|
|
3695
3695
|
})
|
|
@@ -3722,7 +3722,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3722
3722
|
}), (0, l.jsx)(ut, {
|
|
3723
3723
|
type: "secondary",
|
|
3724
3724
|
className: Ce["uploadProgress__file-size"],
|
|
3725
|
-
children: v.size === void 0 ? "" : m.
|
|
3725
|
+
children: v.size === void 0 ? "" : m.Jn(v.size)
|
|
3726
3726
|
})]
|
|
3727
3727
|
}),
|
|
3728
3728
|
description: v.status === "uploading" ? (0, l.jsx)(g.Progress, {
|
|
@@ -3731,7 +3731,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3731
3731
|
status: "active",
|
|
3732
3732
|
showInfo: !1,
|
|
3733
3733
|
className: Ce["uploadProgress__progress-bar"]
|
|
3734
|
-
}) : C ?
|
|
3734
|
+
}) : C ? V ? null : (0, l.jsxs)("div", {
|
|
3735
3735
|
className: Ce["uploadProgress__error-item"],
|
|
3736
3736
|
children: [(0, l.jsx)(ut, {
|
|
3737
3737
|
type: "danger",
|
|
@@ -3751,7 +3751,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3751
3751
|
className: Ce["uploadProgress__common-error"],
|
|
3752
3752
|
children: [(0, l.jsxs)("div", {
|
|
3753
3753
|
className: Ce["uploadProgress__common-error-row"],
|
|
3754
|
-
children: [(0, l.jsx)(
|
|
3754
|
+
children: [(0, l.jsx)(qe.ExclamationCircleOutlined, { style: {
|
|
3755
3755
|
color: u.colorError,
|
|
3756
3756
|
marginRight: 8,
|
|
3757
3757
|
flexShrink: 0
|
|
@@ -3769,7 +3769,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3769
3769
|
})
|
|
3770
3770
|
});
|
|
3771
3771
|
}, { Header: Pl } = g.Layout, { Title: kl } = g.Typography, jl = 200, Sl = ({ activeLibraryItem: e, selectedFolder: t, isTrashFolder: r, onClearTrash: a, files: i, loading: s, onRefresh: o, refreshDisabled: c, showRefresh: u = !1 }) => {
|
|
3772
|
-
let { t: n } = m.
|
|
3772
|
+
let { t: n } = m.zn(), h = e === "my_files" && (r ?? t === "Trash"), [y, f] = d.useState(!1), w = {
|
|
3773
3773
|
[m.g]: n("My files"),
|
|
3774
3774
|
gif: n("GIF"),
|
|
3775
3775
|
[m._]: n("Stock images"),
|
|
@@ -3819,7 +3819,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3819
3819
|
})
|
|
3820
3820
|
});
|
|
3821
3821
|
}, Ur = ({ imageId: e, sourceUrl: t, shouldLoad: r = !0, loader: a, onLoad: i, ...s }) => {
|
|
3822
|
-
let o = m.
|
|
3822
|
+
let o = m.Ia((0, d.useMemo)(() => [t], [t])), [c, u] = (0, d.useState)(() => a.getSnapshot(e, t)), n = (0, d.useRef)(null);
|
|
3823
3823
|
return (0, d.useEffect)(() => (u(a.getSnapshot(e, t)), a.subscribe(e, t, u)), [
|
|
3824
3824
|
e,
|
|
3825
3825
|
a,
|
|
@@ -3843,17 +3843,17 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3843
3843
|
(await o.handleError()).exhausted && a.markError(e), s.onError?.(h);
|
|
3844
3844
|
}
|
|
3845
3845
|
});
|
|
3846
|
-
},
|
|
3846
|
+
}, Gr = 42, El = 6;
|
|
3847
3847
|
function Nl(e) {
|
|
3848
|
-
if (e.length <=
|
|
3849
|
-
let t = e.slice(0,
|
|
3848
|
+
if (e.length <= Gr) return e;
|
|
3849
|
+
let t = e.slice(0, Gr), r = t.lastIndexOf(" ");
|
|
3850
3850
|
return (r > 0 ? t.slice(0, r) : t).trimEnd();
|
|
3851
3851
|
}
|
|
3852
|
-
function
|
|
3853
|
-
let r = Nl(m.
|
|
3852
|
+
function Vr(e, t) {
|
|
3853
|
+
let r = Nl(m.Ti(e?.trim() ?? "").base.replace(/[\\/]+/g, "-").trim());
|
|
3854
3854
|
return r ? `${r}-${t.slice(0, El)}` : void 0;
|
|
3855
3855
|
}
|
|
3856
|
-
var
|
|
3856
|
+
var Ge = {
|
|
3857
3857
|
"em-filemanager": "em-filemanager",
|
|
3858
3858
|
emFilemanager: "em-filemanager",
|
|
3859
3859
|
gifTab: "gifTab",
|
|
@@ -3875,42 +3875,42 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3875
3875
|
playButton: "playButton",
|
|
3876
3876
|
title: "title",
|
|
3877
3877
|
subtitle: "subtitle"
|
|
3878
|
-
}, Lt = 50, Tl = 6,
|
|
3878
|
+
}, Lt = 50, Tl = 6, Wr = 240, Ml = 320, Al = (e) => {
|
|
3879
3879
|
let t = typeof window < "u" ? window.innerWidth : e;
|
|
3880
3880
|
return t <= 700 ? 1 : t <= 1100 ? 2 : t <= 1600 ? 3 : 4;
|
|
3881
|
-
},
|
|
3882
|
-
let { t: o } = m.
|
|
3881
|
+
}, $r = (e) => e.images.downsized.url, Rl = ({ setImageGifList: e, imageGifList: t = [], currentReqGif: r, setCurrentReqGif: a, inputRef: i, customRequest: s }) => {
|
|
3882
|
+
let { t: o } = m.zn(), { GifPlayIcon: c } = se.K(), { options: u } = m.B(), { config: n } = u, h = m.Oa({ maxConcurrent: Tl }), [y, f] = (0, d.useState)(null), [w, I] = (0, d.useState)(new Set()), [_, F] = (0, d.useState)(!1), [V, b] = (0, d.useState)(!1), [v, C] = (0, d.useState)(!1), [O] = g.Form.useForm(), R = (0, d.useRef)(r), oe = (0, d.useRef)(null), k = (0, d.useRef)(null), U = (0, d.useRef)(null), D = (0, d.useRef)(0), Q = (0, d.useRef)(0), $ = (0, d.useRef)(new Set());
|
|
3883
3883
|
(0, d.useEffect)(() => {
|
|
3884
3884
|
R.current = r;
|
|
3885
3885
|
}, [r]), (0, d.useEffect)(() => {
|
|
3886
3886
|
O.setFieldsValue({ keywords: r.keywords });
|
|
3887
3887
|
}, []);
|
|
3888
|
-
let
|
|
3889
|
-
let j =
|
|
3888
|
+
let K = n?.handleProxyUrl, M = n?.fetchWithProxy, W = async (H) => K ? await Promise.resolve(K(H)) ?? H : H, Z = (0, d.useCallback)(async (H) => M ? Promise.resolve(M(H, void 0, { intent: "metadata" })) : fetch(await W(H)), [M, W]), ae = async function({ query: H, page: x }) {
|
|
3889
|
+
let j = H.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
3890
3890
|
try {
|
|
3891
3891
|
let ne = `${m.O}/search?api_key=${n?.REACT_APP_GIPHY_KEY ?? "Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(j)}&limit=${Lt}&offset=${x}&lang=en`;
|
|
3892
3892
|
return { data: await (await Z(ne)).json() };
|
|
3893
3893
|
} catch {}
|
|
3894
3894
|
}, { positionedItems: pe, containerHeight: te, isNearEnd: Ne, viewportMetrics: E, handleViewportChange: we } = se.ge({
|
|
3895
3895
|
items: t,
|
|
3896
|
-
getId: (
|
|
3897
|
-
getPreviewSrc:
|
|
3898
|
-
getAltText: (
|
|
3899
|
-
getWidth: (
|
|
3900
|
-
getHeight: (
|
|
3896
|
+
getId: (H) => H.id,
|
|
3897
|
+
getPreviewSrc: $r,
|
|
3898
|
+
getAltText: (H) => H.title,
|
|
3899
|
+
getWidth: (H) => H.images.downsized.width ? Number(H.images.downsized.width) : void 0,
|
|
3900
|
+
getHeight: (H) => H.images.downsized.height ? Number(H.images.downsized.height) : void 0,
|
|
3901
3901
|
layoutMode: "masonry",
|
|
3902
3902
|
minColumnWidth: 240,
|
|
3903
3903
|
estimatedItemHeight: 220,
|
|
3904
3904
|
prefetchThresholdPx: Ml,
|
|
3905
3905
|
resolveColumnCount: Al
|
|
3906
|
-
}), Be = m.
|
|
3906
|
+
}), Be = m.Xa(we, [t.length]), Fe = () => {
|
|
3907
3907
|
oe.current &&= (clearTimeout(oe.current), null);
|
|
3908
|
-
}, S = (
|
|
3909
|
-
|
|
3908
|
+
}, S = (H) => $.current.has(H) ? !1 : ($.current.add(H), !0), q = (H) => {
|
|
3909
|
+
$.current.delete(H);
|
|
3910
3910
|
}, B = (0, d.useCallback)(async () => {
|
|
3911
|
-
let
|
|
3912
|
-
if (!
|
|
3913
|
-
let x = `gif:${
|
|
3911
|
+
let H = R.current.keywords?.trim();
|
|
3912
|
+
if (!H || _ || V || !v) return;
|
|
3913
|
+
let x = `gif:${H}:${Q.current}`;
|
|
3914
3914
|
if (!S(x)) return;
|
|
3915
3915
|
let j = D.current;
|
|
3916
3916
|
b(!0);
|
|
@@ -3932,25 +3932,25 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3932
3932
|
return re.length > 0 ? [...he, ...re] : he;
|
|
3933
3933
|
}), Q.current += J.length, C(J.length === Lt);
|
|
3934
3934
|
} finally {
|
|
3935
|
-
|
|
3935
|
+
q(x), j === D.current && b(!1);
|
|
3936
3936
|
}
|
|
3937
3937
|
}, [
|
|
3938
3938
|
v,
|
|
3939
3939
|
_,
|
|
3940
|
-
|
|
3940
|
+
V,
|
|
3941
3941
|
e
|
|
3942
3942
|
]), ue = async () => {
|
|
3943
3943
|
Fe();
|
|
3944
|
-
let
|
|
3945
|
-
if (!
|
|
3944
|
+
let H = R.current.keywords?.trim();
|
|
3945
|
+
if (!H) {
|
|
3946
3946
|
k.current = null, U.current = null, D.current += 1, Q.current = 0, e([]), I(new Set()), C(!1), b(!1);
|
|
3947
3947
|
return;
|
|
3948
3948
|
}
|
|
3949
|
-
if (U.current ===
|
|
3950
|
-
let x = `gif:${
|
|
3949
|
+
if (U.current === H || k.current === H || _ && k.current === H) return;
|
|
3950
|
+
let x = `gif:${H}:0`;
|
|
3951
3951
|
if (!S(x)) return;
|
|
3952
3952
|
let j = D.current + 1;
|
|
3953
|
-
D.current = j, k.current =
|
|
3953
|
+
D.current = j, k.current = H, Q.current = 0, e([]), I(new Set()), C(!1), b(!1), F(!0);
|
|
3954
3954
|
try {
|
|
3955
3955
|
let ne = await ae({
|
|
3956
3956
|
query: R.current,
|
|
@@ -3963,52 +3963,52 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
3963
3963
|
if (j !== D.current) return;
|
|
3964
3964
|
e(xe), Q.current = J.length, C(J.length === Lt);
|
|
3965
3965
|
} else e([]), C(!1);
|
|
3966
|
-
U.current =
|
|
3966
|
+
U.current = H;
|
|
3967
3967
|
} catch {
|
|
3968
3968
|
C(!1);
|
|
3969
3969
|
} finally {
|
|
3970
|
-
|
|
3970
|
+
q(x), k.current === H && (k.current = null), F(!1);
|
|
3971
3971
|
}
|
|
3972
|
-
}, ve = async (
|
|
3972
|
+
}, ve = async (H, x, j) => {
|
|
3973
3973
|
f(x), setTimeout(() => {
|
|
3974
3974
|
f(null);
|
|
3975
|
-
}, 2e3), s(
|
|
3975
|
+
}, 2e3), s(H, Vr(j, x) ?? x);
|
|
3976
3976
|
};
|
|
3977
3977
|
return (0, d.useEffect)(() => () => {
|
|
3978
3978
|
Fe();
|
|
3979
3979
|
}, []), (0, d.useEffect)(() => {
|
|
3980
|
-
!_ && !
|
|
3980
|
+
!_ && !V && v && t.length > 0 && Ne && B();
|
|
3981
3981
|
}, [
|
|
3982
3982
|
v,
|
|
3983
3983
|
t.length,
|
|
3984
3984
|
Ne,
|
|
3985
3985
|
B,
|
|
3986
3986
|
_,
|
|
3987
|
-
|
|
3987
|
+
V
|
|
3988
3988
|
]), (0, l.jsx)("div", {
|
|
3989
|
-
className:
|
|
3989
|
+
className: Ge.gifTab,
|
|
3990
3990
|
children: (0, l.jsx)("div", {
|
|
3991
|
-
className:
|
|
3991
|
+
className: Ge.searchOutputWrapper,
|
|
3992
3992
|
children: (0, l.jsxs)("div", {
|
|
3993
3993
|
id: "scrollableDiv",
|
|
3994
3994
|
ref: Be,
|
|
3995
|
-
className:
|
|
3995
|
+
className: Ge.scrollableDiv,
|
|
3996
3996
|
children: [
|
|
3997
3997
|
(0, l.jsxs)(g.Form, {
|
|
3998
3998
|
form: O,
|
|
3999
|
-
onValuesChange: (
|
|
4000
|
-
if (
|
|
3999
|
+
onValuesChange: (H) => {
|
|
4000
|
+
if (H.keywords !== void 0) {
|
|
4001
4001
|
let x = {
|
|
4002
4002
|
...R.current,
|
|
4003
|
-
keywords:
|
|
4003
|
+
keywords: H.keywords
|
|
4004
4004
|
};
|
|
4005
4005
|
a(x), R.current = x, Fe(), oe.current = setTimeout(ue, 800);
|
|
4006
4006
|
}
|
|
4007
4007
|
},
|
|
4008
|
-
className: t.length > 0 ?
|
|
4008
|
+
className: t.length > 0 ? Ge.searchResults : Ge.search,
|
|
4009
4009
|
children: [(0, l.jsx)(g.Form.Item, {
|
|
4010
4010
|
name: "keywords",
|
|
4011
|
-
className:
|
|
4011
|
+
className: Ge.gifSearchInput,
|
|
4012
4012
|
children: (0, l.jsx)(g.Input, {
|
|
4013
4013
|
onPressEnter: () => {
|
|
4014
4014
|
ue();
|
|
@@ -4026,35 +4026,35 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4026
4026
|
})
|
|
4027
4027
|
})
|
|
4028
4028
|
}), t.length > 0 && !_ && (0, l.jsx)("div", {
|
|
4029
|
-
className: `ant-divider ${
|
|
4029
|
+
className: `ant-divider ${Ge.divider}`,
|
|
4030
4030
|
role: "separator"
|
|
4031
4031
|
})]
|
|
4032
4032
|
}),
|
|
4033
4033
|
!t.length && !_ && (0, l.jsx)(l.Fragment, { children: r.keywords ? (0, l.jsx)(se.J, {}) : (0, l.jsxs)("div", {
|
|
4034
|
-
className:
|
|
4034
|
+
className: Ge.resultsContainer,
|
|
4035
4035
|
children: [
|
|
4036
4036
|
(0, l.jsx)("div", {
|
|
4037
|
-
className:
|
|
4038
|
-
children: (0, l.jsx)(c, { className:
|
|
4037
|
+
className: Ge.videoIcon,
|
|
4038
|
+
children: (0, l.jsx)(c, { className: Ge.playButton })
|
|
4039
4039
|
}),
|
|
4040
4040
|
(0, l.jsx)("h1", {
|
|
4041
|
-
className:
|
|
4041
|
+
className: Ge.title,
|
|
4042
4042
|
children: o("Over 350,000 live images")
|
|
4043
4043
|
}),
|
|
4044
4044
|
(0, l.jsx)("p", {
|
|
4045
|
-
className:
|
|
4045
|
+
className: Ge.subtitle,
|
|
4046
4046
|
children: o("Enter a search query and we'll find the perfect image for you")
|
|
4047
4047
|
})
|
|
4048
4048
|
]
|
|
4049
4049
|
}) }),
|
|
4050
4050
|
!t.length && _ && (0, l.jsx)(dt.r, {}),
|
|
4051
4051
|
t.length > 0 && (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)("div", {
|
|
4052
|
-
className:
|
|
4052
|
+
className: Ge.virtualCanvas,
|
|
4053
4053
|
style: { height: te },
|
|
4054
|
-
children: pe.map(({ row:
|
|
4055
|
-
let j =
|
|
4054
|
+
children: pe.map(({ row: H, layout: x }) => {
|
|
4055
|
+
let j = H.item, ne = w.has(j.id), J = $r(j), xe = x.bottom >= E.scrollTop - Wr && x.top <= E.scrollTop + E.viewportHeight + Wr;
|
|
4056
4056
|
return (0, l.jsxs)("div", {
|
|
4057
|
-
className: `${
|
|
4057
|
+
className: `${Ge.listItem} ${ne ? Ge.loaded : ""}`,
|
|
4058
4058
|
onClick: () => ve(j.images.downsized.url, j.id, j.title),
|
|
4059
4059
|
style: {
|
|
4060
4060
|
position: "absolute",
|
|
@@ -4072,7 +4072,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4072
4072
|
sourceUrl: J,
|
|
4073
4073
|
shouldLoad: xe,
|
|
4074
4074
|
loader: h,
|
|
4075
|
-
className: y === j.id ?
|
|
4075
|
+
className: y === j.id ? Ge.loadedImage : "",
|
|
4076
4076
|
width: "100%",
|
|
4077
4077
|
height: "100%",
|
|
4078
4078
|
alt: j.title,
|
|
@@ -4091,11 +4091,11 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4091
4091
|
target: "_blank",
|
|
4092
4092
|
onClick: (he) => he.stopPropagation()
|
|
4093
4093
|
}),
|
|
4094
|
-
y === j.id && (0, l.jsx)(g.Spin, { className:
|
|
4094
|
+
y === j.id && (0, l.jsx)(g.Spin, { className: Ge.antSpin })
|
|
4095
4095
|
]
|
|
4096
4096
|
}, j.id);
|
|
4097
4097
|
})
|
|
4098
|
-
}),
|
|
4098
|
+
}), V && (0, l.jsx)(dt.r, {})] })
|
|
4099
4099
|
]
|
|
4100
4100
|
})
|
|
4101
4101
|
})
|
|
@@ -4136,22 +4136,22 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4136
4136
|
title: "title",
|
|
4137
4137
|
subtitle: "subtitle",
|
|
4138
4138
|
dark: "dark"
|
|
4139
|
-
}, Ll = "https://api.unsplash.com", Ot = 30, Ol = 6,
|
|
4139
|
+
}, Ll = "https://api.unsplash.com", Ot = 30, Ol = 6, qr = 240, Dl = 320, Bl = 540, zl = 1200, Ul = (e) => {
|
|
4140
4140
|
let t = typeof window < "u" ? window.innerWidth : e;
|
|
4141
4141
|
return t <= 650 ? 1 : t <= 1e3 ? 2 : t <= 1450 ? 3 : 4;
|
|
4142
|
-
},
|
|
4142
|
+
}, Hr = (e, t) => {
|
|
4143
4143
|
let r = new URL(e);
|
|
4144
4144
|
return r.searchParams.set("w", t.toString()), r.toString();
|
|
4145
|
-
},
|
|
4146
|
-
let { t: o } = m.
|
|
4147
|
-
|
|
4145
|
+
}, Gl = ({ imageStockList: e, setImageStockList: t, currentReq: r, setCurrentReq: a, inputRef: i, customRequest: s }) => {
|
|
4146
|
+
let { t: o } = m.zn(), { StockBigIcon: c, MixedViewIcon: u, LandscapeViewIcon: n, PortraitViewIcon: h, SquareViewIcon: y } = se.K(), { options: f } = m.B(), { config: w } = f, I = m.Oa({ maxConcurrent: Ol }), [_, F] = (0, d.useState)(!1), [V, b] = (0, d.useState)(!1), [v, C] = (0, d.useState)(!1), [O, R] = (0, d.useState)(null), [oe, k] = (0, d.useState)(new Set()), [U] = g.Form.useForm(), D = w?.fetchWithProxy, Q = w?.handleProxyUrl, $ = w?.UNSPLASH_KEY ?? "HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0", K = w?.locale?.slice(0, 2) || "ru", M = (0, d.useRef)(r), W = (0, d.useRef)(null), Z = (0, d.useRef)(null), ae = (0, d.useRef)(0), pe = (0, d.useRef)(1), te = (0, d.useRef)(new Set()), Ne = async (L) => Q ? await Promise.resolve(Q(L)) ?? L : L, E = (0, d.useCallback)(async (L) => D ? Promise.resolve(D(L, void 0, { intent: "metadata" })) : fetch(await Ne(L)), [D, Ne]), we = () => {
|
|
4147
|
+
W.current &&= (clearTimeout(W.current), null);
|
|
4148
4148
|
}, Be = (L) => te.current.has(L) ? !1 : (te.current.add(L), !0), Fe = (L) => {
|
|
4149
4149
|
te.current.delete(L);
|
|
4150
4150
|
}, S = (L) => L.map((re) => ({
|
|
4151
4151
|
...re,
|
|
4152
4152
|
urls: {
|
|
4153
|
-
raw:
|
|
4154
|
-
small:
|
|
4153
|
+
raw: Hr(re.urls.raw, zl),
|
|
4154
|
+
small: Hr(re.urls.raw, Bl)
|
|
4155
4155
|
}
|
|
4156
4156
|
}));
|
|
4157
4157
|
(0, d.useEffect)(() => {
|
|
@@ -4168,18 +4168,18 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4168
4168
|
orientation: r.orientation
|
|
4169
4169
|
});
|
|
4170
4170
|
}, []);
|
|
4171
|
-
let
|
|
4171
|
+
let q = async function(L) {
|
|
4172
4172
|
try {
|
|
4173
|
-
let re = `${L}${L.includes("?") ? "&" : "?"}client_id=${
|
|
4173
|
+
let re = `${L}${L.includes("?") ? "&" : "?"}client_id=${$}`;
|
|
4174
4174
|
return { data: await (await E(re)).json() };
|
|
4175
4175
|
} catch {}
|
|
4176
4176
|
}, B = async function({ query: L, page: re }) {
|
|
4177
4177
|
let X = L.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
4178
4178
|
try {
|
|
4179
|
-
let Pe = `${Ll}/search/photos?client_id=${
|
|
4179
|
+
let Pe = `${Ll}/search/photos?client_id=${$}&lang=${K}&per_page=${Ot}&query=${encodeURIComponent(X)}&page=${re}`;
|
|
4180
4180
|
return L.color !== "" && (Pe += `&color=${L.color}`), L.orientation !== "" && (Pe += `&orientation=${L.orientation}`), { data: await (await E(Pe)).json() };
|
|
4181
4181
|
} catch {}
|
|
4182
|
-
}, { positionedItems: ue, containerHeight: ve, isNearEnd:
|
|
4182
|
+
}, { positionedItems: ue, containerHeight: ve, isNearEnd: H, viewportMetrics: x, handleViewportChange: j } = se.ge({
|
|
4183
4183
|
items: e,
|
|
4184
4184
|
getId: (L) => L.id,
|
|
4185
4185
|
getPreviewSrc: (L) => L.urls.small,
|
|
@@ -4191,8 +4191,8 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4191
4191
|
estimatedItemHeight: 220,
|
|
4192
4192
|
prefetchThresholdPx: Dl,
|
|
4193
4193
|
resolveColumnCount: Ul
|
|
4194
|
-
}), ne = m.
|
|
4195
|
-
if (_ ||
|
|
4194
|
+
}), ne = m.Xa(j, [e.length]), J = (0, d.useCallback)(async () => {
|
|
4195
|
+
if (_ || V || !v || !M.current.keywords.trim()) return;
|
|
4196
4196
|
let L = ae.current, re = pe.current, X = `stock:${`${M.current.keywords.trim()}|${M.current.color}|${M.current.orientation}`}:${re}`;
|
|
4197
4197
|
if (Be(X)) {
|
|
4198
4198
|
b(!0);
|
|
@@ -4220,7 +4220,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4220
4220
|
}, [
|
|
4221
4221
|
v,
|
|
4222
4222
|
_,
|
|
4223
|
-
|
|
4223
|
+
V,
|
|
4224
4224
|
t
|
|
4225
4225
|
]), xe = async () => {
|
|
4226
4226
|
we();
|
|
@@ -4254,19 +4254,19 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4254
4254
|
(0, d.useEffect)(() => () => {
|
|
4255
4255
|
we();
|
|
4256
4256
|
}, []), (0, d.useEffect)(() => {
|
|
4257
|
-
!_ && !
|
|
4257
|
+
!_ && !V && v && e.length > 0 && H && J();
|
|
4258
4258
|
}, [
|
|
4259
4259
|
v,
|
|
4260
4260
|
e.length,
|
|
4261
|
-
|
|
4261
|
+
H,
|
|
4262
4262
|
J,
|
|
4263
4263
|
_,
|
|
4264
|
-
|
|
4264
|
+
V
|
|
4265
4265
|
]);
|
|
4266
4266
|
let he = async (L, re, X, Pe) => {
|
|
4267
|
-
|
|
4267
|
+
q(re.download_location), R(X), setTimeout(() => R(null), 2e3);
|
|
4268
4268
|
let Oe = L.raw;
|
|
4269
|
-
s(Oe,
|
|
4269
|
+
s(Oe, Vr(Pe, X) ?? m.ji(Oe));
|
|
4270
4270
|
};
|
|
4271
4271
|
return (0, l.jsx)("div", {
|
|
4272
4272
|
className: ye.stockTab,
|
|
@@ -4285,7 +4285,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4285
4285
|
...m.ie,
|
|
4286
4286
|
...re
|
|
4287
4287
|
};
|
|
4288
|
-
a(X), M.current = X, we(), X.keywords === "" ? (Z.current = null, ae.current += 1, pe.current = 1, t([]), k(new Set()), C(!1), b(!1), a({ ...m.ie }), M.current = m.ie, U.resetFields()) :
|
|
4288
|
+
a(X), M.current = X, we(), X.keywords === "" ? (Z.current = null, ae.current += 1, pe.current = 1, t([]), k(new Set()), C(!1), b(!1), a({ ...m.ie }), M.current = m.ie, U.resetFields()) : W.current = setTimeout(xe, 800);
|
|
4289
4289
|
},
|
|
4290
4290
|
className: e.length > 0 ? ye.searchResults : ye.search,
|
|
4291
4291
|
children: [(0, l.jsxs)(g.Row, {
|
|
@@ -4486,7 +4486,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4486
4486
|
className: ye.virtualCanvas,
|
|
4487
4487
|
style: { height: ve },
|
|
4488
4488
|
children: ue.map(({ row: L, layout: re }) => {
|
|
4489
|
-
let X = L.item, Pe = oe.has(X.id), Oe = re.bottom >= x.scrollTop -
|
|
4489
|
+
let X = L.item, Pe = oe.has(X.id), Oe = re.bottom >= x.scrollTop - qr && re.top <= x.scrollTop + x.viewportHeight + qr;
|
|
4490
4490
|
return (0, l.jsxs)("div", {
|
|
4491
4491
|
className: `${ye.listItem} ${Pe ? ye.loaded : ""}`,
|
|
4492
4492
|
onClick: () => he(X.urls, X.links, X.id, X.alt_description || X.description),
|
|
@@ -4546,12 +4546,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4546
4546
|
]
|
|
4547
4547
|
}, X.id);
|
|
4548
4548
|
})
|
|
4549
|
-
}),
|
|
4549
|
+
}), V && (0, l.jsx)(dt.r, {})] })
|
|
4550
4550
|
]
|
|
4551
4551
|
})
|
|
4552
4552
|
})
|
|
4553
4553
|
});
|
|
4554
|
-
},
|
|
4554
|
+
}, Vl = (e, t) => {
|
|
4555
4555
|
let r = () => {
|
|
4556
4556
|
try {
|
|
4557
4557
|
let a = {
|
|
@@ -4562,35 +4562,35 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4562
4562
|
} catch {}
|
|
4563
4563
|
};
|
|
4564
4564
|
t ? setTimeout(r, t) : r();
|
|
4565
|
-
},
|
|
4566
|
-
let { options: e } = m.
|
|
4565
|
+
}, Wl = () => {
|
|
4566
|
+
let { options: e } = m.B(), t = e.config;
|
|
4567
4567
|
return (0, d.useCallback)((r, a) => {
|
|
4568
|
-
t?.pushToGTM !== !1 &&
|
|
4568
|
+
t?.pushToGTM !== !1 && Vl(r, a);
|
|
4569
4569
|
}, [t?.pushToGTM]);
|
|
4570
4570
|
};
|
|
4571
|
-
function
|
|
4571
|
+
function Kr(e) {
|
|
4572
4572
|
let t = e.trim();
|
|
4573
4573
|
return /^(https?:)?\/\//i.test(t) || /^data:/i.test(t);
|
|
4574
4574
|
}
|
|
4575
|
-
function
|
|
4575
|
+
function $l(e) {
|
|
4576
4576
|
let t = e.trim();
|
|
4577
|
-
return
|
|
4577
|
+
return Kr(t) ? t : `data:image/jpeg;base64, ${e}`;
|
|
4578
4578
|
}
|
|
4579
|
-
function
|
|
4580
|
-
let { t: h } = m.
|
|
4579
|
+
function ql({ setFrameHeight: e, customRequest: t, aiTabRef: r, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: s, imageAiList: o, setImageAiList: c, isLoadingAi: u, setIsLoadingAi: n }) {
|
|
4580
|
+
let { t: h } = m.zn(), { options: y } = m.B(), f = y.config, w = m.mr(), I = Wl(), { messages: _ } = y.config, [F, V] = (0, d.useState)([]), [b, v] = (0, d.useState)(0), [C, O] = (0, d.useState)(null), [R, oe] = (0, d.useState)(!1), [k, U] = (0, d.useState)(h("Evaluating the task")), [D, Q] = (0, d.useState)(!1), $ = (0, d.useRef)(new Set()), K = (0, d.useRef)(new Set()), M = (0, d.useRef)(new Set());
|
|
4581
4581
|
(0, d.useEffect)(() => {
|
|
4582
|
-
|
|
4582
|
+
V(_);
|
|
4583
4583
|
}, [_]), (0, d.useEffect)(() => {
|
|
4584
|
-
!o.length && !C && (
|
|
4584
|
+
!o.length && !C && (V([]), $.current.clear(), K.current.clear(), M.current.clear(), ae.current = -1);
|
|
4585
4585
|
}, [o, C]);
|
|
4586
|
-
let
|
|
4586
|
+
let W = (0, d.useMemo)(() => f && typeof f?.sendAIImageRequest == "function" ? f?.sendAIImageRequest : () => Promise.resolve({}), [f]), Z = (0, d.useCallback)((x) => {
|
|
4587
4587
|
let j = `${C}-${x.progress}-${JSON.stringify(x.images || x.data)}`;
|
|
4588
4588
|
if (!M.current.has(j)) if (M.current.add(j), x.status !== "error" && x.status !== "Canceled") {
|
|
4589
4589
|
if (x.images) {
|
|
4590
4590
|
if (U(String(x.status)), x.progress === 100) {
|
|
4591
4591
|
n(!1), c(x.images);
|
|
4592
4592
|
let ne = C, J = Array.isArray(x.images) ? x.images : [];
|
|
4593
|
-
J.length > 0 && ne &&
|
|
4593
|
+
J.length > 0 && ne && !$.current.has(ne) && ($.current.add(ne), w.success({
|
|
4594
4594
|
id: "AI_IMAGE_GENERERATION_SUCCESS",
|
|
4595
4595
|
message: h("Images generated successfully"),
|
|
4596
4596
|
placement: "bottomRight",
|
|
@@ -4604,7 +4604,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4604
4604
|
} else if (x.data && (c([String(x.data)]), x.progress === 100)) {
|
|
4605
4605
|
n(!1);
|
|
4606
4606
|
let ne = C, J = x.data ? [String(x.data)] : [];
|
|
4607
|
-
J.length > 0 && ne &&
|
|
4607
|
+
J.length > 0 && ne && !$.current.has(ne) && ($.current.add(ne), w.success({
|
|
4608
4608
|
id: "AI_IMAGE_GENERERATION_SUCCESS",
|
|
4609
4609
|
message: h("Images generated successfully"),
|
|
4610
4610
|
placement: "bottomRight",
|
|
@@ -4615,7 +4615,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4615
4615
|
}
|
|
4616
4616
|
})), O(null), Q(!1);
|
|
4617
4617
|
}
|
|
4618
|
-
} else n(!1), Q(!1), C && !
|
|
4618
|
+
} else n(!1), Q(!1), C && !K.current.has(C) && (K.current.add(C), w.error({
|
|
4619
4619
|
id: "AI_RESPONSE_INVALID",
|
|
4620
4620
|
message: h("Something went wrong, please try again"),
|
|
4621
4621
|
placement: "bottomRight",
|
|
@@ -4649,7 +4649,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4649
4649
|
return (j) => x(j);
|
|
4650
4650
|
}
|
|
4651
4651
|
return (x) => {};
|
|
4652
|
-
}, [f]), te = (0, d.useMemo)(() => f && typeof f?.handleLimitUsageEmitter == "object" ? f?.handleLimitUsageEmitter : { fire: () => {} }, [f]), Ne = f?.elementId, { projectId: E } = f, { limits: we } = f?.limits ? f : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Be } = we, Fe = Be > 0 && b >= Be, S = !!(f?.limits && f.counters) && m.E.isPlugin,
|
|
4652
|
+
}, [f]), te = (0, d.useMemo)(() => f && typeof f?.handleLimitUsageEmitter == "object" ? f?.handleLimitUsageEmitter : { fire: () => {} }, [f]), Ne = f?.elementId, { projectId: E } = f, { limits: we } = f?.limits ? f : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Be } = we, Fe = Be > 0 && b >= Be, S = !!(f?.limits && f.counters) && m.E.isPlugin, q = (0, d.useCallback)(() => {
|
|
4653
4653
|
te.fire({
|
|
4654
4654
|
name: "AiImgCount",
|
|
4655
4655
|
count: b + 1
|
|
@@ -4660,12 +4660,12 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4660
4660
|
b,
|
|
4661
4661
|
Be
|
|
4662
4662
|
]), ue = (0, d.useCallback)(async () => {
|
|
4663
|
-
U(h("Evaluating the task")), s !== "" && !u && (n(!0), Q(!0), c([]),
|
|
4663
|
+
U(h("Evaluating the task")), s !== "" && !u && (n(!0), Q(!0), c([]), V([]), I({
|
|
4664
4664
|
event: "submit_form",
|
|
4665
4665
|
action: "ai_image_generation",
|
|
4666
4666
|
entity_id: Ne,
|
|
4667
4667
|
project_id: E
|
|
4668
|
-
}),
|
|
4668
|
+
}), W({ body: {
|
|
4669
4669
|
project_id: E,
|
|
4670
4670
|
request: "create-image",
|
|
4671
4671
|
connection: "midjourney",
|
|
@@ -4694,7 +4694,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4694
4694
|
}), pe({
|
|
4695
4695
|
task_id: he?.id,
|
|
4696
4696
|
entity_id: Ne
|
|
4697
|
-
})) : (n(!1), Q(!1), L && !
|
|
4697
|
+
})) : (n(!1), Q(!1), L && !K.current.has(L) && (K.current.add(L), w.error({
|
|
4698
4698
|
id: "AI_IMAGE_GENERATION_FAILED",
|
|
4699
4699
|
message: J?.message || h("Something went wrong, please try again"),
|
|
4700
4700
|
placement: "bottomRight",
|
|
@@ -4709,7 +4709,7 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4709
4709
|
}).catch((x) => {
|
|
4710
4710
|
n(!1), Q(!1);
|
|
4711
4711
|
let j = x;
|
|
4712
|
-
return (j?.error || j?.data) && C && !
|
|
4712
|
+
return (j?.error || j?.data) && C && !K.current.has(C) && (K.current.add(C), w?.error({
|
|
4713
4713
|
id: "AI_IMAGE_GENERATION_FAILED",
|
|
4714
4714
|
message: h("Something went wrong, please try again"),
|
|
4715
4715
|
placement: "bottomRight",
|
|
@@ -4732,13 +4732,13 @@ __useblocks__.define("static/core/496a28e52.js", [
|
|
|
4732
4732
|
I,
|
|
4733
4733
|
Ne,
|
|
4734
4734
|
E,
|
|
4735
|
-
|
|
4735
|
+
W,
|
|
4736
4736
|
w,
|
|
4737
4737
|
pe,
|
|
4738
4738
|
h,
|
|
4739
4739
|
C
|
|
4740
4740
|
]), ve = (0, d.useCallback)(() => {
|
|
4741
|
-
B ? (S && (v((x) => x + 1),
|
|
4741
|
+
B ? (S && (v((x) => x + 1), q()), ue()) : S && w.error({
|
|
4742
4742
|
id: "AI_IMAGE_GENERATION_LIMIT_EXCEEDED",
|
|
4743
4743
|
message: h("The usage limit has been exceeded"),
|
|
4744
4744
|
description: h(`The maximum number of requests for the current subscription period has been reached.
|
|
@@ -4749,7 +4749,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4749
4749
|
B,
|
|
4750
4750
|
S,
|
|
4751
4751
|
v,
|
|
4752
|
-
|
|
4752
|
+
q,
|
|
4753
4753
|
ue,
|
|
4754
4754
|
w,
|
|
4755
4755
|
h
|
|
@@ -4757,11 +4757,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4757
4757
|
(0, d.useEffect)(() => {
|
|
4758
4758
|
S && v(f?.counters?.ai_img_counter || 0);
|
|
4759
4759
|
}, [f, S]);
|
|
4760
|
-
let
|
|
4760
|
+
let H = (0, d.useCallback)(async (x) => {
|
|
4761
4761
|
if (a) return;
|
|
4762
4762
|
let j;
|
|
4763
4763
|
try {
|
|
4764
|
-
if (
|
|
4764
|
+
if (Kr(x)) j = await (await fetch(x)).blob();
|
|
4765
4765
|
else {
|
|
4766
4766
|
let J = atob(x), xe = Array(J.length);
|
|
4767
4767
|
for (let he = 0; he < J.length; he++) xe[he] = J.charCodeAt(he);
|
|
@@ -4815,8 +4815,8 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4815
4815
|
requestStatus: k,
|
|
4816
4816
|
setRequestStatus: U,
|
|
4817
4817
|
handleGenerate: ve,
|
|
4818
|
-
handleLimitAiImgCount:
|
|
4819
|
-
convertBase64ToFile:
|
|
4818
|
+
handleLimitAiImgCount: q,
|
|
4819
|
+
convertBase64ToFile: H,
|
|
4820
4820
|
isShiftPressed: R,
|
|
4821
4821
|
setIsShiftPressed: oe,
|
|
4822
4822
|
currentReqId: C,
|
|
@@ -4829,7 +4829,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4829
4829
|
emFilemanager: "em-filemanager",
|
|
4830
4830
|
slideshowContainer: "slideshowContainer",
|
|
4831
4831
|
slideshowImage: "slideshowImage"
|
|
4832
|
-
},
|
|
4832
|
+
}, Hl = ({ images: e, transitionDuration: t = 1e3, frameHeight: r }) => {
|
|
4833
4833
|
let [a, i] = (0, d.useState)([]), [s, o] = (0, d.useState)(r);
|
|
4834
4834
|
(0, d.useEffect)(() => {
|
|
4835
4835
|
let u = () => {
|
|
@@ -4863,7 +4863,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4863
4863
|
minHeight: 130
|
|
4864
4864
|
},
|
|
4865
4865
|
children: a.map((u, n) => (0, l.jsx)("img", {
|
|
4866
|
-
src:
|
|
4866
|
+
src: $l(u.src),
|
|
4867
4867
|
alt: `Slide ${n + 1}`,
|
|
4868
4868
|
className: Yr.slideshowImage,
|
|
4869
4869
|
style: {
|
|
@@ -4873,7 +4873,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4873
4873
|
}
|
|
4874
4874
|
}, n))
|
|
4875
4875
|
});
|
|
4876
|
-
},
|
|
4876
|
+
}, Kl = ({ className: e, style: t, color: r, text: a, variant: i, ...s }) => {
|
|
4877
4877
|
let o = a || "";
|
|
4878
4878
|
return (0, l.jsx)(g.Tag, {
|
|
4879
4879
|
style: t,
|
|
@@ -4884,11 +4884,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4884
4884
|
children: o
|
|
4885
4885
|
});
|
|
4886
4886
|
}, Yl = ({ text: e, counter: t, limits: r, wrapperStyles: a }) => {
|
|
4887
|
-
let { t: i } = m.
|
|
4887
|
+
let { t: i } = m.zn(), { options: s } = m.B(), o = s.config, { token: c } = g.theme.useToken(), u = +r > 0, n = !u || t < +r, h = o?.billingPageUrl || "/billing";
|
|
4888
4888
|
return (0, l.jsxs)("div", {
|
|
4889
4889
|
className: "limits-couter-wrapper",
|
|
4890
4890
|
style: a,
|
|
4891
|
-
children: [(0, l.jsx)(
|
|
4891
|
+
children: [(0, l.jsx)(Kl, {
|
|
4892
4892
|
variant: "filled",
|
|
4893
4893
|
text: t + " " + i("of") + " " + (u ? r : "∞") + " " + (e || i("tests", { count: r })) + " " + i("was used", { count: t }),
|
|
4894
4894
|
className: "limit-counter",
|
|
@@ -4938,7 +4938,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4938
4938
|
children: (0, l.jsx)(g.Button, {
|
|
4939
4939
|
className: `${Le.arrowBtn} ${Le.arrowBtnNext}`,
|
|
4940
4940
|
size: "large",
|
|
4941
|
-
icon: (0, l.jsx)(
|
|
4941
|
+
icon: (0, l.jsx)(qe.ArrowRightOutlined, {})
|
|
4942
4942
|
})
|
|
4943
4943
|
}));
|
|
4944
4944
|
Qr.displayName = "SampleNextArrow";
|
|
@@ -4948,12 +4948,12 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4948
4948
|
children: (0, l.jsx)(g.Button, {
|
|
4949
4949
|
className: `${Le.arrowBtn} ${Le.arrowBtnPrev}`,
|
|
4950
4950
|
size: "large",
|
|
4951
|
-
icon: (0, l.jsx)(
|
|
4951
|
+
icon: (0, l.jsx)(qe.ArrowLeftOutlined, {})
|
|
4952
4952
|
})
|
|
4953
4953
|
}));
|
|
4954
4954
|
Zr.displayName = "SamplePrevArrow";
|
|
4955
4955
|
var Ql = ({ customRequest: e, inputAiRef: t, isImageUploaded: r, setIsImageUploaded: a, aiImageRequest: i, setAiImageRequest: s, imageAiList: o, setImageAiList: c, isLoadingAi: u, setIsLoadingAi: n }) => {
|
|
4956
|
-
let { t: h } = m.
|
|
4956
|
+
let { t: h } = m.zn(), { AiIcon_2: y } = se.K(), f = d.default.useRef(null), [w, I] = (0, d.useState)("auto"), { aiImageCounter: _, currentAiImgLimits: F, loadingDuringGeneration: V, requestStatus: b, handleGenerate: v, convertBase64ToFile: C, isShiftPressed: O, setIsShiftPressed: R, limitsInPlugin: oe } = ql({
|
|
4957
4957
|
setFrameHeight: I,
|
|
4958
4958
|
customRequest: e,
|
|
4959
4959
|
aiTabRef: f,
|
|
@@ -4966,14 +4966,14 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4966
4966
|
setIsLoadingAi: n
|
|
4967
4967
|
});
|
|
4968
4968
|
(0, d.useEffect)(() => {}, [r]);
|
|
4969
|
-
let [k, U] = (0, d.useState)(!1), D = (0, d.useCallback)(() => U(!0), []), Q = (0, d.useCallback)(() => U(!1), []),
|
|
4970
|
-
|
|
4969
|
+
let [k, U] = (0, d.useState)(!1), D = (0, d.useCallback)(() => U(!0), []), Q = (0, d.useCallback)(() => U(!1), []), $ = (0, d.useCallback)((W) => s(W.target.value), [s]), K = (0, d.useCallback)((W) => {
|
|
4970
|
+
W.key === "Shift" ? R(!0) : W.key === "Enter" && !O && (W.preventDefault(), v());
|
|
4971
4971
|
}, [
|
|
4972
4972
|
O,
|
|
4973
4973
|
v,
|
|
4974
4974
|
R
|
|
4975
|
-
]), M = (0, d.useCallback)((
|
|
4976
|
-
|
|
4975
|
+
]), M = (0, d.useCallback)((W) => {
|
|
4976
|
+
W.key === "Shift" && R(!1);
|
|
4977
4977
|
}, [R]);
|
|
4978
4978
|
return (0, l.jsxs)("div", {
|
|
4979
4979
|
className: Le.imageAi,
|
|
@@ -4994,7 +4994,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
4994
4994
|
className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg ${Le.inputAffixWrapper}${k ? " ant-input-affix-wrapper-focused" : ""}`,
|
|
4995
4995
|
children: [(0, l.jsx)(g.Input.TextArea, {
|
|
4996
4996
|
ref: t,
|
|
4997
|
-
onKeyDown:
|
|
4997
|
+
onKeyDown: K,
|
|
4998
4998
|
onKeyUp: M,
|
|
4999
4999
|
onFocus: D,
|
|
5000
5000
|
onBlur: Q,
|
|
@@ -5003,11 +5003,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5003
5003
|
className: `${Le.textAreaInputHybrid} ${Le.textarea}`,
|
|
5004
5004
|
placeholder: h("Generate image"),
|
|
5005
5005
|
value: i,
|
|
5006
|
-
onChange:
|
|
5006
|
+
onChange: $,
|
|
5007
5007
|
spellCheck: "false"
|
|
5008
5008
|
}), (0, l.jsx)("span", {
|
|
5009
5009
|
className: `ant-input-suffix ${Le.inputSuffix}`,
|
|
5010
|
-
children: u ||
|
|
5010
|
+
children: u || V ? (0, l.jsx)(qe.LoadingOutlined, {
|
|
5011
5011
|
className: `${Le.inputIcon} input-icon`,
|
|
5012
5012
|
spin: !0
|
|
5013
5013
|
}) : (0, l.jsx)(y, {
|
|
@@ -5036,7 +5036,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5036
5036
|
className: Le.loading,
|
|
5037
5037
|
children: (0, l.jsxs)("div", {
|
|
5038
5038
|
className: "spin",
|
|
5039
|
-
children: [(0, l.jsx)(
|
|
5039
|
+
children: [(0, l.jsx)(qe.LoadingOutlined, {
|
|
5040
5040
|
style: { fontSize: 48 },
|
|
5041
5041
|
spin: !0
|
|
5042
5042
|
}), (0, l.jsx)("p", {
|
|
@@ -5044,17 +5044,17 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5044
5044
|
children: b
|
|
5045
5045
|
})]
|
|
5046
5046
|
})
|
|
5047
|
-
}), o.length > 0 && o.map((
|
|
5047
|
+
}), o.length > 0 && o.map((W, Z) => (0, l.jsxs)("div", {
|
|
5048
5048
|
className: Le.imageItem,
|
|
5049
|
-
children: [(0, l.jsx)(
|
|
5049
|
+
children: [(0, l.jsx)(Hl, {
|
|
5050
5050
|
images: o,
|
|
5051
5051
|
frameHeight: w
|
|
5052
5052
|
}), (0, l.jsx)("div", {
|
|
5053
5053
|
className: "buttons",
|
|
5054
5054
|
children: o.length > 0 && !u && (0, l.jsx)(g.Button, {
|
|
5055
|
-
onClick: () => C(
|
|
5055
|
+
onClick: () => C(W),
|
|
5056
5056
|
loading: r,
|
|
5057
|
-
icon: (0, l.jsx)(
|
|
5057
|
+
icon: (0, l.jsx)(qe.CheckOutlined, {}),
|
|
5058
5058
|
children: h("Use this variant")
|
|
5059
5059
|
})
|
|
5060
5060
|
})]
|
|
@@ -5063,7 +5063,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5063
5063
|
]
|
|
5064
5064
|
});
|
|
5065
5065
|
}, Zl = (e) => {
|
|
5066
|
-
let { state: t, actions: r, options: a } = m.
|
|
5066
|
+
let { state: t, actions: r, options: a } = m.B(), { t: i } = m.zn(), s = m.mr(), { folders: o, folderToRename: c, renameFolderForm: u, isRenameFolderModalVisible: n } = t, { setFolderToRename: h, setIsRenameFolderModalVisible: y } = r, { apiEndpoints: f, dataProviders: w, config: I } = a, _ = (0, d.useCallback)((b) => {
|
|
5067
5067
|
h?.(b), y?.(!0);
|
|
5068
5068
|
let v = o?.find((C) => C.id === b);
|
|
5069
5069
|
v && u && u.setFieldsValue({ newFolderName: v.name });
|
|
@@ -5078,7 +5078,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5078
5078
|
y,
|
|
5079
5079
|
h,
|
|
5080
5080
|
u
|
|
5081
|
-
]),
|
|
5081
|
+
]), V = (0, d.useCallback)(async () => {
|
|
5082
5082
|
if (!(!c || !u)) try {
|
|
5083
5083
|
let b = await u.validateFields();
|
|
5084
5084
|
if (!b?.newFolderName) {
|
|
@@ -5162,11 +5162,11 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5162
5162
|
actions: {
|
|
5163
5163
|
showRenameFolderModal: _,
|
|
5164
5164
|
handleRenameFolderCancel: F,
|
|
5165
|
-
handleRenameFolderOk:
|
|
5165
|
+
handleRenameFolderOk: V
|
|
5166
5166
|
}
|
|
5167
5167
|
};
|
|
5168
5168
|
}, Jl = () => {
|
|
5169
|
-
let [e, t] = (0, d.useState)([]), [r, a] = (0, d.useState)(!1), [i, s] = (0, d.useState)(!1), o = (0, d.useRef)(0), c = (0, d.useRef)(new Map()), u = (0, d.useCallback)(() => (o.current += 1, `upload_${o.current}_${Date.now()}`), []), n = (0, d.useCallback)((b) => m.
|
|
5169
|
+
let [e, t] = (0, d.useState)([]), [r, a] = (0, d.useState)(!1), [i, s] = (0, d.useState)(!1), o = (0, d.useRef)(0), c = (0, d.useRef)(new Map()), u = (0, d.useCallback)(() => (o.current += 1, `upload_${o.current}_${Date.now()}`), []), n = (0, d.useCallback)((b) => m.Jn(b.size), []), h = (0, d.useCallback)((b, v) => {
|
|
5170
5170
|
let C = v.map((O) => ({
|
|
5171
5171
|
id: u(),
|
|
5172
5172
|
folderId: b,
|
|
@@ -5199,7 +5199,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5199
5199
|
status: "success",
|
|
5200
5200
|
progress: 100
|
|
5201
5201
|
};
|
|
5202
|
-
return v?.name && (R.name = v.name), v?.size && O.size === void 0 && (R.size = m.
|
|
5202
|
+
return v?.name && (R.name = v.name), v?.size && O.size === void 0 && (R.size = m.Jn(v.size)), R;
|
|
5203
5203
|
}
|
|
5204
5204
|
return O;
|
|
5205
5205
|
}));
|
|
@@ -5215,7 +5215,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5215
5215
|
}, 300);
|
|
5216
5216
|
}, []), F = (0, d.useCallback)(() => {
|
|
5217
5217
|
s((b) => !b);
|
|
5218
|
-
}, []),
|
|
5218
|
+
}, []), V = (0, d.useCallback)((b) => c.current.get(b), []);
|
|
5219
5219
|
return {
|
|
5220
5220
|
uploadFiles: e,
|
|
5221
5221
|
isUploadVisible: r,
|
|
@@ -5227,7 +5227,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5227
5227
|
updateProgress: f,
|
|
5228
5228
|
markAsSuccess: w,
|
|
5229
5229
|
markAsError: I,
|
|
5230
|
-
getUploadedFile:
|
|
5230
|
+
getUploadedFile: V,
|
|
5231
5231
|
closeUpload: _,
|
|
5232
5232
|
minimizeUpload: F
|
|
5233
5233
|
};
|
|
@@ -5238,7 +5238,7 @@ Select the appropriate plan to fulfil more requests`),
|
|
|
5238
5238
|
if (r.type = "text/css", r.dataset.themeVariablesFm = "true", r.setAttribute("data-file-manager", "true"), Object.entries(e).length) {
|
|
5239
5239
|
let a = "";
|
|
5240
5240
|
Object.entries(e).forEach(([s, o]) => {
|
|
5241
|
-
typeof o != "object" && (a += ` ${m.
|
|
5241
|
+
typeof o != "object" && (a += ` ${m.ni(s)}: ${o};
|
|
5242
5242
|
`);
|
|
5243
5243
|
}), a = `.em-filemanager {
|
|
5244
5244
|
${a}}`, r.appendChild(document.createTextNode(a));
|
|
@@ -5253,16 +5253,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5253
5253
|
e = e === "system" ? t : e;
|
|
5254
5254
|
}
|
|
5255
5255
|
document.documentElement.setAttribute("data-theme", e);
|
|
5256
|
-
}, { Sider: rs, Content: is } = g.Layout, as = d.default.lazy(() => Promise.resolve().then(() => ze("./
|
|
5256
|
+
}, { Sider: rs, Content: is } = g.Layout, as = d.default.lazy(() => Promise.resolve().then(() => ze("./7877b5712.js"))), ls = d.default.lazy(() => Promise.resolve().then(() => ze("./e9b6fbb9.js"))), Jr = { keywords: "" }, ss = {
|
|
5257
5257
|
imageStock: "jpg",
|
|
5258
5258
|
gif: "gif"
|
|
5259
5259
|
}, os = () => {
|
|
5260
|
-
let e = m.
|
|
5261
|
-
|
|
5262
|
-
let B = d.default.useRef(null), ue = d.default.useRef([]), [ve,
|
|
5263
|
-
let p = m.
|
|
5260
|
+
let e = m.Fr(), t = m.Sa(), r = m.Ca(), a = m.wa(), i = Jl(), s = m.Qi(), { deleteItems: o } = m.Lr(), c = m.mr(), { t: u } = m.zn(), { options: n, state: h, actions: y } = m.B(), f = n, w = f?.onChangeSelection, I = h, _ = f?.config, { dataProviders: F } = f, { form: V, urlForm: b, renameForm: v, moveForm: C, renameFolderForm: O, copyForm: R, isModalVisible: oe, isUrlModalVisible: k, isMoveModalVisible: U, isRenameFolderModalVisible: D, isCopyModalVisible: Q, isDeleteConfirmVisible: $, folderToRename: K, activeLibraryItem: M } = h, { setIsUrlModalVisible: W, setActiveLibraryItem: Z } = y, { config: ae } = n, { DropZoneFileIcon: pe } = se.K(), [te, Ne] = (0, d.useState)(!1), [E, we] = (0, d.useState)(!1), [Be, Fe] = (0, d.useState)(!1), S = (0, d.useRef)(0), q = (0, d.useRef)(!1);
|
|
5261
|
+
q.current = E;
|
|
5262
|
+
let B = d.default.useRef(null), ue = d.default.useRef([]), [ve, H] = (0, d.useState)(!1), [x, j] = (0, d.useState)(!1), ne = m.sa((p) => p.selectedFiles), J = m.sa((p) => p.clearSelection), xe = m.sa((p) => p.syncVisibleFiles), { folders: he, loading: L } = e.state, { fetchFolders: re, fetchChildFolders: X, handleCreateFolder: Pe, handleModalOk: Oe, handleModalCancel: Ue, generateMenuItems: Ae } = e.actions, at = Zl(re), { files: be, loading: et, isRenamingFile: ht, fileToRename: ie } = t.state, { fetchFiles: ge, handleDeleteFile: z, handleDeleteFolder: G, handleAddFile: ce, handleAddFileByUrl: Se, showRenameModal: Te, handleRenameCancel: Ee, handleRenameOk: tt, handleDroppedFiles: $e, showMoveModal: xt, handleMoveCancel: Ds, handleMoveOk: pi, handleCopyOk: gi, handleCopyCancel: Bs, showDeleteConfirm: vi, handleDeleteConfirmCancel: zs, handleDeleteConfirmOk: yi } = t.actions, { selectedFolder: ke, pathHistory: wi } = r.state, { handleFolderSelect: lt, handleItemClick: Ii } = r.actions, { pagination: mt } = a.state, bi = m.sr(ge), { searchTerm: Gt, sortBy: Vt, sortOrder: Wt } = bi.state, { handleSearch: $t, handleSort: _i, handlePaginationChange: Ci } = bi.actions, Us = (0, d.useCallback)(async () => {
|
|
5263
|
+
let p = m.Mr(wi || []);
|
|
5264
5264
|
try {
|
|
5265
|
-
await m.
|
|
5265
|
+
await m.Nr({
|
|
5266
5266
|
options: f,
|
|
5267
5267
|
pathFolder: p,
|
|
5268
5268
|
dataProviders: f?.dataProviders
|
|
@@ -5272,9 +5272,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5272
5272
|
folderId: ke || "",
|
|
5273
5273
|
page: mt.current,
|
|
5274
5274
|
limit: mt.pageSize,
|
|
5275
|
-
search:
|
|
5276
|
-
sortBy:
|
|
5277
|
-
sortOrder:
|
|
5275
|
+
search: Gt,
|
|
5276
|
+
sortBy: Vt,
|
|
5277
|
+
sortOrder: Wt,
|
|
5278
5278
|
itemType: "all"
|
|
5279
5279
|
});
|
|
5280
5280
|
}, [
|
|
@@ -5283,20 +5283,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5283
5283
|
f,
|
|
5284
5284
|
mt,
|
|
5285
5285
|
wi,
|
|
5286
|
-
|
|
5286
|
+
Gt,
|
|
5287
5287
|
ke,
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
]), Ze = m.
|
|
5288
|
+
Vt,
|
|
5289
|
+
Wt
|
|
5290
|
+
]), Ze = m.Ea({
|
|
5291
5291
|
files: be || [],
|
|
5292
5292
|
fetchFiles: ge,
|
|
5293
5293
|
selectedFolder: ke || null
|
|
5294
|
-
}), [Fi, st] = (0, d.useState)(!1),
|
|
5294
|
+
}), [Fi, st] = (0, d.useState)(!1), Gs = (0, d.useCallback)((p) => {
|
|
5295
5295
|
if (p.preventDefault(), p.stopPropagation(), !p.dataTransfer || !p.dataTransfer.types || !p.dataTransfer.types.includes("Files")) return;
|
|
5296
5296
|
p.dataTransfer.dropEffect = "copy";
|
|
5297
5297
|
let P = p.relatedTarget, Y = p.currentTarget;
|
|
5298
5298
|
P && Y.contains(P) || (S.current += 1, S.current > 0 && Ne(!0));
|
|
5299
|
-
}, []),
|
|
5299
|
+
}, []), Vs = (0, d.useCallback)((p) => {
|
|
5300
5300
|
p.preventDefault(), p.stopPropagation();
|
|
5301
5301
|
let P = p.relatedTarget, Y = p.currentTarget;
|
|
5302
5302
|
if (!P || Y.contains(P)) {
|
|
@@ -5307,9 +5307,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5307
5307
|
return;
|
|
5308
5308
|
}
|
|
5309
5309
|
S.current = Math.max(0, S.current - 1), S.current <= 0 && Ne(!1);
|
|
5310
|
-
}, []),
|
|
5310
|
+
}, []), Ws = (0, d.useCallback)((p) => {
|
|
5311
5311
|
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy");
|
|
5312
|
-
}, []),
|
|
5312
|
+
}, []), $s = (0, d.useCallback)((p) => {
|
|
5313
5313
|
p.preventDefault(), p.stopPropagation(), Ne(!1), S.current = 0;
|
|
5314
5314
|
let P = (() => {
|
|
5315
5315
|
let Y = p.dataTransfer;
|
|
@@ -5322,12 +5322,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5322
5322
|
}
|
|
5323
5323
|
return ee;
|
|
5324
5324
|
})();
|
|
5325
|
-
P.length && (st(!0),
|
|
5325
|
+
P.length && (st(!0), $e(P).catch((Y) => {
|
|
5326
5326
|
Y?.name;
|
|
5327
5327
|
}).finally(() => {
|
|
5328
5328
|
st(!1);
|
|
5329
5329
|
}));
|
|
5330
|
-
}, [
|
|
5330
|
+
}, [$e]), ot = (0, d.useCallback)(() => {
|
|
5331
5331
|
Ne(!1), S.current = 0, document.body.removeAttribute("data-fm-dragging"), Fe(!1), we(!1);
|
|
5332
5332
|
}, []);
|
|
5333
5333
|
d.default.useEffect(() => {
|
|
@@ -5362,11 +5362,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5362
5362
|
let le = p(A.dataTransfer);
|
|
5363
5363
|
if (!le.length) return;
|
|
5364
5364
|
let de = A.target, Ie = de.closest(`.${T.filesContainer.replace(/\s+/g, ".")}`) || de.closest("[data-files-container]"), Re = de.closest(".em-filemanager") || de.closest(".file-manager__layout") || de.closest("[data-drop-overlay]") || de.closest("[data-drag-capture]");
|
|
5365
|
-
(
|
|
5365
|
+
(q.current || te || Ie || Re) && (A.preventDefault(), A.stopPropagation(), we(!1), Ne(!1), S.current = 0, st(!0), $e(le).catch((Xe) => {
|
|
5366
5366
|
Xe?.name;
|
|
5367
5367
|
}).finally(() => st(!1)));
|
|
5368
5368
|
}, Y = (A) => {
|
|
5369
|
-
A.dataTransfer?.types?.includes("Files") && (A.preventDefault(), A.dataTransfer.dropEffect = "copy", document.body.hasAttribute("data-fm-dragging") || (document.body.setAttribute("data-fm-dragging", "true"), Fe(!0)), yt === "my_files" &&
|
|
5369
|
+
A.dataTransfer?.types?.includes("Files") && (A.preventDefault(), A.dataTransfer.dropEffect = "copy", document.body.hasAttribute("data-fm-dragging") || (document.body.setAttribute("data-fm-dragging", "true"), Fe(!0)), yt === "my_files" && !q.current && we(!0));
|
|
5370
5370
|
}, ee = (A) => {
|
|
5371
5371
|
A.dataTransfer?.types?.includes("Files") && (A.preventDefault(), A.dataTransfer.dropEffect = "copy", document.body.setAttribute("data-fm-dragging", "true"), Fe(!0));
|
|
5372
5372
|
}, N = {
|
|
@@ -5378,7 +5378,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5378
5378
|
};
|
|
5379
5379
|
}, [
|
|
5380
5380
|
te,
|
|
5381
|
-
|
|
5381
|
+
$e,
|
|
5382
5382
|
yt
|
|
5383
5383
|
]), (0, d.useEffect)(() => {
|
|
5384
5384
|
let p = (P) => {
|
|
@@ -5411,7 +5411,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5411
5411
|
document.removeEventListener("click", p, !0);
|
|
5412
5412
|
};
|
|
5413
5413
|
}, [te, ot]);
|
|
5414
|
-
let
|
|
5414
|
+
let qs = d.default.useCallback(async () => {
|
|
5415
5415
|
await yi(), await re(), ke === "Trash" && X && await X("Trash"), requestAnimationFrame(() => {
|
|
5416
5416
|
requestAnimationFrame(() => B.current?.refreshFileCounts?.());
|
|
5417
5417
|
});
|
|
@@ -5420,9 +5420,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5420
5420
|
X,
|
|
5421
5421
|
yi,
|
|
5422
5422
|
ke
|
|
5423
|
-
]),
|
|
5423
|
+
]), Hs = d.default.useCallback(() => {
|
|
5424
5424
|
j(!0);
|
|
5425
|
-
}, []),
|
|
5425
|
+
}, []), Ks = d.default.useCallback(async () => {
|
|
5426
5426
|
if (ke !== "Trash") {
|
|
5427
5427
|
j(!1);
|
|
5428
5428
|
return;
|
|
@@ -5503,14 +5503,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5503
5503
|
onStartBatch: (ee) => {
|
|
5504
5504
|
p = i.startUpload(ke || void 0, ee), P = new Map(), ee.forEach((N, A) => {
|
|
5505
5505
|
let le = p[A];
|
|
5506
|
-
le && (P.set(N.name, le), P.set(m.
|
|
5506
|
+
le && (P.set(N.name, le), P.set(m.Me(N.name, Y), le));
|
|
5507
5507
|
});
|
|
5508
5508
|
},
|
|
5509
5509
|
onStart: (ee) => {
|
|
5510
5510
|
if (p.length === 0) {
|
|
5511
5511
|
p = i.startUpload(ke || void 0, [ee]);
|
|
5512
5512
|
let N = p[0];
|
|
5513
|
-
N && (P.set(ee.name, N), P.set(m.
|
|
5513
|
+
N && (P.set(ee.name, N), P.set(m.Me(ee.name, Y), N));
|
|
5514
5514
|
}
|
|
5515
5515
|
},
|
|
5516
5516
|
onProgress: (ee, N) => {
|
|
@@ -5562,8 +5562,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5562
5562
|
f?.config
|
|
5563
5563
|
]), nt = d.default.useCallback(async (p, P, Y, ee) => {
|
|
5564
5564
|
try {
|
|
5565
|
-
|
|
5566
|
-
let N = m.
|
|
5565
|
+
H(!0);
|
|
5566
|
+
let N = m.Me(Y || p && m.ji(p) || "uploaded-file", _), A = ss[ee ?? ""], le = A && !m.wi(N) ? `${N}.${A}` : N, de = i.startUploadByUrl(ke || void 0, le);
|
|
5567
5567
|
try {
|
|
5568
5568
|
let Ie = await Se(p, P, !0, ee ?? "uploadByUrl", Y);
|
|
5569
5569
|
if (i.updateProgress(de, 100), Ie) {
|
|
@@ -5573,11 +5573,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5573
5573
|
} else i.markAsSuccess(de);
|
|
5574
5574
|
await B.current?.refreshFileCounts();
|
|
5575
5575
|
} catch (Ie) {
|
|
5576
|
-
let Re = m.
|
|
5576
|
+
let Re = m.Er(m.W(Ie), u);
|
|
5577
5577
|
i.markAsError(de, Re);
|
|
5578
5578
|
}
|
|
5579
5579
|
} finally {
|
|
5580
|
-
|
|
5580
|
+
H(!1);
|
|
5581
5581
|
}
|
|
5582
5582
|
}, [
|
|
5583
5583
|
Se,
|
|
@@ -5611,7 +5611,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5611
5611
|
be,
|
|
5612
5612
|
lt
|
|
5613
5613
|
]), ki = d.default.useCallback(async (p) => {
|
|
5614
|
-
if (
|
|
5614
|
+
if ($e) {
|
|
5615
5615
|
let P = i.startUpload(ke || void 0, p);
|
|
5616
5616
|
p.forEach(async (Y, ee) => {
|
|
5617
5617
|
let N = P[ee];
|
|
@@ -5622,17 +5622,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5622
5622
|
setTimeout(() => {
|
|
5623
5623
|
clearInterval(le);
|
|
5624
5624
|
}, 2e3);
|
|
5625
|
-
}), await
|
|
5625
|
+
}), await $e(p), P.forEach((Y) => {
|
|
5626
5626
|
i.updateProgress(Y, 100), i.markAsSuccess(Y);
|
|
5627
5627
|
}), await B.current?.refreshFileCounts();
|
|
5628
5628
|
}
|
|
5629
5629
|
}, [
|
|
5630
|
-
|
|
5630
|
+
$e,
|
|
5631
5631
|
i,
|
|
5632
5632
|
ke
|
|
5633
5633
|
]), ji = d.default.useCallback(async (p) => {
|
|
5634
|
-
await
|
|
5635
|
-
}, [
|
|
5634
|
+
await G(p), await re(), await B.current?.refreshFileCounts();
|
|
5635
|
+
}, [G, re]), wt = m.Ta({
|
|
5636
5636
|
files: be || [],
|
|
5637
5637
|
clearSelection: J,
|
|
5638
5638
|
showRenameModal: Te,
|
|
@@ -5658,8 +5658,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5658
5658
|
J
|
|
5659
5659
|
]), (0, d.useEffect)(() => {
|
|
5660
5660
|
if (!w || M !== "my_files") return;
|
|
5661
|
-
if (!
|
|
5662
|
-
|
|
5661
|
+
if (!Vi.current) {
|
|
5662
|
+
Vi.current = !0;
|
|
5663
5663
|
return;
|
|
5664
5664
|
}
|
|
5665
5665
|
let p = (Array.isArray(be) ? be : []).filter((P) => ne.has(P.id));
|
|
@@ -5719,18 +5719,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5719
5719
|
nt,
|
|
5720
5720
|
ki
|
|
5721
5721
|
]);
|
|
5722
|
-
let
|
|
5722
|
+
let qt = (0, d.useRef)(mt);
|
|
5723
5723
|
(0, d.useEffect)(() => {
|
|
5724
|
-
|
|
5724
|
+
qt.current = mt;
|
|
5725
5725
|
}, [mt]);
|
|
5726
5726
|
let Xs = (0, d.useCallback)((p) => {
|
|
5727
|
-
Ci(p.current ||
|
|
5727
|
+
Ci(p.current || qt.current.current, p.pageSize || qt.current.pageSize);
|
|
5728
5728
|
}, [Ci]), eo = (0, d.useCallback)((p) => {
|
|
5729
5729
|
Ii?.(p);
|
|
5730
5730
|
}, [Ii]), to = d.default.useCallback((p) => {
|
|
5731
5731
|
let { sortBy: P, sortOrder: Y } = tl(p);
|
|
5732
5732
|
_i(P, Y);
|
|
5733
|
-
}, [_i]), [ro, Ni] = (0, d.useState)(Jr), [io, Ti] = (0, d.useState)([]), Mi = (0, d.useRef)(null), [ao, Ai] = (0, d.useState)(m.ie), [lo, Ri] = (0, d.useState)([]), Li = (0, d.useRef)(null), [so, oo] = (0, d.useState)(""), Oi = (0, d.useRef)(null), [no, Di] = (0, d.useState)(""), [co, Bi] = (0, d.useState)([]), It = d.default.useRef(void 0), [uo, zi] = (0, d.useState)(!1), [ho, Ui] = (0, d.useState)(!1),
|
|
5733
|
+
}, [_i]), [ro, Ni] = (0, d.useState)(Jr), [io, Ti] = (0, d.useState)([]), Mi = (0, d.useRef)(null), [ao, Ai] = (0, d.useState)(m.ie), [lo, Ri] = (0, d.useState)([]), Li = (0, d.useRef)(null), [so, oo] = (0, d.useState)(""), Oi = (0, d.useRef)(null), [no, Di] = (0, d.useState)(""), [co, Bi] = (0, d.useState)([]), It = d.default.useRef(void 0), [uo, zi] = (0, d.useState)(!1), [ho, Ui] = (0, d.useState)(!1), Gi = d.default.useRef(null), Vi = d.default.useRef(!1), [mo, fo] = (0, d.useState)({
|
|
5734
5734
|
mode: "qr",
|
|
5735
5735
|
rawText: "",
|
|
5736
5736
|
foregroundHex: "#000000",
|
|
@@ -5738,7 +5738,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5738
5738
|
transparentBackground: !1,
|
|
5739
5739
|
qrSidePx: 200,
|
|
5740
5740
|
barcodeBarHeightPx: 60
|
|
5741
|
-
}),
|
|
5741
|
+
}), Wi = d.default.useRef(M), $i = d.default.useCallback((p) => {
|
|
5742
5742
|
let P = p.indexOf(",");
|
|
5743
5743
|
if (P === -1) return null;
|
|
5744
5744
|
let Y = p.substring(0, P), ee = Y.match(/^data:([^;]+)/), N = ee && ee[1] || "image/svg+xml", A = "svg";
|
|
@@ -5753,7 +5753,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5753
5753
|
le = new Blob([de], { type: N });
|
|
5754
5754
|
}
|
|
5755
5755
|
return new File([le], `icon_${Date.now()}.${A}`, { type: N });
|
|
5756
|
-
}, []),
|
|
5756
|
+
}, []), qi = d.default.useCallback(async (p) => {
|
|
5757
5757
|
let P = i.startUpload(ke || void 0, [p])[0], Y = 0, ee = setInterval(() => {
|
|
5758
5758
|
Y = Math.min(Y + 10 + Math.floor(Date.now() % 10), 90), i.updateProgress(P, Y);
|
|
5759
5759
|
}, 200);
|
|
@@ -5777,17 +5777,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5777
5777
|
ke
|
|
5778
5778
|
]), po = (0, d.useCallback)(async (p) => {
|
|
5779
5779
|
if (p && p.startsWith("data:")) {
|
|
5780
|
-
let P =
|
|
5780
|
+
let P = $i(p);
|
|
5781
5781
|
if (!P) return;
|
|
5782
|
-
await
|
|
5782
|
+
await qi(P);
|
|
5783
5783
|
return;
|
|
5784
5784
|
}
|
|
5785
5785
|
p && await nt(p, void 0, void 0, "iconStock");
|
|
5786
5786
|
}, [
|
|
5787
|
-
|
|
5787
|
+
$i,
|
|
5788
5788
|
nt,
|
|
5789
|
-
|
|
5790
|
-
]),
|
|
5789
|
+
qi
|
|
5790
|
+
]), Hi = (0, d.useCallback)(async () => {
|
|
5791
5791
|
let p = ae?.fileForEdit;
|
|
5792
5792
|
if (It.current !== p && M === "editor" && p && !Ze.editingFile) {
|
|
5793
5793
|
It.current = p;
|
|
@@ -5814,20 +5814,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5814
5814
|
s
|
|
5815
5815
|
]);
|
|
5816
5816
|
(0, d.useEffect)(() => {
|
|
5817
|
-
|
|
5818
|
-
}, [
|
|
5819
|
-
let p =
|
|
5820
|
-
|
|
5821
|
-
}, [M,
|
|
5817
|
+
Hi();
|
|
5818
|
+
}, [Hi]), (0, d.useEffect)(() => {
|
|
5819
|
+
let p = Wi.current;
|
|
5820
|
+
Wi.current = M, M === "my_files" ? (Ti([]), Ni(Jr), Ri([]), Ai(m.ie), Bi([]), Di(""), Ui(!1), zi(!1), p !== "my_files" && (p === "stock_images" || p === "gif" || p === "ai") && $t("")) : M === "ai" ? Gi.current?.focus() : M === "gif" ? Mi.current?.focus() : M === "stock_images" ? Li.current?.focus() : M === "icons" && Oi.current?.focus();
|
|
5821
|
+
}, [M, $t]);
|
|
5822
5822
|
let go = d.default.useCallback(async () => {
|
|
5823
5823
|
await Ei(), await B.current?.refreshFileCounts();
|
|
5824
|
-
}, [Ei]),
|
|
5824
|
+
}, [Ei]), Ki = (0, d.useCallback)((p) => p ? p.files?.length ? Array.from(p.files) : p.items ? Array.from(p.items).map((P) => P.getAsFile()).filter((P) => !!P) : [] : [], []);
|
|
5825
5825
|
return (0, l.jsxs)(l.Fragment, { children: [
|
|
5826
|
-
Be && yt === "my_files" && (0,
|
|
5826
|
+
Be && yt === "my_files" && (0, Kt.createPortal)((0, l.jsx)("div", {
|
|
5827
5827
|
className: T.dragCaptureLayer,
|
|
5828
5828
|
"data-drag-capture": "true",
|
|
5829
5829
|
onDragOver: (p) => {
|
|
5830
|
-
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy"), p.dataTransfer?.types?.includes("Files") &&
|
|
5830
|
+
p.preventDefault(), p.stopPropagation(), p.dataTransfer && (p.dataTransfer.dropEffect = "copy"), p.dataTransfer?.types?.includes("Files") && !q.current && we(!0);
|
|
5831
5831
|
},
|
|
5832
5832
|
onDragEnter: (p) => {
|
|
5833
5833
|
p.preventDefault(), p.stopPropagation(), p.dataTransfer?.types?.includes("Files") && we(!0);
|
|
@@ -5838,14 +5838,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5838
5838
|
},
|
|
5839
5839
|
onDrop: (p) => {
|
|
5840
5840
|
p.preventDefault(), p.stopPropagation(), Fe(!1), we(!1), document.body.removeAttribute("data-fm-dragging");
|
|
5841
|
-
let P =
|
|
5842
|
-
P.length && (st(!0),
|
|
5841
|
+
let P = Ki(p.dataTransfer);
|
|
5842
|
+
P.length && (st(!0), $e(P).catch((Y) => {
|
|
5843
5843
|
Y?.name;
|
|
5844
5844
|
}).finally(() => st(!1)));
|
|
5845
5845
|
},
|
|
5846
5846
|
"aria-hidden": "true"
|
|
5847
5847
|
}), document.body),
|
|
5848
|
-
E && (0,
|
|
5848
|
+
E && (0, Kt.createPortal)((0, l.jsx)("div", {
|
|
5849
5849
|
className: T.dragOverlayGlobal,
|
|
5850
5850
|
"data-drop-overlay": "true",
|
|
5851
5851
|
onDragOver: (p) => {
|
|
@@ -5854,8 +5854,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5854
5854
|
onDragEnter: (p) => p.preventDefault(),
|
|
5855
5855
|
onDrop: (p) => {
|
|
5856
5856
|
p.preventDefault(), p.stopPropagation(), we(!1), Fe(!1), document.body.removeAttribute("data-fm-dragging");
|
|
5857
|
-
let P =
|
|
5858
|
-
P.length && (st(!0),
|
|
5857
|
+
let P = Ki(p.dataTransfer);
|
|
5858
|
+
P.length && (st(!0), $e(P).catch((Y) => {
|
|
5859
5859
|
Y?.name;
|
|
5860
5860
|
}).finally(() => st(!1)));
|
|
5861
5861
|
},
|
|
@@ -5883,10 +5883,10 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5883
5883
|
children: (0, l.jsxs)("div", {
|
|
5884
5884
|
className: T.filesContainer,
|
|
5885
5885
|
"data-files-container": "true",
|
|
5886
|
-
onDragOver:
|
|
5887
|
-
onDragLeave:
|
|
5888
|
-
onDragEnter:
|
|
5889
|
-
onDrop:
|
|
5886
|
+
onDragOver: Ws,
|
|
5887
|
+
onDragLeave: Vs,
|
|
5888
|
+
onDragEnter: Gs,
|
|
5889
|
+
onDrop: $s,
|
|
5890
5890
|
children: [
|
|
5891
5891
|
te && (0, l.jsx)("div", {
|
|
5892
5892
|
className: T.dragOverlay,
|
|
@@ -5923,7 +5923,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5923
5923
|
fetchFolders: re,
|
|
5924
5924
|
fetchChildFolders: X,
|
|
5925
5925
|
handleAddFile: xi,
|
|
5926
|
-
setIsUrlModalVisible: (p) =>
|
|
5926
|
+
setIsUrlModalVisible: (p) => W?.(p),
|
|
5927
5927
|
handleDeleteFolder: ji,
|
|
5928
5928
|
handleCreateFolder: Pe,
|
|
5929
5929
|
activeLibraryItem: M,
|
|
@@ -5946,7 +5946,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5946
5946
|
activeLibraryItem: M,
|
|
5947
5947
|
selectedFolder: he?.find((p) => p?.id === ke)?.name || u("Folders"),
|
|
5948
5948
|
isTrashFolder: ke === "Trash",
|
|
5949
|
-
onClearTrash:
|
|
5949
|
+
onClearTrash: Hs,
|
|
5950
5950
|
files: be || [],
|
|
5951
5951
|
loading: Si,
|
|
5952
5952
|
onRefresh: Us,
|
|
@@ -5955,12 +5955,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5955
5955
|
}),
|
|
5956
5956
|
(0, l.jsx)(g.Divider, { className: "zero-divider" }),
|
|
5957
5957
|
M === "my_files" && (0, l.jsx)(Dr, {
|
|
5958
|
-
searchTerm:
|
|
5958
|
+
searchTerm: Gt,
|
|
5959
5959
|
handleAddFile: xi,
|
|
5960
5960
|
files: be || [],
|
|
5961
|
-
handleSearch:
|
|
5962
|
-
sortBy:
|
|
5963
|
-
sortOrder:
|
|
5961
|
+
handleSearch: $t,
|
|
5962
|
+
sortBy: Vt,
|
|
5963
|
+
sortOrder: Wt,
|
|
5964
5964
|
handleSortOptionChange: to,
|
|
5965
5965
|
pagination: mt,
|
|
5966
5966
|
setPagination: Xs,
|
|
@@ -5986,7 +5986,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
5986
5986
|
inputRef: Mi,
|
|
5987
5987
|
customRequest: (p, P) => nt(p, void 0, P, "gif")
|
|
5988
5988
|
}),
|
|
5989
|
-
M === "stock_images" && (0, l.jsx)(
|
|
5989
|
+
M === "stock_images" && (0, l.jsx)(Gl, {
|
|
5990
5990
|
imageStockList: lo,
|
|
5991
5991
|
setImageStockList: Ri,
|
|
5992
5992
|
currentReq: ao,
|
|
@@ -6030,7 +6030,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6030
6030
|
setImageAiList: Bi,
|
|
6031
6031
|
aiImageRequest: no,
|
|
6032
6032
|
setAiImageRequest: Di,
|
|
6033
|
-
inputAiRef:
|
|
6033
|
+
inputAiRef: Gi,
|
|
6034
6034
|
customRequest: Pi,
|
|
6035
6035
|
isLoadingAi: uo,
|
|
6036
6036
|
setIsLoadingAi: zi,
|
|
@@ -6059,11 +6059,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6059
6059
|
isModalVisible: oe,
|
|
6060
6060
|
handleModalOk: Oe,
|
|
6061
6061
|
handleModalCancel: Ue,
|
|
6062
|
-
form:
|
|
6062
|
+
form: V,
|
|
6063
6063
|
selectedFolder: ke || null,
|
|
6064
6064
|
folders: he || [],
|
|
6065
6065
|
isUrlModalVisible: k,
|
|
6066
|
-
setIsUrlModalVisible: (p) =>
|
|
6066
|
+
setIsUrlModalVisible: (p) => W?.(p),
|
|
6067
6067
|
handleAddFileByUrl: nt,
|
|
6068
6068
|
urlForm: b,
|
|
6069
6069
|
isRenameModalVisible: ht,
|
|
@@ -6081,16 +6081,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6081
6081
|
handleRenameFolderOk: go,
|
|
6082
6082
|
handleRenameFolderCancel: Js,
|
|
6083
6083
|
renameFolderForm: O,
|
|
6084
|
-
folderToRename:
|
|
6084
|
+
folderToRename: K,
|
|
6085
6085
|
isCopyModalVisible: Q,
|
|
6086
6086
|
handleCopyOk: Zs,
|
|
6087
6087
|
handleCopyCancel: Bs,
|
|
6088
6088
|
copyForm: R,
|
|
6089
|
-
isDeleteConfirmVisible:
|
|
6090
|
-
handleDeleteConfirmOk:
|
|
6089
|
+
isDeleteConfirmVisible: $,
|
|
6090
|
+
handleDeleteConfirmOk: qs,
|
|
6091
6091
|
handleDeleteConfirmCancel: () => zs?.(),
|
|
6092
6092
|
isClearTrashConfirmVisible: x,
|
|
6093
|
-
handleClearTrashConfirm:
|
|
6093
|
+
handleClearTrashConfirm: Ks,
|
|
6094
6094
|
handleClearTrashCancel: Ys,
|
|
6095
6095
|
fetchChildFolders: X
|
|
6096
6096
|
}),
|
|
@@ -6125,7 +6125,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6125
6125
|
replaceSpaces: !0,
|
|
6126
6126
|
removeForbiddenChars: !0,
|
|
6127
6127
|
toLowerCase: !0
|
|
6128
|
-
},
|
|
6128
|
+
}, V = {
|
|
6129
6129
|
transliterate: !0,
|
|
6130
6130
|
replaceSpaces: !0,
|
|
6131
6131
|
removeForbiddenChars: !0,
|
|
@@ -6147,7 +6147,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6147
6147
|
...e.fileNameProcessing
|
|
6148
6148
|
},
|
|
6149
6149
|
folderNameProcessing: {
|
|
6150
|
-
...
|
|
6150
|
+
...V,
|
|
6151
6151
|
...e.folderNameProcessing
|
|
6152
6152
|
},
|
|
6153
6153
|
...e
|
|
@@ -6156,14 +6156,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6156
6156
|
d.default.useEffect(() => {
|
|
6157
6157
|
w.theme && ts(w.theme), es(w);
|
|
6158
6158
|
}, [w]), (0, d.useEffect)(() => {
|
|
6159
|
-
w.locale && w.locale !== m.
|
|
6159
|
+
w.locale && w.locale !== m.Gn.language && m.Gn.changeLanguage(w.locale), w.customLocale && w.locale && m.Gn.addResourceBundle(w.locale, "translation", w.customLocale, !0, !0);
|
|
6160
6160
|
}, [w.locale, w.customLocale]);
|
|
6161
6161
|
let I = (0, d.useRef)(null), _ = (0, d.useCallback)(() => I.current ?? document.body, []);
|
|
6162
6162
|
return (0, l.jsx)(g.App, {
|
|
6163
6163
|
className: "em-filemanager",
|
|
6164
6164
|
children: (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)(g.ConfigProvider, {
|
|
6165
6165
|
getPopupContainer: () => I.current || document.body,
|
|
6166
|
-
children: (0, l.jsx)(m.
|
|
6166
|
+
children: (0, l.jsx)(m.er, {
|
|
6167
6167
|
options: d.default.useMemo(() => ({
|
|
6168
6168
|
apiEndpoints: o,
|
|
6169
6169
|
searchQuery: i,
|
|
@@ -6228,7 +6228,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6228
6228
|
};
|
|
6229
6229
|
}
|
|
6230
6230
|
var ei = g.Alert.ErrorBoundary, ds = (e) => (0, l.jsx)(_r, {
|
|
6231
|
-
i18n: m.
|
|
6231
|
+
i18n: m.Gn,
|
|
6232
6232
|
children: (0, l.jsx)(Ir, {
|
|
6233
6233
|
externalTheme: e.config?.theme ?? "light",
|
|
6234
6234
|
customThemeToken: e.config?.customTheme,
|
|
@@ -6258,7 +6258,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6258
6258
|
]), _ = d.default.useCallback(async (k, U, D, Q) => {
|
|
6259
6259
|
if (!k && !U || !a?.getFiles) return null;
|
|
6260
6260
|
try {
|
|
6261
|
-
let [
|
|
6261
|
+
let [$] = (await a.getFiles({
|
|
6262
6262
|
folderId: Q ? void 0 : D ?? void 0,
|
|
6263
6263
|
noFolder: Q,
|
|
6264
6264
|
search: U || void 0,
|
|
@@ -6266,7 +6266,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6266
6266
|
page: 1,
|
|
6267
6267
|
limit: 1
|
|
6268
6268
|
})).files;
|
|
6269
|
-
return
|
|
6269
|
+
return !$ || k && $.id !== k ? null : $;
|
|
6270
6270
|
} catch {
|
|
6271
6271
|
return null;
|
|
6272
6272
|
}
|
|
@@ -6277,7 +6277,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6277
6277
|
} catch {
|
|
6278
6278
|
return null;
|
|
6279
6279
|
}
|
|
6280
|
-
}, [a]),
|
|
6280
|
+
}, [a]), V = d.default.useMemo(() => {
|
|
6281
6281
|
if (e.file) return e.file;
|
|
6282
6282
|
let k = e.name || "edited-image", U = e.extension || (e.type ? e.type.split("/")[1] : "png"), D = e.type || `image/${U}`;
|
|
6283
6283
|
return {
|
|
@@ -6296,11 +6296,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6296
6296
|
e.type
|
|
6297
6297
|
]), b = d.default.useCallback(async (k, U) => {
|
|
6298
6298
|
if (a?.updateFile && k.thumbnail) try {
|
|
6299
|
-
let D = U?.mimeType || m.se(k.thumbnail, k.type), Q = m.ce(D),
|
|
6299
|
+
let D = U?.mimeType || m.se(k.thumbnail, k.type), Q = m.ce(D), $ = k.name.substring(0, k.name.lastIndexOf(".")) + "." + Q, K = U?.blob || m.he(k.thumbnail, D);
|
|
6300
6300
|
return await a.updateFile(k.id, {
|
|
6301
|
-
name:
|
|
6301
|
+
name: $,
|
|
6302
6302
|
type: D,
|
|
6303
|
-
data:
|
|
6303
|
+
data: K
|
|
6304
6304
|
});
|
|
6305
6305
|
} catch {
|
|
6306
6306
|
return null;
|
|
@@ -6309,8 +6309,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6309
6309
|
}, [a]), v = d.default.useCallback(async (k, U) => {
|
|
6310
6310
|
if (!k.thumbnail) return null;
|
|
6311
6311
|
try {
|
|
6312
|
-
let D = I.saveCopyToCurrentFolder === !0 ? k.saveWithoutFolder ?? !k.id : !0, Q = D ? "" : k.folderId || "",
|
|
6313
|
-
type:
|
|
6312
|
+
let D = I.saveCopyToCurrentFolder === !0 ? k.saveWithoutFolder ?? !k.id : !0, Q = D ? "" : k.folderId || "", $ = U?.mimeType || m.se(k.thumbnail, k.type), K = U?.blob || m.he(k.thumbnail, $), M = m.Me(k.name, I), W = await m.Zn(a, M, Q, D, m.Pe(I)), Z = new File([K], W, {
|
|
6313
|
+
type: $,
|
|
6314
6314
|
lastModified: Date.now()
|
|
6315
6315
|
});
|
|
6316
6316
|
if (a?.uploadFiles) {
|
|
@@ -6322,7 +6322,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6322
6322
|
folderId: Q,
|
|
6323
6323
|
noFolder: D,
|
|
6324
6324
|
data: Z,
|
|
6325
|
-
extension: m.ce(
|
|
6325
|
+
extension: m.ce($)
|
|
6326
6326
|
}],
|
|
6327
6327
|
folderId: Q
|
|
6328
6328
|
}), pe = ae.detailed?.[0];
|
|
@@ -6334,7 +6334,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6334
6334
|
folderId: te.folderId ?? Q,
|
|
6335
6335
|
type: te.type || Z.type,
|
|
6336
6336
|
size: te.size ?? Z.size,
|
|
6337
|
-
extension: te.extension || m.ce(
|
|
6337
|
+
extension: te.extension || m.ce($),
|
|
6338
6338
|
url: te.url,
|
|
6339
6339
|
thumbnailUrl: te.thumbnailUrl,
|
|
6340
6340
|
thumbnail: te.thumbnail,
|
|
@@ -6355,7 +6355,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6355
6355
|
folderId: Q,
|
|
6356
6356
|
noFolder: D,
|
|
6357
6357
|
data: Z,
|
|
6358
|
-
extension: m.ce(
|
|
6358
|
+
extension: m.ce($)
|
|
6359
6359
|
});
|
|
6360
6360
|
return ae ? ae.url || ae.thumbnailUrl || ae.thumbnail ? ae : await F(ae.id) || null : null;
|
|
6361
6361
|
}
|
|
@@ -6392,16 +6392,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6392
6392
|
v
|
|
6393
6393
|
]), R = (0, d.useRef)(null), oe = (0, d.useCallback)(() => R.current ?? document.body, []);
|
|
6394
6394
|
return (0, d.useEffect)(() => {
|
|
6395
|
-
s && s !== m.
|
|
6395
|
+
s && s !== m.Gn.language && m.Gn.changeLanguage(s);
|
|
6396
6396
|
}, [s]), (0, l.jsx)(g.App, {
|
|
6397
6397
|
className: "em-filemanager",
|
|
6398
6398
|
children: (0, l.jsxs)(l.Fragment, { children: [(0, l.jsx)(g.ConfigProvider, {
|
|
6399
6399
|
getPopupContainer: () => R.current || document.body,
|
|
6400
6400
|
children: (0, l.jsx)(_r, {
|
|
6401
|
-
i18n: m.
|
|
6401
|
+
i18n: m.Gn,
|
|
6402
6402
|
children: (0, l.jsx)(Ir, {
|
|
6403
6403
|
externalTheme: i ?? "light",
|
|
6404
|
-
children: (0, l.jsx)(ei, { children: (0, l.jsx)(m.
|
|
6404
|
+
children: (0, l.jsx)(ei, { children: (0, l.jsx)(m.er, {
|
|
6405
6405
|
options: {
|
|
6406
6406
|
dataProviders: a,
|
|
6407
6407
|
handleNotify: e.handleNotify,
|
|
@@ -6413,7 +6413,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6413
6413
|
children: (0, l.jsx)(zr, {
|
|
6414
6414
|
visible: !0,
|
|
6415
6415
|
onClose: t,
|
|
6416
|
-
file:
|
|
6416
|
+
file: V,
|
|
6417
6417
|
onSave: C,
|
|
6418
6418
|
onSaveCopy: O
|
|
6419
6419
|
})
|
|
@@ -6522,25 +6522,25 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6522
6522
|
};
|
|
6523
6523
|
}
|
|
6524
6524
|
var pt = "Trash";
|
|
6525
|
-
function
|
|
6525
|
+
function He(e) {
|
|
6526
6526
|
return e.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
6527
6527
|
}
|
|
6528
6528
|
function ai(e, t, r = pt) {
|
|
6529
|
-
let a =
|
|
6529
|
+
let a = He(e);
|
|
6530
6530
|
if (!a) return [];
|
|
6531
6531
|
let i = [e, a];
|
|
6532
|
-
if (a ===
|
|
6532
|
+
if (a === He(t)) {
|
|
6533
6533
|
i.push(t);
|
|
6534
|
-
let s =
|
|
6535
|
-
s === "Trash" || s.toLowerCase() === "trash" ? i.push(r, pt, pt.toLowerCase()) : r !== "Trash" &&
|
|
6534
|
+
let s = He(t);
|
|
6535
|
+
s === "Trash" || s.toLowerCase() === "trash" ? i.push(r, pt, pt.toLowerCase()) : r !== "Trash" && He(r) !== s && i.push(r);
|
|
6536
6536
|
}
|
|
6537
|
-
return Array.from(new Set(i.map(
|
|
6537
|
+
return Array.from(new Set(i.map(He).filter(Boolean)));
|
|
6538
6538
|
}
|
|
6539
6539
|
function vs(e) {
|
|
6540
6540
|
let t = new Map();
|
|
6541
|
-
for (let [r, a] of Object.entries(e)) a.id && t.set(
|
|
6541
|
+
for (let [r, a] of Object.entries(e)) a.id && t.set(He(r), a);
|
|
6542
6542
|
return (r) => {
|
|
6543
|
-
let a = t.get(
|
|
6543
|
+
let a = t.get(He(r));
|
|
6544
6544
|
if (a) return {
|
|
6545
6545
|
id: a.id,
|
|
6546
6546
|
name: a.name ?? a.id,
|
|
@@ -6550,7 +6550,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6550
6550
|
};
|
|
6551
6551
|
}
|
|
6552
6552
|
var li = "", Dt = 1800 * 1e3;
|
|
6553
|
-
function
|
|
6553
|
+
function Ve(e) {
|
|
6554
6554
|
return e == null || e === "" ? li : e;
|
|
6555
6555
|
}
|
|
6556
6556
|
function Bt(e) {
|
|
@@ -6561,7 +6561,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6561
6561
|
function ys(e) {
|
|
6562
6562
|
return !e || typeof e.search != "string" ? !1 : e.search.trim().length > 0;
|
|
6563
6563
|
}
|
|
6564
|
-
function
|
|
6564
|
+
function Ke(e) {
|
|
6565
6565
|
if (!e) return null;
|
|
6566
6566
|
let t = e.folderId;
|
|
6567
6567
|
return t == null ? null : String(t);
|
|
@@ -6642,25 +6642,25 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6642
6642
|
return r && je(r) ? r : void 0;
|
|
6643
6643
|
}
|
|
6644
6644
|
getChildrenIds(t, r = {}) {
|
|
6645
|
-
let a =
|
|
6645
|
+
let a = Ve(t), i = this.childrenByParent.get(a);
|
|
6646
6646
|
return i ? r.onlyFileSystemItems ? Array.from(i.files) : r.onlyFolders ? Array.from(i.folders) : [...Array.from(i.folders), ...Array.from(i.files)] : [];
|
|
6647
6647
|
}
|
|
6648
6648
|
searchByUrl(t) {
|
|
6649
|
-
let r = m.
|
|
6649
|
+
let r = m.ki(t);
|
|
6650
6650
|
for (let a of this.entities.values()) {
|
|
6651
6651
|
let i = a.value.url;
|
|
6652
|
-
if (i && (i === t || m.
|
|
6652
|
+
if (i && (i === t || m.ki(i) === r)) return a.value;
|
|
6653
6653
|
}
|
|
6654
6654
|
return null;
|
|
6655
6655
|
}
|
|
6656
6656
|
upsertEntity(t) {
|
|
6657
|
-
let r = this.entities.get(t.id) ?? null, a = r ? r.value : null, i = a ?
|
|
6657
|
+
let r = this.entities.get(t.id) ?? null, a = r ? r.value : null, i = a ? Ke(a) : null, s = Ke(t), o = a ? je(a) : !1, c = je(t), u;
|
|
6658
6658
|
if (a && je(a) && c) {
|
|
6659
6659
|
let f = a.childrenCount, w = t.childrenCount;
|
|
6660
6660
|
f !== void 0 && w === void 0 && (u = f);
|
|
6661
6661
|
}
|
|
6662
6662
|
if (a && (i !== s || o !== c)) {
|
|
6663
|
-
let f =
|
|
6663
|
+
let f = Ve(i), w = this.childrenByParent.get(f);
|
|
6664
6664
|
w && (o ? w.folders.delete(t.id) : w.files.delete(t.id), w.files.size === 0 && w.folders.size === 0 && this.childrenByParent.delete(f));
|
|
6665
6665
|
}
|
|
6666
6666
|
let n = t;
|
|
@@ -6671,7 +6671,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6671
6671
|
value: { ...n },
|
|
6672
6672
|
updatedAt: this.now()
|
|
6673
6673
|
}), this.checkCacheSize();
|
|
6674
|
-
let h =
|
|
6674
|
+
let h = Ve(s), y = this.childrenByParent.get(h);
|
|
6675
6675
|
y || (y = {
|
|
6676
6676
|
files: new Set(),
|
|
6677
6677
|
folders: new Set()
|
|
@@ -6696,7 +6696,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6696
6696
|
entity: null,
|
|
6697
6697
|
parentId: null
|
|
6698
6698
|
};
|
|
6699
|
-
let a = r.value, i =
|
|
6699
|
+
let a = r.value, i = Ke(a), s = Ve(i), o = this.childrenByParent.get(s);
|
|
6700
6700
|
return o && (je(a) ? o.folders.delete(t) : o.files.delete(t), o.files.size === 0 && o.folders.size === 0 && this.childrenByParent.delete(s)), this.entities.delete(t), {
|
|
6701
6701
|
entity: { ...a },
|
|
6702
6702
|
parentId: i
|
|
@@ -6710,18 +6710,18 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6710
6710
|
};
|
|
6711
6711
|
let a = [{
|
|
6712
6712
|
id: t,
|
|
6713
|
-
parentId:
|
|
6713
|
+
parentId: Ke(r.value)
|
|
6714
6714
|
}], i = [], s = [];
|
|
6715
6715
|
for (; a.length;) {
|
|
6716
6716
|
let u = a.shift();
|
|
6717
6717
|
i.push(u);
|
|
6718
|
-
let n = this.childrenByParent.get(
|
|
6718
|
+
let n = this.childrenByParent.get(Ve(u.id));
|
|
6719
6719
|
if (n) {
|
|
6720
6720
|
for (let h of Array.from(n.folders)) {
|
|
6721
6721
|
let y = this.entities.get(h);
|
|
6722
6722
|
y && a.push({
|
|
6723
6723
|
id: h,
|
|
6724
|
-
parentId:
|
|
6724
|
+
parentId: Ke(y.value)
|
|
6725
6725
|
});
|
|
6726
6726
|
}
|
|
6727
6727
|
for (let h of Array.from(n.files)) s.push(h);
|
|
@@ -6731,16 +6731,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6731
6731
|
for (let u of s) {
|
|
6732
6732
|
let n = this.entities.get(u);
|
|
6733
6733
|
if (!n) continue;
|
|
6734
|
-
let h = n.value, y =
|
|
6734
|
+
let h = n.value, y = Ve(Ke(h)), f = this.childrenByParent.get(y);
|
|
6735
6735
|
f && (f.files.delete(u), f.files.size === 0 && f.folders.size === 0 && this.childrenByParent.delete(y)), this.entities.delete(u), o.push({ ...h });
|
|
6736
6736
|
}
|
|
6737
6737
|
let c = [];
|
|
6738
6738
|
for (let u = i.length - 1; u >= 0; u--) {
|
|
6739
6739
|
let { id: n, parentId: h } = i[u], y = this.entities.get(n);
|
|
6740
6740
|
if (!y) continue;
|
|
6741
|
-
let f = y.value, w =
|
|
6741
|
+
let f = y.value, w = Ve(f.id);
|
|
6742
6742
|
this.childrenByParent.delete(w);
|
|
6743
|
-
let I =
|
|
6743
|
+
let I = Ve(h), _ = this.childrenByParent.get(I);
|
|
6744
6744
|
_ && (_.folders.delete(n), _.files.size === 0 && _.folders.size === 0 && this.childrenByParent.delete(I)), this.entities.delete(n), c.push({ ...f });
|
|
6745
6745
|
}
|
|
6746
6746
|
return {
|
|
@@ -6751,7 +6751,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6751
6751
|
moveEntityById(t, r) {
|
|
6752
6752
|
let a = this.entities.get(t) ?? null;
|
|
6753
6753
|
if (!a) return null;
|
|
6754
|
-
let i = a.value, s =
|
|
6754
|
+
let i = a.value, s = Ve(Ke(i)), o = this.childrenByParent.get(s);
|
|
6755
6755
|
o && (je(i) ? o.folders.delete(t) : o.files.delete(t), o.files.size === 0 && o.folders.size === 0 && this.childrenByParent.delete(s));
|
|
6756
6756
|
let c = {
|
|
6757
6757
|
...i,
|
|
@@ -6765,7 +6765,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6765
6765
|
value: c,
|
|
6766
6766
|
updatedAt: this.now()
|
|
6767
6767
|
});
|
|
6768
|
-
let u =
|
|
6768
|
+
let u = Ve(r), n = this.childrenByParent.get(u);
|
|
6769
6769
|
return n || (n = {
|
|
6770
6770
|
files: new Set(),
|
|
6771
6771
|
folders: new Set()
|
|
@@ -6807,7 +6807,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6807
6807
|
let a = r?.parentId, i = r?.recursive ?? !1, s = r?.itemType ?? "all", o = r?.caseSensitive ?? !1, c = r?.limit ?? Infinity, u = o ? t.trim() : t.trim().toLowerCase(), n = [], h = null;
|
|
6808
6808
|
if (a !== void 0) {
|
|
6809
6809
|
h = new Set();
|
|
6810
|
-
let y =
|
|
6810
|
+
let y = Ve(a);
|
|
6811
6811
|
if (h.add(y), i) {
|
|
6812
6812
|
let f = [y], w = new Set();
|
|
6813
6813
|
for (; f.length > 0;) {
|
|
@@ -6823,7 +6823,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6823
6823
|
if (n.length >= c) break;
|
|
6824
6824
|
let f = y.value;
|
|
6825
6825
|
if (h !== null) {
|
|
6826
|
-
let I =
|
|
6826
|
+
let I = Ve(Ke(f));
|
|
6827
6827
|
if (!h.has(I)) continue;
|
|
6828
6828
|
}
|
|
6829
6829
|
if (s === "file" && je(f) || s === "folder" && !je(f)) continue;
|
|
@@ -6878,7 +6878,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6878
6878
|
return Date.now();
|
|
6879
6879
|
}
|
|
6880
6880
|
parentKey(t) {
|
|
6881
|
-
return
|
|
6881
|
+
return Ve(t ?? null);
|
|
6882
6882
|
}
|
|
6883
6883
|
isExpired(t) {
|
|
6884
6884
|
return t == null || this.ttl !== Infinity && this.now() - t > this.ttl;
|
|
@@ -6941,13 +6941,13 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6941
6941
|
}
|
|
6942
6942
|
for (let oe of _.items) i.upsertEntity(oe);
|
|
6943
6943
|
n.view.value = _.items.map((oe) => oe.id);
|
|
6944
|
-
let { items:
|
|
6944
|
+
let { items: V, ...b } = _, v = { ...b };
|
|
6945
6945
|
n.view.meta = v, n.view.meta && (n.view.meta.stale = !1), this.failedRequests.delete(u), n.view.updatedAt = this.now(), !I && typeof v.total == "number" && (this.serverChildrenCountHandler ? this.serverChildrenCountHandler(t ?? null, v.total, i) : i.updateServerChildrenCount(t, v.total));
|
|
6946
6946
|
let C = this.strategy.preloadPagesAfter ?? 0, O = this.strategy.preloadPagesBefore ?? 0, R = Bt(r?.pageSize);
|
|
6947
6947
|
if ((C > 0 || O > 0) && Number.isFinite(R)) {
|
|
6948
|
-
let oe = t, k = { ...r }, U = typeof v.totalPages == "number" ? v.totalPages : 1, D = r?.page ?? 1, Q = R,
|
|
6948
|
+
let oe = t, k = { ...r }, U = typeof v.totalPages == "number" ? v.totalPages : 1, D = r?.page ?? 1, Q = R, $ = a, K = y;
|
|
6949
6949
|
setTimeout(() => {
|
|
6950
|
-
this.preloadPagesAsync(oe, k, D, U, Q, C, O, i, v, K
|
|
6950
|
+
this.preloadPagesAsync(oe, k, D, U, Q, C, O, i, v, $, K);
|
|
6951
6951
|
}, 0);
|
|
6952
6952
|
}
|
|
6953
6953
|
return _;
|
|
@@ -6978,7 +6978,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
6978
6978
|
if (!_?.view.meta) return;
|
|
6979
6979
|
let F = typeof _.view.meta.totalPages == "number" ? _.view.meta.totalPages : 1;
|
|
6980
6980
|
if (F !== i) return;
|
|
6981
|
-
let
|
|
6981
|
+
let V = async (b) => {
|
|
6982
6982
|
let v = {
|
|
6983
6983
|
...r,
|
|
6984
6984
|
page: b
|
|
@@ -7015,14 +7015,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7015
7015
|
...r,
|
|
7016
7016
|
page: v
|
|
7017
7017
|
}), O = w.get(C);
|
|
7018
|
-
(!O?.view.value || this.isExpired(O.view.updatedAt)) &&
|
|
7018
|
+
(!O?.view.value || this.isExpired(O.view.updatedAt)) && V(v);
|
|
7019
7019
|
}
|
|
7020
7020
|
if (c > 0 && a > 1) for (let b = 1; b <= Math.min(c, a - 1); b++) {
|
|
7021
7021
|
let v = a - b, C = Qe({
|
|
7022
7022
|
...r,
|
|
7023
7023
|
page: v
|
|
7024
7024
|
}), O = w.get(C);
|
|
7025
|
-
(!O?.view.value || this.isExpired(O.view.updatedAt)) &&
|
|
7025
|
+
(!O?.view.value || this.isExpired(O.view.updatedAt)) && V(v);
|
|
7026
7026
|
}
|
|
7027
7027
|
} catch {}
|
|
7028
7028
|
}
|
|
@@ -7077,8 +7077,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7077
7077
|
break;
|
|
7078
7078
|
}
|
|
7079
7079
|
if (u.view.value = [...u.view.value, ..._], u.view.updatedAt = Date.now(), w.view.value = w.view.value.slice(_.length), w.view.updatedAt = Date.now(), w.view.value.length === 0) {
|
|
7080
|
-
let F = n + 1,
|
|
7081
|
-
if (F < (
|
|
7080
|
+
let F = n + 1, V = w.view.meta;
|
|
7081
|
+
if (F < (V && typeof V.totalPages == "number" ? V.totalPages : 1)) {
|
|
7082
7082
|
let b = Qe({
|
|
7083
7083
|
...c,
|
|
7084
7084
|
page: F
|
|
@@ -7167,7 +7167,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7167
7167
|
], t.view.updatedAt = this.now(), !0);
|
|
7168
7168
|
}
|
|
7169
7169
|
updateChildrenCountForOperation(t, r, a, i) {
|
|
7170
|
-
let s =
|
|
7170
|
+
let s = Ke(r);
|
|
7171
7171
|
switch (t) {
|
|
7172
7172
|
case "delete":
|
|
7173
7173
|
this.adjustChildrenCount(i, s, -1), this.childrenCountInvalidator?.(s);
|
|
@@ -7197,7 +7197,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7197
7197
|
let h = n.params ?? {}, y = h?.page ?? 1, f = Bt(h?.pageSize), w = Number.isFinite(f), I = !!(h?.sortBy || h?.sortOrder), _ = !!h?.search, F = h?.itemType || "all";
|
|
7198
7198
|
if (this.isEntityTypeCompatible(r, F)) {
|
|
7199
7199
|
if (_ && this.strategy.filterMatch && !this.strategy.filterMatch(r, n.params)) {
|
|
7200
|
-
n.view.value?.includes(r.id) && (n.view.value = n.view.value.filter((
|
|
7200
|
+
n.view.value?.includes(r.id) && (n.view.value = n.view.value.filter((V) => V !== r.id), n.view.meta && typeof n.view.meta.total == "number" && (n.view.meta.total = Math.max(0, n.view.meta.total - 1)), this.markViewStaleForReload(n));
|
|
7201
7201
|
continue;
|
|
7202
7202
|
}
|
|
7203
7203
|
if (!n.view.value) {
|
|
@@ -7398,7 +7398,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7398
7398
|
}
|
|
7399
7399
|
}, Is = class Zi {
|
|
7400
7400
|
invalidateChildrenCountCache(t) {
|
|
7401
|
-
let r =
|
|
7401
|
+
let r = Ve(t ?? "");
|
|
7402
7402
|
this.childrenCountPromises.delete(r), this.failedRequests.delete(ft.childrenCountKey(r));
|
|
7403
7403
|
}
|
|
7404
7404
|
constructor(t = {}, r = Dt, a, i) {
|
|
@@ -7421,7 +7421,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7421
7421
|
return this.views.getOrCreateChildren(t, r, a, this.entities);
|
|
7422
7422
|
}
|
|
7423
7423
|
upsertEntity(t) {
|
|
7424
|
-
let r = this.entities.getEntity(t.id), a = r ?
|
|
7424
|
+
let r = this.entities.getEntity(t.id), a = r ? Ke(r) : null, i = Ke(t), s = r ? je(r) : !1, o = je(t);
|
|
7425
7425
|
if (this.entities.upsertEntity(t), r) {
|
|
7426
7426
|
if (a !== i || s !== o) {
|
|
7427
7427
|
this.views.smartInvalidateChildrenViews(a, r, "delete", this.entities), this.views.smartInvalidateChildrenViews(i, t, "insert", this.entities);
|
|
@@ -7433,17 +7433,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7433
7433
|
isAncestor(t, r) {
|
|
7434
7434
|
let a = r, i = new Set();
|
|
7435
7435
|
for (; a && !i.has(a);) {
|
|
7436
|
-
if (i.add(a),
|
|
7436
|
+
if (i.add(a), Ve(a) === Ve(t)) return !0;
|
|
7437
7437
|
let s = this.entities.getEntity(a);
|
|
7438
7438
|
if (!s) break;
|
|
7439
|
-
a =
|
|
7439
|
+
a = Ke(s), a === null && (a = li);
|
|
7440
7440
|
}
|
|
7441
7441
|
return !1;
|
|
7442
7442
|
}
|
|
7443
7443
|
moveEntity(t, r) {
|
|
7444
7444
|
let a = this.entities.getEntity(t);
|
|
7445
7445
|
if (!a || je(a) && r !== null && this.isAncestor(t, r)) return null;
|
|
7446
|
-
let i =
|
|
7446
|
+
let i = Ke(a), s = this.entities.moveEntityById(t, r);
|
|
7447
7447
|
return s ? (this.views.smartInvalidateChildrenViews(i, a, "delete", this.entities), this.views.smartInvalidateChildrenViews(r, s, "insert", this.entities), s) : null;
|
|
7448
7448
|
}
|
|
7449
7449
|
copyEntity(t, r, a, i) {
|
|
@@ -7461,7 +7461,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7461
7461
|
let n = new Map();
|
|
7462
7462
|
for (let h of u) n.set(h, Ye());
|
|
7463
7463
|
for (let h of u) {
|
|
7464
|
-
let y = this.entities.getFolder(h), f = n.get(h), w =
|
|
7464
|
+
let y = this.entities.getFolder(h), f = n.get(h), w = Ke(y), I = w === null ? r : n.get(w) ?? null, _ = {
|
|
7465
7465
|
...y,
|
|
7466
7466
|
...h === t ? i : void 0,
|
|
7467
7467
|
id: f,
|
|
@@ -7555,7 +7555,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7555
7555
|
return this.entities.searchByName(t, r);
|
|
7556
7556
|
}
|
|
7557
7557
|
async getChildrenCount(t = "", r) {
|
|
7558
|
-
let a =
|
|
7558
|
+
let a = Ve(t), i = ft.childrenCountKey(a), s = this.failedRequests.getFreshError(i, this.errorTtl);
|
|
7559
7559
|
if (s != null) return Promise.reject(s);
|
|
7560
7560
|
let o = this.childrenCountPromises.get(a);
|
|
7561
7561
|
if (o) return o;
|
|
@@ -7668,8 +7668,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7668
7668
|
return ai(e, this._getTrashPath(), pt);
|
|
7669
7669
|
}
|
|
7670
7670
|
_folderFromResolvedPath(e, t) {
|
|
7671
|
-
if (e.isFolder !== !0) throw new m.
|
|
7672
|
-
if (!e.id) throw new m.
|
|
7671
|
+
if (e.isFolder !== !0) throw new m.G(e.isFolder === !1 ? "Path '%s' resolves to a file, not a folder".replace("%s", t) : "Path '%s' resolved to an item that is not marked as a folder".replace("%s", t), "ValidationError");
|
|
7672
|
+
if (!e.id) throw new m.G("Path '%s' resolved to a folder without id".replace("%s", t), "ValidationError");
|
|
7673
7673
|
let r = {
|
|
7674
7674
|
id: e.id,
|
|
7675
7675
|
name: e.name || e.id,
|
|
@@ -7690,7 +7690,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7690
7690
|
}
|
|
7691
7691
|
async _findOrCreateFolderByPath(e) {
|
|
7692
7692
|
let t = xs(e);
|
|
7693
|
-
if (t.length > hi) throw new m.
|
|
7693
|
+
if (t.length > hi) throw new m.G("Path depth exceeds maximum limit of %s".replace("%s", String(hi)), "ValidationError");
|
|
7694
7694
|
let r = await this._resolveFolderByPath(e);
|
|
7695
7695
|
if (r) return r;
|
|
7696
7696
|
let a;
|
|
@@ -7700,14 +7700,14 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7700
7700
|
itemType: "folder"
|
|
7701
7701
|
}), o = s.find((c) => c.name === i);
|
|
7702
7702
|
if (o) {
|
|
7703
|
-
if (!o.isFolder) throw new m.
|
|
7703
|
+
if (!o.isFolder) throw new m.G("Path component '%s' in '%s' is not a folder".replace("%s", i).replace("%s", e), "ValidationError");
|
|
7704
7704
|
a = {
|
|
7705
7705
|
id: o.id,
|
|
7706
7706
|
name: o.name,
|
|
7707
7707
|
parentId: o.folderId
|
|
7708
7708
|
};
|
|
7709
7709
|
} else {
|
|
7710
|
-
if (typeof this._dataProvider.createFolder != "function") throw new m.
|
|
7710
|
+
if (typeof this._dataProvider.createFolder != "function") throw new m.G("Create folder operation is not supported by data provider", "UnsupportedOperation");
|
|
7711
7711
|
a = await this.createFolder({
|
|
7712
7712
|
name: i,
|
|
7713
7713
|
parentId: a?.id
|
|
@@ -7718,7 +7718,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7718
7718
|
}
|
|
7719
7719
|
async getTrashFolder() {
|
|
7720
7720
|
let e = await this._findOrCreateFolderByPath(this._getTrashPath());
|
|
7721
|
-
if (!e) throw new m.
|
|
7721
|
+
if (!e) throw new m.G("Trash folder path '%s' could not be resolved".replace("%s", this._getTrashPath()), "FolderNotFound");
|
|
7722
7722
|
return e;
|
|
7723
7723
|
}
|
|
7724
7724
|
async getTempFolder() {
|
|
@@ -7726,7 +7726,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7726
7726
|
if (e) try {
|
|
7727
7727
|
return await this._findOrCreateFolderByPath(e);
|
|
7728
7728
|
} catch (t) {
|
|
7729
|
-
if (t instanceof m.
|
|
7729
|
+
if (t instanceof m.G && t.code === "ValidationError") throw t;
|
|
7730
7730
|
return;
|
|
7731
7731
|
}
|
|
7732
7732
|
}
|
|
@@ -7798,17 +7798,17 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7798
7798
|
};
|
|
7799
7799
|
}
|
|
7800
7800
|
_validateName(e, t = !1) {
|
|
7801
|
-
if (!e || e.trim().length === 0) throw new m.
|
|
7801
|
+
if (!e || e.trim().length === 0) throw new m.G(t ? "Folder name cannot be empty" : "File name cannot be empty", t ? "FolderInvalidName" : "FileInvalidName");
|
|
7802
7802
|
if (/[/\\:*?"<>|]/.test(e)) {
|
|
7803
7803
|
let r = t ? "FolderInvalidName" : "FileInvalidName";
|
|
7804
|
-
throw new m.
|
|
7804
|
+
throw new m.G(t ? "Folder name contains invalid characters: %s".replace("%s", e) : "File name contains invalid characters: %s".replace("%s", e), r);
|
|
7805
7805
|
}
|
|
7806
7806
|
}
|
|
7807
7807
|
_validateTargetFolderType(e) {
|
|
7808
7808
|
let t = this.normalizeId(e);
|
|
7809
7809
|
if (t === this._rootId) return;
|
|
7810
7810
|
let r = this._cache.getEntity(t);
|
|
7811
|
-
if (r && !r.isFolder) throw new m.
|
|
7811
|
+
if (r && !r.isFolder) throw new m.G("Target item with id '%s' is not a folder".replace("%s", e), "ValidationError");
|
|
7812
7812
|
}
|
|
7813
7813
|
_checkNameExistsInCache(e, t, r, a) {
|
|
7814
7814
|
let i = this.normalizeId(e), s = this._cache.getChildrenIds(i);
|
|
@@ -7882,8 +7882,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7882
7882
|
}
|
|
7883
7883
|
async getFiles({ folderId: e, search: t, sortBy: r, sortOrder: a, page: i, limit: s, itemType: o = "all", noFolder: c = !1 }) {
|
|
7884
7884
|
c && (e = (await this.getTempFolder())?.id);
|
|
7885
|
-
let u = this.normalizeId(e ?? this._rootId), n = this._options.enablePagination === !1, h = n ? 1 : i, y = n ? di : s, f = this._options.clientSideFilter, w = this._options.clientSideSorting, I = this._options.clientSidePaging, _ = I ? Math.max(1, i ?? 1) : void 0, F = I ? typeof s == "number" && Number.isFinite(s) && s > 0 ? s : ui : void 0,
|
|
7886
|
-
if (this._isDeletingId(u)) return
|
|
7885
|
+
let u = this.normalizeId(e ?? this._rootId), n = this._options.enablePagination === !1, h = n ? 1 : i, y = n ? di : s, f = this._options.clientSideFilter, w = this._options.clientSideSorting, I = this._options.clientSidePaging, _ = I ? Math.max(1, i ?? 1) : void 0, F = I ? typeof s == "number" && Number.isFinite(s) && s > 0 ? s : ui : void 0, V = this._emptyFilesResult(I ? _ : h, I ? F : y);
|
|
7886
|
+
if (this._isDeletingId(u)) return V;
|
|
7887
7887
|
let b = this._options.unifiedCatalogFetch !== !1 && n && (o === "folder" || o === "file"), v = b ? "all" : o, C = {
|
|
7888
7888
|
folderId: u,
|
|
7889
7889
|
itemType: v
|
|
@@ -7899,11 +7899,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7899
7899
|
pageSize: O
|
|
7900
7900
|
}, oe;
|
|
7901
7901
|
try {
|
|
7902
|
-
oe = await this._cache.getOrCreateChildren(u, R, async (K
|
|
7903
|
-
let M =
|
|
7904
|
-
...
|
|
7905
|
-
folderId:
|
|
7906
|
-
limit:
|
|
7902
|
+
oe = await this._cache.getOrCreateChildren(u, R, async ($, K) => {
|
|
7903
|
+
let M = K.pageSize, W = M != null && Number.isFinite(Number(M)) ? Number(M) : di, Z = await this._dataProvider.getItems({
|
|
7904
|
+
...K,
|
|
7905
|
+
folderId: $,
|
|
7906
|
+
limit: W
|
|
7907
7907
|
}), ae = Fs(Z.items);
|
|
7908
7908
|
return I ? {
|
|
7909
7909
|
items: ae,
|
|
@@ -7913,16 +7913,16 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7913
7913
|
...Z.pagination
|
|
7914
7914
|
};
|
|
7915
7915
|
});
|
|
7916
|
-
} catch (
|
|
7917
|
-
if (this._isDeletingId(u)) return
|
|
7918
|
-
throw
|
|
7916
|
+
} catch ($) {
|
|
7917
|
+
if (this._isDeletingId(u)) return V;
|
|
7918
|
+
throw $;
|
|
7919
7919
|
}
|
|
7920
7920
|
let k = oe.items;
|
|
7921
|
-
if (b && (o === "folder" ? k = k.filter((
|
|
7921
|
+
if (b && (o === "folder" ? k = k.filter(($) => $.isFolder) : o === "file" && (k = k.filter(($) => !$.isFolder))), f) {
|
|
7922
7922
|
if (typeof this._options.clientSideFilter == "function") k = this._options.clientSideFilter(k, t);
|
|
7923
7923
|
else if (t) {
|
|
7924
|
-
let
|
|
7925
|
-
k = k.filter((
|
|
7924
|
+
let $ = t.toLowerCase();
|
|
7925
|
+
k = k.filter((K) => K.name?.toLowerCase().includes($));
|
|
7926
7926
|
}
|
|
7927
7927
|
}
|
|
7928
7928
|
w && (k = typeof this._options.clientSideSorting == "function" ? this._options.clientSideSorting(k, r, a) : this._defaultClientSideSort(k, r, a));
|
|
@@ -7931,20 +7931,20 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7931
7931
|
let D = k;
|
|
7932
7932
|
if (I) if (typeof this._options.clientSidePaging == "function") D = this._options.clientSidePaging(k, _, F);
|
|
7933
7933
|
else {
|
|
7934
|
-
let
|
|
7935
|
-
D = k.slice(K
|
|
7934
|
+
let $ = (_ - 1) * F, K = $ + F;
|
|
7935
|
+
D = k.slice($, K);
|
|
7936
7936
|
}
|
|
7937
7937
|
if (typeof this._dataProvider.getUrl == "function" || typeof this._dataProvider.getThumbnailUrl == "function") {
|
|
7938
|
-
let
|
|
7939
|
-
if (
|
|
7940
|
-
let [M,
|
|
7938
|
+
let $ = D.map(async (K) => {
|
|
7939
|
+
if (K.isFolder) return K;
|
|
7940
|
+
let [M, W] = await Promise.all([K.url ? Promise.resolve(K.url) : typeof this._dataProvider.getUrl == "function" ? this._dataProvider.getUrl(K) : Promise.resolve(void 0), K.thumbnailUrl ? Promise.resolve(K.thumbnailUrl) : typeof this._dataProvider.getThumbnailUrl == "function" ? this._dataProvider.getThumbnailUrl(K) : Promise.resolve(void 0)]);
|
|
7941
7941
|
return {
|
|
7942
|
-
...
|
|
7942
|
+
...K,
|
|
7943
7943
|
url: M,
|
|
7944
|
-
thumbnailUrl:
|
|
7944
|
+
thumbnailUrl: W
|
|
7945
7945
|
};
|
|
7946
7946
|
});
|
|
7947
|
-
D = await Promise.all(
|
|
7947
|
+
D = await Promise.all($);
|
|
7948
7948
|
}
|
|
7949
7949
|
let Q = I ? {
|
|
7950
7950
|
page: _,
|
|
@@ -7987,10 +7987,10 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
7987
7987
|
childrenCount: e.childCount
|
|
7988
7988
|
});
|
|
7989
7989
|
if (typeof this._dataProvider.getFileData == "function") return await this._dataProvider.getFileData(i, a);
|
|
7990
|
-
if (!i.url && typeof this._dataProvider.getUrl != "function") throw new m.
|
|
7990
|
+
if (!i.url && typeof this._dataProvider.getUrl != "function") throw new m.G("Cannot read file", "FileReadError");
|
|
7991
7991
|
let s = i.url || (typeof this._dataProvider.getUrl == "function" ? await this._dataProvider.getUrl(i) : "");
|
|
7992
7992
|
if (s) return (await (this._config.fetchWithProxy ?? fetch)(s, a?.forceReload ? { cache: "no-store" } : void 0)).blob();
|
|
7993
|
-
throw new m.
|
|
7993
|
+
throw new m.G("Unable to get file data", "FileReadError");
|
|
7994
7994
|
}
|
|
7995
7995
|
async findFileByUrl(e) {
|
|
7996
7996
|
let t = this._cache.searchByUrl(e);
|
|
@@ -8037,8 +8037,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8037
8037
|
}
|
|
8038
8038
|
async _uploadFile(e) {
|
|
8039
8039
|
let t = this.normalizeId(e.folderId ?? this._rootId);
|
|
8040
|
-
if (typeof this._dataProvider.uploadFile != "function") throw new m.
|
|
8041
|
-
if (this._validateName(e.name, !1), this._validateDuplicates && this._checkNameExistsInCache(t, e.name, !1)) throw new m.
|
|
8040
|
+
if (typeof this._dataProvider.uploadFile != "function") throw new m.G("Upload file operation is not supported by data provider", "UnsupportedOperation");
|
|
8041
|
+
if (this._validateName(e.name, !1), this._validateDuplicates && this._checkNameExistsInCache(t, e.name, !1)) throw new m.G("File '%s' already exists in target folder".replace("%s", e.name), "FileAlreadyExists");
|
|
8042
8042
|
let r = await this._dataProvider.uploadFile({
|
|
8043
8043
|
...e,
|
|
8044
8044
|
folderId: t
|
|
@@ -8065,7 +8065,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8065
8065
|
for (let o of r) if (o.name) {
|
|
8066
8066
|
this._validateName(o.name, !1);
|
|
8067
8067
|
let c = this.normalizeId(o.folderId ?? i);
|
|
8068
|
-
if (this._checkNameExistsInCache(c, o.name, !1)) throw new m.
|
|
8068
|
+
if (this._checkNameExistsInCache(c, o.name, !1)) throw new m.G("File '%s' already exists in target folder".replace("%s", o.name), "FileAlreadyExists");
|
|
8069
8069
|
}
|
|
8070
8070
|
}
|
|
8071
8071
|
let s = {
|
|
@@ -8127,7 +8127,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8127
8127
|
};
|
|
8128
8128
|
}
|
|
8129
8129
|
})), s.success = !s.detailed.some((o) => !o.success);
|
|
8130
|
-
else throw new m.
|
|
8130
|
+
else throw new m.G("Upload files is not supported by data provider", "UnsupportedOperation");
|
|
8131
8131
|
if (s.success && this._enableTrash) try {
|
|
8132
8132
|
this._cache.forceInvalidate(i);
|
|
8133
8133
|
} catch {}
|
|
@@ -8182,7 +8182,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8182
8182
|
if (!s) return {
|
|
8183
8183
|
requestId: i,
|
|
8184
8184
|
success: !1,
|
|
8185
|
-
error: new m.
|
|
8185
|
+
error: new m.G("Item with id '%s' not found".replace("%s", i), "FileNotFound")
|
|
8186
8186
|
};
|
|
8187
8187
|
try {
|
|
8188
8188
|
return await this._dataProvider.deleteItem(s, t), a ? this._cache.moveEntity(i, a.id) : this._cache.deleteEntity(i), {
|
|
@@ -8204,8 +8204,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8204
8204
|
}
|
|
8205
8205
|
async hardDeleteItem(e) {
|
|
8206
8206
|
let t = this._cache.getEntity(e);
|
|
8207
|
-
if (!t) throw new m.
|
|
8208
|
-
if (typeof this._dataProvider.deleteItem != "function") throw new m.
|
|
8207
|
+
if (!t) throw new m.G("Item with id '%s' not found in cache".replace("%s", e), "FileNotFound");
|
|
8208
|
+
if (typeof this._dataProvider.deleteItem != "function") throw new m.G("Delete item operation is not supported by data provider", "DeleteNotAllowed");
|
|
8209
8209
|
if (await this._dataProvider.deleteItem(t, { permanent: !0 }), this._cache.deleteEntity(e), this._enableTrash) try {
|
|
8210
8210
|
let r = await this.getTrashFolder();
|
|
8211
8211
|
r && this._cache.forceInvalidate(r.id);
|
|
@@ -8213,7 +8213,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8213
8213
|
return !0;
|
|
8214
8214
|
}
|
|
8215
8215
|
async cleanTrash() {
|
|
8216
|
-
if (!this._enableTrash) throw new m.
|
|
8216
|
+
if (!this._enableTrash) throw new m.G("Trash is not enabled", "UnsupportedOperation");
|
|
8217
8217
|
if (typeof this._dataProvider.cleanTrash == "function") {
|
|
8218
8218
|
let e = await this._dataProvider.cleanTrash();
|
|
8219
8219
|
try {
|
|
@@ -8222,11 +8222,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8222
8222
|
} catch {}
|
|
8223
8223
|
return e;
|
|
8224
8224
|
}
|
|
8225
|
-
throw new m.
|
|
8225
|
+
throw new m.G("Clean trash is not supported by data provider", "UnsupportedOperation");
|
|
8226
8226
|
}
|
|
8227
8227
|
async createFolder({ name: e, parentId: t, is_force_create: r }) {
|
|
8228
8228
|
let a = this.normalizeId(t ?? this._rootId);
|
|
8229
|
-
if (this._validateName(e, !0), this._validateDuplicates && this._checkNameExistsInCache(a, e, !0)) throw new m.
|
|
8229
|
+
if (this._validateName(e, !0), this._validateDuplicates && this._checkNameExistsInCache(a, e, !0)) throw new m.G("Folder '%s' already exists in parent folder".replace("%s", e), "FolderAlreadyExists");
|
|
8230
8230
|
let i = await this._dataProvider.createFolder(e, a, r), s = Me({
|
|
8231
8231
|
id: i.id,
|
|
8232
8232
|
folderId: a,
|
|
@@ -8259,12 +8259,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8259
8259
|
}
|
|
8260
8260
|
}
|
|
8261
8261
|
async renameFolder(e, t) {
|
|
8262
|
-
if (typeof this._dataProvider.renameItem != "function") throw new m.
|
|
8262
|
+
if (typeof this._dataProvider.renameItem != "function") throw new m.G("Rename folder is not supported", "RenameNotAllowed");
|
|
8263
8263
|
let r = this.normalizeId(e), a = this._cache.getEntity(r);
|
|
8264
|
-
if (!a) throw new m.
|
|
8264
|
+
if (!a) throw new m.G("Folder with id '%s' not found in cache".replace("%s", e), "FolderNotFound");
|
|
8265
8265
|
if (this._validateName(t, !0), this._validateDuplicates) {
|
|
8266
8266
|
let s = this.normalizeId(a.folderId);
|
|
8267
|
-
if (this._checkNameExistsInCache(s, t, !0, r)) throw new m.
|
|
8267
|
+
if (this._checkNameExistsInCache(s, t, !0, r)) throw new m.G("Folder '%s' already exists in parent folder".replace("%s", t), "FolderAlreadyExists");
|
|
8268
8268
|
}
|
|
8269
8269
|
let i = rt(await this._dataProvider.renameItem(a, t));
|
|
8270
8270
|
return this._cache.upsertEntity(Me({
|
|
@@ -8273,13 +8273,13 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8273
8273
|
})), this._cache.getEntity(i.id);
|
|
8274
8274
|
}
|
|
8275
8275
|
async renameFile(e, t) {
|
|
8276
|
-
if (typeof this._dataProvider.renameItem != "function") throw new m.
|
|
8276
|
+
if (typeof this._dataProvider.renameItem != "function") throw new m.G("Rename file is not supported", "RenameNotAllowed");
|
|
8277
8277
|
let r = this._cache.getEntity(e);
|
|
8278
|
-
if (!r) throw new m.
|
|
8278
|
+
if (!r) throw new m.G("File with id '%s' not found in cache".replace("%s", e), "FileNotFound");
|
|
8279
8279
|
let a = this.normalizeId(e);
|
|
8280
8280
|
if (this._validateName(t, !1), this._validateDuplicates) {
|
|
8281
8281
|
let s = this.normalizeId(r.folderId);
|
|
8282
|
-
if (this._checkNameExistsInCache(s, t, !1, a)) throw new m.
|
|
8282
|
+
if (this._checkNameExistsInCache(s, t, !1, a)) throw new m.G("File '%s' already exists in parent folder".replace("%s", t), "FileAlreadyExists");
|
|
8283
8283
|
}
|
|
8284
8284
|
let i = rt(await this._dataProvider.renameItem(r, t));
|
|
8285
8285
|
return i && this._cache.upsertEntity(Me({
|
|
@@ -8288,7 +8288,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8288
8288
|
})), this._cache.getEntity(a);
|
|
8289
8289
|
}
|
|
8290
8290
|
async moveItem({ itemId: e, targetFolderId: t, isFolder: r }) {
|
|
8291
|
-
if (typeof this._dataProvider.moveItem != "function") throw new m.
|
|
8291
|
+
if (typeof this._dataProvider.moveItem != "function") throw new m.G("Move item operation is not supported by data provider", "MoveNotAllowed");
|
|
8292
8292
|
let a = this.normalizeId(t);
|
|
8293
8293
|
this._validateTargetFolderType(t);
|
|
8294
8294
|
let i = this._cache.getEntity(e);
|
|
@@ -8314,12 +8314,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8314
8314
|
return !0;
|
|
8315
8315
|
}
|
|
8316
8316
|
if (i.isFolder) {
|
|
8317
|
-
if (e === a) throw new m.
|
|
8318
|
-
if (this._isAncestor(e, a)) throw new m.
|
|
8317
|
+
if (e === a) throw new m.G("Cannot move folder into itself", "MoveIntoSelf");
|
|
8318
|
+
if (this._isAncestor(e, a)) throw new m.G("Cannot move folder into its descendant", "MoveIntoDescendant");
|
|
8319
8319
|
}
|
|
8320
8320
|
if (this._validateDuplicates && a !== this.normalizeId(i.folderId) && i.name && this._checkNameExistsInCache(a, i.name, !!i.isFolder, e)) {
|
|
8321
8321
|
let o = i.isFolder ? "FolderAlreadyExists" : "FileAlreadyExists";
|
|
8322
|
-
throw new m.
|
|
8322
|
+
throw new m.G(`${i.isFolder ? "Folder" : "File"} '${i.name}' already exists in target folder`, o);
|
|
8323
8323
|
}
|
|
8324
8324
|
let s = rt(await this._dataProvider.moveItem(i, a));
|
|
8325
8325
|
if (s.id === e) {
|
|
@@ -8343,12 +8343,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8343
8343
|
let a = t.map((s) => this._cache.getEntity(s));
|
|
8344
8344
|
for (let s of a) if (s) {
|
|
8345
8345
|
if (s.isFolder) {
|
|
8346
|
-
if (s.id === r) throw new m.
|
|
8347
|
-
if (this._isAncestor(s.id, r)) throw new m.
|
|
8346
|
+
if (s.id === r) throw new m.G("Cannot move folder '%s' into itself".replace("%s", s.name), "MoveIntoSelf");
|
|
8347
|
+
if (this._isAncestor(s.id, r)) throw new m.G("Cannot move folder '%s' into its descendant".replace("%s", s.name), "MoveIntoDescendant");
|
|
8348
8348
|
}
|
|
8349
8349
|
if (this._validateDuplicates && r !== this.normalizeId(s.folderId) && s.name && this._checkNameExistsInCache(r, s.name, !!s.isFolder, s.id)) {
|
|
8350
8350
|
let o = s.isFolder ? "FolderAlreadyExists" : "FileAlreadyExists";
|
|
8351
|
-
throw new m.
|
|
8351
|
+
throw new m.G(`${s.isFolder ? "Folder" : "File"} '${s.name}' already exists in target folder`, o);
|
|
8352
8352
|
}
|
|
8353
8353
|
}
|
|
8354
8354
|
let i = {
|
|
@@ -8377,7 +8377,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8377
8377
|
};
|
|
8378
8378
|
}
|
|
8379
8379
|
}));
|
|
8380
|
-
else throw new m.
|
|
8380
|
+
else throw new m.G("Move items is not supported", "MoveNotAllowed");
|
|
8381
8381
|
if (i.success) {
|
|
8382
8382
|
let s = i.detailed || t.map((o) => ({
|
|
8383
8383
|
requestId: o,
|
|
@@ -8400,11 +8400,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8400
8400
|
return i;
|
|
8401
8401
|
} else return {
|
|
8402
8402
|
success: !1,
|
|
8403
|
-
error: i.error || new m.
|
|
8403
|
+
error: i.error || new m.G("Move items failed", "MoveNotAllowed")
|
|
8404
8404
|
};
|
|
8405
8405
|
}
|
|
8406
8406
|
async copyItem({ itemId: e, targetFolderId: t }) {
|
|
8407
|
-
if (typeof this._dataProvider.copyItem != "function") throw new m.
|
|
8407
|
+
if (typeof this._dataProvider.copyItem != "function") throw new m.G("Copy item is not supported", "CopyNotAllowed");
|
|
8408
8408
|
let r = this.normalizeId(t);
|
|
8409
8409
|
this._validateTargetFolderType(t);
|
|
8410
8410
|
let a = this._cache.getEntity(e);
|
|
@@ -8422,7 +8422,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8422
8422
|
let s = r === this.normalizeId(a.folderId) ? e : void 0;
|
|
8423
8423
|
if (this._checkNameExistsInCache(r, a.name, !!a.isFolder, s)) {
|
|
8424
8424
|
let o = a.isFolder ? "FolderAlreadyExists" : "FileAlreadyExists";
|
|
8425
|
-
throw new m.
|
|
8425
|
+
throw new m.G(`${a.isFolder ? "Folder" : "File"} '${a.name}' already exists in target folder`, o);
|
|
8426
8426
|
}
|
|
8427
8427
|
}
|
|
8428
8428
|
let i = rt(await this._dataProvider.copyItem(a, r));
|
|
@@ -8450,7 +8450,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8450
8450
|
let n = r === this.normalizeId(u.folderId) ? i[c] : void 0;
|
|
8451
8451
|
if (this._checkNameExistsInCache(r, u.name, !!u.isFolder, n)) {
|
|
8452
8452
|
let h = u.isFolder ? "FolderAlreadyExists" : "FileAlreadyExists";
|
|
8453
|
-
throw new m.
|
|
8453
|
+
throw new m.G(`${u.isFolder ? "Folder" : "File"} '${u.name}' already exists in target folder`, h);
|
|
8454
8454
|
}
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
@@ -8479,7 +8479,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8479
8479
|
};
|
|
8480
8480
|
}
|
|
8481
8481
|
}));
|
|
8482
|
-
else throw new m.
|
|
8482
|
+
else throw new m.G("Copy items is not supported", "CopyNotAllowed");
|
|
8483
8483
|
if (o.success && o.detailed) for (let c = 0, u = o.detailed.length; c < u; c++) {
|
|
8484
8484
|
let n = o.detailed[c];
|
|
8485
8485
|
if (n.success && n.data?.id) {
|
|
@@ -8493,7 +8493,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8493
8493
|
}));
|
|
8494
8494
|
}
|
|
8495
8495
|
}
|
|
8496
|
-
else if (!o.detailed) throw new m.
|
|
8496
|
+
else if (!o.detailed) throw new m.G("batchResult in copy method must have detailed results", "ValidationError");
|
|
8497
8497
|
return o;
|
|
8498
8498
|
}
|
|
8499
8499
|
async uploadFileByUrl(e) {
|
|
@@ -8516,12 +8516,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8516
8516
|
}
|
|
8517
8517
|
}
|
|
8518
8518
|
async updateFile(e, t) {
|
|
8519
|
-
if (typeof this._dataProvider.updateFile != "function") throw new m.
|
|
8519
|
+
if (typeof this._dataProvider.updateFile != "function") throw new m.G("Update file is not supported", "UnsupportedOperation");
|
|
8520
8520
|
let r = this.normalizeId(e), a = this._cache.getEntity(r);
|
|
8521
|
-
if (!a) throw new m.
|
|
8521
|
+
if (!a) throw new m.G("File with id '%s' not found in cache".replace("%s", e), "FileNotFound");
|
|
8522
8522
|
if (t.name && t.name !== a.name && this._validateName(t.name, !1), this._validateDuplicates && t.name && t.name !== a.name) {
|
|
8523
8523
|
let s = this.normalizeId(a.folderId);
|
|
8524
|
-
if (this._checkNameExistsInCache(s, t.name, !1, r)) throw new m.
|
|
8524
|
+
if (this._checkNameExistsInCache(s, t.name, !1, r)) throw new m.G("File '%s' already exists in parent folder".replace("%s", t.name), "FileAlreadyExists");
|
|
8525
8525
|
}
|
|
8526
8526
|
let i = rt(await this._dataProvider.updateFile(a, { ...t }));
|
|
8527
8527
|
return this._cache.upsertEntity(Me({
|
|
@@ -8530,9 +8530,9 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8530
8530
|
...t
|
|
8531
8531
|
})), this._cache.getEntity(r);
|
|
8532
8532
|
}
|
|
8533
|
-
},
|
|
8533
|
+
}, We = [], Ut = 0; Ut < 256; ++Ut) We.push((Ut + 256).toString(16).slice(1));
|
|
8534
8534
|
function ks(e, t = 0) {
|
|
8535
|
-
return (
|
|
8535
|
+
return (We[e[t + 0]] + We[e[t + 1]] + We[e[t + 2]] + We[e[t + 3]] + "-" + We[e[t + 4]] + We[e[t + 5]] + "-" + We[e[t + 6]] + We[e[t + 7]] + "-" + We[e[t + 8]] + We[e[t + 9]] + "-" + We[e[t + 10]] + We[e[t + 11]] + We[e[t + 12]] + We[e[t + 13]] + We[e[t + 14]] + We[e[t + 15]]).toLowerCase();
|
|
8536
8536
|
}
|
|
8537
8537
|
var Ft, js = new Uint8Array(16);
|
|
8538
8538
|
function Ss() {
|
|
@@ -8592,12 +8592,12 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8592
8592
|
let t = (a, i, s) => {
|
|
8593
8593
|
if (!a) return;
|
|
8594
8594
|
if (a.isFolder !== !0) return a;
|
|
8595
|
-
let o =
|
|
8595
|
+
let o = He(He(s) === He(this.trashPath) ? this.trashPath : i), c = a.folderId != null && a.folderId !== "" ? He(a.folderId) : this.rootPath;
|
|
8596
8596
|
return {
|
|
8597
8597
|
...a,
|
|
8598
8598
|
id: this._getOrGenerateId(o),
|
|
8599
8599
|
name: a.name,
|
|
8600
|
-
folderId: c ===
|
|
8600
|
+
folderId: c === He(this.rootPath) ? this.rootPath || "" : this._getOrGenerateId(c),
|
|
8601
8601
|
isFolder: !0
|
|
8602
8602
|
};
|
|
8603
8603
|
}, r = ai(e, this.trashPath, this.trashId);
|
|
@@ -8610,8 +8610,8 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8610
8610
|
}
|
|
8611
8611
|
_getOrGenerateId(e) {
|
|
8612
8612
|
if (e === this.rootPath) return "";
|
|
8613
|
-
let t =
|
|
8614
|
-
if (t ===
|
|
8613
|
+
let t = He(e);
|
|
8614
|
+
if (t === He(this.trashPath)) return this.trashId;
|
|
8615
8615
|
if (this._pathToId.has(t)) return this._pathToId.get(t);
|
|
8616
8616
|
let r = Es();
|
|
8617
8617
|
return this._pathToId.set(t, r), this._idToPath.set(r, t), r;
|
|
@@ -8622,7 +8622,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8622
8622
|
let a = this._idToPath.get(e);
|
|
8623
8623
|
if (!a) {
|
|
8624
8624
|
if (r) return `unknown folder ${e}`;
|
|
8625
|
-
throw new m.
|
|
8625
|
+
throw new m.G(`Path for id '${e}' not found in mapping`, "FileNotFound");
|
|
8626
8626
|
}
|
|
8627
8627
|
let i = 0;
|
|
8628
8628
|
for (; i < this.rootPath.length && this.rootPath[i] === "/";) i++;
|
|
@@ -8664,7 +8664,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8664
8664
|
};
|
|
8665
8665
|
}
|
|
8666
8666
|
async renameItem(e, t) {
|
|
8667
|
-
if (typeof this._inner.renameItem != "function") throw new m.
|
|
8667
|
+
if (typeof this._inner.renameItem != "function") throw new m.G("Rename item is not supported by inner storage", "RenameNotAllowed");
|
|
8668
8668
|
let r = this.pathForId(e.id, e.isFolder ?? !1), a = r, { ...i } = await this._inner.renameItem({
|
|
8669
8669
|
...e,
|
|
8670
8670
|
id: r,
|
|
@@ -8679,7 +8679,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8679
8679
|
};
|
|
8680
8680
|
}
|
|
8681
8681
|
async deleteItem(e, t) {
|
|
8682
|
-
if (typeof this._inner.deleteItem != "function") throw new m.
|
|
8682
|
+
if (typeof this._inner.deleteItem != "function") throw new m.G("Delete item is not supported by inner storage", "DeleteNotAllowed");
|
|
8683
8683
|
let r = this.pathForId(e.id, e.isFolder ?? !1);
|
|
8684
8684
|
await this._inner.deleteItem({
|
|
8685
8685
|
...e,
|
|
@@ -8688,7 +8688,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8688
8688
|
}, t), this.recursivelyRemoveMappings(e.id, r);
|
|
8689
8689
|
}
|
|
8690
8690
|
async uploadFile(e) {
|
|
8691
|
-
if (typeof this._inner.uploadFile != "function") throw new m.
|
|
8691
|
+
if (typeof this._inner.uploadFile != "function") throw new m.G("Upload file is not supported by inner storage", "UnsupportedOperation");
|
|
8692
8692
|
let t = e.folderId ? this.pathForId(e.folderId, !0) : this.rootPath, r = await this._inner.uploadFile({
|
|
8693
8693
|
...e,
|
|
8694
8694
|
folderId: t
|
|
@@ -8746,7 +8746,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8746
8746
|
};
|
|
8747
8747
|
}
|
|
8748
8748
|
async moveItem(e, t) {
|
|
8749
|
-
if (typeof this._inner.moveItem != "function") throw new m.
|
|
8749
|
+
if (typeof this._inner.moveItem != "function") throw new m.G("Move item is not supported by inner storage", "MoveNotAllowed");
|
|
8750
8750
|
let r = this.pathForId(e.id, e.isFolder ?? !1), a = t ? this.pathForId(t, !0) : this.rootPath, i = await this._inner.moveItem({
|
|
8751
8751
|
...e,
|
|
8752
8752
|
id: r,
|
|
@@ -8761,7 +8761,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8761
8761
|
};
|
|
8762
8762
|
}
|
|
8763
8763
|
async moveItems(e, t) {
|
|
8764
|
-
if (typeof this._inner.moveItems != "function") throw new m.
|
|
8764
|
+
if (typeof this._inner.moveItems != "function") throw new m.G("Move items is not supported by inner storage", "MoveNotAllowed");
|
|
8765
8765
|
let r = t ? this.pathForId(t, !0) : this.rootPath, a = e.map((o) => ({
|
|
8766
8766
|
...o,
|
|
8767
8767
|
id: this.pathForId(o.id, o.isFolder ?? !1),
|
|
@@ -8813,7 +8813,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8813
8813
|
};
|
|
8814
8814
|
}
|
|
8815
8815
|
async copyItems(e, t) {
|
|
8816
|
-
if (typeof this._inner.copyItems != "function") throw new m.
|
|
8816
|
+
if (typeof this._inner.copyItems != "function") throw new m.G("Copy items is not supported by inner storage", "CopyNotAllowed");
|
|
8817
8817
|
let r = t ? this.pathForId(t, !0) : this.rootPath, a = e.map((c) => ({
|
|
8818
8818
|
...c,
|
|
8819
8819
|
id: this.pathForId(c.id, c.isFolder ?? !1),
|
|
@@ -8881,7 +8881,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8881
8881
|
};
|
|
8882
8882
|
}
|
|
8883
8883
|
async deleteItems(e, t) {
|
|
8884
|
-
if (typeof this._inner.deleteItems != "function") throw new m.
|
|
8884
|
+
if (typeof this._inner.deleteItems != "function") throw new m.G("Delete items is not supported by inner storage", "DeleteNotAllowed");
|
|
8885
8885
|
let r = e.map((o) => ({
|
|
8886
8886
|
...o,
|
|
8887
8887
|
id: this.pathForId(o.id, o.isFolder ?? !1),
|
|
@@ -8967,7 +8967,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8967
8967
|
for (let s = 0; s < a.length; s++) this._idToPath.delete(a[s]), this._pathToId.delete(i[s]);
|
|
8968
8968
|
}
|
|
8969
8969
|
async copyItem(e, t) {
|
|
8970
|
-
if (typeof this._inner.copyItem != "function") throw new m.
|
|
8970
|
+
if (typeof this._inner.copyItem != "function") throw new m.G("Copy item is not supported by inner storage", "CopyNotAllowed");
|
|
8971
8971
|
let r = this.pathForId(e.id, e.isFolder ?? !1), a = t ? this.pathForId(t, !0) : this.rootPath, i = await this._inner.copyItem({
|
|
8972
8972
|
...e,
|
|
8973
8973
|
id: r,
|
|
@@ -8980,7 +8980,7 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
8980
8980
|
};
|
|
8981
8981
|
}
|
|
8982
8982
|
async updateFile(e, t) {
|
|
8983
|
-
if (typeof this._inner.updateFile != "function") throw new m.
|
|
8983
|
+
if (typeof this._inner.updateFile != "function") throw new m.G("Update file is not supported by inner storage", "UnsupportedOperation");
|
|
8984
8984
|
let r = this.pathForId(e.id, !1), { ...a } = await this._inner.updateFile({
|
|
8985
8985
|
...e,
|
|
8986
8986
|
id: r,
|
|
@@ -9002,11 +9002,11 @@ ${a}}`, r.appendChild(document.createTextNode(a));
|
|
|
9002
9002
|
folderId: this.pathForId(e.folderId ?? "", !0)
|
|
9003
9003
|
}, t);
|
|
9004
9004
|
let a = e.url || (typeof this.getUrl == "function" ? await this.getUrl(e) : void 0);
|
|
9005
|
-
if (!a) throw new m.
|
|
9005
|
+
if (!a) throw new m.G("Cannot get file data: no url and no inner.getFileData", "FileReadError");
|
|
9006
9006
|
return fetch(a, t?.forceReload ? { cache: "no-store" } : void 0).then((i) => i.blob());
|
|
9007
9007
|
}
|
|
9008
9008
|
async cleanTrash() {
|
|
9009
|
-
if (typeof this._inner.cleanTrash != "function") throw new m.
|
|
9009
|
+
if (typeof this._inner.cleanTrash != "function") throw new m.G("Clean trash is not supported by inner storage", "UnsupportedOperation");
|
|
9010
9010
|
return await this._inner.cleanTrash();
|
|
9011
9011
|
}
|
|
9012
9012
|
};
|