@blocklet/list 0.14.3 → 0.14.4

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.
Files changed (2) hide show
  1. package/lib/index.es.js +471 -452
  2. package/package.json +5 -4
package/lib/index.es.js CHANGED
@@ -1,55 +1,55 @@
1
- import { jsx as t, jsxs as m, Fragment as F } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as f, Fragment as F } from "react/jsx-runtime";
2
2
  import { styled as D, useTheme as xe } from "@arcblock/ux/lib/Theme";
3
3
  import { Global as we, css as ke } from "@emotion/react";
4
4
  import { ErrorFallback as Z } from "@arcblock/ux/lib/ErrorBoundary";
5
- import { Button as ee, useTheme as Xe, useMediaQuery as N, Drawer as Ye, Box as S, CircularProgress as te, MenuList as Je, SvgIcon as Ke, Popper as Ze, Grow as et, Paper as tt, ClickAwayListener as rt, MenuItem as ot, Stack as I, FormControlLabel as ve, Checkbox as Ce, Typography as L, Link as nt, Grid as me, OutlinedInput as lt, InputAdornment as he } from "@mui/material";
6
- import { ErrorBoundary as at } from "react-error-boundary";
7
- import it from "@iconify-icons/tabler/compass";
8
- import { Icon as Se } from "@iconify/react";
9
- import Be from "@mui/icons-material/Close";
10
- import { createContext as Re, useState as q, useMemo as E, useContext as Pe, useCallback as K, useEffect as j, forwardRef as st, useRef as U, memo as ct, createElement as dt, Fragment as ut } from "react";
11
- import Te from "axios";
12
- import pt from "lodash/orderBy";
5
+ import { Button as ee, useTheme as ve, useMediaQuery as M, Drawer as Je, Box as v, CircularProgress as te, MenuList as Ke, SvgIcon as Ze, Popper as et, Grow as tt, Paper as rt, ClickAwayListener as ot, MenuItem as nt, Stack as I, FormControlLabel as Ce, Checkbox as Se, Typography as L, Link as lt, Grid as me, OutlinedInput as at, InputAdornment as he } from "@mui/material";
6
+ import { ErrorBoundary as it } from "react-error-boundary";
7
+ import st from "@iconify-icons/tabler/compass";
8
+ import { Icon as Be } from "@iconify/react";
9
+ import Re from "@mui/icons-material/Close";
10
+ import { createContext as Pe, useState as j, useMemo as E, useContext as Te, useCallback as K, useEffect as q, forwardRef as ct, useRef as U, memo as dt, createElement as ut, Fragment as pt } from "react";
11
+ import { createAxios as Ie } from "@blocklet/js-sdk";
12
+ import mt from "lodash/orderBy";
13
13
  import i from "prop-types";
14
- import { useInfiniteScroll as mt, useRequest as re, useReactive as ht, useDebounceFn as ft } from "ahooks";
15
- import gt from "lodash/omitBy";
16
- import yt from "json-stable-stringify";
14
+ import { useInfiniteScroll as ht, useRequest as re, useReactive as ft, useDebounceFn as gt } from "ahooks";
15
+ import yt from "lodash/omitBy";
16
+ import bt from "json-stable-stringify";
17
17
  import "lodash/cloneDeep";
18
- import bt from "color";
18
+ import xt from "color";
19
+ import { withQuery as Le, joinURL as wt } from "ufo";
19
20
  import fe from "flat";
20
- import xt from "@mui/icons-material/KeyboardArrowDown";
21
- import wt from "lodash/isEmpty";
22
- import Ie from "@mui/material/Box";
23
- import kt from "@arcblock/ux/lib/Avatar";
24
- import vt from "@arcblock/ux/lib/Img";
25
- import Ct from "@iconify-icons/tabler/cloud-download";
26
- import St from "@mui/icons-material/ChevronLeft";
27
- import Bt from "@mui/icons-material/ChevronRight";
28
- import Rt from "react-image-gallery";
21
+ import kt from "@mui/icons-material/KeyboardArrowDown";
22
+ import vt from "lodash/isEmpty";
23
+ import $e from "@mui/material/Box";
24
+ import Ct from "@arcblock/ux/lib/Avatar";
25
+ import St from "@arcblock/ux/lib/Img";
26
+ import Bt from "@iconify-icons/tabler/cloud-download";
27
+ import Rt from "@mui/icons-material/ChevronLeft";
28
+ import Pt from "@mui/icons-material/ChevronRight";
29
+ import Tt from "react-image-gallery";
29
30
  import "react-image-gallery/styles/css/image-gallery.css";
30
- import Pt from "@arcblock/ux/lib/Empty";
31
- import Tt from "react-infinite-scroll-hook";
32
- import Le from "@mui/material/Typography";
33
- import It from "@mui/icons-material/Menu";
34
- import { createRoot as Lt } from "react-dom/client";
35
- import { autocomplete as $t } from "@algolia/autocomplete-js";
36
- import { useHotkeys as zt } from "react-hotkeys-hook";
37
- import { joinURL as _t } from "ufo";
38
- import At from "@mui/icons-material/Search";
31
+ import It from "@arcblock/ux/lib/Empty";
32
+ import Lt from "react-infinite-scroll-hook";
33
+ import _e from "@mui/material/Typography";
34
+ import $t from "@mui/icons-material/Menu";
35
+ import { createRoot as _t } from "react-dom/client";
36
+ import { autocomplete as zt } from "@algolia/autocomplete-js";
37
+ import { useHotkeys as At } from "react-hotkeys-hook";
38
+ import Ft from "@mui/icons-material/Search";
39
39
  import "@algolia/autocomplete-theme-classic/dist/theme.css";
40
- const $e = Re({
40
+ const ze = Pe({
41
41
  open: !1,
42
42
  toggleOpen: (e) => {
43
43
  }
44
44
  });
45
- function Ft({ children: e }) {
46
- const [o, r] = q(!1), n = (l) => {
47
- r(l ?? !l);
48
- }, a = E(() => ({ open: o, toggleOpen: n }), [o]);
49
- return /* @__PURE__ */ t($e.Provider, { value: a, children: e });
45
+ function Dt({ children: e }) {
46
+ const [r, o] = j(!1), n = (l) => {
47
+ o(l ?? !l);
48
+ }, a = E(() => ({ open: r, toggleOpen: n }), [r]);
49
+ return /* @__PURE__ */ t(ze.Provider, { value: a, children: e });
50
50
  }
51
51
  function oe() {
52
- return Pe($e);
52
+ return Te(ze);
53
53
  }
54
54
  const T = {
55
55
  nameAsc: "title",
@@ -65,32 +65,32 @@ const T = {
65
65
  explorePath: "/api/blocklets/explore",
66
66
  exploreDidsPath: "/api/blocklets/dids",
67
67
  cacheSize: 100
68
- }, Dt = (e, o, r, n) => mt(
68
+ }, Mt = (e, r, o, n) => ht(
69
69
  async (a) => {
70
- a || (r.currentPage = r.defaultCurrentPage);
71
- const { currentPage: l, pageSize: d } = r, u = {
72
- ...o,
73
- category: o.category === "All" ? "" : o.category,
74
- sortBy: T[o.sortBy],
70
+ a || (o.currentPage = o.defaultCurrentPage);
71
+ const { currentPage: l, pageSize: c } = o, p = {
72
+ ...r,
73
+ category: r.category === "All" ? "" : r.category,
74
+ sortBy: T[r.sortBy],
75
75
  page: l,
76
- pageSize: d
76
+ pageSize: c
77
77
  };
78
78
  n(null);
79
- const { data: s = {} } = await e.get(T.blockletsPath, { params: u });
80
- return r.currentPage++, { page: l, pageSize: d, list: (s == null ? void 0 : s.dataList) || [], total: (s == null ? void 0 : s.total) || 0 };
79
+ const { data: d = {} } = await e.get(T.blockletsPath, { params: p });
80
+ return o.currentPage++, { page: l, pageSize: c, list: (d == null ? void 0 : d.dataList) || [], total: (d == null ? void 0 : d.total) || 0 };
81
81
  },
82
82
  {
83
83
  isNoMore: (a) => a ? a.page * a.pageSize >= a.total : !1,
84
- reloadDeps: [e, yt(o)],
84
+ reloadDeps: [e, bt(r)],
85
85
  onError: n
86
86
  }
87
87
  ), Et = (e) => re(
88
88
  async () => {
89
- const { data: o } = await e.get(T.categoriesPath);
90
- return Array.isArray(o) ? o : [];
89
+ const { data: r } = await e.get(T.categoriesPath);
90
+ return Array.isArray(r) ? r : [];
91
91
  },
92
92
  { manual: !0 }
93
- ), ze = {
93
+ ), Ae = {
94
94
  filters: i.shape({
95
95
  keyword: i.string,
96
96
  sortBy: i.string,
@@ -114,7 +114,7 @@ const T = {
114
114
  showResourcesSwitch: i.bool,
115
115
  showCategory: i.bool,
116
116
  tagFilters: i.array
117
- }, _e = {
117
+ }, Fe = {
118
118
  locale: "zh",
119
119
  filters: {},
120
120
  serverVersion: "",
@@ -130,7 +130,7 @@ const T = {
130
130
  showResourcesSwitch: !1,
131
131
  showCategory: !0,
132
132
  tagFilters: []
133
- }, Ae = (e) => [
133
+ }, De = (e) => [
134
134
  {
135
135
  name: e("sort.popularity"),
136
136
  value: "popularity"
@@ -143,22 +143,29 @@ const T = {
143
143
  // name: t('sort.rating'),
144
144
  // value: 'rating',
145
145
  // },
146
- ], Mt = (e) => [
146
+ ], Nt = (e, r, o) => {
147
+ var c;
148
+ const n = (c = window.blocklet) == null ? void 0 : c.version, { w: a, h: l } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
149
+ return Le(e, {
150
+ ...a || l ? { imageFilter: "resize", w: a, h: l } : {},
151
+ v: n
152
+ });
153
+ }, Ot = (e) => [
147
154
  { name: e("blocklet.free"), value: "free" },
148
155
  { name: e("blocklet.payment"), value: "payment" }
149
- ], Nt = (e = [], o = "en") => e.map((r) => ({ name: r.locales[o] || r.locales.en, value: r._id })), Ot = (e, o) => (
156
+ ], jt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), qt = (e, r) => (
150
157
  // eslint-disable-next-line no-prototype-builtins
151
- e == null ? void 0 : e.replace(/{(\w*)}/g, (r, n) => o.hasOwnProperty(n) ? o[n] : "")
152
- ), qt = () => window.innerWidth <= 600, jt = (e) => bt(e).rgb().object();
153
- function Vt(e, o) {
154
- let r;
158
+ e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
159
+ ), Vt = () => window.innerWidth <= 600, Wt = (e) => xt(e).rgb().object();
160
+ function Ut(e, r) {
161
+ let o;
155
162
  return function(...a) {
156
- return r && clearTimeout(r), new Promise((l) => {
157
- r = setTimeout(() => l(e(...a)), o);
163
+ return o && clearTimeout(o), new Promise((l) => {
164
+ o = setTimeout(() => l(e(...a)), r);
158
165
  });
159
166
  };
160
167
  }
161
- const Wt = Vt((e) => Promise.resolve(e), 300), Ut = {
168
+ const Ht = Ut((e) => Promise.resolve(e), 300), Gt = {
162
169
  common: {
163
170
  title: "Blocklet Store",
164
171
  searchStore: "Search Blocklet",
@@ -206,7 +213,7 @@ const Wt = Vt((e) => Promise.resolve(e), 300), Ut = {
206
213
  autocomplete: {
207
214
  expandResult: 'View all search results for "{name}"'
208
215
  }
209
- }, Ht = {
216
+ }, Qt = {
210
217
  common: {
211
218
  title: "Blocklet 商店",
212
219
  searchStore: "搜索 Blocklet",
@@ -255,15 +262,15 @@ const Wt = Vt((e) => Promise.resolve(e), 300), Ut = {
255
262
  expandResult: "查看 “{name}” 的所有搜索结果"
256
263
  }
257
264
  }, J = {
258
- en: fe(Ut),
259
- zh: fe(Ht)
260
- }, Fe = (e, o) => {
261
- const r = {};
262
- return e && (r["x-blocklet-server-version"] = e), o && (r["x-blocklet-store-version"] = o), r;
263
- }, Gt = (e) => (o, r) => {
264
- const n = J[e] ? J[e][o] : J.en[o];
265
- return Ot(n, r) || o;
266
- }, De = {
265
+ en: fe(Gt),
266
+ zh: fe(Qt)
267
+ }, Me = (e, r) => {
268
+ const o = {};
269
+ return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
270
+ }, Xt = (e) => (r, o) => {
271
+ const n = J[e] ? J[e][r] : J.en[r];
272
+ return qt(n, o) || r;
273
+ }, Ee = {
267
274
  errors: {
268
275
  fetchBlockletsError: null,
269
276
  fetchCategoriesError: null
@@ -317,143 +324,143 @@ const Wt = Vt((e) => Promise.resolve(e), 300), Ut = {
317
324
  developerName: "",
318
325
  handleSearchSelect: () => {
319
326
  }
320
- }, Ee = Re(De), { Provider: Qt, Consumer: Yr } = Ee;
327
+ }, Ne = Pe(Ee), { Provider: Yt, Consumer: Kr } = Ne;
321
328
  function ne({
322
329
  filters: e,
323
- children: o,
324
- endpoint: r,
330
+ children: r,
331
+ endpoint: o,
325
332
  locale: n,
326
333
  blockletRender: a,
327
334
  onFilterChange: l,
328
- onSearchSelect: d,
329
- extraFilter: u,
330
- wrapChildren: s,
331
- baseSearch: v,
332
- serverVersion: f,
333
- storeVersion: y,
334
- fetchCategoryDelay: c,
335
- showResourcesSwitch: w,
336
- showCategory: k,
337
- tagFilters: x
335
+ onSearchSelect: c,
336
+ extraFilter: p,
337
+ wrapChildren: d,
338
+ baseSearch: w,
339
+ serverVersion: y,
340
+ storeVersion: b,
341
+ fetchCategoryDelay: $,
342
+ showResourcesSwitch: B,
343
+ showCategory: S,
344
+ tagFilters: s
338
345
  }) {
339
346
  var ue;
340
- const z = Fe(f, y), b = E(() => Te.create({ baseURL: r, headers: z }), [r]), h = { sortBy: "popularity", sortDirection: "desc", ...e }, C = h.category, _ = ht({
347
+ const k = Me(y, b), h = E(() => Ie({ baseURL: o, headers: k }), [o]), u = { sortBy: "popularity", sortDirection: "desc", ...e }, x = u.category, z = ft({
341
348
  currentPage: T.currentPage,
342
- pageSize: qt() ? T.mobilePageSize : T.pageSize,
349
+ pageSize: Vt() ? T.mobilePageSize : T.pageSize,
343
350
  defaultCurrentPage: T.defaultCurrentPage
344
- }), [A, $] = q(null), R = Dt(b, h, _, $), {
351
+ }), [A, _] = j(null), R = Mt(h, u, z, _), {
345
352
  data: X = [],
346
- error: We,
347
- loading: Ue,
353
+ error: He,
354
+ loading: Ge,
348
355
  run: se
349
- } = Et(b), Y = E(() => {
350
- const p = pt(X, [(P) => P.name], ["asc"]), g = p.findIndex((P) => P.name === "All" || P.locales.en === "All");
351
- return g > -1 ? [{ ...p[g], _id: "All" }, ...p.slice(0, g), ...p.slice(g + 1)] : p;
356
+ } = Et(h), Y = E(() => {
357
+ const m = mt(X, [(P) => P.name], ["asc"]), g = m.findIndex((P) => P.name === "All" || P.locales.en === "All");
358
+ return g > -1 ? [{ ...m[g], _id: "All" }, ...m.slice(0, g), ...m.slice(g + 1)] : m;
352
359
  }, [X]), ce = E(() => {
353
- var p;
354
- return u(((p = R.data) == null ? void 0 : p.list) || []);
355
- }, [R.data, u]), de = K(Gt(n), [n]), He = E(() => Nt(Y, n), [Y, n]), Ge = Mt(de), Qe = {
356
- errors: { fetchBlockletsError: A, fetchCategoriesError: We },
360
+ var m;
361
+ return p(((m = R.data) == null ? void 0 : m.list) || []);
362
+ }, [R.data, p]), de = K(Xt(n), [n]), Qe = E(() => jt(Y, n), [Y, n]), Xe = Ot(de), Ye = {
363
+ errors: { fetchBlockletsError: A, fetchCategoriesError: He },
357
364
  loadings: {
358
365
  fetchBlockletsLoading: R.loading,
359
- fetchCategoriesLoading: Ue,
366
+ fetchCategoriesLoading: Ge,
360
367
  loadingMore: R.loadingMore
361
368
  },
362
- endpoint: r,
369
+ endpoint: o,
363
370
  blockletList: ce,
364
371
  total: ((ue = R.data) == null ? void 0 : ue.total) || 0,
365
- wrapChildren: s,
372
+ wrapChildren: d,
366
373
  t: de,
367
- storeVersion: y,
368
- serverVersion: f,
369
- filters: h,
370
- selectedCategory: C,
374
+ storeVersion: b,
375
+ serverVersion: y,
376
+ filters: u,
377
+ selectedCategory: x,
371
378
  categoryList: Y,
372
379
  blockletRender: a,
373
380
  locale: n,
374
- categoryOptions: He,
375
- priceOptions: Ge,
376
- storeApi: b,
377
- baseSearch: v,
378
- showResourcesSwitch: w,
379
- showCategory: k,
380
- tagFilters: x,
381
+ categoryOptions: Qe,
382
+ priceOptions: Xe,
383
+ storeApi: h,
384
+ baseSearch: w,
385
+ showResourcesSwitch: B,
386
+ showCategory: S,
387
+ tagFilters: s,
381
388
  hasNextPage: !R.noMore,
382
389
  onFilterChange: l,
383
- cleanFilter: (p) => {
384
- const g = p ? gt(h, (P, M) => p == null ? void 0 : p.includes(M)) : {};
390
+ cleanFilter: (m) => {
391
+ const g = m ? yt(u, (P, N) => m == null ? void 0 : m.includes(N)) : {};
385
392
  l(g);
386
393
  },
387
- handleSort: (p) => {
388
- const g = { ...h, sortBy: p, sortDirection: p === "nameAsc" ? "asc" : "desc" };
394
+ handleSort: (m) => {
395
+ const g = { ...u, sortBy: m, sortDirection: m === "nameAsc" ? "asc" : "desc" };
389
396
  l(g);
390
397
  },
391
- handleKeyword: (p) => {
392
- const g = { ...h, category: void 0, keyword: p || void 0 };
398
+ handleKeyword: (m) => {
399
+ const g = { ...u, category: void 0, keyword: m || void 0 };
393
400
  l(g);
394
401
  },
395
- handlePrice: (p) => {
396
- const g = { ...h, price: p === h.price ? void 0 : p };
402
+ handlePrice: (m) => {
403
+ const g = { ...u, price: m === u.price ? void 0 : m };
397
404
  l(g);
398
405
  },
399
- handleCategory: (p) => {
400
- const g = p === "all" || p === h.category ? "" : p, P = { ...h, category: g };
406
+ handleCategory: (m) => {
407
+ const g = m === "all" || m === u.category ? "" : m, P = { ...u, category: g };
401
408
  l(P);
402
409
  },
403
- handleDeveloper: (p) => {
404
- const g = { ...h, owner: p || void 0 };
410
+ handleDeveloper: (m) => {
411
+ const g = { ...u, owner: m || void 0 };
405
412
  l(g);
406
413
  },
407
- handlePage: (p) => {
408
- const g = { ...h, currentPage: p };
414
+ handlePage: (m) => {
415
+ const g = { ...u, currentPage: m };
409
416
  l(g);
410
417
  },
411
418
  handleSwitchShowResources: () => {
412
- const p = { ...h };
413
- l(p);
419
+ const m = { ...u };
420
+ l(m);
414
421
  },
415
422
  loadMore: R.loadMore,
416
- getCategoryLocale: (p) => {
417
- if (!p)
423
+ getCategoryLocale: (m) => {
424
+ if (!m)
418
425
  return null;
419
- const g = X.find((P) => P._id === p);
426
+ const g = X.find((P) => P._id === m);
420
427
  return g ? g.locales[n] || g.locales.en : null;
421
428
  },
422
429
  get developerName() {
423
430
  var g, P;
424
- return ((P = (g = ce.find((M) => {
431
+ return ((P = (g = ce.find((N) => {
425
432
  var pe;
426
- return ((pe = M == null ? void 0 : M.owner) == null ? void 0 : pe.did) === h.owner;
433
+ return ((pe = N == null ? void 0 : N.owner) == null ? void 0 : pe.did) === u.owner;
427
434
  })) == null ? void 0 : g.owner) == null ? void 0 : P.name) || "";
428
435
  },
429
- handleSearchSelect: d
436
+ handleSearchSelect: c
430
437
  };
431
- return j(() => {
432
- setTimeout(se, c || 0);
433
- }, [r, se, c]), /* @__PURE__ */ t(Qt, { value: Qe, children: o });
438
+ return q(() => {
439
+ setTimeout(se, $ || 0);
440
+ }, [o, se, $]), /* @__PURE__ */ t(Yt, { value: Ye, children: r });
434
441
  }
435
442
  ne.propTypes = {
436
- ...ze,
443
+ ...Ae,
437
444
  children: i.any.isRequired
438
445
  };
439
- ne.defaultProps = _e;
440
- function B() {
441
- const e = Pe(Ee);
442
- return e || De;
446
+ ne.defaultProps = Fe;
447
+ function C() {
448
+ const e = Te(Ne);
449
+ return e || Ee;
443
450
  }
444
- function Me({
451
+ function Oe({
445
452
  children: e,
446
- onClick: o,
447
- size: r = 32
453
+ onClick: r,
454
+ size: o = 32
448
455
  }) {
449
456
  return /* @__PURE__ */ t(
450
457
  ee,
451
458
  {
452
- onClick: o,
459
+ onClick: r,
453
460
  variant: "outlined",
454
461
  sx: {
455
- minWidth: r,
456
- height: r,
462
+ minWidth: o,
463
+ height: o,
457
464
  p: 0,
458
465
  borderColor: "divider",
459
466
  "&:hover": {
@@ -466,43 +473,43 @@ function Me({
466
473
  }
467
474
  );
468
475
  }
469
- function V(e, o) {
470
- return e === void 0 ? o : e;
476
+ function V(e, r) {
477
+ return e === void 0 ? r : e;
471
478
  }
472
479
  function G({
473
480
  xs: e,
474
- sm: o,
475
- md: r,
481
+ sm: r,
482
+ md: o,
476
483
  lg: n,
477
484
  xl: a,
478
485
  exact: l
479
486
  }) {
480
- const d = Xe(), u = N(d.breakpoints.down("sm")), s = N(d.breakpoints.between("sm", "md")), v = N(d.breakpoints.between("md", "lg")), f = N(d.breakpoints.between("lg", "xl"));
487
+ const c = ve(), p = M(c.breakpoints.down("sm")), d = M(c.breakpoints.between("sm", "md")), w = M(c.breakpoints.between("md", "lg")), y = M(c.breakpoints.between("lg", "xl"));
481
488
  if (l)
482
- return u ? e || null : s ? o || null : v ? r || null : f ? n || null : a || null;
483
- let y = e;
484
- return u || (y = V(o, y), s) || (y = V(r, y), v) || (y = V(n, y), f) ? y : V(a, y);
489
+ return p ? e || null : d ? r || null : w ? o || null : y ? n || null : a || null;
490
+ let b = e;
491
+ return p || (b = V(r, b), d) || (b = V(o, b), w) || (b = V(n, b), y) ? b : V(a, b);
485
492
  }
486
- function Xt({ children: e }) {
487
- const { open: o, toggleOpen: r } = oe();
493
+ function Jt({ children: e }) {
494
+ const { open: r, toggleOpen: o } = oe();
488
495
  return /* @__PURE__ */ t(
489
496
  G,
490
497
  {
491
- xs: /* @__PURE__ */ t(Ye, { open: o, onClose: () => r(!1), children: e }),
492
- md: /* @__PURE__ */ t(S, { children: e })
498
+ xs: /* @__PURE__ */ t(Je, { open: r, onClose: () => o(!1), children: e }),
499
+ md: /* @__PURE__ */ t(v, { children: e })
493
500
  }
494
501
  );
495
502
  }
496
- const Yt = D(ee)`
503
+ const Kt = D(ee)`
497
504
  border-radius: 4px;
498
- `, le = st(({ children: e, rounded: o, loading: r, disabled: n, ...a }, l) => /* @__PURE__ */ t(
499
- Yt,
505
+ `, le = ct(({ children: e, rounded: r, loading: o, disabled: n, ...a }, l) => /* @__PURE__ */ t(
506
+ Kt,
500
507
  {
501
508
  ref: l,
502
509
  disableElevation: !0,
503
- disabled: n || r,
510
+ disabled: n || o,
504
511
  ...a,
505
- startIcon: r && /* @__PURE__ */ t(te, { size: "1em" }),
512
+ startIcon: o && /* @__PURE__ */ t(te, { size: "1em" }),
506
513
  children: e
507
514
  }
508
515
  ));
@@ -518,49 +525,49 @@ le.defaultProps = {
518
525
  loading: !1,
519
526
  disabled: !1
520
527
  };
521
- function Q({ title: e, value: o, icon: r, prepend: n, options: a, onChange: l, itemRender: d, ...u }) {
522
- const s = U(null), v = xe(), [f, y] = q(!1), [c, w] = q(o !== null ? o : ""), k = N(v.breakpoints.down("sm"));
523
- j(() => {
524
- w(o !== null ? o : "");
525
- }, [o]);
526
- const x = K(() => {
527
- y(!1);
528
- }, []), z = K(() => {
529
- y(!0);
528
+ function Q({ title: e, value: r, icon: o, prepend: n, options: a, onChange: l, itemRender: c, ...p }) {
529
+ const d = U(null), w = xe(), [y, b] = j(!1), [$, B] = j(r !== null ? r : ""), S = M(w.breakpoints.down("sm"));
530
+ q(() => {
531
+ B(r !== null ? r : "");
532
+ }, [r]);
533
+ const s = K(() => {
534
+ b(!1);
535
+ }, []), k = K(() => {
536
+ b(!0);
530
537
  }, []);
531
- function b(C) {
532
- w(C.value), l(C.value), k && x();
538
+ function h(x) {
539
+ B(x.value), l(x.value), S && s();
533
540
  }
534
- function h(C) {
535
- return C === c;
541
+ function u(x) {
542
+ return x === $;
536
543
  }
537
- return /* @__PURE__ */ m(F, { children: [
538
- /* @__PURE__ */ m(
539
- Jt,
544
+ return /* @__PURE__ */ f(F, { children: [
545
+ /* @__PURE__ */ f(
546
+ Zt,
540
547
  {
541
- ref: s,
542
- onClick: z,
548
+ ref: d,
549
+ onClick: k,
543
550
  variant: "outlined",
544
551
  size: "small",
545
- className: ["my-select__selector", wt(c) ? "" : "my-select__selector--active"].join(" "),
552
+ className: ["my-select__selector", vt($) ? "" : "my-select__selector--active"].join(" "),
546
553
  sx: { minWidth: "auto" },
547
- ...u,
554
+ ...p,
548
555
  children: [
549
- /* @__PURE__ */ t("div", { className: "my-select__icon", children: r }),
556
+ /* @__PURE__ */ t("div", { className: "my-select__icon", children: o }),
550
557
  e,
551
- /* @__PURE__ */ t(Ke, { className: "my-select__arrowdown", component: xt, fontSize: "small" })
558
+ /* @__PURE__ */ t(Ze, { className: "my-select__arrowdown", component: kt, fontSize: "small" })
552
559
  ]
553
560
  }
554
561
  ),
555
- /* @__PURE__ */ t(Ze, { open: f, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: C, placement: _ }) => /* @__PURE__ */ t(et, { ...C, sx: { transformOrigin: _ === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(tt, { children: /* @__PURE__ */ t(rt, { onClickAway: x, children: /* @__PURE__ */ m(Kt, { autoFocusItem: f, onMouseEnter: z, onMouseLeave: x, children: [
562
+ /* @__PURE__ */ t(et, { open: y, anchorEl: d.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: x, placement: z }) => /* @__PURE__ */ t(tt, { ...x, sx: { transformOrigin: z === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(rt, { children: /* @__PURE__ */ t(ot, { onClickAway: s, children: /* @__PURE__ */ f(er, { autoFocusItem: y, onMouseEnter: k, onMouseLeave: s, children: [
556
563
  n,
557
- a.map((A) => d ? d(A) : /* @__PURE__ */ t(
558
- ot,
564
+ a.map((A) => c ? c(A) : /* @__PURE__ */ t(
565
+ nt,
559
566
  {
560
- onClick: () => b(A),
567
+ onClick: () => h(A),
561
568
  className: [
562
569
  "my-select__option",
563
- h(A.value) ? "my-select__option--active" : ""
570
+ u(A.value) ? "my-select__option--active" : ""
564
571
  ].join(" "),
565
572
  children: A.name
566
573
  },
@@ -586,7 +593,7 @@ Q.defaultProps = {
586
593
  onChange: () => {
587
594
  }
588
595
  };
589
- const Jt = D(le)`
596
+ const Zt = D(le)`
590
597
  border: 1px solid #f0f0f0;
591
598
  padding: 6px 8px 6px 12px;
592
599
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -617,7 +624,7 @@ const Jt = D(le)`
617
624
  margin-right: 3px;
618
625
  }
619
626
  }
620
- `, Kt = D(Je)`
627
+ `, er = D(Ke)`
621
628
  .my-select__option__icon {
622
629
  color: transparent;
623
630
  font-size: 14px;
@@ -634,10 +641,10 @@ const Jt = D(le)`
634
641
  }
635
642
  }
636
643
  `;
637
- function Ne() {
638
- var d;
639
- const { filters: e, handleSort: o, handlePrice: r, t: n } = B(), a = Ae(n), l = ((d = a.find((u) => u.value === e.sortBy)) == null ? void 0 : d.name) || n("sort.sort");
640
- return /* @__PURE__ */ m(
644
+ function je() {
645
+ var c;
646
+ const { filters: e, handleSort: r, handlePrice: o, t: n } = C(), a = De(n), l = ((c = a.find((p) => p.value === e.sortBy)) == null ? void 0 : c.name) || n("sort.sort");
647
+ return /* @__PURE__ */ f(
641
648
  I,
642
649
  {
643
650
  direction: { xs: "row", md: "column" },
@@ -647,15 +654,15 @@ function Ne() {
647
654
  justifyContent: "space-between",
648
655
  children: [
649
656
  /* @__PURE__ */ t(
650
- ve,
657
+ Ce,
651
658
  {
652
659
  control: /* @__PURE__ */ t(
653
- Ce,
660
+ Se,
654
661
  {
655
662
  checked: e.price === "free",
656
663
  size: "small",
657
664
  sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
658
- onChange: (u) => r(u.target.checked ? "free" : "")
665
+ onChange: (p) => o(p.target.checked ? "free" : "")
659
666
  }
660
667
  ),
661
668
  label: n("blocklet.free")
@@ -667,7 +674,7 @@ function Ne() {
667
674
  value: e.sortBy,
668
675
  options: a,
669
676
  title: l,
670
- onChange: o,
677
+ onChange: r,
671
678
  icon: null,
672
679
  prepend: null,
673
680
  itemRender: null
@@ -677,13 +684,13 @@ function Ne() {
677
684
  }
678
685
  );
679
686
  }
680
- function Zt() {
681
- const { selectedCategory: e, handleCategory: o, t: r, categoryOptions: n, filters: a, cleanFilter: l, loadings: d } = B(), { toggleOpen: u } = oe();
682
- return /* @__PURE__ */ m(Xt, { children: [
687
+ function tr() {
688
+ const { selectedCategory: e, handleCategory: r, t: o, categoryOptions: n, filters: a, cleanFilter: l, loadings: c } = C(), { toggleOpen: p } = oe();
689
+ return /* @__PURE__ */ f(Jt, { children: [
683
690
  /* @__PURE__ */ t(
684
691
  G,
685
692
  {
686
- xs: /* @__PURE__ */ m(
693
+ xs: /* @__PURE__ */ f(
687
694
  I,
688
695
  {
689
696
  direction: "row",
@@ -695,7 +702,7 @@ function Zt() {
695
702
  borderBottom: 1,
696
703
  borderColor: "divider",
697
704
  children: [
698
- /* @__PURE__ */ t(Me, { onClick: () => u(!1), children: /* @__PURE__ */ t(Be, {}) }),
705
+ /* @__PURE__ */ t(Oe, { onClick: () => p(!1), children: /* @__PURE__ */ t(Re, {}) }),
699
706
  /* @__PURE__ */ t(L, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: "Categories" })
700
707
  ]
701
708
  }
@@ -706,14 +713,14 @@ function Zt() {
706
713
  /* @__PURE__ */ t(
707
714
  I,
708
715
  {
709
- visibility: d.fetchCategoriesLoading ? "hidden" : "visible",
716
+ visibility: c.fetchCategoriesLoading ? "hidden" : "visible",
710
717
  width: { xs: 268, md: 200 },
711
718
  boxSizing: "content-box",
712
719
  p: { xs: 2, md: 0 },
713
720
  pr: { md: 6 },
714
- children: a.keyword ? /* @__PURE__ */ t(Ne, {}) : /* @__PURE__ */ m(F, { children: [
715
- /* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 1, children: [
716
- /* @__PURE__ */ t(Se, { icon: it }),
721
+ children: a.keyword ? /* @__PURE__ */ t(je, {}) : /* @__PURE__ */ f(F, { children: [
722
+ /* @__PURE__ */ f(v, { display: "flex", alignItems: "center", gap: 1, children: [
723
+ /* @__PURE__ */ t(Be, { icon: st }),
717
724
  /* @__PURE__ */ t(
718
725
  L,
719
726
  {
@@ -722,59 +729,59 @@ function Zt() {
722
729
  fontWeight: e ? void 0 : "fontWeightMedium",
723
730
  sx: { cursor: "pointer" },
724
731
  onClick: () => {
725
- u(!1), l();
732
+ p(!1), l();
726
733
  },
727
- children: r("explore.title")
734
+ children: o("explore.title")
728
735
  }
729
736
  )
730
737
  ] }),
731
- !!n.length && /* @__PURE__ */ t(I, { pt: 3, mt: 3, borderTop: 1, borderColor: "divider", gap: 2, children: n.map((s) => /* @__PURE__ */ t(
738
+ !!n.length && /* @__PURE__ */ t(I, { pt: 3, mt: 3, borderTop: 1, borderColor: "divider", gap: 2, children: n.map((d) => /* @__PURE__ */ t(
732
739
  L,
733
740
  {
734
741
  variant: "body1",
735
- title: s.name,
742
+ title: d.name,
736
743
  sx: { cursor: "pointer" },
737
744
  "data-cy": "filter",
738
- color: e === s.value ? "text.primary" : "text.lighter",
745
+ color: e === d.value ? "text.primary" : "text.lighter",
739
746
  textTransform: "capitalize",
740
747
  onClick: () => {
741
- e === s.value ? l() : o(s.value), u(!1);
748
+ e === d.value ? l() : r(d.value), p(!1);
742
749
  },
743
- children: s.name
750
+ children: d.name
744
751
  },
745
- s.value
752
+ d.value
746
753
  )) })
747
754
  ] })
748
755
  }
749
756
  )
750
757
  ] });
751
758
  }
752
- function Oe() {
753
- const { endpoint: e, serverVersion: o, storeVersion: r } = B(), n = Fe(o, r), a = E(() => Te.create({
759
+ function qe() {
760
+ const { endpoint: e, serverVersion: r, storeVersion: o } = C(), n = Me(r, o), a = E(() => Ie({
754
761
  baseURL: e,
755
762
  headers: n
756
763
  }), [e]);
757
764
  return {
758
765
  get: async (l) => {
759
- const { data: d } = await a.get(l);
760
- return d;
766
+ const { data: c } = await a.get(l);
767
+ return c;
761
768
  },
762
- post: async (l, d) => {
763
- const { data: u } = await a.post(l, d);
764
- return u;
769
+ post: async (l, c) => {
770
+ const { data: p } = await a.post(l, c);
771
+ return p;
765
772
  }
766
773
  };
767
774
  }
768
- const qe = ct(function(o) {
769
- return /* @__PURE__ */ t(Ie, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...o, children: /* @__PURE__ */ t(te, {}) });
775
+ const Ve = dt(function(r) {
776
+ return /* @__PURE__ */ t($e, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(te, {}) });
770
777
  });
771
778
  function ge({
772
779
  icon: e,
773
- children: o,
774
- maxWidth: r = 100,
780
+ children: r,
781
+ maxWidth: o = 100,
775
782
  title: n
776
783
  }) {
777
- return (o === 0 || o) && /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: r, overflow: "hidden" }, children: [
784
+ return (r === 0 || r) && /* @__PURE__ */ f(I, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
778
785
  e,
779
786
  /* @__PURE__ */ t(
780
787
  L,
@@ -782,19 +789,23 @@ function ge({
782
789
  flex: 1,
783
790
  variant: "body2",
784
791
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
785
- title: n || (typeof o == "string" ? o : void 0),
786
- children: o
792
+ title: n || (typeof r == "string" ? r : void 0),
793
+ children: r
787
794
  }
788
795
  )
789
796
  ] });
790
797
  }
791
798
  const ye = 292;
792
- function er() {
793
- var f, y;
794
- const { t: e } = B(), { post: o } = Oe(), r = ((y = (f = window.blocklet) == null ? void 0 : f.preferences) == null ? void 0 : y.homeBanner) || [], { data: n = [] } = re(async () => {
795
- const c = await o(T.exploreDidsPath, { didList: r.map((w) => w.did) });
796
- return Array.isArray(c) ? c : [];
797
- }), a = {
799
+ function rr() {
800
+ var B, S;
801
+ const { t: e } = C(), { get: r } = qe(), o = ve(), n = M(o.breakpoints.down("md")), a = ((S = (B = window.blocklet) == null ? void 0 : B.preferences) == null ? void 0 : S.homeBanner) || [], { data: l = [], error: c } = re(async () => {
802
+ const s = await r(
803
+ Le(T.blockletsPath, { didList: a.map((k) => k.did).join(",") })
804
+ );
805
+ return s != null && s.dataList ? a.map((k) => s.dataList.find((h) => h.did === k.did)) : [];
806
+ });
807
+ c && console.error("Get Banner Blocklets error:", c);
808
+ const p = {
798
809
  position: "absolute",
799
810
  top: "50%",
800
811
  transform: "translateY(-50%)",
@@ -802,13 +813,12 @@ function er() {
802
813
  cursor: "pointer",
803
814
  color: "text.lighter"
804
815
  };
805
- return r.length > 0 ? /* @__PURE__ */ m(F, { children: [
816
+ return !c && a.length > 0 ? /* @__PURE__ */ f(F, { children: [
806
817
  /* @__PURE__ */ t(L, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
807
- /* @__PURE__ */ t(S, { height: { xs: "auto", md: ye }, position: "relative", bgcolor: "#F0F7FF", borderRadius: 3, children: /* @__PURE__ */ t(
808
- Rt,
818
+ /* @__PURE__ */ t(v, { height: { xs: "auto", md: ye }, position: "relative", bgcolor: "#F0F7FF", borderRadius: 3, children: /* @__PURE__ */ t(
819
+ Tt,
809
820
  {
810
821
  showNav: !0,
811
- autoPlay: !0,
812
822
  slideDuration: 1e3,
813
823
  slideInterval: 5e3,
814
824
  showPlayButton: !1,
@@ -816,14 +826,14 @@ function er() {
816
826
  showBullets: !1,
817
827
  showThumbnails: !1,
818
828
  showFullscreenButton: !1,
819
- renderLeftNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(St, { sx: { ...a, left: 5 } }) }),
820
- renderRightNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Bt, { sx: { ...a, right: 5 } }) }),
821
- items: r.map((c, w) => ({
822
- original: c.did,
829
+ renderLeftNav: (s) => /* @__PURE__ */ t(v, { onClick: s, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...p, left: 5 } }) }),
830
+ renderRightNav: (s) => /* @__PURE__ */ t(v, { onClick: s, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Pt, { sx: { ...p, right: 5 } }) }),
831
+ items: a.map((s, k) => ({
832
+ original: s.did,
823
833
  renderItem: () => {
824
- var x;
825
- const k = n[w] || {};
826
- return /* @__PURE__ */ m(
834
+ var u;
835
+ const h = l[k] || {};
836
+ return /* @__PURE__ */ f(
827
837
  I,
828
838
  {
829
839
  height: { xs: "auto", md: ye },
@@ -834,14 +844,14 @@ function er() {
834
844
  p: { xs: 2, md: 5 },
835
845
  gap: { xs: 2, md: 5 },
836
846
  children: [
837
- l(c.cover || rr(c.did, (x = k.screenshots) == null ? void 0 : x[0])),
838
- /* @__PURE__ */ m(I, { flex: 1, height: "100%", gap: 3, children: [
839
- /* @__PURE__ */ m(S, { flex: 1, children: [
840
- d(c.name || k.title || c.name),
841
- u(c.desc || k.description)
847
+ d(s.cover || nr(s.did, (u = h.screenshots) == null ? void 0 : u[0])),
848
+ /* @__PURE__ */ f(I, { flex: 1, height: "100%", gap: 3, children: [
849
+ /* @__PURE__ */ f(v, { flex: 1, children: [
850
+ w(s.name || h.title || s.name),
851
+ y(s.desc || h.description)
842
852
  ] }),
843
- k.did && s(k, c.baseNum),
844
- v(c.link, c.did)
853
+ h.did && b(h, s.baseNum),
854
+ $(s.link, s.did)
845
855
  ] })
846
856
  ]
847
857
  }
@@ -851,13 +861,22 @@ function er() {
851
861
  }
852
862
  ) })
853
863
  ] }) : null;
854
- function l(c) {
855
- return /* @__PURE__ */ t(S, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", children: /* @__PURE__ */ t(vt, { src: c, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) });
864
+ function d(s) {
865
+ return /* @__PURE__ */ t(v, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(
866
+ St,
867
+ {
868
+ src: Nt(s, { h: 400, w: 700 }),
869
+ alt: "",
870
+ width: n ? void 0 : 338,
871
+ height: 210,
872
+ style: { objectFit: "cover" }
873
+ }
874
+ ) });
856
875
  }
857
- function d(c) {
858
- return /* @__PURE__ */ t(L, { variant: "h2", width: "100%", children: c });
876
+ function w(s) {
877
+ return /* @__PURE__ */ t(L, { variant: "h2", width: "100%", children: s });
859
878
  }
860
- function u(c) {
879
+ function y(s) {
861
880
  return /* @__PURE__ */ t(
862
881
  L,
863
882
  {
@@ -875,19 +894,19 @@ function er() {
875
894
  overflow: "hidden",
876
895
  WebkitBoxOrient: "vertical"
877
896
  },
878
- children: c
897
+ children: s
879
898
  }
880
899
  );
881
900
  }
882
- function s(c, w = 0) {
883
- const { did: k, owner: x, stats: z } = c;
884
- return /* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
885
- /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(kt, { src: x.avatar, did: k, size: 20, variant: "circle" }), children: x.fullName }),
886
- /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(Se, { icon: Ct }), title: `${z.downloads + w}`, children: tr(z.downloads + w) })
901
+ function b(s, k = 0) {
902
+ const { did: h, owner: u, stats: x } = s;
903
+ return /* @__PURE__ */ f(v, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
904
+ /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(Ct, { src: u.avatar, did: h, size: 20, variant: "circle" }), children: u.fullName }),
905
+ /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(Be, { icon: Bt }), title: `${x.downloads + k}`, children: or(x.downloads + k) })
887
906
  ] });
888
907
  }
889
- function v(c, w) {
890
- return /* @__PURE__ */ t(nt, { href: c || `/blocklets/${w}`, align: "left", width: 100, children: /* @__PURE__ */ t(
908
+ function $(s, k) {
909
+ return /* @__PURE__ */ t(lt, { href: s || `/blocklets/${k}`, align: "left", width: 100, children: /* @__PURE__ */ t(
891
910
  ee,
892
911
  {
893
912
  variant: "outlined",
@@ -903,34 +922,34 @@ function er() {
903
922
  ) });
904
923
  }
905
924
  }
906
- const tr = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, rr = (e, o) => e && o ? `/assets/${e}/screenshots/${o}` : "";
907
- function or({ title: e, blocklets: o }) {
908
- const { blockletRender: r, serverVersion: n } = B();
909
- return /* @__PURE__ */ m(S, { mt: 3, children: [
925
+ const or = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, nr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
926
+ function lr({ title: e, blocklets: r }) {
927
+ const { blockletRender: o, serverVersion: n } = C();
928
+ return /* @__PURE__ */ f(v, { mt: 3, children: [
910
929
  /* @__PURE__ */ t(L, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
911
- /* @__PURE__ */ t(me, { container: !0, spacing: 2, children: o.map((a) => /* @__PURE__ */ t(me, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": a.did, children: /* @__PURE__ */ t(S, { padding: "1px", children: r({ blocklet: a, blocklets: o, serverVersion: n }) }) }, a.did)) })
930
+ /* @__PURE__ */ t(me, { container: !0, spacing: 2, children: r.map((a) => /* @__PURE__ */ t(me, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": a.did, children: /* @__PURE__ */ t(v, { padding: "1px", children: o({ blocklet: a, blocklets: r, serverVersion: n }) }) }, a.did)) })
912
931
  ] });
913
932
  }
914
- function nr() {
915
- const { get: e } = Oe(), { t: o } = B(), {
916
- data: r = [],
933
+ function ar() {
934
+ const { get: e } = qe(), { t: r } = C(), {
935
+ data: o = [],
917
936
  error: n,
918
937
  loading: a
919
938
  } = re(async () => {
920
939
  const l = await e(T.explorePath);
921
940
  return Array.isArray(l) ? l : [];
922
941
  });
923
- return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : a ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ m(F, { children: [
924
- /* @__PURE__ */ t(er, {}),
925
- r.map(
926
- (l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(or, { title: o(`explore.${l.type}`), blocklets: l.blocklets }, l.type) : null
942
+ return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : a ? /* @__PURE__ */ t(Ve, { mt: 15 }) : /* @__PURE__ */ f(F, { children: [
943
+ /* @__PURE__ */ t(rr, {}),
944
+ o.map(
945
+ (l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(lr, { title: r(`explore.${l.type}`), blocklets: l.blocklets }, l.type) : null
927
946
  )
928
947
  ] });
929
948
  }
930
- function lr() {
931
- var u;
932
- const { filters: e, handleSort: o, handlePrice: r, t: n, getCategoryLocale: a } = B(), l = Ae(n), d = ((u = l.find((s) => s.value === e.sortBy)) == null ? void 0 : u.name) || n("sort.sort");
933
- return /* @__PURE__ */ m(
949
+ function ir() {
950
+ var p;
951
+ const { filters: e, handleSort: r, handlePrice: o, t: n, getCategoryLocale: a } = C(), l = De(n), c = ((p = l.find((d) => d.value === e.sortBy)) == null ? void 0 : p.name) || n("sort.sort");
952
+ return /* @__PURE__ */ f(
934
953
  I,
935
954
  {
936
955
  direction: { xs: "column", md: "row" },
@@ -942,17 +961,17 @@ function lr() {
942
961
  pb: 3,
943
962
  children: [
944
963
  /* @__PURE__ */ t(L, { variant: "h2", textTransform: "capitalize", children: a(e.category) }),
945
- /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", width: { xs: "100%", md: "auto" }, justifyContent: "space-between", children: [
964
+ /* @__PURE__ */ f(I, { direction: "row", alignItems: "center", width: { xs: "100%", md: "auto" }, justifyContent: "space-between", children: [
946
965
  /* @__PURE__ */ t(
947
- ve,
966
+ Ce,
948
967
  {
949
968
  control: /* @__PURE__ */ t(
950
- Ce,
969
+ Se,
951
970
  {
952
971
  checked: e.price === "free",
953
972
  size: "small",
954
973
  sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
955
- onChange: (s) => r(s.target.checked ? "free" : "")
974
+ onChange: (d) => o(d.target.checked ? "free" : "")
956
975
  }
957
976
  ),
958
977
  label: n("blocklet.free")
@@ -963,8 +982,8 @@ function lr() {
963
982
  {
964
983
  value: e.sortBy,
965
984
  options: l,
966
- title: d,
967
- onChange: o,
985
+ title: c,
986
+ onChange: r,
968
987
  icon: null,
969
988
  prepend: null,
970
989
  itemRender: null
@@ -976,16 +995,16 @@ function lr() {
976
995
  );
977
996
  }
978
997
  function be() {
979
- const { t: e } = B();
980
- return /* @__PURE__ */ t(Le, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
998
+ const { t: e } = C();
999
+ return /* @__PURE__ */ t(_e, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
981
1000
  }
982
- function O({ filterTip: e, keywordTip: o }) {
983
- const { t: r, locale: n } = B(), a = () => n === "zh" ? "、" : " , ";
984
- return /* @__PURE__ */ m(Ie, { className: "tips", children: [
985
- /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
986
- e && /* @__PURE__ */ t("span", { children: r("blocklet.filterTip") }),
987
- e && o && a(),
988
- o && /* @__PURE__ */ t("span", { children: r("blocklet.keywordTip") })
1001
+ function O({ filterTip: e, keywordTip: r }) {
1002
+ const { t: o, locale: n } = C(), a = () => n === "zh" ? "、" : " , ";
1003
+ return /* @__PURE__ */ f($e, { className: "tips", children: [
1004
+ /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1005
+ e && /* @__PURE__ */ t("span", { children: o("blocklet.filterTip") }),
1006
+ e && r && a(),
1007
+ r && /* @__PURE__ */ t("span", { children: o("blocklet.keywordTip") })
989
1008
  ] });
990
1009
  }
991
1010
  O.propTypes = {
@@ -996,16 +1015,16 @@ O.defaultProps = {
996
1015
  filterTip: !1,
997
1016
  keywordTip: !1
998
1017
  };
999
- function H({ primaryStart: e, primaryEnd: o, filter: r }) {
1000
- return /* @__PURE__ */ m(Le, { variant: "subtitle2", children: [
1018
+ function H({ primaryStart: e, primaryEnd: r, filter: o }) {
1019
+ return /* @__PURE__ */ f(_e, { variant: "subtitle2", children: [
1001
1020
  /* @__PURE__ */ t("span", { children: e }),
1002
- /* @__PURE__ */ m("span", { className: "primary", children: [
1021
+ /* @__PURE__ */ f("span", { className: "primary", children: [
1003
1022
  " ",
1004
- r,
1023
+ o,
1005
1024
  " "
1006
1025
  ] }),
1007
- /* @__PURE__ */ m("span", { children: [
1008
- o,
1026
+ /* @__PURE__ */ f("span", { children: [
1027
+ r,
1009
1028
  " "
1010
1029
  ] })
1011
1030
  ] });
@@ -1015,80 +1034,80 @@ H.propTypes = {
1015
1034
  primaryEnd: i.string.isRequired,
1016
1035
  filter: i.string.isRequired
1017
1036
  };
1018
- function je({ blocklets: e, ...o }) {
1037
+ function We({ blocklets: e, ...r }) {
1019
1038
  const {
1020
- blockletRender: r,
1039
+ blockletRender: o,
1021
1040
  errors: n,
1022
1041
  loadings: a,
1023
1042
  selectedCategory: l,
1024
- getCategoryLocale: d,
1025
- filters: u,
1026
- t: s,
1027
- serverVersion: v,
1028
- hasNextPage: f,
1029
- loadMore: y,
1030
- endpoint: c
1031
- } = B(), w = !!l || !!u.price, [k] = Tt({
1043
+ getCategoryLocale: c,
1044
+ filters: p,
1045
+ t: d,
1046
+ serverVersion: w,
1047
+ hasNextPage: y,
1048
+ loadMore: b,
1049
+ endpoint: $
1050
+ } = C(), B = !!l || !!p.price, [S] = Lt({
1032
1051
  loading: a.fetchBlockletsLoading || a.loadingMore,
1033
- hasNextPage: f,
1034
- onLoadMore: y
1052
+ hasNextPage: y,
1053
+ onLoadMore: b
1035
1054
  });
1036
1055
  if (n.fetchBlockletsError)
1037
1056
  return /* @__PURE__ */ t(
1038
1057
  Z,
1039
1058
  {
1040
- error: new Error(`Failed to fetch blocklets from ${c}: ${n.fetchBlockletsError.message}`)
1059
+ error: new Error(`Failed to fetch blocklets from ${$}: ${n.fetchBlockletsError.message}`)
1041
1060
  }
1042
1061
  );
1043
1062
  if (a.fetchBlockletsLoading)
1044
- return /* @__PURE__ */ t(qe, { mt: 15 });
1045
- if (u.keyword && w && e.length === 0)
1046
- return /* @__PURE__ */ m(W, { children: [
1063
+ return /* @__PURE__ */ t(Ve, { mt: 15 });
1064
+ if (p.keyword && B && e.length === 0)
1065
+ return /* @__PURE__ */ f(W, { children: [
1047
1066
  /* @__PURE__ */ t(
1048
1067
  H,
1049
1068
  {
1050
- primaryStart: s("blocklet.noBlockletPart1"),
1051
- primaryEnd: s("blocklet.noBlockletPart2"),
1052
- filter: u.keyword
1069
+ primaryStart: d("blocklet.noBlockletPart1"),
1070
+ primaryEnd: d("blocklet.noBlockletPart2"),
1071
+ filter: p.keyword
1053
1072
  }
1054
1073
  ),
1055
1074
  /* @__PURE__ */ t(O, { keywordTip: !0, filterTip: !0 })
1056
1075
  ] });
1057
- if (u.keyword && e.length === 0)
1058
- return /* @__PURE__ */ m(W, { children: [
1076
+ if (p.keyword && e.length === 0)
1077
+ return /* @__PURE__ */ f(W, { children: [
1059
1078
  /* @__PURE__ */ t(
1060
1079
  H,
1061
1080
  {
1062
- primaryStart: s("blocklet.noBlockletPart1"),
1063
- primaryEnd: s("blocklet.noBlockletPart2"),
1064
- filter: u.keyword
1081
+ primaryStart: d("blocklet.noBlockletPart1"),
1082
+ primaryEnd: d("blocklet.noBlockletPart2"),
1083
+ filter: p.keyword
1065
1084
  }
1066
1085
  ),
1067
1086
  /* @__PURE__ */ t(O, { keywordTip: !0 })
1068
1087
  ] });
1069
- if (w && e.length === 0) {
1070
- const x = d(l);
1071
- return /* @__PURE__ */ m(W, { children: [
1072
- x ? /* @__PURE__ */ t(
1088
+ if (B && e.length === 0) {
1089
+ const s = c(l);
1090
+ return /* @__PURE__ */ f(W, { children: [
1091
+ s ? /* @__PURE__ */ t(
1073
1092
  H,
1074
1093
  {
1075
- primaryStart: s("blocklet.noCategoryResults1"),
1076
- primaryEnd: s("blocklet.noCategoryResults2"),
1077
- filter: x
1094
+ primaryStart: d("blocklet.noCategoryResults1"),
1095
+ primaryEnd: d("blocklet.noCategoryResults2"),
1096
+ filter: s
1078
1097
  }
1079
1098
  ) : /* @__PURE__ */ t(be, {}),
1080
1099
  /* @__PURE__ */ t(O, { filterTip: !0 })
1081
1100
  ] });
1082
1101
  }
1083
- return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(be, {}) }) : /* @__PURE__ */ m(F, { children: [
1084
- /* @__PURE__ */ t(S, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...o, gap: 2, children: e.map((x) => /* @__PURE__ */ t(S, { "data-blocklet-did": x.did, children: r({ blocklet: x, blocklets: e, serverVersion: v }) }, x.did)) }),
1085
- f && /* @__PURE__ */ t(S, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: k, children: /* @__PURE__ */ t(te, {}) })
1102
+ return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(be, {}) }) : /* @__PURE__ */ f(F, { children: [
1103
+ /* @__PURE__ */ t(v, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...r, gap: 2, children: e.map((s) => /* @__PURE__ */ t(v, { "data-blocklet-did": s.did, children: o({ blocklet: s, blocklets: e, serverVersion: w }) }, s.did)) }),
1104
+ y && /* @__PURE__ */ t(v, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: S, children: /* @__PURE__ */ t(te, {}) })
1086
1105
  ] });
1087
1106
  }
1088
- je.propTypes = {
1107
+ We.propTypes = {
1089
1108
  blocklets: i.array.isRequired
1090
1109
  };
1091
- const W = D(Pt)`
1110
+ const W = D(It)`
1092
1111
  text-align: center;
1093
1112
  margin-top: 100px;
1094
1113
  .primary {
@@ -1098,38 +1117,38 @@ const W = D(Pt)`
1098
1117
  margin-top: ${(e) => e.theme.spacing(1)};
1099
1118
  }
1100
1119
  `;
1101
- function ae({ onSelect: e, wrapChildren: o }) {
1102
- const r = U(null), n = U(null), a = U(null), { storeApi: l, blockletRender: d, filters: u, endpoint: s, handleKeyword: v, t: f, serverVersion: y } = B(), c = async (b) => {
1103
- const { data: h } = await l.get(T.blockletsPath, { params: b }), C = h.dataList || [];
1104
- return C.length > 0 && C.unshift({ type: "more-result", total: h.total || 0 }), C;
1105
- }, w = (b) => {
1106
- v(b.state.query), b.setIsOpen(!1);
1107
- }, k = () => {
1108
- r.current && setTimeout(() => {
1109
- const b = r.current.querySelector("input.bl-autocomplete-input");
1110
- b && b.focus();
1120
+ function ae({ onSelect: e, wrapChildren: r }) {
1121
+ const o = U(null), n = U(null), a = U(null), { storeApi: l, blockletRender: c, filters: p, endpoint: d, handleKeyword: w, t: y, serverVersion: b } = C(), $ = async (h) => {
1122
+ const { data: u } = await l.get(T.blockletsPath, { params: h }), x = u.dataList || [];
1123
+ return x.length > 0 && x.unshift({ type: "more-result", total: u.total || 0 }), x;
1124
+ }, B = (h) => {
1125
+ w(h.state.query), h.setIsOpen(!1);
1126
+ }, S = () => {
1127
+ o.current && setTimeout(() => {
1128
+ const h = o.current.querySelector("input.bl-autocomplete-input");
1129
+ h && h.focus();
1111
1130
  });
1112
- }, x = (b) => {
1113
- b.setIsOpen(!1), k();
1114
- }, z = ({ prevState: b, state: h }) => {
1115
- b.query !== h.query && (h.query || (v(), k()));
1131
+ }, s = (h) => {
1132
+ h.setIsOpen(!1), S();
1133
+ }, k = ({ prevState: h, state: u }) => {
1134
+ h.query !== u.query && (u.query || (w(), S()));
1116
1135
  };
1117
- return zt(
1136
+ return At(
1118
1137
  "ctrl + k, command + k",
1119
- (b) => (b.stopPropagation(), b.preventDefault(), k(), !1),
1138
+ (h) => (h.stopPropagation(), h.preventDefault(), S(), !1),
1120
1139
  { enableOnTags: ["INPUT"] }
1121
- ), j(() => {
1122
- k();
1123
- }, [s]), j(() => {
1124
- if (!r.current)
1140
+ ), q(() => {
1141
+ S();
1142
+ }, [d]), q(() => {
1143
+ if (!o.current)
1125
1144
  return;
1126
- const b = $t({
1127
- container: r.current,
1128
- renderer: { createElement: dt, Fragment: ut, render: () => {
1145
+ const h = zt({
1146
+ container: o.current,
1147
+ renderer: { createElement: ut, Fragment: pt, render: () => {
1129
1148
  } },
1130
- render({ children: h }, C) {
1131
- var _;
1132
- (!n.current || a.current !== C) && (a.current = C, (_ = n.current) == null || _.unmount(), n.current = Lt(C)), n.current.render(o(h));
1149
+ render({ children: u }, x) {
1150
+ var z;
1151
+ (!n.current || a.current !== x) && (a.current = x, (z = n.current) == null || z.unmount(), n.current = _t(x)), n.current.render(r(u));
1133
1152
  },
1134
1153
  autoFocus: !0,
1135
1154
  openOnFocus: !1,
@@ -1143,53 +1162,53 @@ function ae({ onSelect: e, wrapChildren: o }) {
1143
1162
  detachedContainer: "bl-autocomplete-detached-container"
1144
1163
  },
1145
1164
  translations: {
1146
- clearButtonTitle: f("common.clear"),
1147
- detachedCancelButtonText: f("common.cancel"),
1148
- submitButtonTitle: f("common.search"),
1149
- detachedSearchButtonTitle: f("common.search")
1165
+ clearButtonTitle: y("common.clear"),
1166
+ detachedCancelButtonText: y("common.cancel"),
1167
+ submitButtonTitle: y("common.search"),
1168
+ detachedSearchButtonTitle: y("common.search")
1150
1169
  },
1151
- placeholder: f("common.searchStore"),
1170
+ placeholder: y("common.searchStore"),
1152
1171
  initialState: {
1153
- query: u.keyword
1172
+ query: p.keyword
1154
1173
  },
1155
- onStateChange(h) {
1156
- z(h);
1174
+ onStateChange(u) {
1175
+ k(u);
1157
1176
  },
1158
- onSubmit: w,
1159
- onReset(h) {
1160
- x(h);
1177
+ onSubmit: B,
1178
+ onReset(u) {
1179
+ s(u);
1161
1180
  },
1162
- getSources({ query: h, state: C, ..._ }) {
1181
+ getSources({ query: u, state: x, ...z }) {
1163
1182
  const A = {
1164
1183
  sortBy: T.nameDesc,
1165
1184
  page: 1,
1166
1185
  pageSize: 10,
1167
- keyword: h
1186
+ keyword: u
1168
1187
  };
1169
- return Wt([
1188
+ return Ht([
1170
1189
  {
1171
1190
  sourceId: "blocklets",
1172
1191
  getItems() {
1173
- return c(A);
1192
+ return $(A);
1174
1193
  },
1175
1194
  // 选中后填充 搜索框中值
1176
- getItemInputValue({ item: $ }) {
1177
- return $.type === "more-result" ? h : $.title;
1195
+ getItemInputValue({ item: _ }) {
1196
+ return _.type === "more-result" ? u : _.title;
1178
1197
  },
1179
1198
  // 选中或者点击自动完成列表中的 item 时触发
1180
- onSelect({ event: $, item: R }) {
1181
- return R.type === "more-result" ? (_.setIsOpen(!1), v(h)) : $.type === "keydown" ? v(R.title) : e({
1199
+ onSelect({ event: _, item: R }) {
1200
+ return R.type === "more-result" ? (z.setIsOpen(!1), w(u)) : _.type === "keydown" ? w(R.title) : e({
1182
1201
  blocklet: R,
1183
- detailUrl: _t(s, "/blocklets", R.did),
1184
- storeUrl: s
1202
+ detailUrl: wt(d, "/blocklets", R.did),
1203
+ storeUrl: d
1185
1204
  });
1186
1205
  },
1187
1206
  templates: {
1188
- item({ item: $ }) {
1189
- return $.type === "more-result" ? /* @__PURE__ */ t("div", { children: f("autocomplete.expandResult", { name: h, number: $.total.toLocaleString() }) }) : d({ blocklet: $, autocompleteSetters: _, serverVersion: y });
1207
+ item({ item: _ }) {
1208
+ return _.type === "more-result" ? /* @__PURE__ */ t("div", { children: y("autocomplete.expandResult", { name: u, number: _.total.toLocaleString() }) }) : c({ blocklet: _, autocompleteSetters: z, serverVersion: b });
1190
1209
  },
1191
1210
  noResults() {
1192
- return f("blocklet.noResults");
1211
+ return y("blocklet.noResults");
1193
1212
  }
1194
1213
  }
1195
1214
  }
@@ -1197,20 +1216,20 @@ function ae({ onSelect: e, wrapChildren: o }) {
1197
1216
  }
1198
1217
  });
1199
1218
  return () => {
1200
- b.destroy();
1219
+ h.destroy();
1201
1220
  };
1202
- }, [u, d]), /* @__PURE__ */ m(F, { children: [
1221
+ }, [p, c]), /* @__PURE__ */ f(F, { children: [
1203
1222
  /* @__PURE__ */ t(
1204
1223
  we,
1205
1224
  {
1206
- styles: (b) => ke`
1225
+ styles: (h) => ke`
1207
1226
  .bl-autocomplete-detached-container {
1208
1227
  .bl-autocomplete-detached-cancel {
1209
1228
  white-space: nowrap;
1210
1229
  }
1211
1230
  }
1212
1231
  .bl-autocomplete-panel {
1213
- @media (min-width: ${b.breakpoints.values.md}px) {
1232
+ @media (min-width: ${h.breakpoints.values.md}px) {
1214
1233
  min-width: 450px;
1215
1234
  left: unset !important;
1216
1235
  }
@@ -1218,7 +1237,7 @@ function ae({ onSelect: e, wrapChildren: o }) {
1218
1237
  `
1219
1238
  }
1220
1239
  ),
1221
- /* @__PURE__ */ t("div", { className: "bl-search-container", ref: r })
1240
+ /* @__PURE__ */ t("div", { className: "bl-search-container", ref: o })
1222
1241
  ] });
1223
1242
  }
1224
1243
  ae.propTypes = {
@@ -1228,29 +1247,29 @@ ae.propTypes = {
1228
1247
  ae.defaultProps = {
1229
1248
  wrapChildren: (e) => e
1230
1249
  };
1231
- function ie({ placeholder: e, ...o }) {
1232
- const { filters: r, handleKeyword: n } = B(), [a, l] = q(r.keyword || ""), d = ft(n, { wait: 300 }), u = (v) => {
1233
- const { value: f } = v.target;
1234
- l(f), d.run(f);
1235
- }, s = () => {
1250
+ function ie({ placeholder: e, ...r }) {
1251
+ const { filters: o, handleKeyword: n } = C(), [a, l] = j(o.keyword || ""), c = gt(n, { wait: 300 }), p = (w) => {
1252
+ const { value: y } = w.target;
1253
+ l(y), c.run(y);
1254
+ }, d = () => {
1236
1255
  l(""), n();
1237
1256
  };
1238
- return j(() => {
1239
- l(r.keyword || "");
1240
- }, [r.keyword]), /* @__PURE__ */ t(
1241
- ar,
1257
+ return q(() => {
1258
+ l(o.keyword || "");
1259
+ }, [o.keyword]), /* @__PURE__ */ t(
1260
+ sr,
1242
1261
  {
1243
1262
  inputProps: {
1244
1263
  "data-cy": "search-blocklet"
1245
1264
  },
1246
- startAdornment: /* @__PURE__ */ t(he, { position: "start", children: /* @__PURE__ */ t(ir, {}) }),
1247
- onChange: u,
1265
+ startAdornment: /* @__PURE__ */ t(he, { position: "start", children: /* @__PURE__ */ t(cr, {}) }),
1266
+ onChange: p,
1248
1267
  placeholder: e,
1249
1268
  value: a,
1250
1269
  title: e,
1251
1270
  "data-cy": "search",
1252
- endAdornment: a && /* @__PURE__ */ t(he, { position: "end", children: /* @__PURE__ */ t(sr, { "data-cy": "search-delete", onClick: s }) }),
1253
- ...o
1271
+ endAdornment: a && /* @__PURE__ */ t(he, { position: "end", children: /* @__PURE__ */ t(dr, { "data-cy": "search-delete", onClick: d }) }),
1272
+ ...r
1254
1273
  }
1255
1274
  );
1256
1275
  }
@@ -1260,7 +1279,7 @@ ie.propTypes = {
1260
1279
  ie.defaultProps = {
1261
1280
  placeholder: "Type to search..."
1262
1281
  };
1263
- const ar = D(lt)`
1282
+ const sr = D(at)`
1264
1283
  background-color: ${(e) => e.theme.palette.grey[50]};
1265
1284
  font-size: 14px;
1266
1285
  border-radius: 6px;
@@ -1277,20 +1296,20 @@ const ar = D(lt)`
1277
1296
  color: transparent;
1278
1297
  }
1279
1298
  }
1280
- `, ir = D(At)`
1299
+ `, cr = D(Ft)`
1281
1300
  color: ${(e) => e.theme.palette.grey[500]};
1282
1301
  font-size: 28px;
1283
1302
  @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
1284
1303
  font-size: 24px;
1285
1304
  }
1286
- `, sr = D(Be)`
1305
+ `, dr = D(Re)`
1287
1306
  color: ${(e) => e.theme.palette.grey[500]};
1288
1307
  font-size: 16px;
1289
1308
  cursor: pointer;
1290
1309
  `;
1291
- function cr() {
1292
- const { filters: e, handleSearchSelect: o, t: r, wrapChildren: n, baseSearch: a } = B(), { toggleOpen: l } = oe(), d = !!e.keyword;
1293
- return /* @__PURE__ */ m(
1310
+ function ur() {
1311
+ const { filters: e, handleSearchSelect: r, t: o, wrapChildren: n, baseSearch: a } = C(), { toggleOpen: l } = oe(), c = !!e.keyword;
1312
+ return /* @__PURE__ */ f(
1294
1313
  I,
1295
1314
  {
1296
1315
  direction: "row",
@@ -1305,66 +1324,66 @@ function cr() {
1305
1324
  /* @__PURE__ */ t(
1306
1325
  G,
1307
1326
  {
1308
- xs: !d && /* @__PURE__ */ t(Me, { onClick: () => l(!0), children: /* @__PURE__ */ t(It, {}) }),
1309
- md: /* @__PURE__ */ t(L, { variant: "h1", children: r("common.title") })
1327
+ xs: !c && /* @__PURE__ */ t(Oe, { onClick: () => l(!0), children: /* @__PURE__ */ t($t, {}) }),
1328
+ md: /* @__PURE__ */ t(L, { variant: "h1", children: o("common.title") })
1310
1329
  }
1311
1330
  ),
1312
1331
  /* @__PURE__ */ t(
1313
- S,
1332
+ v,
1314
1333
  {
1315
- width: { xs: d ? "100%" : 300, md: 300 },
1334
+ width: { xs: c ? "100%" : 300, md: 300 },
1316
1335
  className: "filter-bar",
1317
1336
  sx: {
1318
1337
  "& .bl-autocomplete-form": { borderRadius: 2 },
1319
1338
  "& .aa-SubmitButton, & .aa-LoadingIndicator": { width: "auto", pl: 1.5, pr: 1 },
1320
1339
  "& .aa-SubmitIcon, & .aa-LoadingIcon": { height: 16, width: 16 }
1321
1340
  },
1322
- children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder: r("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(ae, { onSelect: o, wrapChildren: n })
1341
+ children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder: o("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(ae, { onSelect: r, wrapChildren: n })
1323
1342
  }
1324
1343
  )
1325
1344
  ]
1326
1345
  }
1327
1346
  );
1328
1347
  }
1329
- function dr() {
1330
- const { blockletList: e, total: o, filters: r, t: n } = B(), a = r.category || r.keyword || r.price;
1331
- return /* @__PURE__ */ t(Ft, { children: /* @__PURE__ */ m(at, { FallbackComponent: Z, children: [
1332
- /* @__PURE__ */ t(cr, {}),
1333
- /* @__PURE__ */ m(S, { display: "flex", height: "100%", children: [
1334
- /* @__PURE__ */ t(Zt, {}),
1335
- /* @__PURE__ */ t(I, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: a ? /* @__PURE__ */ m(F, { children: [
1336
- r.keyword ? /* @__PURE__ */ m(F, { children: [
1337
- /* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(Ne, {}), md: null }),
1348
+ function pr() {
1349
+ const { blockletList: e, total: r, filters: o, t: n } = C(), a = o.category || o.keyword || o.price;
1350
+ return /* @__PURE__ */ t(Dt, { children: /* @__PURE__ */ f(it, { FallbackComponent: Z, children: [
1351
+ /* @__PURE__ */ t(ur, {}),
1352
+ /* @__PURE__ */ f(v, { display: "flex", height: "100%", children: [
1353
+ /* @__PURE__ */ t(tr, {}),
1354
+ /* @__PURE__ */ t(I, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: a ? /* @__PURE__ */ f(F, { children: [
1355
+ o.keyword ? /* @__PURE__ */ f(F, { children: [
1356
+ /* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(je, {}), md: null }),
1338
1357
  l()
1339
- ] }) : /* @__PURE__ */ t(lr, {}),
1340
- /* @__PURE__ */ t(je, { blocklets: e, height: "100%" })
1341
- ] }) : /* @__PURE__ */ t(nr, {}) })
1358
+ ] }) : /* @__PURE__ */ t(ir, {}),
1359
+ /* @__PURE__ */ t(We, { blocklets: e, height: "100%" })
1360
+ ] }) : /* @__PURE__ */ t(ar, {}) })
1342
1361
  ] })
1343
1362
  ] }) });
1344
1363
  function l() {
1345
- return /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
1346
- /* @__PURE__ */ t(L, { variant: "h3", children: n("blocklet.search", { keyword: r.keyword }) }),
1347
- /* @__PURE__ */ t(L, { variant: "body1", color: "text.lighter", fontSize: 13, children: n("blocklet.resultCount", { count: o }) })
1364
+ return /* @__PURE__ */ f(I, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
1365
+ /* @__PURE__ */ t(L, { variant: "h3", children: n("blocklet.search", { keyword: o.keyword }) }),
1366
+ /* @__PURE__ */ t(L, { variant: "body1", color: "text.lighter", fontSize: 13, children: n("blocklet.resultCount", { count: r }) })
1348
1367
  ] });
1349
1368
  }
1350
1369
  }
1351
- function Ve(e) {
1352
- const o = xe(), r = jt(o.palette.primary.main), n = {
1370
+ function Ue(e) {
1371
+ const r = xe(), o = Wt(r.palette.primary.main), n = {
1353
1372
  autocomplete: ke`
1354
1373
  :root {
1355
- --aa-detached-media-query: (max-width: ${o.breakpoints.values.md}px) !important;
1356
- --aa-detached-modal-media-query: (min-width: ${o.breakpoints.values.md}px) !important;
1357
- --aa-detached-modal-max-width: ${o.breakpoints.values.md}px !important;
1358
- --aa-selected-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
1359
- --aa-primary-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
1374
+ --aa-detached-media-query: (max-width: ${r.breakpoints.values.md}px) !important;
1375
+ --aa-detached-modal-media-query: (min-width: ${r.breakpoints.values.md}px) !important;
1376
+ --aa-detached-modal-max-width: ${r.breakpoints.values.md}px !important;
1377
+ --aa-selected-color-rgb: ${o.r}, ${o.g}, ${o.b} !important;
1378
+ --aa-primary-color-rgb: ${o.r}, ${o.g}, ${o.b} !important;
1360
1379
  --aa-input-background-color-rgb: 250, 250, 250 !important;
1361
1380
  }
1362
1381
  .bl-autocomplete-panel {
1363
- z-index: ${o.zIndex.modal};
1382
+ z-index: ${r.zIndex.modal};
1364
1383
  }
1365
1384
  .bl-autocomplete-label {
1366
1385
  .aa-SubmitIcon {
1367
- color: ${o.palette.grey[500]} !important;
1386
+ color: ${r.palette.grey[500]} !important;
1368
1387
  }
1369
1388
  }
1370
1389
  .bl-autocomplete-form {
@@ -1380,21 +1399,21 @@ function Ve(e) {
1380
1399
  box-shadow: none !important;
1381
1400
  }
1382
1401
  .aa-SubmitIcon {
1383
- color: ${o.palette.grey[500]} !important;
1402
+ color: ${r.palette.grey[500]} !important;
1384
1403
  }
1385
1404
  }
1386
1405
  .aa-Panel .arcblock-blocklet button {
1387
- border: 1px solid rgba(${r.r}, ${r.g}, ${r.b}, 0.5);
1406
+ border: 1px solid rgba(${o.r}, ${o.g}, ${o.b}, 0.5);
1388
1407
  }
1389
1408
  `
1390
1409
  };
1391
- return /* @__PURE__ */ m(ne, { ...e, children: [
1410
+ return /* @__PURE__ */ f(ne, { ...e, children: [
1392
1411
  /* @__PURE__ */ t(we, { styles: n.autocomplete }),
1393
- /* @__PURE__ */ t(dr, {})
1412
+ /* @__PURE__ */ t(pr, {})
1394
1413
  ] });
1395
1414
  }
1396
- Ve.propTypes = ze;
1397
- Ve.defaultProps = _e;
1415
+ Ue.propTypes = Ae;
1416
+ Ue.defaultProps = Fe;
1398
1417
  export {
1399
- Ve as default
1418
+ Ue as default
1400
1419
  };