@emailmaker/filemanager 1.1.85-dev.10 → 1.1.85-dev.11

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.
@@ -1,14 +1,14 @@
1
- import { $ as e, C as t, I as n, L as r, S as i, U as a, V as o, Z as s, b as c, et as l, j as u, t as d, x as f } from "./file-manager-hooks-fhltHD9p.js";
2
- import { a as p, i as m, l as h, o as g, s as _, t as v, u as y } from "./file-manager-urls-BpPtVuK4.js";
1
+ import { $ as e, C as t, I as n, L as r, S as i, U as a, V as o, Z as s, b as c, et as l, j as u, t as d, x as f } from "./file-manager-hooks-C6CQk0K1.js";
2
+ import { a as p, i as m, l as h, o as g, s as _, t as v, u as y } from "./file-manager-urls-Cc0AE1sg.js";
3
3
  import b from "react";
4
- import { Button as x, Checkbox as S, ColorPicker as C, Divider as w, Form as T, Input as ee, InputNumber as E, Modal as te, Space as D, Spin as ne, Typography as re } from "antd";
5
- import { Fragment as ie, jsx as O, jsxs as k } from "react/jsx-runtime";
6
- import { LoadingOutlined as ae } from "@ant-design/icons";
7
- import { FolderPlus as oe } from "@untitledui/icons/FolderPlus";
8
- import { Copy04 as se } from "@untitledui/icons/Copy04";
9
- import { Scale01 as ce } from "@untitledui/icons/Scale01";
10
- import { SearchMd as le } from "@untitledui/icons/SearchMd";
11
- var A = {
4
+ import { Button as x, Checkbox as ee, ColorPicker as S, Divider as te, Form as C, Input as w, InputNumber as T, Modal as ne, Space as E, Spin as re, Typography as ie } from "antd";
5
+ import { Fragment as ae, jsx as D, jsxs as O } from "react/jsx-runtime";
6
+ import { LoadingOutlined as oe } from "@ant-design/icons";
7
+ import { FolderPlus as se } from "@untitledui/icons/FolderPlus";
8
+ import { Copy04 as ce } from "@untitledui/icons/Copy04";
9
+ import { Scale01 as le } from "@untitledui/icons/Scale01";
10
+ import { SearchMd as ue } from "@untitledui/icons/SearchMd";
11
+ var k = {
12
12
  "em-filemanager": "em-filemanager",
13
13
  emFilemanager: "em-filemanager",
14
14
  iconsTab: "iconsTab",
@@ -67,21 +67,21 @@ var A = {
67
67
  iconsHeaderDivider: "iconsHeaderDivider",
68
68
  copyToFolderModalBody: "copyToFolderModalBody",
69
69
  copyToFolderModalLoadingOverlay: "copyToFolderModalLoadingOverlay"
70
- }, ue = ({ query: e, onQueryChange: t, onSubmit: n, hasResults: r = !1, inputRef: i }) => {
70
+ }, de = ({ query: e, onQueryChange: t, onSubmit: n, hasResults: r = !1, inputRef: i }) => {
71
71
  let { t: a } = s(), { options: c } = o(), { config: l } = c, u = e.length > 0 && r;
72
- return /* @__PURE__ */ k("div", {
73
- className: A.iconsSearchFormCenteredContainer,
74
- children: [/* @__PURE__ */ O(T, {
72
+ return /* @__PURE__ */ O("div", {
73
+ className: k.iconsSearchFormCenteredContainer,
74
+ children: [/* @__PURE__ */ D(C, {
75
75
  layout: "inline",
76
76
  onFinish: n,
77
- className: u ? A.iconsSearchResults : A.iconsSearchFormCentered,
78
- children: /* @__PURE__ */ O(T.Item, {
79
- className: A.iconsSearchFormInput,
80
- children: /* @__PURE__ */ O(ee, {
77
+ className: u ? k.iconsSearchResults : k.iconsSearchFormCentered,
78
+ children: /* @__PURE__ */ D(C.Item, {
79
+ className: k.iconsSearchFormInput,
80
+ children: /* @__PURE__ */ D(w, {
81
81
  ref: i,
82
- className: A.iconsSearchFormInputInput,
82
+ className: k.iconsSearchFormInputInput,
83
83
  allowClear: !0,
84
- prefix: /* @__PURE__ */ O(le, {
84
+ prefix: /* @__PURE__ */ D(ue, {
85
85
  size: 16,
86
86
  strokeWidth: l?.iconStrokeWidth,
87
87
  onClick: n
@@ -94,64 +94,64 @@ var A = {
94
94
  spellCheck: "false"
95
95
  })
96
96
  })
97
- }), u && /* @__PURE__ */ O("div", {
98
- className: `ant-divider ${A.iconsSearchDivider}`,
97
+ }), u && /* @__PURE__ */ D("div", {
98
+ className: `ant-divider ${k.iconsSearchDivider}`,
99
99
  role: "separator"
100
100
  })]
101
101
  });
102
- }, de = (e) => {
102
+ }, fe = (e) => {
103
103
  let { t } = s(), { colorHex: n, setColorHex: r, colorHex2: i, setColorHex2: a, colorHex3: o, setColorHex3: c, sizePx: l, setSizePx: u, strokeWidth: d, setStrokeWidth: f, showSecondColor: p, showThirdColor: m } = e;
104
- return /* @__PURE__ */ O("div", {
105
- className: A.iconsControls,
106
- children: /* @__PURE__ */ k("div", {
107
- className: A.iconsControlsControls,
104
+ return /* @__PURE__ */ D("div", {
105
+ className: k.iconsControls,
106
+ children: /* @__PURE__ */ O("div", {
107
+ className: k.iconsControlsControls,
108
108
  children: [
109
- /* @__PURE__ */ k("div", {
110
- className: A.iconsControlsNumField,
111
- children: [/* @__PURE__ */ O(re.Text, {
109
+ /* @__PURE__ */ O("div", {
110
+ className: k.iconsControlsNumField,
111
+ children: [/* @__PURE__ */ D(ie.Text, {
112
112
  type: "secondary",
113
- className: A.iconsControlsNumLabel,
113
+ className: k.iconsControlsNumLabel,
114
114
  children: t("Size")
115
- }), /* @__PURE__ */ O(E, {
116
- className: A.iconsControlsNumInput,
115
+ }), /* @__PURE__ */ D(T, {
116
+ className: k.iconsControlsNumInput,
117
117
  min: 20,
118
118
  max: 200,
119
119
  step: 1,
120
120
  value: l,
121
- suffix: /* @__PURE__ */ O("span", {
122
- className: A.iconsControlsNumSuffix,
121
+ suffix: /* @__PURE__ */ D("span", {
122
+ className: k.iconsControlsNumSuffix,
123
123
  children: "px"
124
124
  }),
125
125
  onChange: (e) => u(typeof e == "number" && !Number.isNaN(e) ? e : 50),
126
126
  "aria-label": t("Size")
127
127
  })]
128
128
  }),
129
- /* @__PURE__ */ k("div", {
130
- className: A.iconsControlsNumField,
131
- children: [/* @__PURE__ */ O(re.Text, {
129
+ /* @__PURE__ */ O("div", {
130
+ className: k.iconsControlsNumField,
131
+ children: [/* @__PURE__ */ D(ie.Text, {
132
132
  type: "secondary",
133
- className: A.iconsControlsNumLabel,
133
+ className: k.iconsControlsNumLabel,
134
134
  children: t("Stroke width")
135
- }), /* @__PURE__ */ O(E, {
136
- className: A.iconsControlsNumInput,
135
+ }), /* @__PURE__ */ D(T, {
136
+ className: k.iconsControlsNumInput,
137
137
  min: .3,
138
138
  max: 3,
139
139
  step: .1,
140
140
  value: typeof d == "number" ? d : 1,
141
- suffix: /* @__PURE__ */ O("span", {
142
- className: A.iconsControlsNumSuffix,
141
+ suffix: /* @__PURE__ */ D("span", {
142
+ className: k.iconsControlsNumSuffix,
143
143
  children: "px"
144
144
  }),
145
145
  onChange: (e) => f(typeof e == "number" && !Number.isNaN(e) ? e : 1),
146
146
  "aria-label": t("Stroke width")
147
147
  })]
148
148
  }),
149
- /* @__PURE__ */ k(D, {
149
+ /* @__PURE__ */ O(E, {
150
150
  size: 8,
151
151
  children: [
152
- /* @__PURE__ */ k("div", {
153
- className: A.iconsControlElement,
154
- children: [/* @__PURE__ */ O("span", { children: t("Color1") }), /* @__PURE__ */ O(C, {
152
+ /* @__PURE__ */ O("div", {
153
+ className: k.iconsControlElement,
154
+ children: [/* @__PURE__ */ D("span", { children: t("Color1") }), /* @__PURE__ */ D(S, {
155
155
  value: n,
156
156
  format: "hex",
157
157
  disabledAlpha: !0,
@@ -163,9 +163,9 @@ var A = {
163
163
  size: "middle"
164
164
  })]
165
165
  }),
166
- p && /* @__PURE__ */ k("div", {
167
- className: A.iconsControlElement,
168
- children: [/* @__PURE__ */ O("span", { children: t("Color2") }), /* @__PURE__ */ O(C, {
166
+ p && /* @__PURE__ */ O("div", {
167
+ className: k.iconsControlElement,
168
+ children: [/* @__PURE__ */ D("span", { children: t("Color2") }), /* @__PURE__ */ D(S, {
169
169
  value: i,
170
170
  format: "hex",
171
171
  disabledAlpha: !0,
@@ -177,9 +177,9 @@ var A = {
177
177
  size: "middle"
178
178
  })]
179
179
  }),
180
- m && /* @__PURE__ */ k("div", {
181
- className: A.iconsControlElement,
182
- children: [/* @__PURE__ */ O("span", { children: t("Color3") }), /* @__PURE__ */ O(C, {
180
+ m && /* @__PURE__ */ O("div", {
181
+ className: k.iconsControlElement,
182
+ children: [/* @__PURE__ */ D("span", { children: t("Color3") }), /* @__PURE__ */ D(S, {
183
183
  value: o,
184
184
  format: "hex",
185
185
  disabledAlpha: !0,
@@ -196,48 +196,48 @@ var A = {
196
196
  ]
197
197
  })
198
198
  });
199
- }, fe = /* @__PURE__ */ O(ae, {
199
+ }, pe = /* @__PURE__ */ D(oe, {
200
200
  style: { fontSize: 20 },
201
201
  spin: !0
202
- }), pe = 240, j = 160, me = 56, he = ({ items: e, loading: t, isCollectingResults: n = !1, hasMore: r = !1, hasQuery: i, selectedHash: a, onItemClick: o, onInsert: c, onLoadMore: l, colorVars: u, svgTextMap: f, previewSize: p, selectedHashes: g, onToggleSelect: _ }) => {
203
- let { t: v } = s(), { ThumbsUpIcon: x } = y(), C = !!(g && g.size > 0), w = b.useRef(null), { positionedItems: T, containerHeight: ee, isNearEnd: E, handleViewportChange: te } = m({
202
+ }), me = 240, A = 160, he = 56, ge = ({ items: e, loading: t, isCollectingResults: n = !1, hasMore: r = !1, hasQuery: i, selectedHash: a, onItemClick: o, onInsert: c, onLoadMore: l, colorVars: u, svgTextMap: f, previewSize: p, selectedHashes: g, onToggleSelect: _ }) => {
203
+ let { t: v } = s(), { ThumbsUpIcon: x } = y(), S = !!(g && g.size > 0), te = b.useRef(null), { positionedItems: C, containerHeight: w, isNearEnd: T, handleViewportChange: ne } = m({
204
204
  items: e,
205
205
  getId: (e) => e.hash,
206
206
  getPreviewSrc: () => void 0,
207
207
  getAltText: (e) => e.name,
208
208
  layoutMode: "grid",
209
- minColumnWidth: j,
210
- estimatedItemHeight: (p ?? 50) + me,
209
+ minColumnWidth: A,
210
+ estimatedItemHeight: (p ?? 50) + he,
211
211
  gap: 16,
212
- prefetchThresholdPx: pe
213
- }), D = d(te, [e.length, p ?? 50]);
212
+ prefetchThresholdPx: me
213
+ }), E = d(ne, [e.length, p ?? 50]);
214
214
  b.useEffect(() => {
215
- r || (w.current = null);
215
+ r || (te.current = null);
216
216
  }, [r, e.length]), b.useEffect(() => {
217
- if (!t && !n && r && e.length > 0 && E) {
218
- if (w.current === e.length) return;
219
- w.current = e.length, l?.();
217
+ if (!t && !n && r && e.length > 0 && T) {
218
+ if (te.current === e.length) return;
219
+ te.current = e.length, l?.();
220
220
  }
221
221
  }, [
222
222
  r,
223
223
  n,
224
- E,
224
+ T,
225
225
  e.length,
226
226
  t,
227
227
  l
228
228
  ]);
229
- let re = i ? /* @__PURE__ */ O("div", {
230
- className: A.iconsGridEmptyState,
231
- children: /* @__PURE__ */ O(h, {})
232
- }) : /* @__PURE__ */ O("div", {
233
- className: A.iconsGridEmptyState,
234
- children: /* @__PURE__ */ k("div", {
235
- className: A.resultsContainer,
229
+ let ie = i ? /* @__PURE__ */ D("div", {
230
+ className: k.iconsGridEmptyState,
231
+ children: /* @__PURE__ */ D(h, {})
232
+ }) : /* @__PURE__ */ D("div", {
233
+ className: k.iconsGridEmptyState,
234
+ children: /* @__PURE__ */ O("div", {
235
+ className: k.resultsContainer,
236
236
  children: [
237
- /* @__PURE__ */ O("span", {
238
- className: A.videoIcon,
239
- children: /* @__PURE__ */ O(x, {
240
- className: A.playButton,
237
+ /* @__PURE__ */ D("span", {
238
+ className: k.videoIcon,
239
+ children: /* @__PURE__ */ D(x, {
240
+ className: k.playButton,
241
241
  style: {
242
242
  width: 48,
243
243
  height: 49,
@@ -245,27 +245,27 @@ var A = {
245
245
  }
246
246
  })
247
247
  }),
248
- /* @__PURE__ */ O("h1", {
249
- className: A.title,
248
+ /* @__PURE__ */ D("h1", {
249
+ className: k.title,
250
250
  children: v("Thousands of icons")
251
251
  }),
252
- /* @__PURE__ */ O("p", {
253
- className: A.subtitle,
252
+ /* @__PURE__ */ D("p", {
253
+ className: k.subtitle,
254
254
  children: v("Enter a search query and we'll find the perfect icon for you")
255
255
  })
256
256
  ]
257
257
  })
258
258
  });
259
- return /* @__PURE__ */ k("div", {
259
+ return /* @__PURE__ */ O("div", {
260
260
  id: "iconsScrollableDiv",
261
- ref: D,
262
- className: A.iconsGrid,
263
- children: [e.length === 0 && !t ? re : /* @__PURE__ */ k(ie, { children: [/* @__PURE__ */ O("div", {
264
- className: A.iconsGridVirtualCanvas,
265
- style: { height: ee },
266
- children: T.map(({ row: e, layout: t }) => {
261
+ ref: E,
262
+ className: k.iconsGrid,
263
+ children: [e.length === 0 && !t ? ie : /* @__PURE__ */ O(ae, { children: [/* @__PURE__ */ D("div", {
264
+ className: k.iconsGridVirtualCanvas,
265
+ style: { height: w },
266
+ children: C.map(({ row: e, layout: t }) => {
267
267
  let n = e.item, r = !!(g && g.has(n.hash) || a === n.hash), i = f[n.hash];
268
- return /* @__PURE__ */ k("div", {
268
+ return /* @__PURE__ */ O("div", {
269
269
  style: {
270
270
  position: "absolute",
271
271
  top: t.top,
@@ -273,13 +273,13 @@ var A = {
273
273
  width: t.width,
274
274
  height: t.height
275
275
  },
276
- className: `${A.iconsGridItem} ${r ? A.iconsGridItemSelected : ""} ${C ? A.iconsGridShowCheckboxes : ""}`,
276
+ className: `${k.iconsGridItem} ${r ? k.iconsGridItemSelected : ""} ${S ? k.iconsGridShowCheckboxes : ""}`,
277
277
  onClick: () => o(n),
278
278
  children: [
279
- /* @__PURE__ */ O("div", {
279
+ /* @__PURE__ */ D("div", {
280
280
  style: { height: p ?? 50 },
281
- className: A.iconsGridItemThumbnail,
282
- children: i ? /* @__PURE__ */ O("div", {
281
+ className: k.iconsGridItemThumbnail,
282
+ children: i ? /* @__PURE__ */ D("div", {
283
283
  style: {
284
284
  color: u?.colorHex,
285
285
  "--em-icon-grad-1": u?.colorHex ?? "#000",
@@ -295,31 +295,31 @@ var A = {
295
295
  "--em-icon-fill-3": u?.colorHex3 ?? "#00C2FF"
296
296
  },
297
297
  dangerouslySetInnerHTML: { __html: i },
298
- className: A.iconsGridItemSvg
299
- }) : /* @__PURE__ */ O("div", {
300
- className: A.iconsGridItemImg,
298
+ className: k.iconsGridItemSvg
299
+ }) : /* @__PURE__ */ D("div", {
300
+ className: k.iconsGridItemImg,
301
301
  style: {
302
302
  display: "flex",
303
303
  alignItems: "center",
304
304
  justifyContent: "center"
305
305
  },
306
- children: /* @__PURE__ */ O(ne, {
307
- indicator: fe,
306
+ children: /* @__PURE__ */ D(re, {
307
+ indicator: pe,
308
308
  size: "small"
309
309
  })
310
310
  })
311
311
  }),
312
- /* @__PURE__ */ O("div", {
313
- className: A.iconsGridItemName,
312
+ /* @__PURE__ */ D("div", {
313
+ className: k.iconsGridItemName,
314
314
  title: n.name,
315
315
  children: n.name
316
316
  }),
317
- _ ? /* @__PURE__ */ O("div", {
317
+ _ ? /* @__PURE__ */ D("div", {
318
318
  onClick: (e) => {
319
319
  e.stopPropagation();
320
320
  },
321
- className: A.iconsGridCheckbox,
322
- children: /* @__PURE__ */ O(S, {
321
+ className: k.iconsGridCheckbox,
322
+ children: /* @__PURE__ */ D(ee, {
323
323
  checked: !!(g && g.has(n.hash)),
324
324
  onChange: () => _(n.hash)
325
325
  })
@@ -327,25 +327,25 @@ var A = {
327
327
  ]
328
328
  }, n.hash);
329
329
  })
330
- }), n && /* @__PURE__ */ O("div", {
331
- className: A.iconsGridLoadingMore,
332
- children: /* @__PURE__ */ O(ne, { indicator: fe })
333
- })] }), t && e.length === 0 && /* @__PURE__ */ O("div", {
334
- className: A.iconsGridLoading,
335
- children: /* @__PURE__ */ O(ne, { indicator: fe })
330
+ }), n && /* @__PURE__ */ D("div", {
331
+ className: k.iconsGridLoadingMore,
332
+ children: /* @__PURE__ */ D(re, { indicator: pe })
333
+ })] }), t && e.length === 0 && /* @__PURE__ */ D("div", {
334
+ className: k.iconsGridLoading,
335
+ children: /* @__PURE__ */ D(re, { indicator: pe })
336
336
  })]
337
337
  });
338
338
  };
339
339
  //#endregion
340
340
  //#region packages/file-manager/src/components/ImageIcons/defaultIconStockTranslate.ts
341
- function ge(e) {
341
+ function _e(e) {
342
342
  return /[\u0400-\u04FF]/.test(e);
343
343
  }
344
- function _e(e) {
344
+ function ve(e) {
345
345
  let t = e.trim();
346
346
  return async (e, n) => {
347
347
  let r = e.trim();
348
- if (!ge(r)) return r;
348
+ if (!_e(r)) return r;
349
349
  try {
350
350
  let i = await fetch(t, {
351
351
  method: "POST",
@@ -364,40 +364,40 @@ function _e(e) {
364
364
  }
365
365
  };
366
366
  }
367
- function ve(e) {
367
+ function ye(e) {
368
368
  if (!e) return;
369
369
  if (e.handleTranslate) return e.handleTranslate;
370
370
  let t = e.iconStockTranslateUrl?.trim();
371
- if (t) return _e(t);
371
+ if (t) return ve(t);
372
372
  }
373
373
  //#endregion
374
374
  //#region node_modules/@iconify/utils/lib/icon/defaults.js
375
- var ye = Object.freeze({
375
+ var be = Object.freeze({
376
376
  left: 0,
377
377
  top: 0,
378
378
  width: 16,
379
379
  height: 16
380
- }), M = Object.freeze({
380
+ }), j = Object.freeze({
381
381
  rotate: 0,
382
382
  vFlip: !1,
383
383
  hFlip: !1
384
- }), N = Object.freeze({
385
- ...ye,
386
- ...M
387
- }), be = Object.freeze({
388
- ...N,
384
+ }), M = Object.freeze({
385
+ ...be,
386
+ ...j
387
+ }), xe = Object.freeze({
388
+ ...M,
389
389
  body: "",
390
390
  hidden: !1
391
- }), P = Object.freeze({
391
+ }), N = Object.freeze({
392
392
  width: null,
393
393
  height: null
394
- }), xe = Object.freeze({
395
- ...P,
396
- ...M
394
+ }), Se = Object.freeze({
395
+ ...N,
396
+ ...j
397
397
  });
398
398
  //#endregion
399
399
  //#region node_modules/@iconify/utils/lib/icon/transformations.js
400
- function F(e, t) {
400
+ function P(e, t) {
401
401
  let n = {};
402
402
  !e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
403
403
  let r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
@@ -405,14 +405,14 @@ function F(e, t) {
405
405
  }
406
406
  //#endregion
407
407
  //#region node_modules/@iconify/utils/lib/icon/merge.js
408
- function Se(e, t) {
409
- let n = F(e, t);
410
- for (let r in be) r in M ? r in e && !(r in n) && (n[r] = M[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
408
+ function Ce(e, t) {
409
+ let n = P(e, t);
410
+ for (let r in xe) r in j ? r in e && !(r in n) && (n[r] = j[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
411
411
  return n;
412
412
  }
413
413
  //#endregion
414
414
  //#region node_modules/@iconify/utils/lib/icon-set/tree.js
415
- function I(e, t) {
415
+ function F(e, t) {
416
416
  let n = e.icons, r = e.aliases || Object.create(null), i = Object.create(null);
417
417
  function a(e) {
418
418
  if (n[e]) return i[e] = [];
@@ -427,28 +427,28 @@ function I(e, t) {
427
427
  }
428
428
  //#endregion
429
429
  //#region node_modules/@iconify/utils/lib/icon-set/get-icon.js
430
- function L(e, t, n) {
430
+ function I(e, t, n) {
431
431
  let r = e.icons, i = e.aliases || Object.create(null), a = {};
432
432
  function o(e) {
433
- a = Se(r[e] || i[e], a);
433
+ a = Ce(r[e] || i[e], a);
434
434
  }
435
- return o(t), n.forEach(o), Se(e, a);
435
+ return o(t), n.forEach(o), Ce(e, a);
436
436
  }
437
- function R(e, t) {
438
- if (e.icons[t]) return L(e, t, []);
439
- let n = I(e, [t])[t];
440
- return n ? L(e, t, n) : null;
437
+ function L(e, t) {
438
+ if (e.icons[t]) return I(e, t, []);
439
+ let n = F(e, [t])[t];
440
+ return n ? I(e, t, n) : null;
441
441
  }
442
442
  //#endregion
443
443
  //#region node_modules/@iconify/utils/lib/svg/size.js
444
- var Ce = /(-?[0-9.]*[0-9]+[0-9.]*)/g, z = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
445
- function we(e, t, n) {
444
+ var we = /(-?[0-9.]*[0-9]+[0-9.]*)/g, R = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
445
+ function Te(e, t, n) {
446
446
  if (t === 1) return e;
447
447
  if (n ||= 100, typeof e == "number") return Math.ceil(e * t * n) / n;
448
448
  if (typeof e != "string") return e;
449
- let r = e.split(Ce);
449
+ let r = e.split(we);
450
450
  if (r === null || !r.length) return e;
451
- let i = [], a = r.shift(), o = z.test(a);
451
+ let i = [], a = r.shift(), o = R.test(a);
452
452
  for (;;) {
453
453
  if (o) {
454
454
  let e = parseFloat(a);
@@ -460,7 +460,7 @@ function we(e, t, n) {
460
460
  }
461
461
  //#endregion
462
462
  //#region node_modules/@iconify/utils/lib/svg/defs.js
463
- function B(e, t = "defs") {
463
+ function z(e, t = "defs") {
464
464
  let n = "", r = e.indexOf("<" + t);
465
465
  for (; r >= 0;) {
466
466
  let i = e.indexOf(">", r), a = e.indexOf("</" + t);
@@ -474,22 +474,22 @@ function B(e, t = "defs") {
474
474
  content: e
475
475
  };
476
476
  }
477
- function Te(e, t) {
477
+ function Ee(e, t) {
478
478
  return e ? "<defs>" + e + "</defs>" + t : t;
479
479
  }
480
- function Ee(e, t, n) {
481
- let r = B(e);
482
- return Te(r.defs, t + r.content + n);
480
+ function De(e, t, n) {
481
+ let r = z(e);
482
+ return Ee(r.defs, t + r.content + n);
483
483
  }
484
484
  //#endregion
485
485
  //#region node_modules/@iconify/utils/lib/svg/build.js
486
- var De = (e) => e === "unset" || e === "undefined" || e === "none";
487
- function V(e, t) {
486
+ var Oe = (e) => e === "unset" || e === "undefined" || e === "none";
487
+ function B(e, t) {
488
488
  let n = {
489
- ...N,
489
+ ...M,
490
490
  ...e
491
491
  }, r = {
492
- ...xe,
492
+ ...Se,
493
493
  ...t
494
494
  }, i = {
495
495
  left: n.left,
@@ -510,12 +510,12 @@ function V(e, t) {
510
510
  break;
511
511
  case 3: s = i.width / 2 + i.left, t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")");
512
512
  }
513
- o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a = Ee(a, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
513
+ o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a = De(a, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
514
514
  });
515
515
  let o = r.width, s = r.height, c = i.width, l = i.height, u, d;
516
- o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u = we(d, c / l)) : (u = o === "auto" ? c : o, d = s === null ? we(u, l / c) : s === "auto" ? l : s);
516
+ o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u = Te(d, c / l)) : (u = o === "auto" ? c : o, d = s === null ? Te(u, l / c) : s === "auto" ? l : s);
517
517
  let f = {}, p = (e, t) => {
518
- De(t) || (f[e] = t.toString());
518
+ Oe(t) || (f[e] = t.toString());
519
519
  };
520
520
  p("width", u), p("height", d);
521
521
  let m = [
@@ -532,7 +532,7 @@ function V(e, t) {
532
532
  }
533
533
  //#endregion
534
534
  //#region node_modules/@iconify/utils/lib/svg/html.js
535
- function Oe(e, t) {
535
+ function V(e, t) {
536
536
  let n = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
537
537
  for (let e in t) n += " " + e + "=\"" + t[e] + "\"";
538
538
  return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + n + ">" + e + "</svg>";
@@ -940,52 +940,84 @@ function Pe(e) {
940
940
  groups: Ne(e)
941
941
  };
942
942
  }
943
- function W(e, t, n) {
943
+ function Fe(e, t, n) {
944
944
  return t.length >= 2 && e.includes(t) ? !0 : n.length !== 0 && n.every((t) => t.some((t) => t.length >= 2 && e.includes(t)));
945
945
  }
946
946
  //#endregion
947
- //#region packages/file-manager/src/components/ImageIcons/iconSets.ts
948
- var Fe = ["lucide", "tabler"], G = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = {};
947
+ //#region packages/file-manager/src/components/ImageIcons/packagedIconSets.ts
949
948
  function Ie(e) {
950
- let t = q.baseUrl === e.baseUrl, n = q.path === e.path;
951
- t && n || (q = e, G.clear(), K.clear());
949
+ try {
950
+ switch (e) {
951
+ case "lucide": return new URL("./assets/icon-sets/lucide.json", import.meta.url).href;
952
+ case "tabler": return new URL("./assets/icon-sets/tabler.json", import.meta.url).href;
953
+ default: return;
954
+ }
955
+ } catch {
956
+ return;
957
+ }
958
+ }
959
+ //#endregion
960
+ //#region packages/file-manager/src/components/ImageIcons/iconSets.ts
961
+ var Le = ["lucide", "tabler"], W = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), K = {};
962
+ function Re(e) {
963
+ let t = K.baseUrl === e.baseUrl, n = K.path === e.path, r = K.load === e.load;
964
+ t && n && r || (K = e, W.clear(), G.clear());
952
965
  }
953
- function Le(e) {
954
- let t = q.path || "static/media/icon-sets";
955
- return v(q.baseUrl || "", `${t}/${e}.json`);
966
+ function q(e) {
967
+ let t = K.path || "static/media/icon-sets";
968
+ return v(K.baseUrl || "", `${t}/${e}.json`);
956
969
  }
957
- async function Re(e) {
970
+ function ze(e) {
971
+ if (K.path) return [q(e)];
972
+ let t = Ie(e);
973
+ return t ? [t, q(e)] : [q(e)];
974
+ }
975
+ async function Be(e) {
976
+ let t = await fetch(e);
977
+ if (!t.ok) throw Error(`HTTP ${t.status}`);
978
+ return await t.json();
979
+ }
980
+ async function J(e, t) {
958
981
  try {
959
- let t = await fetch(Le(e));
960
- if (!t.ok) throw Error(`HTTP ${t.status}`);
961
- let n = await t.json();
962
- return G.set(e, n), n;
982
+ let n = await t(e);
983
+ return W.set(e, n), n;
963
984
  } catch (t) {
964
- return console.error(`[file-manager] icon set "${e}" is not available at ${Le(e)}`, t), K.delete(e), null;
985
+ return console.error(`[file-manager] icon set "${e}" failed to load`, t), G.delete(e), null;
965
986
  }
966
987
  }
967
- function ze(e) {
968
- let t = G.get(e);
988
+ async function Ve(e) {
989
+ if (K.load) return J(e, K.load);
990
+ let t = ze(e), n;
991
+ for (let r of t) try {
992
+ let t = await Be(r);
993
+ return W.set(e, t), t;
994
+ } catch (e) {
995
+ n = e;
996
+ }
997
+ return console.error(`[file-manager] icon set "${e}" is not available at ${t.join(", ")}`, n), G.delete(e), null;
998
+ }
999
+ function He(e) {
1000
+ let t = W.get(e);
969
1001
  if (t) return Promise.resolve(t);
970
- let n = K.get(e) ?? Re(e);
971
- return K.set(e, n), n;
1002
+ let n = G.get(e) ?? Ve(e);
1003
+ return G.set(e, n), n;
972
1004
  }
973
- async function Be() {
974
- return (await Promise.all(Fe.map(async (e) => ({
1005
+ async function Ue() {
1006
+ return (await Promise.all(Le.map(async (e) => ({
975
1007
  prefix: e,
976
- json: await ze(e)
1008
+ json: await He(e)
977
1009
  })))).filter((e) => e.json !== null);
978
1010
  }
979
- function J(e) {
980
- return G.get(e) ?? null;
1011
+ function We(e) {
1012
+ return W.get(e) ?? null;
981
1013
  }
982
1014
  //#endregion
983
1015
  //#region packages/file-manager/src/components/ImageIcons/iconStockSearch.ts
984
- var Ve = {
1016
+ var Ge = {
985
1017
  lucide: "Lucide",
986
1018
  tabler: "Tabler Icons"
987
1019
  };
988
- function He(e, t) {
1020
+ function Ke(e, t) {
989
1021
  let n = t, r = e.icons;
990
1022
  for (let e = 0; e < 24; e += 1) {
991
1023
  let e = r[n];
@@ -997,20 +1029,20 @@ function He(e, t) {
997
1029
  }
998
1030
  return n;
999
1031
  }
1000
- function Ue(e, t) {
1032
+ function qe(e, t) {
1001
1033
  let n = e.icons[t];
1002
1034
  return !!(n && "body" in n && n.hidden);
1003
1035
  }
1004
- function We(e) {
1036
+ function Y(e) {
1005
1037
  return e.split("-").map((e) => e.length ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ");
1006
1038
  }
1007
- function Ge(e, t) {
1039
+ function Je(e, t) {
1008
1040
  let n = e.prefix || t.toLowerCase(), r = [];
1009
1041
  for (let i of Object.keys(e.icons)) {
1010
1042
  let a = e.icons[i];
1011
1043
  if (a && "body" in a && a.hidden) continue;
1012
- let o = He(e, i);
1013
- if (Ue(e, o) || !R(e, i)) continue;
1044
+ let o = Ke(e, i);
1045
+ if (qe(e, o) || !L(e, i)) continue;
1014
1046
  let s = `${i} ${i.replace(/-/g, " ")}`.toLowerCase();
1015
1047
  r.push({
1016
1048
  prefix: n,
@@ -1022,13 +1054,13 @@ function Ge(e, t) {
1022
1054
  }
1023
1055
  return r;
1024
1056
  }
1025
- var Ke = null;
1026
- async function qe() {
1027
- return Ke ||= (await Be()).flatMap(({ prefix: e, json: t }) => Ge(t, Ve[e])), Ke;
1057
+ var Ye = null;
1058
+ async function Xe() {
1059
+ return Ye ||= (await Ue()).flatMap(({ prefix: e, json: t }) => Je(t, Ge[e])), Ye;
1028
1060
  }
1029
- function Y(e, t, n) {
1061
+ function Ze(e, t, n) {
1030
1062
  let { haystack: r, slug: i } = e;
1031
- if (!W(r, t, n)) return 0;
1063
+ if (!Fe(r, t, n)) return 0;
1032
1064
  let a = 10;
1033
1065
  if (t.length >= 2 && r.includes(t)) i.startsWith(t) ? a += 100 : r.startsWith(t) ? a += 50 : r.split(/\s+/).some((e) => e.startsWith(t)) ? a += 30 : a += 15;
1034
1066
  else if (n.length > 0) for (let e of n) {
@@ -1039,29 +1071,29 @@ function Y(e, t, n) {
1039
1071
  }
1040
1072
  return a;
1041
1073
  }
1042
- async function Je(e) {
1074
+ async function Qe(e) {
1043
1075
  let t = e.trim();
1044
1076
  if (t.length < 3) return [];
1045
1077
  let { direct: n, groups: r } = Pe(t), i = /* @__PURE__ */ new Map();
1046
- for (let e of await qe()) {
1047
- let t = Y(e, n, r);
1078
+ for (let e of await Xe()) {
1079
+ let t = Ze(e, n, r);
1048
1080
  if (t <= 0) continue;
1049
1081
  let a = `${e.prefix}:${e.canonical}`, o = i.get(a);
1050
1082
  (!o || t > o.score) && i.set(a, { score: t });
1051
1083
  }
1052
1084
  return Array.from(i.entries()).sort((e, t) => t[1].score - e[1].score || e[0].localeCompare(t[0])).map(([e]) => e);
1053
1085
  }
1054
- function Ye(e, t) {
1086
+ function $e(e, t) {
1055
1087
  if (t.length === 0) return e;
1056
1088
  let n = new Set(e), r = [...e];
1057
1089
  for (let e of t) n.has(e) || (n.add(e), r.push(e));
1058
1090
  return r;
1059
1091
  }
1060
- function Xe(e) {
1061
- let t = e.indexOf(":"), n = t > 0 ? e.slice(0, t) : "", r = t > 0 ? e.slice(t + 1) : e, i = Ve[n] ?? n;
1092
+ function et(e) {
1093
+ let t = e.indexOf(":"), n = t > 0 ? e.slice(0, t) : "", r = t > 0 ? e.slice(t + 1) : e, i = Ge[n] ?? n;
1062
1094
  return {
1063
1095
  hash: e,
1064
- name: We(r),
1096
+ name: Y(r),
1065
1097
  imagePreviewUrl: "",
1066
1098
  isFree: !0,
1067
1099
  familySlug: n,
@@ -1071,7 +1103,7 @@ function Xe(e) {
1071
1103
  //#endregion
1072
1104
  //#region packages/file-manager/src/utils/svgParseUtils.ts
1073
1105
  var X = "path|rect|circle|ellipse|polygon|line|polyline|g";
1074
- function Ze(e) {
1106
+ function tt(e) {
1075
1107
  let t = e.trim();
1076
1108
  if (/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)) {
1077
1109
  let e = t.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/);
@@ -1132,7 +1164,7 @@ function Q(e, t) {
1132
1164
  let n = RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), r = e.match(n);
1133
1165
  return r ? r[1].trim() : null;
1134
1166
  }
1135
- function Qe(e) {
1167
+ function nt(e) {
1136
1168
  let t = [], n = /* @__PURE__ */ new Set();
1137
1169
  Array.from(e.matchAll(/<stop[^>]*?stop-color\s*=\s*["']([^"']+)["']/gi)).map((e) => e[1]).forEach((e) => {
1138
1170
  let r = Z(e);
@@ -1185,7 +1217,7 @@ function Qe(e) {
1185
1217
  }
1186
1218
  return t;
1187
1219
  }
1188
- function $e(e) {
1220
+ function rt(e) {
1189
1221
  let t = 0, n = RegExp(`<(?:${X})([^>]*)>`, "gi"), r;
1190
1222
  for (; (r = n.exec(e)) !== null;) {
1191
1223
  let e = r[1], n = e.match(/fill\s*=\s*["']([^"']*)["']/i), i = e.match(/style\s*=\s*["']([^"']*)["']/i), a = n && n[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]), o = i && Q(i[1], "fill") && !/^none$/i.test(Q(i[1], "fill"));
@@ -1193,7 +1225,7 @@ function $e(e) {
1193
1225
  }
1194
1226
  return t;
1195
1227
  }
1196
- function et(e) {
1228
+ function it(e) {
1197
1229
  let t = 0, n = RegExp(`<(?:${X})([^>]*)>`, "gi"), r;
1198
1230
  for (; (r = n.exec(e)) !== null;) {
1199
1231
  let e = r[1], n = e.match(/stroke\s*=\s*["']([^"']*)["']/i), i = e.match(/style\s*=\s*["']([^"']*)["']/i), a = n && n[1] && !/^none$/i.test(n[1]) && !/^url\(#/i.test(n[1]), o = i && Q(i[1], "stroke") && !/^none$/i.test(Q(i[1], "stroke"));
@@ -1201,22 +1233,22 @@ function et(e) {
1201
1233
  }
1202
1234
  return t;
1203
1235
  }
1204
- function tt(e) {
1236
+ function at(e) {
1205
1237
  return /<linearGradient/i.test(e) || /<radialGradient/i.test(e) || /fill="url\(#|stroke="url\(#/i.test(e);
1206
1238
  }
1207
- function nt(e) {
1239
+ function $(e) {
1208
1240
  let t = e.trim().replace(/(?:px|em|ex|%)\s*$/i, ""), n = parseFloat(t);
1209
1241
  return Number.isNaN(n) || n <= 0 || n > 10 ? null : Math.round(n * 10) / 10;
1210
1242
  }
1211
- function rt(e) {
1243
+ function ot(e) {
1212
1244
  let t = [], n = e.indexOf("</defs>"), r = n >= 0 ? e.slice(n) : e, i = RegExp(`<(?:${X})[^>]*stroke-width\\s*=\\s*["']([^"']+)["']`, "gi"), a;
1213
1245
  for (; (a = i.exec(r)) !== null;) {
1214
- let e = nt(a[1]);
1246
+ let e = $(a[1]);
1215
1247
  e != null && t.push(e);
1216
1248
  }
1217
1249
  let o = RegExp(`<(?:${X})[^>]*style\\s*=\\s*["'][^"']*stroke-width\\s*:\\s*([^;"]+)[^"']*["']`, "gi");
1218
1250
  for (; (a = o.exec(r)) !== null;) {
1219
- let e = nt(a[1]);
1251
+ let e = $(a[1]);
1220
1252
  e != null && t.push(e);
1221
1253
  }
1222
1254
  if (t.length === 0) return;
@@ -1224,16 +1256,16 @@ function rt(e) {
1224
1256
  let s = Math.floor(t.length / 2);
1225
1257
  return t.length % 2 == 1 ? t[s] : (t[s - 1] + t[s]) / 2;
1226
1258
  }
1227
- function it(e) {
1259
+ function st(e) {
1228
1260
  return {
1229
- colors: Qe(e),
1230
- fillsCount: $e(e),
1231
- strokesCount: et(e),
1232
- hasGradient: tt(e),
1233
- strokeWidth: rt(e)
1261
+ colors: nt(e),
1262
+ fillsCount: rt(e),
1263
+ strokesCount: it(e),
1264
+ hasGradient: at(e),
1265
+ strokeWidth: ot(e)
1234
1266
  };
1235
1267
  }
1236
- function at(e) {
1268
+ function ct(e) {
1237
1269
  let t = [], n = /* @__PURE__ */ new Set(), r = 0, i = 0, a = !1, o;
1238
1270
  for (let s of e) {
1239
1271
  r += s.fillsCount, i += s.strokesCount, s.hasGradient && (a = !0);
@@ -1251,7 +1283,7 @@ function at(e) {
1251
1283
  strokeWidth: o
1252
1284
  };
1253
1285
  }
1254
- function ot(e) {
1286
+ function lt(e) {
1255
1287
  let t = /* @__PURE__ */ new Map(), n = { v: 1 }, r = (e) => {
1256
1288
  let r = Z(e);
1257
1289
  r && !t.has(r) && (t.set(r, n.v), n.v = Math.min(n.v + 1, 3));
@@ -1269,7 +1301,7 @@ function ot(e) {
1269
1301
  }
1270
1302
  return t;
1271
1303
  }
1272
- function st(e) {
1304
+ function ut(e) {
1273
1305
  let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
1274
1306
  let r = Z(e);
1275
1307
  r && !n.has(r) && (n.add(r), t.push(e));
@@ -1291,10 +1323,10 @@ function st(e) {
1291
1323
  }
1292
1324
  //#endregion
1293
1325
  //#region packages/file-manager/src/components/ImageIcons/normalizeSvgForCss.ts
1294
- function ct(e, t) {
1326
+ function dt(e, t) {
1295
1327
  let n = e, r = /<linearGradient[\s\S]*?<\/linearGradient>/i.test(n) || /<radialGradient[\s\S]*?<\/radialGradient>/i.test(n);
1296
1328
  if (!(/fill="url\(#/i.test(n) || /stroke="url\(#/i.test(n))) {
1297
- let e = ot(n), t = (t) => {
1329
+ let e = lt(n), t = (t) => {
1298
1330
  let n = Z(t), r = n ? e.get(n) : void 0;
1299
1331
  return r === 1 ? "var(--em-icon-color-1)" : r === 2 ? "var(--em-icon-color-2)" : r === 3 ? "var(--em-icon-color-3)" : "currentColor";
1300
1332
  };
@@ -1333,8 +1365,8 @@ function ct(e, t) {
1333
1365
  }
1334
1366
  //#endregion
1335
1367
  //#region packages/file-manager/src/components/ImageIcons/useIconifyStock.ts
1336
- var $ = /* @__PURE__ */ new Map();
1337
- function lt(e) {
1368
+ var ft = /* @__PURE__ */ new Map();
1369
+ function pt(e) {
1338
1370
  let t = e.indexOf(":");
1339
1371
  if (t <= 0) return null;
1340
1372
  let n = e.slice(0, t), r = e.slice(t + 1);
@@ -1343,21 +1375,21 @@ function lt(e) {
1343
1375
  slug: r
1344
1376
  } : null;
1345
1377
  }
1346
- function ut(e, t, n) {
1347
- let r = J(e);
1378
+ function mt(e, t, n) {
1379
+ let r = We(e);
1348
1380
  if (!r) throw Error(`Unknown icon set prefix: ${e}`);
1349
- let i = R(r, t);
1381
+ let i = L(r, t);
1350
1382
  if (!i) throw Error(`Unknown icon: ${e}:${t}`);
1351
- let a = V(i, {
1383
+ let a = B(i, {
1352
1384
  width: n,
1353
1385
  height: n
1354
- }), o = Oe(a.body, a.attributes);
1386
+ }), o = V(a.body, a.attributes);
1355
1387
  return o = o.replace(/<svg([^>]*)>/i, (e, t) => `<svg${t.replace(/\swidth="[^"]*"/i, "").replace(/\sheight="[^"]*"/i, "")} width="100%" height="100%">`), o;
1356
1388
  }
1357
- function dt(e) {
1389
+ function ht(e) {
1358
1390
  return {
1359
1391
  fetchSvgDataUrl: b.useCallback(async (t, n) => {
1360
- let r = lt(t);
1392
+ let r = pt(t);
1361
1393
  if (!r) throw Error(`Invalid icon id (expected prefix:name): ${t}`);
1362
1394
  let { prefix: i, slug: a } = r, o = n?.size ?? 96, s = [
1363
1395
  t,
@@ -1365,25 +1397,25 @@ function dt(e) {
1365
1397
  e ? "" : `c1=${n?.inlineColors?.colorHex ?? ""}|c2=${n?.inlineColors?.colorHex2 ?? ""}|c3=${n?.inlineColors?.colorHex3 ?? ""}`,
1366
1398
  n?.strokeWidth == null ? "" : `sw=${n.strokeWidth}`,
1367
1399
  `s=${o}`
1368
- ].filter(Boolean).join("|"), l = $.get(s);
1400
+ ].filter(Boolean).join("|"), l = ft.get(s);
1369
1401
  if (l) return l;
1370
1402
  if (n?.signal?.aborted) throw new DOMException("Aborted", "AbortError");
1371
- await Be();
1372
- let u = ut(i, a, o), d = u;
1373
- e ? d = ct(d, { strokeWidth: n?.strokeWidth }) : n?.inlineColors && (d = c(d, n.inlineColors));
1403
+ await Ue();
1404
+ let u = mt(i, a, o), d = u;
1405
+ e ? d = dt(d, { strokeWidth: n?.strokeWidth }) : n?.inlineColors && (d = c(d, n.inlineColors));
1374
1406
  let f = `data:image/svg+xml;utf8,${encodeURIComponent(d)}`, p = {
1375
1407
  text: d,
1376
1408
  url: f,
1377
1409
  original: u
1378
1410
  };
1379
- return $.set(s, p), p;
1411
+ return ft.set(s, p), p;
1380
1412
  }, [e]),
1381
- normalizeSvgForCss: ct
1413
+ normalizeSvgForCss: dt
1382
1414
  };
1383
1415
  }
1384
1416
  //#endregion
1385
1417
  //#region packages/file-manager/src/components/ImageIcons/useIconsCopyToFolder.tsx
1386
- async function ft(t) {
1418
+ async function gt(t) {
1387
1419
  let { hashes: n, items: r, folderId: i, dataProviders: o, getPngDataUrlForItem: s, dataUrlToBlob: c, config: u } = t, d = 0, f = 0;
1388
1420
  for (let t of n) {
1389
1421
  let n = r.find((e) => e.hash === t);
@@ -1418,23 +1450,23 @@ async function ft(t) {
1418
1450
  failCount: f
1419
1451
  };
1420
1452
  }
1421
- var pt = ({ items: e, selectedHashes: t, getPngDataUrlForItem: n, dataUrlToBlob: i, clearSelection: a }) => {
1422
- let { t: c } = s(), { options: l, state: d } = o(), f = r(), [m, h] = b.useState(!1), [g] = T.useForm(), [_, v] = b.useState(!1), x = b.useRef(!1), { state: S, actions: { fetchFolders: C, fetchChildFolders: w, handleModalOk: ee } } = u(), { EmptyFolderIcon: E } = y(), { activeFormField: te, setActiveFormField: D, generateMenuItemsFromFolders: ne } = p({
1423
- folders: Array.isArray(S.folders) ? S.folders : [],
1453
+ var _t = ({ items: e, selectedHashes: t, getPngDataUrlForItem: n, dataUrlToBlob: i, clearSelection: a }) => {
1454
+ let { t: c } = s(), { options: l, state: d } = o(), f = r(), [m, h] = b.useState(!1), [g] = C.useForm(), [_, v] = b.useState(!1), x = b.useRef(!1), { state: ee, actions: { fetchFolders: S, fetchChildFolders: te, handleModalOk: w } } = u(), { EmptyFolderIcon: T } = y(), { activeFormField: ne, setActiveFormField: E, generateMenuItemsFromFolders: re } = p({
1455
+ folders: Array.isArray(ee.folders) ? ee.folders : [],
1424
1456
  selectedFolder: d.selectedFolder,
1425
- EmptyFolderIcon: E,
1426
- handleCreateFolderModalOk: ee,
1457
+ EmptyFolderIcon: T,
1458
+ handleCreateFolderModalOk: w,
1427
1459
  setIsLoading: v,
1428
1460
  t: c
1429
- }), re = b.useCallback(async () => {
1430
- await C(), h(!0);
1431
- }, [C]), ie = b.useCallback(async (e) => {
1432
- e.length > 0 && (g.setFieldsValue({ targetFolder: e[0] }), te !== e[0].toString() && D(""));
1461
+ }), ie = b.useCallback(async () => {
1462
+ await S(), h(!0);
1463
+ }, [S]), ae = b.useCallback(async (e) => {
1464
+ e.length > 0 && (g.setFieldsValue({ targetFolder: e[0] }), ne !== e[0].toString() && E(""));
1433
1465
  }, [
1434
- te,
1466
+ ne,
1435
1467
  g,
1436
- D
1437
- ]), O = b.useCallback(async (r) => {
1468
+ E
1469
+ ]), D = b.useCallback(async (r) => {
1438
1470
  try {
1439
1471
  let { dataProviders: o } = l;
1440
1472
  if (!o || !o.uploadFile && !o.uploadFiles) {
@@ -1447,7 +1479,7 @@ var pt = ({ items: e, selectedHashes: t, getPngDataUrlForItem: n, dataUrlToBlob:
1447
1479
  }
1448
1480
  let s = r || d?.selectedFolder || void 0, u = Array.from(t);
1449
1481
  if (u.length === 0) return;
1450
- let { successCount: p, failCount: m } = await ft({
1482
+ let { successCount: p, failCount: m } = await gt({
1451
1483
  hashes: u,
1452
1484
  items: e,
1453
1485
  folderId: s,
@@ -1528,41 +1560,41 @@ var pt = ({ items: e, selectedHashes: t, getPngDataUrlForItem: n, dataUrlToBlob:
1528
1560
  isCopyIconsModalVisible: m,
1529
1561
  isCopyLoading: _,
1530
1562
  copyForm: g,
1531
- openCopyModal: re,
1563
+ openCopyModal: ie,
1532
1564
  closeCopyModal: b.useCallback(() => {
1533
- _ || x.current || (h(!1), D(""), v(!1));
1534
- }, [_, D]),
1565
+ _ || x.current || (h(!1), E(""), v(!1));
1566
+ }, [_, E]),
1535
1567
  resetAfterClose: b.useCallback(() => {
1536
- D(""), v(!1);
1537
- }, [D]),
1538
- handleCopyTreeSelect: ie,
1568
+ E(""), v(!1);
1569
+ }, [E]),
1570
+ handleCopyTreeSelect: ae,
1539
1571
  handleIconsCopyOk: b.useCallback(async (e) => {
1540
1572
  if (!x.current) {
1541
1573
  x.current = !0, v(!0);
1542
1574
  try {
1543
- await O(e ?? null), h(!1), D("");
1575
+ await D(e ?? null), h(!1), E("");
1544
1576
  } finally {
1545
1577
  x.current = !1, v(!1);
1546
1578
  }
1547
1579
  }
1548
- }, [O, D]),
1580
+ }, [D, E]),
1549
1581
  handleCreateFolderAndCopy: b.useCallback(() => {
1550
1582
  let e = d.selectedFolder ?? "folders";
1551
- D(e), g.setFieldsValue({
1583
+ E(e), g.setFieldsValue({
1552
1584
  folderName: c("New folder"),
1553
1585
  targetFolder: e
1554
1586
  });
1555
1587
  }, [
1556
1588
  g,
1557
1589
  d.selectedFolder,
1558
- D,
1590
+ E,
1559
1591
  c
1560
1592
  ]),
1561
- fetchChildFolders: w,
1562
- generateMenuItemsFromFolders: ne
1593
+ fetchChildFolders: te,
1594
+ generateMenuItemsFromFolders: re
1563
1595
  };
1564
- }, mt = 30, ht = 30, gt = 8;
1565
- async function _t(e, t, n) {
1596
+ }, vt = 30, yt = 30, bt = 8;
1597
+ async function xt(e, t, n) {
1566
1598
  if (e.length === 0) return [];
1567
1599
  let r = Array(e.length), i = 0, a = Math.max(1, Math.min(t, e.length)), o = async () => {
1568
1600
  for (;;) {
@@ -1573,32 +1605,32 @@ async function _t(e, t, n) {
1573
1605
  };
1574
1606
  return await Promise.all(Array.from({ length: a }, () => o())), r;
1575
1607
  }
1576
- var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1577
- let { t: u } = s(), d = n(), [p, m] = b.useState(""), h = r === void 0 ? p : r, v = a === void 0 ? m : a, [y, S] = b.useState(""), [C, E] = b.useState([]), [ae, le] = b.useState(0), [fe, pe] = b.useState(!1), [j, me] = b.useState(!1), [ge, _e] = b.useState(!1), [ye, M] = b.useState(null), [N, be] = b.useState({}), [P, xe] = b.useState({}), [F, Se] = b.useState("#000000"), [I, L] = b.useState("#ff007a"), [R, Ce] = b.useState("#00C2FF"), [z, we] = b.useState(1), [B, Te] = b.useState(50), [Ee, De] = b.useState(!1), { options: V } = o(), Oe = V.config, H = b.useRef(!1), U = b.useRef(null), ke = b.useRef(0), Ae = b.useRef(null), je = b.useRef(null), Me = b.useRef(void 0);
1578
- Me.current = ve(V?.config);
1579
- let Ne = b.useRef(V?.config?.locale);
1580
- Ne.current = V?.config?.locale;
1581
- let Pe = b.useRef(null), W = b.useRef(/* @__PURE__ */ new Set()), Fe = b.useRef(null), G = b.useRef(/* @__PURE__ */ new Set()), [K, q] = b.useState(/* @__PURE__ */ new Set()), Le = b.useRef([]), Re = b.useRef(null), { fetchSvgDataUrl: ze, normalizeSvgForCss: Be } = dt(!0), J = b.useMemo(() => {
1582
- if (C.length === 0) return null;
1583
- let e = new Set(C.map((e) => e.hash)), t = Object.keys(P).some((t) => e.has(t)) ? P : N, n = C.map((e) => t[e.hash]).filter((e) => !!e);
1584
- return n.length === 0 ? null : at(n.map((e) => it(e)));
1608
+ var St = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1609
+ let { t: u } = s(), d = n(), [p, m] = b.useState(""), h = r === void 0 ? p : r, v = a === void 0 ? m : a, [y, ee] = b.useState(""), [S, T] = b.useState([]), [oe, ue] = b.useState(0), [pe, me] = b.useState(!1), [A, he] = b.useState(!1), [_e, ve] = b.useState(!1), [be, j] = b.useState(null), [M, xe] = b.useState({}), [N, Se] = b.useState({}), [P, Ce] = b.useState("#000000"), [F, I] = b.useState("#ff007a"), [L, we] = b.useState("#00C2FF"), [R, Te] = b.useState(1), [z, Ee] = b.useState(50), [De, Oe] = b.useState(!1), { options: B } = o(), V = B.config, H = b.useRef(!1), U = b.useRef(null), ke = b.useRef(0), Ae = b.useRef(null), je = b.useRef(null), Me = b.useRef(void 0);
1610
+ Me.current = ye(B?.config);
1611
+ let Ne = b.useRef(B?.config?.locale);
1612
+ Ne.current = B?.config?.locale;
1613
+ let Pe = b.useRef(null), Fe = b.useRef(/* @__PURE__ */ new Set()), Ie = b.useRef(null), Le = b.useRef(/* @__PURE__ */ new Set()), [W, G] = b.useState(/* @__PURE__ */ new Set()), K = b.useRef([]), q = b.useRef(null), { fetchSvgDataUrl: ze, normalizeSvgForCss: Be } = ht(!0), J = b.useMemo(() => {
1614
+ if (S.length === 0) return null;
1615
+ let e = new Set(S.map((e) => e.hash)), t = Object.keys(N).some((t) => e.has(t)) ? N : M, n = S.map((e) => t[e.hash]).filter((e) => !!e);
1616
+ return n.length === 0 ? null : ct(n.map((e) => st(e)));
1585
1617
  }, [
1586
- C,
1587
- P,
1588
- N
1618
+ S,
1619
+ N,
1620
+ M
1589
1621
  ]), Ve = !!J?.hasGradient, He = b.useMemo(() => {
1590
1622
  let e = t("icon-color-2", "i");
1591
- return C.some((t) => {
1592
- let n = N[t.hash];
1623
+ return S.some((t) => {
1624
+ let n = M[t.hash];
1593
1625
  return !!n && e.test(n);
1594
1626
  });
1595
- }, [C, N]), Ue = b.useMemo(() => {
1627
+ }, [S, M]), Ue = b.useMemo(() => {
1596
1628
  let e = t("icon-color-3", "i");
1597
- return C.some((t) => {
1598
- let n = N[t.hash];
1629
+ return S.some((t) => {
1630
+ let n = M[t.hash];
1599
1631
  return !!n && e.test(n);
1600
1632
  });
1601
- }, [C, N]), We = b.useMemo(() => J ? Ve || J.colors.length >= 2 && He : !1, [
1633
+ }, [S, M]), We = b.useMemo(() => J ? Ve || J.colors.length >= 2 && He : !1, [
1602
1634
  J,
1603
1635
  Ve,
1604
1636
  !0,
@@ -1609,46 +1641,51 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1609
1641
  Ue
1610
1642
  ]);
1611
1643
  b.useEffect(() => {
1612
- Ie({
1613
- baseUrl: Oe?.baseUrl,
1614
- path: Oe?.iconSetsUrl
1644
+ Re({
1645
+ baseUrl: V?.baseUrl,
1646
+ path: V?.iconSetsUrl,
1647
+ load: V?.loadIconSet
1615
1648
  });
1616
- }, [Oe?.baseUrl, Oe?.iconSetsUrl]), b.useEffect(() => (H.current = !0, () => {
1649
+ }, [
1650
+ V?.baseUrl,
1651
+ V?.iconSetsUrl,
1652
+ V?.loadIconSet
1653
+ ]), b.useEffect(() => (H.current = !0, () => {
1617
1654
  H.current = !1;
1618
1655
  try {
1619
- Pe.current?.abort(), Fe.current?.abort();
1656
+ Pe.current?.abort(), Ie.current?.abort();
1620
1657
  } catch {}
1621
1658
  }), []);
1622
1659
  let Ke = b.useRef(h), qe = b.useCallback(async (e) => {
1623
1660
  let t = e.override?.query ?? y;
1624
- if (!t || t.trim().length < 3 || (e.initial ? j : ge || j) || !H.current) return;
1625
- e.initial ? (Le.current = e.override?.stockIds === void 0 ? await Je(t) : e.override.stockIds, me(!0), E([]), be({}), xe({}), le(0), pe(!1)) : _e(!0);
1626
- let n = Le.current, r = e.initial ? 0 : ae, i = e.initial ? mt : ht, a = `${t}|${r}|${i}|${e.initial ? "i" : "m"}`;
1627
- if (!G.current.has(a)) {
1628
- G.current.add(a);
1661
+ if (!t || t.trim().length < 3 || (e.initial ? A : _e || A) || !H.current) return;
1662
+ e.initial ? (K.current = e.override?.stockIds === void 0 ? await Qe(t) : e.override.stockIds, he(!0), T([]), xe({}), Se({}), ue(0), me(!1)) : ve(!0);
1663
+ let n = K.current, r = e.initial ? 0 : oe, i = e.initial ? vt : yt, a = `${t}|${r}|${i}|${e.initial ? "i" : "m"}`;
1664
+ if (!Le.current.has(a)) {
1665
+ Le.current.add(a);
1629
1666
  try {
1630
- let t = n.slice(r, r + i).map(Xe);
1667
+ let t = n.slice(r, r + i).map(et);
1631
1668
  if (!H.current) return;
1632
1669
  if (e.initial) {
1633
1670
  let e = t.filter((e, t, n) => n.findIndex((t) => t.hash === e.hash) === t);
1634
- E(e);
1635
- } else E((e) => {
1671
+ T(e);
1672
+ } else T((e) => {
1636
1673
  let n = new Set(e.map((e) => e.hash)), r = t.filter((e) => !n.has(e.hash));
1637
1674
  return r.length > 0 ? [...e, ...r] : e;
1638
1675
  });
1639
- pe(r + t.length < n.length), le(r + t.length);
1676
+ me(r + t.length < n.length), ue(r + t.length);
1640
1677
  } catch (e) {
1641
1678
  if (e?.name === "AbortError") return;
1642
1679
  console.error(e), d.error(u("Request error"));
1643
1680
  } finally {
1644
- H.current && (e.initial ? me(!1) : _e(!1)), G.current.delete(a);
1681
+ H.current && (e.initial ? he(!1) : ve(!1)), Le.current.delete(a);
1645
1682
  }
1646
1683
  }
1647
1684
  }, [
1648
1685
  y,
1649
- ge,
1650
- j,
1651
- ae,
1686
+ _e,
1687
+ A,
1688
+ oe,
1652
1689
  u
1653
1690
  ]);
1654
1691
  b.useEffect(() => {
@@ -1665,19 +1702,19 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1665
1702
  console.error("IconsTab: translation error", e), i = r;
1666
1703
  }
1667
1704
  if (n !== ke.current) return;
1668
- W.current.clear(), M(null), q(/* @__PURE__ */ new Set()), S(i);
1705
+ Fe.current.clear(), j(null), G(/* @__PURE__ */ new Set()), ee(i);
1669
1706
  let a;
1670
- Me.current && r !== i && (a = Ye(await Je(i), await Je(r))), await je.current?.({
1707
+ Me.current && r !== i && (a = $e(await Qe(i), await Qe(r))), await je.current?.({
1671
1708
  initial: !0,
1672
1709
  override: {
1673
1710
  query: i,
1674
1711
  stockIds: a
1675
1712
  }
1676
1713
  }), Ae.current = t;
1677
- }, []), X = b.useCallback(async () => {
1714
+ }, []), Je = b.useCallback(async () => {
1678
1715
  !h || h.trim().length < 3 || (U.current &&= (window.clearTimeout(U.current), null), await Y(h));
1679
- }, [h, Y]), Z = b.useCallback(() => {
1680
- ke.current += 1, W.current.clear(), Le.current = [], Re.current = null, S(""), E([]), _e(!1), pe(!1), le(0), Ae.current = null, M(null), q(/* @__PURE__ */ new Set()), Se("#000000"), L("#ff007a"), Ce("#00C2FF");
1716
+ }, [h, Y]), Ye = b.useCallback(() => {
1717
+ ke.current += 1, Fe.current.clear(), K.current = [], q.current = null, ee(""), T([]), ve(!1), me(!1), ue(0), Ae.current = null, j(null), G(/* @__PURE__ */ new Set()), Ce("#000000"), I("#ff007a"), we("#00C2FF");
1681
1718
  }, []);
1682
1719
  b.useEffect(() => {
1683
1720
  let e = Ke.current;
@@ -1685,7 +1722,7 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1685
1722
  }, [Y]), b.useEffect(() => {
1686
1723
  let e = h.trim();
1687
1724
  if (U.current &&= (window.clearTimeout(U.current), null), e.length < 3) {
1688
- Z();
1725
+ Ye();
1689
1726
  return;
1690
1727
  }
1691
1728
  U.current = window.setTimeout(() => {
@@ -1693,28 +1730,28 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1693
1730
  }, 700);
1694
1731
  }, [
1695
1732
  h,
1696
- Z,
1733
+ Ye,
1697
1734
  Y
1698
1735
  ]);
1699
- let Q = b.useCallback((e) => {
1700
- M(e.hash);
1736
+ let Xe = b.useCallback((e) => {
1737
+ j(e.hash);
1701
1738
  }, []);
1702
1739
  b.useEffect(() => {
1703
- if (C.length === 0) return;
1704
- let e = C.map((e) => e.hash).filter((e) => !N[e]);
1705
- if (e = e.filter((e) => !W.current.has(e)), e.length === 0) return;
1740
+ if (S.length === 0) return;
1741
+ let e = S.map((e) => e.hash).filter((e) => !M[e]);
1742
+ if (e = e.filter((e) => !Fe.current.has(e)), e.length === 0) return;
1706
1743
  let t = !1;
1707
1744
  Pe.current?.abort();
1708
1745
  let n = new AbortController();
1709
- return Pe.current = n, _t(e, gt, (e) => ze(e, {
1710
- strokeWidth: typeof z == "number" ? z : void 0,
1711
- size: B,
1746
+ return Pe.current = n, xt(e, bt, (e) => ze(e, {
1747
+ strokeWidth: typeof R == "number" ? R : void 0,
1748
+ size: z,
1712
1749
  signal: n.signal,
1713
1750
  inlineColors: void 0
1714
1751
  }).then((t) => ({
1715
1752
  h: e,
1716
1753
  r: t
1717
- })).catch((t) => (t?.name === "AbortError" || W.current.add(e), {
1754
+ })).catch((t) => (t?.name === "AbortError" || Fe.current.add(e), {
1718
1755
  h: e,
1719
1756
  r: null
1720
1757
  }))).then((e) => {
@@ -1722,10 +1759,10 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1722
1759
  let n = {}, r = {};
1723
1760
  e.forEach((e) => {
1724
1761
  e && e.h && e.r && (n[e.h] = e.r.text, e.r.original && (r[e.h] = e.r.original));
1725
- }), Object.keys(n).length > 0 && be((e) => ({
1762
+ }), Object.keys(n).length > 0 && xe((e) => ({
1726
1763
  ...e,
1727
1764
  ...n
1728
- })), Object.keys(r).length > 0 && xe((e) => ({
1765
+ })), Object.keys(r).length > 0 && Se((e) => ({
1729
1766
  ...e,
1730
1767
  ...r
1731
1768
  }));
@@ -1733,77 +1770,77 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1733
1770
  t = !0, n.abort();
1734
1771
  };
1735
1772
  }, [
1773
+ P,
1736
1774
  F,
1737
- I,
1738
- R,
1775
+ L,
1739
1776
  ze,
1740
- C,
1741
- B,
1777
+ S,
1742
1778
  z,
1743
- N,
1779
+ R,
1780
+ M,
1744
1781
  !0
1745
1782
  ]), b.useEffect(() => {
1746
- if (C.length === 0) return;
1747
- let e = C.map((e) => e.hash), t = {}, n = !1;
1783
+ if (S.length === 0) return;
1784
+ let e = S.map((e) => e.hash), t = {}, n = !1;
1748
1785
  e.forEach((e) => {
1749
- let r = P[e] || N[e];
1786
+ let r = N[e] || M[e];
1750
1787
  if (!r) return;
1751
- let i = Be(r, { strokeWidth: typeof z == "number" ? z : void 0 });
1752
- i && i !== N[e] && (t[e] = i, n = !0);
1753
- }), n && Object.keys(t).length > 0 && be((e) => ({
1788
+ let i = Be(r, { strokeWidth: typeof R == "number" ? R : void 0 });
1789
+ i && i !== M[e] && (t[e] = i, n = !0);
1790
+ }), n && Object.keys(t).length > 0 && xe((e) => ({
1754
1791
  ...e,
1755
1792
  ...t
1756
1793
  }));
1757
1794
  }, [
1758
- C,
1795
+ S,
1759
1796
  Be,
1760
- P,
1761
- z,
1762
- N
1797
+ N,
1798
+ R,
1799
+ M
1763
1800
  ]), b.useEffect(() => {
1764
- if (C.length === 0) return;
1801
+ if (S.length === 0) return;
1765
1802
  let e = y.trim();
1766
- if (!e || Re.current === e) return;
1767
- let t = C.find((e) => P[e.hash]);
1803
+ if (!e || q.current === e) return;
1804
+ let t = S.find((e) => N[e.hash]);
1768
1805
  if (!t) return;
1769
- let n = P[t.hash];
1806
+ let n = N[t.hash];
1770
1807
  if (!n) return;
1771
- Re.current = e;
1772
- let r = st(n), i = (e) => {
1808
+ q.current = e;
1809
+ let r = ut(n), i = (e) => {
1773
1810
  let t = (e || "").trim().match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
1774
- return t ? "#" + (t[1].length === 3 ? t[1].replace(/(.)/g, "$1$1") : t[1]).toLowerCase() : Ze(e);
1811
+ return t ? "#" + (t[1].length === 3 ? t[1].replace(/(.)/g, "$1$1") : t[1]).toLowerCase() : tt(e);
1775
1812
  };
1776
- r[0] && Se(i(r[0])), r[1] && L(i(r[1])), r[2] && Ce(i(r[2]));
1813
+ r[0] && Ce(i(r[0])), r[1] && I(i(r[1])), r[2] && we(i(r[2]));
1777
1814
  }, [
1778
1815
  y,
1779
- C,
1780
- P
1816
+ S,
1817
+ N
1781
1818
  ]);
1782
- let Qe = b.useCallback((e) => c(e, {
1783
- colorHex: F,
1784
- colorHex2: I,
1785
- colorHex3: R
1819
+ let Ze = b.useCallback((e) => c(e, {
1820
+ colorHex: P,
1821
+ colorHex2: F,
1822
+ colorHex3: L
1786
1823
  }), [
1824
+ P,
1787
1825
  F,
1788
- I,
1789
- R
1790
- ]), $e = b.useCallback((e) => {
1791
- q((t) => {
1826
+ L
1827
+ ]), X = b.useCallback((e) => {
1828
+ G((t) => {
1792
1829
  let n = new Set(t);
1793
1830
  return n.has(e) ? n.delete(e) : n.add(e), n;
1794
1831
  });
1795
- }, []), et = b.useCallback(() => {
1796
- q(/* @__PURE__ */ new Set());
1797
- }, []), tt = b.useMemo(() => {
1798
- if (K.size === 1) {
1799
- let [e] = Array.from(K);
1800
- return C.find((t) => t.hash === e) || null;
1832
+ }, []), Z = b.useCallback(() => {
1833
+ G(/* @__PURE__ */ new Set());
1834
+ }, []), Q = b.useMemo(() => {
1835
+ if (W.size === 1) {
1836
+ let [e] = Array.from(W);
1837
+ return S.find((t) => t.hash === e) || null;
1801
1838
  }
1802
- return K.size === 0 && ye && C.find((e) => e.hash === ye) || null;
1839
+ return W.size === 0 && be && S.find((e) => e.hash === be) || null;
1803
1840
  }, [
1804
- C,
1805
- ye,
1806
- K
1841
+ S,
1842
+ be,
1843
+ W
1807
1844
  ]), nt = b.useCallback((e, t = "image/png") => {
1808
1845
  try {
1809
1846
  let n = e.split(",");
@@ -1817,222 +1854,222 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
1817
1854
  }
1818
1855
  }, []), rt = b.useCallback(async (e, t) => {
1819
1856
  try {
1820
- let n = N[e.hash] || P[e.hash];
1857
+ let n = M[e.hash] || N[e.hash];
1821
1858
  n ||= (await ze(e.hash, {
1822
- strokeWidth: typeof z == "number" ? z : void 0,
1823
- size: B,
1859
+ strokeWidth: typeof R == "number" ? R : void 0,
1860
+ size: z,
1824
1861
  signal: t,
1825
1862
  inlineColors: void 0
1826
1863
  })).text;
1827
- let r = Qe(n), a = f(r, B);
1864
+ let r = Ze(n), a = f(r, z);
1828
1865
  return i(r, a.width, a.height);
1829
1866
  } catch {
1830
1867
  return null;
1831
1868
  }
1832
1869
  }, [
1833
- Qe,
1870
+ Ze,
1871
+ P,
1834
1872
  F,
1835
- I,
1836
- R,
1873
+ L,
1837
1874
  ze,
1838
- P,
1839
- B,
1840
- z,
1841
1875
  N,
1876
+ z,
1877
+ R,
1878
+ M,
1842
1879
  !0
1843
- ]), ot = b.useCallback(async (t) => {
1880
+ ]), it = b.useCallback(async (t) => {
1844
1881
  try {
1845
1882
  if (!H.current) return;
1846
- De(!0), Fe.current?.abort();
1883
+ Oe(!0), Ie.current?.abort();
1847
1884
  let n = new AbortController();
1848
- Fe.current = n;
1885
+ Ie.current = n;
1849
1886
  let r = await rt(t, n.signal);
1850
1887
  if (!H.current || !r) return;
1851
1888
  await Promise.resolve(e(r));
1852
1889
  } catch (e) {
1853
1890
  console.error("IconsTab: insert error", e), d.error(u("Request error"));
1854
1891
  } finally {
1855
- H.current && De(!1);
1892
+ H.current && Oe(!1);
1856
1893
  }
1857
1894
  }, [
1858
1895
  e,
1859
1896
  rt,
1860
1897
  u
1861
- ]), { isCopyIconsModalVisible: ct, isCopyLoading: $, copyForm: lt, openCopyModal: ut, closeCopyModal: ft, resetAfterClose: vt, handleCopyTreeSelect: yt, handleIconsCopyOk: bt, fetchChildFolders: xt, generateMenuItemsFromFolders: St, handleCreateFolderAndCopy: Ct } = pt({
1862
- items: C,
1863
- selectedHashes: K,
1898
+ ]), { isCopyIconsModalVisible: at, isCopyLoading: $, copyForm: ot, openCopyModal: lt, closeCopyModal: dt, resetAfterClose: ft, handleCopyTreeSelect: pt, handleIconsCopyOk: mt, fetchChildFolders: gt, generateMenuItemsFromFolders: St, handleCreateFolderAndCopy: Ct } = _t({
1899
+ items: S,
1900
+ selectedHashes: W,
1864
1901
  getPngDataUrlForItem: rt,
1865
1902
  dataUrlToBlob: nt,
1866
- clearSelection: et
1867
- }), wt = !!y.trim() && (C.length > 0 || j), Tt = wt && K.size > 0;
1868
- return /* @__PURE__ */ k(ie, { children: [/* @__PURE__ */ k("div", {
1869
- className: `${A.iconsTab} ${y.trim() ? A.hasSearch : ""}`,
1903
+ clearSelection: Z
1904
+ }), wt = !!y.trim() && (S.length > 0 || A), Tt = wt && W.size > 0;
1905
+ return /* @__PURE__ */ O(ae, { children: [/* @__PURE__ */ O("div", {
1906
+ className: `${k.iconsTab} ${y.trim() ? k.hasSearch : ""}`,
1870
1907
  children: [
1871
- wt && Tt ? /* @__PURE__ */ k("div", {
1872
- className: A.iconsHeaderContainer,
1873
- children: [/* @__PURE__ */ k("div", {
1874
- className: A.iconsHeaderContainerLeft,
1875
- children: [/* @__PURE__ */ k(re.Text, {
1908
+ wt && Tt ? /* @__PURE__ */ O("div", {
1909
+ className: k.iconsHeaderContainer,
1910
+ children: [/* @__PURE__ */ O("div", {
1911
+ className: k.iconsHeaderContainerLeft,
1912
+ children: [/* @__PURE__ */ O(ie.Text, {
1876
1913
  type: "secondary",
1877
1914
  children: [
1878
- K.size,
1915
+ W.size,
1879
1916
  " ",
1880
1917
  u("selected")
1881
1918
  ]
1882
- }), /* @__PURE__ */ O(x, {
1883
- icon: /* @__PURE__ */ O(ce, { size: 16 }),
1884
- onClick: et,
1919
+ }), /* @__PURE__ */ D(x, {
1920
+ icon: /* @__PURE__ */ D(le, { size: 16 }),
1921
+ onClick: Z,
1885
1922
  children: u("Deselected")
1886
1923
  })]
1887
- }), /* @__PURE__ */ O(D, { children: /* @__PURE__ */ O(x, {
1888
- icon: /* @__PURE__ */ O(se, { size: 16 }),
1889
- onClick: ut,
1924
+ }), /* @__PURE__ */ D(E, { children: /* @__PURE__ */ D(x, {
1925
+ icon: /* @__PURE__ */ D(ce, { size: 16 }),
1926
+ onClick: lt,
1890
1927
  children: u("Copy to folder")
1891
1928
  }) })]
1892
- }) : /* @__PURE__ */ O(ue, {
1929
+ }) : /* @__PURE__ */ D(de, {
1893
1930
  query: h,
1894
1931
  onQueryChange: v,
1895
- onSubmit: X,
1896
- hasResults: C.length > 0 || j,
1932
+ onSubmit: Je,
1933
+ hasResults: S.length > 0 || A,
1897
1934
  inputRef: l
1898
1935
  }),
1899
- wt ? /* @__PURE__ */ O(de, {
1900
- colorHex: F,
1901
- setColorHex: Se,
1902
- colorHex2: I,
1903
- setColorHex2: L,
1904
- colorHex3: R,
1905
- setColorHex3: Ce,
1906
- sizePx: B,
1907
- setSizePx: Te,
1908
- strokeWidth: z,
1909
- setStrokeWidth: we,
1936
+ wt ? /* @__PURE__ */ D(fe, {
1937
+ colorHex: P,
1938
+ setColorHex: Ce,
1939
+ colorHex2: F,
1940
+ setColorHex2: I,
1941
+ colorHex3: L,
1942
+ setColorHex3: we,
1943
+ sizePx: z,
1944
+ setSizePx: Ee,
1945
+ strokeWidth: R,
1946
+ setStrokeWidth: Te,
1910
1947
  showSecondColor: We,
1911
1948
  showThirdColor: Ge
1912
1949
  }) : null,
1913
- /* @__PURE__ */ O(he, {
1914
- items: C,
1915
- loading: j,
1916
- isCollectingResults: ge,
1917
- hasMore: fe,
1950
+ /* @__PURE__ */ D(ge, {
1951
+ items: S,
1952
+ loading: A,
1953
+ isCollectingResults: _e,
1954
+ hasMore: pe,
1918
1955
  hasQuery: !!y.trim(),
1919
- selectedHash: ye,
1920
- onItemClick: Q,
1921
- onInsert: ot,
1956
+ selectedHash: be,
1957
+ onItemClick: Xe,
1958
+ onInsert: it,
1922
1959
  onLoadMore: () => {
1923
1960
  qe({ initial: !1 }).catch(() => {});
1924
1961
  },
1925
1962
  colorVars: {
1926
- colorHex: F,
1927
- colorHex2: I,
1928
- colorHex3: R
1963
+ colorHex: P,
1964
+ colorHex2: F,
1965
+ colorHex3: L
1929
1966
  },
1930
- svgTextMap: N,
1931
- previewSize: B,
1932
- selectedHashes: K,
1933
- onToggleSelect: $e
1967
+ svgTextMap: M,
1968
+ previewSize: z,
1969
+ selectedHashes: W,
1970
+ onToggleSelect: X
1934
1971
  }),
1935
- tt ? /* @__PURE__ */ k("div", {
1936
- className: A.iconsBottomBar,
1937
- children: [/* @__PURE__ */ O(w, { className: "zero-divider" }), /* @__PURE__ */ O("div", {
1938
- className: A.iconsBottomBarContent,
1939
- children: /* @__PURE__ */ O(D, { children: /* @__PURE__ */ O(x, {
1972
+ Q ? /* @__PURE__ */ O("div", {
1973
+ className: k.iconsBottomBar,
1974
+ children: [/* @__PURE__ */ D(te, { className: "zero-divider" }), /* @__PURE__ */ D("div", {
1975
+ className: k.iconsBottomBarContent,
1976
+ children: /* @__PURE__ */ D(E, { children: /* @__PURE__ */ D(x, {
1940
1977
  size: "large",
1941
1978
  type: "primary",
1942
1979
  style: { height: 40 },
1943
- loading: Ee,
1944
- onClick: () => ot(tt),
1980
+ loading: De,
1981
+ onClick: () => it(Q),
1945
1982
  children: u("Choose")
1946
1983
  }) })
1947
1984
  })]
1948
1985
  }) : null
1949
1986
  ]
1950
- }), /* @__PURE__ */ O(te, {
1951
- title: /* @__PURE__ */ O("div", {
1987
+ }), /* @__PURE__ */ D(ne, {
1988
+ title: /* @__PURE__ */ D("div", {
1952
1989
  className: "modal-title",
1953
1990
  children: u("Copy to folder")
1954
1991
  }),
1955
- open: ct,
1992
+ open: at,
1956
1993
  onCancel: () => {
1957
- $ || ft();
1994
+ $ || dt();
1958
1995
  },
1959
1996
  mask: { closable: !$ },
1960
1997
  closable: !$,
1961
1998
  keyboard: !$,
1962
1999
  centered: !0,
1963
- getContainer: V.getModalContainer,
1964
- footer: /* @__PURE__ */ k("div", {
2000
+ getContainer: B.getModalContainer,
2001
+ footer: /* @__PURE__ */ O("div", {
1965
2002
  className: g.formFooter,
1966
- children: [/* @__PURE__ */ k(x, {
2003
+ children: [/* @__PURE__ */ O(x, {
1967
2004
  className: g.folderButton,
1968
2005
  onClick: Ct,
1969
2006
  loading: $,
1970
- children: [/* @__PURE__ */ O(oe, {
2007
+ children: [/* @__PURE__ */ D(se, {
1971
2008
  size: 18,
1972
- strokeWidth: V.config?.iconStrokeWidth
2009
+ strokeWidth: B.config?.iconStrokeWidth
1973
2010
  }), u("Create folder")]
1974
- }), /* @__PURE__ */ O(x, {
2011
+ }), /* @__PURE__ */ D(x, {
1975
2012
  type: "primary",
1976
2013
  className: g.folderButton,
1977
2014
  onClick: () => {
1978
- ft();
2015
+ dt();
1979
2016
  },
1980
2017
  loading: $,
1981
2018
  children: u("Done")
1982
2019
  })]
1983
2020
  }),
1984
- afterClose: () => vt(),
1985
- children: /* @__PURE__ */ k("div", {
1986
- className: A.copyToFolderModalBody,
1987
- children: [$ ? /* @__PURE__ */ O("div", {
1988
- className: A.copyToFolderModalLoadingOverlay,
1989
- children: /* @__PURE__ */ O(ne, { size: "large" })
1990
- }) : null, /* @__PURE__ */ O(T, {
1991
- form: lt,
2021
+ afterClose: () => ft(),
2022
+ children: /* @__PURE__ */ O("div", {
2023
+ className: k.copyToFolderModalBody,
2024
+ children: [$ ? /* @__PURE__ */ D("div", {
2025
+ className: k.copyToFolderModalLoadingOverlay,
2026
+ children: /* @__PURE__ */ D(re, { size: "large" })
2027
+ }) : null, /* @__PURE__ */ D(C, {
2028
+ form: ot,
1992
2029
  layout: "vertical",
1993
2030
  initialValues: {
1994
2031
  targetFolder: "folders",
1995
2032
  folderName: u("New folder"),
1996
2033
  is_force_create: !1
1997
2034
  },
1998
- children: /* @__PURE__ */ k("div", {
2035
+ children: /* @__PURE__ */ O("div", {
1999
2036
  className: g.foldersWrapper,
2000
2037
  children: [
2001
- /* @__PURE__ */ O(T.Item, {
2038
+ /* @__PURE__ */ D(C.Item, {
2002
2039
  name: "targetFolder",
2003
2040
  rules: [{
2004
2041
  required: !0,
2005
2042
  message: u("Select the destination folder")
2006
2043
  }],
2007
2044
  className: g.formItem,
2008
- children: /* @__PURE__ */ O(_, {
2009
- onSelect: yt,
2045
+ children: /* @__PURE__ */ D(_, {
2046
+ onSelect: pt,
2010
2047
  generateMenuItems: () => St({
2011
- targetForm: lt,
2012
- onTreeSelect: yt,
2013
- onComplete: bt,
2048
+ targetForm: ot,
2049
+ onTreeSelect: pt,
2050
+ onComplete: mt,
2014
2051
  actionButtonText: u("Copy here")
2015
2052
  }),
2016
- fetchChildFolders: xt,
2053
+ fetchChildFolders: gt,
2017
2054
  disabledFolders: [],
2018
2055
  mode: "selection",
2019
2056
  className: "folderSelectionTree",
2020
2057
  defaultExpandAll: !0
2021
2058
  })
2022
2059
  }),
2023
- /* @__PURE__ */ O(T.Item, {
2060
+ /* @__PURE__ */ D(C.Item, {
2024
2061
  name: "folderName",
2025
2062
  style: { display: "none" },
2026
2063
  rules: [{
2027
2064
  required: !0,
2028
2065
  validator: (e, t) => typeof t == "string" && t.trim().length === 0 ? Promise.reject(Error(u("Enter the name of the folder"))) : Promise.resolve()
2029
2066
  }],
2030
- children: /* @__PURE__ */ O(ee, {})
2067
+ children: /* @__PURE__ */ D(w, {})
2031
2068
  }),
2032
- /* @__PURE__ */ O(T.Item, {
2069
+ /* @__PURE__ */ D(C.Item, {
2033
2070
  name: "is_force_create",
2034
2071
  style: { display: "none" },
2035
- children: /* @__PURE__ */ O(ee, {})
2072
+ children: /* @__PURE__ */ D(w, {})
2036
2073
  })
2037
2074
  ]
2038
2075
  })
@@ -2041,6 +2078,6 @@ var vt = ({ customRequest: e, query: r, setQuery: a, inputRef: l }) => {
2041
2078
  })] });
2042
2079
  };
2043
2080
  //#endregion
2044
- export { vt as IconsTab, vt as default };
2081
+ export { St as IconsTab, St as default };
2045
2082
 
2046
2083
  //# sourceMappingURL=file-manager-IconsTab.js.map