useblocks 1.1.53 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/iframe/js/amp.BP7EklKo.js +1 -1
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/npm-publish.manifest.json +7 -7
  6. package/package.json +1 -7
  7. package/runtime/THIRD_PARTY_LICENSES.txt +0 -235
  8. package/runtime/index.js +0 -2
  9. package/runtime/package.json +0 -6
  10. package/runtime/plugin-dev-manifest.json +0 -4
  11. package/singlepage_headless_plugin.html +1 -1
  12. package/static/core/{5318562c.js → 161d1254.js} +268 -257
  13. package/static/core/{b9f47840.js → 17d3ee0b.js} +8 -8
  14. package/static/core/{6895dd352.js → 195ca4a32.js} +15 -15
  15. package/static/core/{dc1f9e4f.js → 2569fac8.js} +26 -26
  16. package/static/core/{4ca527032.js → 26ddf93e2.js} +2 -2
  17. package/static/core/{9929a348.js → 30c5fe5f.js} +90 -90
  18. package/static/core/{e93d55b92.js → 3af8f3592.js} +4 -4
  19. package/static/core/{ebd852b6.js → 40f73dfb.js} +1019 -1032
  20. package/static/core/{c3058168.js → 43c3f160.js} +3283 -3189
  21. package/static/core/{542ea53f2.js → 4a27bba92.js} +8 -8
  22. package/static/core/4c39852e.js +3150 -0
  23. package/static/core/{e5e07f1d.js → 4e75b331.js} +13 -13
  24. package/static/core/{e1d239ab.js → 5345bef8.js} +42 -42
  25. package/static/core/{31e98e6e.js → 53463a60.js} +707 -712
  26. package/static/core/{27544e7e.js → 581ce428.js} +37 -19
  27. package/static/core/{d8daf1142.js → 6156301b2.js} +3 -3
  28. package/static/core/{c3849484.js → 64bea1a9.js} +5 -5
  29. package/static/core/{ce4fc17f2.js → 680236f4.js} +1 -1
  30. package/static/core/{4b75d16c2.js → 687795b52.js} +4 -4
  31. package/static/core/{70407ac0.js → 72f86b2d.js} +3 -3
  32. package/static/core/{139e4380.js → 7a15fa8b.js} +3 -3
  33. package/static/core/{b77f0769.js → 8432f11e.js} +5 -5
  34. package/static/core/{d1eb3c68.js → 8815eb5b.js} +15670 -15289
  35. package/static/core/{f3cff4c9.js → 8a496b64.js} +158 -158
  36. package/static/core/{4e1b970f.js → 8ba13f332.js} +1 -1
  37. package/static/core/{75737a9d.js → 951903fb.js} +9096 -9074
  38. package/static/core/{a95c02bb.js → a1355a35.js} +5 -5
  39. package/static/core/{7c6fb2162.js → a36c3ab62.js} +3 -3
  40. package/static/core/{2da1d66b.js → abd3f34c.js} +5 -5
  41. package/static/core/{528ad9282.js → ae20f0992.js} +16 -16
  42. package/static/core/ba6c356e.js +466 -0
  43. package/static/core/{ee0ddb51.js → c9e59b34.js} +6884 -4960
  44. package/static/core/{f96d2049.js → d1a1d4902.js} +1 -1
  45. package/static/core/{5b48fd69.js → d8d6485e.js} +5 -5
  46. package/static/core/{59e92cc3.js → d9398296.js} +5 -5
  47. package/static/core/{b408f33a.js → d9baa55e.js} +25 -25
  48. package/static/core/dbf19c2e.js +811 -0
  49. package/static/core/{bc7e3d2b.js → f953827c.js} +10 -10
  50. package/static/core/{1e5bf73c.js → ffee9a77.js} +7 -7
  51. package/static/esm/2474de05.js +131 -0
  52. package/static/esm/{d180c108.js → 53b688bd.js} +66 -85
  53. package/two_step_headless_plugin.html +1 -1
  54. package/useblocks-core.f6bb8947.js +673 -0
  55. package/useblocks-esm.js +875 -552
  56. package/useblocks.d.ts +8 -0
  57. package/useblocks.js +691 -408
  58. package/runtime/prop-types/index.js +0 -4
  59. package/runtime/react-router-dom/index.js +0 -2
  60. package/static/core/1995fb0a2.js +0 -602
  61. package/static/core/1f5e1fc9.js +0 -3097
  62. package/static/core/ce0410b1.js +0 -467
  63. package/static/esm/448d4bb0.js +0 -127
  64. package/static/runtime/dom-export-CHgQ7Ws9.js +0 -8069
  65. package/static/runtime/prop-types-p_yYKrF7.js +0 -47
  66. package/useblocks-core.2a5dade1.js +0 -643
  67. /package/iframe/{iframe-eblock.2a5dade1.html → iframe-eblock.f6bb8947.html} +0 -0
  68. /package/iframe/{iframe.2a5dade1.html → iframe.f6bb8947.html} +0 -0
@@ -1,27 +1,24 @@
1
1
  (function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #pixie-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--colorPrimary);border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--colorPrimaryHover);border-color:var(--colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--colorWhite)}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--borderWidth) * 1px);border-color:var(--colorFillSecondaryDarken);border-radius:calc(var(--borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--colorBorderSecondary);background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}")),document.head.appendChild(o)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- __useblocks__.define("static/core/31e98e6e.js", [
2
+ __useblocks__.define("static/core/53463a60.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/bd36b180.js",
7
- "static/core/ee0ddb51.js",
8
- "static/core/5318562c.js",
9
- "static/core/ebd852b6.js",
10
- "static/core/75737a9d.js",
11
- "static/core/1995fb0a2.js",
12
- "static/core/1f5e1fc9.js",
7
+ "static/core/c9e59b34.js",
8
+ "static/core/161d1254.js",
9
+ "static/core/4c39852e.js",
10
+ "static/core/40f73dfb.js",
11
+ "static/core/951903fb.js",
12
+ "static/core/dbf19c2e.js",
13
13
  "react",
14
- "prop-types",
15
- "react-router-dom",
16
14
  "react/jsx-runtime"
17
- ], function(le, vt, dn) {
18
- const Je = le("./bd36b180.js"), u = le("./ee0ddb51.js"), _ = le("./5318562c.js"), m = le("./ebd852b6.js"), Ct = le("./75737a9d.js"), F = le("./1995fb0a2.js"), ne = le("./1f5e1fc9.js");
19
- let n = le("react");
20
- n = Je.__toESM(n);
21
- let Te = le("prop-types");
22
- Te = Je.__toESM(Te);
23
- let Ne = le("react-router-dom"), r = le("react/jsx-runtime");
24
- function bt(t, e) {
15
+ ], function(de, gt, ln) {
16
+ const Ze = de("./bd36b180.js"), u = de("./c9e59b34.js"), Z = de("./161d1254.js"), ne = de("./4c39852e.js"), m = de("./40f73dfb.js"), ht = de("./951903fb.js"), N = de("./dbf19c2e.js");
17
+ let n = de("react");
18
+ n = Ze.__toESM(n);
19
+ let r = de("react/jsx-runtime");
20
+ var yt = Ze.__toESM(ne.require_prop_types());
21
+ function vt(t, e) {
25
22
  return { [t]: {
26
23
  Filter: e("Filter"),
27
24
  filter: e("filter"),
@@ -107,18 +104,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
107
104
  square: e("square")
108
105
  } };
109
106
  }
110
- function $e(t, e = "application/octet-stream") {
107
+ function Xe(t, e = "application/octet-stream") {
111
108
  let o = t.trim(), a = e?.trim() || "application/octet-stream";
112
109
  const i = o.indexOf(",");
113
110
  if (o.startsWith("data:") && i >= 0) {
114
111
  const d = o.slice(5, i).split(";")[0]?.trim();
115
112
  d && (a = d), o = o.slice(i + 1);
116
113
  }
117
- const l = o.replace(/\s/g, ""), b = atob(l), g = new Uint8Array(b.length);
118
- for (let d = 0; d < b.length; d++) g[d] = b.charCodeAt(d);
119
- return new Blob([g], { type: a });
114
+ const l = o.replace(/\s/g, ""), b = atob(l), p = new Uint8Array(b.length);
115
+ for (let d = 0; d < b.length; d++) p[d] = b.charCodeAt(d);
116
+ return new Blob([p], { type: a });
120
117
  }
121
- var wt = "static/media/image-editor", At = { text: {
118
+ var Ct = "static/media/image-editor", bt = { text: {
122
119
  replaceDefaultItems: !0,
123
120
  defaultText: "Handwriting",
124
121
  items: [
@@ -236,84 +233,84 @@ __useblocks__.define("static/core/31e98e6e.js", [
236
233
  }
237
234
  ]
238
235
  } };
239
- function It(t, e) {
236
+ function wt(t, e) {
240
237
  if (t === "json") return new Blob([e], { type: "application/json" });
241
238
  if (t === "svg") return new Blob([e], { type: "image/svg+xml" });
242
239
  const o = `image/${t}`;
243
- return $e(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
240
+ return Xe(e.replace(/data:image\/([a-z]*)?;base64,/, ""), o);
244
241
  }
245
- var xt = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
246
- const l = ne.useCookieManager(), [b, g] = (0, n.useState)(), [d, R] = (0, n.useState)(), { __: x } = m.useI18n();
247
- let p = u.useDispatch();
248
- const w = u.useStore(), j = u.useAppConfig(), C = u.useSelector(u.selectedCurrentUser), U = u.useSelector(_.selectSecondModal), y = u.useSelector(u.selectProject), D = (0, n.useMemo)(() => {
249
- if (!j?.icons) return;
250
- const k = {};
251
- for (const [P, E] of Object.entries(j.icons)) typeof E == "string" && (k[P] = F.sanitizeHtml(E));
252
- return Object.keys(k).length > 0 ? k : void 0;
253
- }, [j?.icons]), O = (0, n.useRef)(!1), [T, Q] = (0, n.useState)(), N = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
242
+ var At = ({ currentImageLink: t, prefetchedBlob: e, resolveImageBlob: o, onSave: a, uploadImageResultIsLoading: i }) => {
243
+ const l = N.useCookieManager(), [b, p] = (0, n.useState)(), [d, v] = (0, n.useState)(), { __: I } = m.useI18n();
244
+ let w = u.useDispatch();
245
+ const C = u.useStore(), R = u.useAppConfig(), y = u.useSelector(u.selectedCurrentUser), L = u.useSelector(Z.selectSecondModal), A = u.useSelector(u.selectProject), G = (0, n.useMemo)(() => {
246
+ if (!R?.icons) return;
247
+ const E = {};
248
+ for (const [P, j] of Object.entries(R.icons)) typeof j == "string" && (E[P] = N.sanitizeHtml(j));
249
+ return Object.keys(E).length > 0 ? E : void 0;
250
+ }, [R?.icons]), O = (0, n.useRef)(!1), [D, H] = (0, n.useState)(), B = u.useEventEmitter(u.events.FILE_PROXY_EVENT_ID);
254
251
  (0, n.useEffect)(() => {
255
- let k = !1;
252
+ let E = !1;
256
253
  return (async () => {
257
- const E = t;
258
- if (!E && !e) return;
259
- let I = e;
260
- if (!I && E) try {
261
- typeof o == "function" ? I = await o(E) : I = await (await fetch(E)).blob();
254
+ const j = t;
255
+ if (!j && !e) return;
256
+ let x = e;
257
+ if (!x && j) try {
258
+ typeof o == "function" ? x = await o(j) : x = await (await fetch(j)).blob();
262
259
  } catch {
263
- if (k) return;
264
- if (I = await N.fire({
265
- url: E,
266
- project: y
267
- }).filter((L) => L instanceof Blob)[0], !I) {
268
- const L = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(w, _.TOKEN_ID);
269
- I = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(E)}`, { headers: { authorization: `Bearer ${L}` } })).blob();
260
+ if (E) return;
261
+ if (x = await B.fire({
262
+ url: j,
263
+ project: A
264
+ }).filter((U) => U instanceof Blob)[0], !x) {
265
+ const U = l.get(u.APP_COOKIES.em_token) || await u.di.getInstance(C, Z.TOKEN_ID);
266
+ x = await (await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(j)}`, { headers: { authorization: `Bearer ${U}` } })).blob();
270
267
  }
271
268
  }
272
- if (k || !I) return;
273
- const A = new FileReader();
274
- A.onload = () => {
275
- if (k) return;
276
- const L = A.result;
277
- typeof L == "string" && (g(L), R(I.type), T?.tools.import.openBackgroundImage(L));
278
- }, A.onerror = () => {}, A.readAsDataURL(I);
279
- })().catch((E) => {}), () => {
280
- k = !0;
269
+ if (E || !x) return;
270
+ const S = new FileReader();
271
+ S.onload = () => {
272
+ if (E) return;
273
+ const U = S.result;
274
+ typeof U == "string" && (p(U), v(x.type), D?.tools.import.openBackgroundImage(U));
275
+ }, S.onerror = () => {}, S.readAsDataURL(x);
276
+ })().catch((j) => {}), () => {
277
+ E = !0;
281
278
  };
282
279
  }, [
283
280
  t,
284
281
  e,
285
282
  o,
286
283
  l,
287
- T,
288
- N,
289
- y,
290
- w
284
+ D,
285
+ B,
286
+ A,
287
+ C
291
288
  ]);
292
- const M = (0, n.useCallback)(() => {
293
- g(null), R(null), p(_.closeSecondModal()), p(_.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
294
- }, [p]), z = (0, n.useRef)();
295
- z.current = async function(k, P, E) {
289
+ const z = (0, n.useCallback)(() => {
290
+ p(null), v(null), w(Z.closeSecondModal()), w(Z.closeModal(u.MODALS.UPLOAD_IMAGE_MODAL));
291
+ }, [w]), V = (0, n.useRef)();
292
+ V.current = async function(E, P, j) {
296
293
  try {
297
- const I = It(E, k);
298
- a && await a(new File([I], P, {
294
+ const x = wt(j, E);
295
+ a && await a(new File([x], P, {
299
296
  lastModified: Date.now(),
300
- type: I.type
297
+ type: x.type
301
298
  }));
302
- } catch (I) {
303
- throw I;
299
+ } catch (x) {
300
+ throw x;
304
301
  }
305
302
  };
306
- const ee = (0, n.useCallback)((k) => {
307
- if (k && !(O.current && T)) {
303
+ const ee = (0, n.useCallback)((E) => {
304
+ if (E && !(O.current && D)) {
308
305
  O.current = !0;
309
- const P = C.locale ? C.locale.replace("_", "-") : "en-US", E = C.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : C.theme;
310
- Ct.Tf.init({
306
+ const P = y.locale ? y.locale.replace("_", "-") : "en-US", j = y.theme === "system" ? matchMedia("(prefers-color-scheme: dark)").matches ? u.DARK : u.LIGHT : y.theme;
307
+ ht.Tf.init({
311
308
  selector: "#pixie-editor",
312
- baseUrl: m.getBundledHostAssetUrl(wt),
309
+ baseUrl: m.getBundledHostAssetUrl(Ct),
313
310
  image: b,
314
311
  activeLanguage: P,
315
- languages: bt(P, x),
316
- tools: At,
312
+ languages: vt(P, I),
313
+ tools: bt,
317
314
  ui: {
318
315
  menubar: {
319
316
  replaceDefaultItems: !0,
@@ -331,55 +328,55 @@ __useblocks__.define("static/core/31e98e6e.js", [
331
328
  type: "button",
332
329
  icon: (0, r.jsx)(m.EmIcons, {
333
330
  icon: "HistoryOutlined",
334
- configIcons: D,
331
+ configIcons: G,
335
332
  style: { fontSize: 20 }
336
333
  }),
337
334
  align: "right",
338
335
  desktopOnly: !0,
339
- action: (I) => {
340
- I.togglePanel("history");
336
+ action: (x) => {
337
+ x.togglePanel("history");
341
338
  }
342
339
  },
343
340
  {
344
341
  type: "button",
345
342
  icon: (0, r.jsx)(m.EmIcons, {
346
343
  icon: "CloseOutlined",
347
- configIcons: D,
344
+ configIcons: G,
348
345
  style: { fontSize: 20 }
349
346
  }),
350
347
  align: "right",
351
348
  desktopOnly: !0,
352
- action: () => M()
349
+ action: () => z()
353
350
  }
354
351
  ]
355
352
  },
356
353
  nav: { position: "top" },
357
- activeTheme: E,
354
+ activeTheme: j,
358
355
  mode: "inline",
359
356
  forceOverlayModeOnMobile: !1
360
357
  },
361
- onSave: async function(I, A, L) {
358
+ onSave: async function(x, S, U) {
362
359
  try {
363
- await z.current(I, A, L);
360
+ await V.current(x, S, U);
364
361
  } catch {}
365
362
  }
366
- }).then((I) => {
367
- Q(I);
368
- }).catch((I) => {});
363
+ }).then((x) => {
364
+ H(x);
365
+ }).catch((x) => {});
369
366
  }
370
367
  }, [
371
- C.theme,
368
+ y.theme,
372
369
  b,
373
- T,
374
- Q,
375
- C.locale,
376
- x,
377
- M,
378
- D
379
- ]), K = (0, n.useCallback)(() => {
380
- T?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
370
+ D,
371
+ H,
372
+ y.locale,
373
+ I,
374
+ z,
375
+ G
376
+ ]), q = (0, n.useCallback)(() => {
377
+ D?.tools.export.save(t?.split("/").pop().split(".")[0], d?.split("/")[1]);
381
378
  }, [
382
- T,
379
+ D,
383
380
  t,
384
381
  d
385
382
  ]);
@@ -395,17 +392,17 @@ __useblocks__.define("static/core/31e98e6e.js", [
395
392
  closable: !1,
396
393
  zIndex: 1100,
397
394
  mask: !1,
398
- open: U,
395
+ open: L,
399
396
  footer: [(0, r.jsx)(m.Button, {
400
397
  className: "em-analytics__profile-cancel",
401
- onClick: M,
402
- children: x("Cancel")
398
+ onClick: z,
399
+ children: I("Cancel")
403
400
  }, "Cancel"), (0, r.jsx)(m.Button, {
404
401
  className: "em-analytics__profile-updapixiete",
405
402
  id: "save",
406
403
  type: "primary",
407
- onClick: K,
408
- children: x("Update")
404
+ onClick: q,
405
+ children: I("Update")
409
406
  }, "Ok")],
410
407
  children: [i && (0, r.jsx)("div", {
411
408
  style: {
@@ -422,11 +419,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
422
419
  children: (0, r.jsx)(m.Spin, { size: "large" })
423
420
  }), (0, r.jsx)("div", { id: "pixie-editor" })]
424
421
  });
425
- }, St = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: g }) => {
422
+ }, It = ({ currentImageLink: t, newLink: e, previewDisplayUrl: o, resolvedPreviewObjectUrl: a, resolvedPreviewBlob: i, resolveImageBlob: l, onSave: b, uploadImageResultIsLoading: p }) => {
426
423
  const d = o || a;
427
424
  return (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)("div", { children: (0, r.jsxs)("div", {
428
425
  className: "image-preview",
429
- children: [g && (0, r.jsx)("div", {
426
+ children: [p && (0, r.jsx)("div", {
430
427
  style: {
431
428
  position: "absolute",
432
429
  height: "100%",
@@ -443,22 +440,22 @@ __useblocks__.define("static/core/31e98e6e.js", [
443
440
  alt: "uploadedImage",
444
441
  src: d
445
442
  })]
446
- }) }), (0, r.jsx)(xt, {
443
+ }) }), (0, r.jsx)(At, {
447
444
  currentImageLink: t,
448
445
  prefetchedBlob: i,
449
446
  resolveImageBlob: l,
450
447
  newLink: e,
451
448
  onSave: b,
452
- uploadImageResultIsLoading: g
449
+ uploadImageResultIsLoading: p
453
450
  })] });
454
451
  }, Re = {
455
452
  Pixel: "Pixel",
456
453
  Percent: "Percent"
457
- }, et = {
454
+ }, Je = {
458
455
  unit: Re.Percent,
459
456
  value: 80
460
457
  };
461
- function Rt(t) {
458
+ function xt(t) {
462
459
  return typeof t == "number" ? {
463
460
  unit: Re.Percent,
464
461
  value: t * 100
@@ -468,147 +465,147 @@ __useblocks__.define("static/core/31e98e6e.js", [
468
465
  } : /^(\d*(\.\d+)?)%$/.exec(t) ? {
469
466
  unit: Re.Percent,
470
467
  value: parseFloat(t)
471
- } : et : et;
468
+ } : Je : Je;
472
469
  }
473
- function jt(t, e) {
474
- const o = Rt(t);
470
+ function St(t, e) {
471
+ const o = xt(t);
475
472
  let a;
476
473
  return o.unit === Re.Pixel ? a = `${o.value}px` : a = `${100 - o.value}%`, e ? `${a} 0px 0px 0px` : `0px 0px ${a} 0px`;
477
474
  }
478
- function tt({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: g, scrollableTarget: d, hasChildren: R, inverse: x = !1, pullDownToRefresh: p = !1, pullDownToRefreshContent: w, releaseToRefreshContent: j, pullDownToRefreshThreshold: C = 100, refreshFunction: U, onScroll: y, dataLength: D, initialScrollY: O, className: T = "", role: Q, tabIndex: N, id: M, ...z }) {
479
- const [ee, K] = (0, n.useState)(!1), [k, P] = (0, n.useState)(!1), [E, I] = (0, n.useState)(0), A = (0, n.useRef)(null), L = (0, n.useRef)(null), J = (0, n.useRef)(null), q = (0, n.useRef)(t);
480
- q.current = t;
481
- const s = (0, n.useRef)(U);
482
- s.current = U;
483
- const h = (0, n.useRef)(C);
484
- h.current = C;
485
- const W = (0, n.useRef)(!1), ce = (0, n.useRef)(!1), Z = (0, n.useRef)(0), $ = (0, n.useRef)(0), X = (0, n.useRef)(0), H = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
475
+ function $e({ next: t, hasMore: e, children: o, loader: a, scrollThreshold: i = .8, endMessage: l, style: b, height: p, scrollableTarget: d, hasChildren: v, inverse: I = !1, pullDownToRefresh: w = !1, pullDownToRefreshContent: C, releaseToRefreshContent: R, pullDownToRefreshThreshold: y = 100, refreshFunction: L, onScroll: A, dataLength: G, initialScrollY: O, className: D = "", role: H, tabIndex: B, id: z, ...V }) {
476
+ const [ee, q] = (0, n.useState)(!1), [E, P] = (0, n.useState)(!1), [j, x] = (0, n.useState)(0), S = (0, n.useRef)(null), U = (0, n.useRef)(null), _ = (0, n.useRef)(null), K = (0, n.useRef)(t);
477
+ K.current = t;
478
+ const s = (0, n.useRef)(L);
479
+ s.current = L;
480
+ const h = (0, n.useRef)(y);
481
+ h.current = y;
482
+ const W = (0, n.useRef)(!1), me = (0, n.useRef)(!1), T = (0, n.useRef)(0), J = (0, n.useRef)(0), $ = (0, n.useRef)(0), F = (0, n.useCallback)(() => d instanceof HTMLElement ? d : typeof d == "string" ? document.getElementById(d) : null, [d]);
486
483
  (0, n.useEffect)(() => {
487
- if (typeof D > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
488
- if (p && typeof U != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
484
+ if (typeof G > "u") throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed when loading more content. Check README.md for usage");
485
+ if (w && typeof L != "function") throw new Error(`Mandatory prop "refreshFunction" missing.
489
486
  Pull Down To Refresh functionality will not work
490
487
  as expected. Check README.md for usage'`);
491
488
  if (typeof O == "number") {
492
- const Y = g ? A.current : H();
489
+ const Y = p ? S.current : F();
493
490
  Y && Y.scrollHeight > O && Y.scrollTo(0, O);
494
491
  }
495
492
  }, []), (0, n.useEffect)(() => {
496
- W.current = !1, K(!1);
497
- }, [D]), (0, n.useEffect)(() => {
493
+ W.current = !1, q(!1);
494
+ }, [G]), (0, n.useEffect)(() => {
498
495
  if (!e || typeof IntersectionObserver > "u") return;
499
- const Y = L.current;
496
+ const Y = U.current;
500
497
  if (!Y) return;
501
- const se = g ? A.current : H(), B = new IntersectionObserver(([ae]) => {
502
- !ae.isIntersecting || W.current || (W.current = !0, K(!0), q.current());
498
+ const re = p ? S.current : F(), M = new IntersectionObserver(([ae]) => {
499
+ !ae.isIntersecting || W.current || (W.current = !0, q(!0), K.current());
503
500
  }, {
504
- root: se,
505
- rootMargin: jt(i, x),
501
+ root: re,
502
+ rootMargin: St(i, I),
506
503
  threshold: 0
507
504
  });
508
- return B.observe(Y), () => B.disconnect();
505
+ return M.observe(Y), () => M.disconnect();
509
506
  }, [
510
507
  e,
511
508
  i,
512
- x,
513
- g,
514
- H
509
+ I,
510
+ p,
511
+ F
515
512
  ]), (0, n.useEffect)(() => {
516
513
  var Y;
517
- if (!y) return;
518
- const se = (Y = g ? A.current : H()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
519
- if (!se) return;
520
- const B = (ae) => {
521
- setTimeout(() => y(ae), 0);
514
+ if (!A) return;
515
+ const re = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
516
+ if (!re) return;
517
+ const M = (ae) => {
518
+ setTimeout(() => A(ae), 0);
522
519
  };
523
- return se.addEventListener("scroll", B), () => se.removeEventListener("scroll", B);
520
+ return re.addEventListener("scroll", M), () => re.removeEventListener("scroll", M);
524
521
  }, [
525
- y,
526
- g,
527
- H
522
+ A,
523
+ p,
524
+ F
528
525
  ]), (0, n.useEffect)(() => {
529
- var Y, se;
530
- if (!p) return;
531
- const B = (Y = g ? A.current : H()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
532
- if (!B) return;
533
- if (!((se = J.current) === null || se === void 0) && se.firstChild) {
534
- const G = J.current.firstChild.getBoundingClientRect().height;
535
- X.current = G, I(G);
526
+ var Y, re;
527
+ if (!w) return;
528
+ const M = (Y = p ? S.current : F()) !== null && Y !== void 0 ? Y : typeof window < "u" ? window : null;
529
+ if (!M) return;
530
+ if (!((re = _.current) === null || re === void 0) && re.firstChild) {
531
+ const X = _.current.firstChild.getBoundingClientRect().height;
532
+ $.current = X, x(X);
536
533
  }
537
- const ae = (G) => {
538
- (B instanceof HTMLElement ? B.scrollTop : document.documentElement.scrollTop) > 0 || (ce.current = !0, G instanceof MouseEvent ? Z.current = G.pageY : G instanceof TouchEvent && (Z.current = G.touches[0].pageY), $.current = Z.current, A.current && (A.current.style.willChange = "transform", A.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
539
- }, v = (G) => {
540
- if (!ce.current || (G instanceof MouseEvent ? $.current = G.pageY : G instanceof TouchEvent && ($.current = G.touches[0].pageY), $.current < Z.current)) return;
541
- const fe = $.current - Z.current;
542
- fe >= h.current && P(!0), !(fe > X.current * 1.5) && A.current && (A.current.style.overflow = "visible", A.current.style.transform = `translate3d(0px, ${fe}px, 0px)`);
534
+ const ae = (X) => {
535
+ (M instanceof HTMLElement ? M.scrollTop : document.documentElement.scrollTop) > 0 || (me.current = !0, X instanceof MouseEvent ? T.current = X.pageY : X instanceof TouchEvent && (T.current = X.touches[0].pageY), J.current = T.current, S.current && (S.current.style.willChange = "transform", S.current.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
536
+ }, g = (X) => {
537
+ if (!me.current || (X instanceof MouseEvent ? J.current = X.pageY : X instanceof TouchEvent && (J.current = X.touches[0].pageY), J.current < T.current)) return;
538
+ const ce = J.current - T.current;
539
+ ce >= h.current && P(!0), !(ce > $.current * 1.5) && S.current && (S.current.style.overflow = "visible", S.current.style.transform = `translate3d(0px, ${ce}px, 0px)`);
543
540
  }, te = () => {
544
- Z.current = 0, $.current = 0, ce.current = !1, P((G) => {
545
- var fe;
546
- return G && ((fe = s.current) === null || fe === void 0 || fe.call(s)), !1;
541
+ T.current = 0, J.current = 0, me.current = !1, P((X) => {
542
+ var ce;
543
+ return X && ((ce = s.current) === null || ce === void 0 || ce.call(s)), !1;
547
544
  }), requestAnimationFrame(() => {
548
- A.current && (A.current.style.overflow = "auto", A.current.style.transform = "none", A.current.style.willChange = "unset");
545
+ S.current && (S.current.style.overflow = "auto", S.current.style.transform = "none", S.current.style.willChange = "unset");
549
546
  });
550
547
  };
551
- return B.addEventListener("touchstart", ae), B.addEventListener("touchmove", v), B.addEventListener("touchend", te), B.addEventListener("mousedown", ae), B.addEventListener("mousemove", v), B.addEventListener("mouseup", te), () => {
552
- B.removeEventListener("touchstart", ae), B.removeEventListener("touchmove", v), B.removeEventListener("touchend", te), B.removeEventListener("mousedown", ae), B.removeEventListener("mousemove", v), B.removeEventListener("mouseup", te);
548
+ return M.addEventListener("touchstart", ae), M.addEventListener("touchmove", g), M.addEventListener("touchend", te), M.addEventListener("mousedown", ae), M.addEventListener("mousemove", g), M.addEventListener("mouseup", te), () => {
549
+ M.removeEventListener("touchstart", ae), M.removeEventListener("touchmove", g), M.removeEventListener("touchend", te), M.removeEventListener("mousedown", ae), M.removeEventListener("mousemove", g), M.removeEventListener("mouseup", te);
553
550
  };
554
551
  }, [
552
+ w,
555
553
  p,
556
- g,
557
- H
554
+ F
558
555
  ]);
559
- const ie = {
560
- height: g ?? "auto",
556
+ const he = {
557
+ height: p ?? "auto",
561
558
  overflow: "auto",
562
559
  WebkitOverflowScrolling: "touch",
563
560
  ...b
564
- }, he = R || !!(o && o instanceof Array && o.length), ye = p && g ? { overflow: "auto" } : {}, ue = e ? (0, r.jsx)("div", {
565
- ref: L,
561
+ }, ie = v || !!(o && o instanceof Array && o.length), pe = w && p ? { overflow: "auto" } : {}, Ae = e ? (0, r.jsx)("div", {
562
+ ref: U,
566
563
  style: { height: 1 }
567
564
  }) : null;
568
565
  return (0, r.jsx)("div", {
569
- style: ye,
566
+ style: pe,
570
567
  className: "infinite-scroll-component__outerdiv",
571
568
  children: (0, r.jsxs)("div", {
572
- ...z,
573
- role: Q,
574
- tabIndex: N,
575
- id: M,
576
- className: ["infinite-scroll-component", T].filter(Boolean).join(" "),
577
- ref: A,
578
- style: ie,
569
+ ...V,
570
+ role: H,
571
+ tabIndex: B,
572
+ id: z,
573
+ className: ["infinite-scroll-component", D].filter(Boolean).join(" "),
574
+ ref: S,
575
+ style: he,
579
576
  children: [
580
- p && (0, r.jsx)("div", {
577
+ w && (0, r.jsx)("div", {
581
578
  style: { position: "relative" },
582
- ref: J,
579
+ ref: _,
583
580
  children: (0, r.jsx)("div", {
584
581
  style: {
585
582
  position: "absolute",
586
583
  left: 0,
587
584
  right: 0,
588
- top: -1 * E
585
+ top: -1 * j
589
586
  },
590
- children: k ? j : w
587
+ children: E ? R : C
591
588
  })
592
589
  }),
593
590
  o,
594
- !ee && !he && e && a,
591
+ !ee && !ie && e && a,
595
592
  ee && e && a,
596
- ue,
593
+ Ae,
597
594
  !e && l
598
595
  ]
599
596
  })
600
597
  });
601
598
  }
602
- function kt(t, e) {
599
+ function Rt(t, e) {
603
600
  if (t == null) return {};
604
- var o = Et(t, e), a, i;
601
+ var o = kt(t, e), a, i;
605
602
  if (Object.getOwnPropertySymbols) {
606
603
  var l = Object.getOwnPropertySymbols(t);
607
604
  for (i = 0; i < l.length; i++) a = l[i], !(e.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (o[a] = t[a]);
608
605
  }
609
606
  return o;
610
607
  }
611
- function Et(t, e) {
608
+ function kt(t, e) {
612
609
  if (t == null) return {};
613
610
  var o = {}, a = Object.keys(t), i, l;
614
611
  for (l = 0; l < a.length; l++) i = a[l], !(e.indexOf(i) >= 0) && (o[i] = t[i]);
@@ -623,7 +620,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
623
620
  return t;
624
621
  }, De.apply(this, arguments);
625
622
  }
626
- function nt(t, e) {
623
+ function et(t, e) {
627
624
  var o = Object.keys(t);
628
625
  if (Object.getOwnPropertySymbols) {
629
626
  var a = Object.getOwnPropertySymbols(t);
@@ -633,18 +630,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
633
630
  }
634
631
  return o;
635
632
  }
636
- function je(t) {
633
+ function ke(t) {
637
634
  for (var e = 1; e < arguments.length; e++) {
638
635
  var o = arguments[e] != null ? arguments[e] : {};
639
- e % 2 ? nt(Object(o), !0).forEach(function(a) {
640
- Ot(t, a, o[a]);
641
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : nt(Object(o)).forEach(function(a) {
636
+ e % 2 ? et(Object(o), !0).forEach(function(a) {
637
+ jt(t, a, o[a]);
638
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : et(Object(o)).forEach(function(a) {
642
639
  Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(o, a));
643
640
  });
644
641
  }
645
642
  return t;
646
643
  }
647
- function Ot(t, e, o) {
644
+ function jt(t, e, o) {
648
645
  return e in t ? Object.defineProperty(t, e, {
649
646
  value: o,
650
647
  enumerable: !0,
@@ -652,18 +649,18 @@ __useblocks__.define("static/core/31e98e6e.js", [
652
649
  writable: !0
653
650
  }) : t[e] = o, t;
654
651
  }
655
- var Lt = {
652
+ var Et = {
656
653
  breakpointCols: void 0,
657
654
  className: void 0,
658
655
  columnClassName: void 0,
659
656
  children: void 0,
660
657
  columnAttrs: void 0,
661
658
  column: void 0
662
- }, Fe = 2, Ge = class extends n.default.Component {
659
+ }, Te = 2, Ne = class extends n.default.Component {
663
660
  constructor(t) {
664
661
  super(t), this.reCalculateColumnCount = this.reCalculateColumnCount.bind(this), this.reCalculateColumnCountDebounce = this.reCalculateColumnCountDebounce.bind(this);
665
662
  let e;
666
- this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Fe, this.state = { columnCount: e };
663
+ this.props.breakpointCols && this.props.breakpointCols.default ? e = this.props.breakpointCols.default : e = parseInt(this.props.breakpointCols) || Te, this.state = { columnCount: e };
667
664
  }
668
665
  componentDidMount() {
669
666
  this.reCalculateColumnCount(), window && window.addEventListener("resize", this.reCalculateColumnCountDebounce);
@@ -686,8 +683,8 @@ __useblocks__.define("static/core/31e98e6e.js", [
686
683
  reCalculateColumnCount() {
687
684
  const t = window && window.innerWidth || Infinity;
688
685
  let e = this.props.breakpointCols;
689
- typeof e != "object" && (e = { default: parseInt(e) || Fe });
690
- let o = Infinity, a = e.default || Fe;
686
+ typeof e != "object" && (e = { default: parseInt(e) || Te });
687
+ let o = Infinity, a = e.default || Te;
691
688
  for (let i in e) {
692
689
  const l = parseInt(i);
693
690
  l > 0 && t <= l && l < o && (o = l, a = e[i]);
@@ -706,15 +703,15 @@ __useblocks__.define("static/core/31e98e6e.js", [
706
703
  const { column: t, columnAttrs: e = {}, columnClassName: o } = this.props, a = this.itemsInColumns(), i = `${100 / a.length}%`;
707
704
  let l = o;
708
705
  l && typeof l != "string" && (this.logDeprecated("The property \"columnClassName\" requires a string"), typeof l > "u" && (l = "my-masonry-grid_column"));
709
- const b = je(je(je({}, t), e), {}, {
710
- style: je(je({}, e.style), {}, { width: i }),
706
+ const b = ke(ke(ke({}, t), e), {}, {
707
+ style: ke(ke({}, e.style), {}, { width: i }),
711
708
  className: l
712
709
  });
713
- return a.map((g, d) => n.default.createElement("div", De({}, b, { key: d }), g));
710
+ return a.map((p, d) => n.default.createElement("div", De({}, b, { key: d }), p));
714
711
  }
715
712
  logDeprecated(t) {}
716
713
  render() {
717
- const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, g = kt(t, [
714
+ const t = this.props, { children: e, breakpointCols: o, columnClassName: a, columnAttrs: i, column: l, className: b } = t, p = Rt(t, [
718
715
  "children",
719
716
  "breakpointCols",
720
717
  "columnClassName",
@@ -723,11 +720,11 @@ __useblocks__.define("static/core/31e98e6e.js", [
723
720
  "className"
724
721
  ]);
725
722
  let d = b;
726
- return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, g, { className: d }), this.renderColumns());
723
+ return typeof b != "string" && (this.logDeprecated("The property \"className\" requires a string"), typeof b > "u" && (d = "my-masonry-grid")), n.default.createElement("div", De({}, p, { className: d }), this.renderColumns());
727
724
  }
728
725
  };
729
- Ge.defaultProps = Lt;
730
- function ze(t, e) {
726
+ Ne.defaultProps = Et;
727
+ function Ge(t, e) {
731
728
  return t ? t.exhausted ? {
732
729
  ...t,
733
730
  src: null
@@ -736,21 +733,21 @@ __useblocks__.define("static/core/31e98e6e.js", [
736
733
  src: t.src || e || null
737
734
  } : null;
738
735
  }
739
- function rt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
740
- const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), g = (0, n.useCallback)((d) => {
741
- const R = e(d), x = o(d), p = `${R}:${x}`;
742
- if (b.current.has(p)) return {
743
- itemId: R,
744
- requestUrl: x,
745
- cacheKey: p,
746
- controller: b.current.get(p)
736
+ function tt({ items: t, getItemId: e, getRequestUrl: o, createController: a }) {
737
+ const [i, l] = (0, n.useState)({}), b = (0, n.useRef)(new Map()), p = (0, n.useCallback)((d) => {
738
+ const v = e(d), I = o(d), w = `${v}:${I}`;
739
+ if (b.current.has(w)) return {
740
+ itemId: v,
741
+ requestUrl: I,
742
+ cacheKey: w,
743
+ controller: b.current.get(w)
747
744
  };
748
- const w = a(x);
749
- return b.current.set(p, w), {
750
- itemId: R,
751
- requestUrl: x,
752
- cacheKey: p,
753
- controller: w
745
+ const C = a(I);
746
+ return b.current.set(w, C), {
747
+ itemId: v,
748
+ requestUrl: I,
749
+ cacheKey: w,
750
+ controller: C
754
751
  };
755
752
  }, [
756
753
  a,
@@ -758,103 +755,103 @@ __useblocks__.define("static/core/31e98e6e.js", [
758
755
  o
759
756
  ]);
760
757
  return (0, n.useEffect)(() => {
761
- const d = new Set(), R = {}, x = t.map((p) => {
762
- const { itemId: w, cacheKey: j, controller: C } = g(p);
763
- d.add(j), R[w] = C.src;
764
- const U = ze(C.handleChangeSrc?.(), C.src);
765
- return U?.changed && U.src && (R[w] = U.src), C.subscribeToSrcChange?.((y) => {
766
- const D = ze(y, C.src);
767
- !D?.changed || !D.src || l((O) => O[w] === D.src ? O : {
758
+ const d = new Set(), v = {}, I = t.map((w) => {
759
+ const { itemId: C, cacheKey: R, controller: y } = p(w);
760
+ d.add(R), v[C] = y.src;
761
+ const L = Ge(y.handleChangeSrc?.(), y.src);
762
+ return L?.changed && L.src && (v[C] = L.src), y.subscribeToSrcChange?.((A) => {
763
+ const G = Ge(A, y.src);
764
+ !G?.changed || !G.src || l((O) => O[C] === G.src ? O : {
768
765
  ...O,
769
- [w]: D.src
766
+ [C]: G.src
770
767
  });
771
768
  });
772
769
  }).filter(Boolean);
773
- return b.current.forEach((p, w) => {
774
- d.has(w) || b.current.delete(w);
775
- }), l(R), () => {
776
- x.forEach((p) => p?.());
770
+ return b.current.forEach((w, C) => {
771
+ d.has(C) || b.current.delete(C);
772
+ }), l(v), () => {
773
+ I.forEach((w) => w?.());
777
774
  };
778
- }, [g, t]), {
775
+ }, [p, t]), {
779
776
  getDisplaySrc: (0, n.useCallback)((d) => {
780
- const { itemId: R, requestUrl: x, controller: p } = g(d);
781
- return i[R] || p.src || x;
782
- }, [i, g]),
777
+ const { itemId: v, requestUrl: I, controller: w } = p(d);
778
+ return i[v] || w.src || I;
779
+ }, [i, p]),
783
780
  handleLoad: (0, n.useCallback)((d) => {
784
- g(d).controller.handleSuccess();
785
- }, [g]),
781
+ p(d).controller.handleSuccess();
782
+ }, [p]),
786
783
  handleError: (0, n.useCallback)((d) => {
787
- const { itemId: R, controller: x } = g(d), p = ze(x.handleError(), x.src);
788
- p?.changed && p.src && l((w) => ({
789
- ...w,
790
- [R]: p.src
784
+ const { itemId: v, controller: I } = p(d), w = Ge(I.handleError(), I.src);
785
+ w?.changed && w.src && l((C) => ({
786
+ ...C,
787
+ [v]: w.src
791
788
  }));
792
- }, [g])
789
+ }, [p])
793
790
  };
794
791
  }
795
- var st = "blocks", Dt = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: g, setStockLink: d, customRequest: R }) => {
796
- const x = u.useAppConfig(), p = u.useIsStandalone(), [w, j] = (0, n.useState)(!1), [C, U] = (0, n.useState)(2), { __: y } = m.useI18n(), D = m.useNotification(), [O] = _.useLazyGetUnsplashImageQuery(), [T] = _.useLazyGetSearchImageQuery(), Q = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : y("Failed to load stock images through the configured proxy chain."), [y]), N = (0, n.useCallback)((s) => {
797
- D.error({
792
+ var nt = "blocks", Ot = ({ setCurrentImageLink: t, setModalHeight: e, setModalWidth: o, setImageStockList: a, imageStockList: i, currentReq: l, setCurrentReq: b, inputRef: p, setStockLink: d, customRequest: v }) => {
793
+ const I = u.useAppConfig(), w = u.useIsStandalone(), [C, R] = (0, n.useState)(!1), [y, L] = (0, n.useState)(2), { __: A } = m.useI18n(), G = m.useNotification(), [O] = Z.useLazyGetUnsplashImageQuery(), [D] = Z.useLazyGetSearchImageQuery(), H = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : A("Failed to load stock images through the configured proxy chain."), [A]), B = (0, n.useCallback)((s) => {
794
+ G.error({
798
795
  id: "STOCK_IMAGES_SEARCH_FAILED",
799
- title: y("Failed to load stock images"),
800
- description: Q(s)
796
+ title: A("Failed to load stock images"),
797
+ description: H(s)
801
798
  });
802
799
  }, [
803
- y,
804
- Q,
805
- D
806
- ]), M = async () => {
807
- w || (j(!0), T({
800
+ A,
801
+ H,
802
+ G
803
+ ]), z = async () => {
804
+ C || (R(!0), D({
808
805
  query: l,
809
- page: C
806
+ page: y
810
807
  }).then((s) => {
811
808
  if (s?.error) {
812
- N(s.error), j(!1);
809
+ B(s.error), R(!1);
813
810
  return;
814
811
  }
815
812
  const h = s?.data?.results || [];
816
- a((W) => [...W, ...h]), j(!1), U((W) => W + 1);
813
+ a((W) => [...W, ...h]), R(!1), L((W) => W + 1);
817
814
  }).catch(() => {
818
- j(!1);
815
+ R(!1);
819
816
  }));
820
817
  };
821
818
  (0, n.useEffect)(() => {
822
- l.keywords !== "" && z();
819
+ l.keywords !== "" && V();
823
820
  }, [l.color, l.orientation]);
824
- const z = async () => {
825
- const s = await T({
821
+ const V = async () => {
822
+ const s = await D({
826
823
  query: l,
827
824
  page: 1
828
825
  });
829
826
  if (s?.error) {
830
- N(s.error), a([]);
827
+ B(s.error), a([]);
831
828
  return;
832
829
  }
833
830
  const h = s?.data?.results || [];
834
831
  h.length > 0 ? (a(h), setTimeout(() => {
835
832
  o(1060), e("84vh");
836
833
  }, 0)) : a([]);
837
- }, [ee, K] = (0, n.useState)(null), k = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
838
- config: x,
839
- standalone: p,
834
+ }, [ee, q] = (0, n.useState)(null), E = (0, n.useCallback)((s, h, W) => `${s}${s.includes("?") ? "&" : "?"}w=${h}&q=${W}`, []), P = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
835
+ config: I,
836
+ standalone: w,
840
837
  resourceType: "stockImages",
841
838
  intent: "display"
842
- }), [x, p]), { getDisplaySrc: E, handleLoad: I, handleError: A } = rt({
839
+ }), [I, w]), { getDisplaySrc: j, handleLoad: x, handleError: S } = tt({
843
840
  items: i,
844
841
  getItemId: (0, n.useCallback)((s) => s.id, []),
845
- getRequestUrl: (0, n.useCallback)((s) => k(s.urls.raw, 644, 96), [k]),
842
+ getRequestUrl: (0, n.useCallback)((s) => E(s.urls.raw, 644, 96), [E]),
846
843
  createController: P
847
- }), L = (s) => (h) => {
848
- I(s), h.target.parentNode.classList.add("loaded");
849
- }, J = (s) => () => {
850
- A(s);
851
- }, q = (s, h, W) => {
852
- O(h.download_location), K(W), setTimeout(() => K(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), R(`${s.raw}&w=1200&q=96`);
844
+ }), U = (s) => (h) => {
845
+ x(s), h.target.parentNode.classList.add("loaded");
846
+ }, _ = (s) => () => {
847
+ S(s);
848
+ }, K = (s, h, W) => {
849
+ O(h.download_location), q(W), setTimeout(() => q(null), 2e3), d(`${s.raw}&w=1200&q=96`), t(`${s.raw}&w=1200&q=96`), v(`${s.raw}&w=1200&q=96`);
853
850
  };
854
851
  return (0, r.jsxs)("div", {
855
852
  className: "stock-tab",
856
853
  children: [(0, r.jsxs)(m.Form, {
857
- onValuesChange: z,
854
+ onValuesChange: V,
858
855
  className: i.length > 0 ? "serach-results" : "",
859
856
  children: [(0, r.jsxs)(m.Row, {
860
857
  gutter: 24,
@@ -863,16 +860,16 @@ __useblocks__.define("static/core/31e98e6e.js", [
863
860
  children: (0, r.jsx)(m.Form.Item, {
864
861
  className: "stock-search-input",
865
862
  children: (0, r.jsx)(m.SearchInput, {
866
- onSearch: z,
863
+ onSearch: V,
867
864
  allowClear: !0,
868
865
  size: i.length > 0 ? "medium" : "large",
869
- placeholder: y("Search image"),
866
+ placeholder: A("Search image"),
870
867
  value: l.keywords,
871
868
  onChange: (s) => b((h) => ({
872
869
  ...h,
873
870
  keywords: s.target.value
874
871
  })),
875
- ref: g,
872
+ ref: p,
876
873
  spellCheck: "false",
877
874
  enterButton: !1
878
875
  })
@@ -885,35 +882,35 @@ __useblocks__.define("static/core/31e98e6e.js", [
885
882
  })),
886
883
  children: [
887
884
  (0, r.jsx)(m.Tooltip, {
888
- title: y("All"),
885
+ title: A("All"),
889
886
  placement: "top",
890
887
  children: (0, r.jsx)(m.Radio.Button, {
891
888
  value: "",
892
- children: (0, r.jsx)(F.EmIcons, { icon: "MixedView" })
889
+ children: (0, r.jsx)(N.EmIcons, { icon: "MixedView" })
893
890
  })
894
891
  }),
895
892
  (0, r.jsx)(m.Tooltip, {
896
- title: y("Landscape"),
893
+ title: A("Landscape"),
897
894
  placement: "top",
898
895
  children: (0, r.jsx)(m.Radio.Button, {
899
896
  value: "landscape",
900
- children: (0, r.jsx)(F.EmIcons, { icon: "LandscapeView" })
897
+ children: (0, r.jsx)(N.EmIcons, { icon: "LandscapeView" })
901
898
  })
902
899
  }),
903
900
  (0, r.jsx)(m.Tooltip, {
904
- title: y("Portrait"),
901
+ title: A("Portrait"),
905
902
  placement: "top",
906
903
  children: (0, r.jsx)(m.Radio.Button, {
907
904
  value: "portrait",
908
- children: (0, r.jsx)(F.EmIcons, { icon: "PortraitView" })
905
+ children: (0, r.jsx)(N.EmIcons, { icon: "PortraitView" })
909
906
  })
910
907
  }),
911
908
  (0, r.jsx)(m.Tooltip, {
912
- title: y("Squarish"),
909
+ title: A("Squarish"),
913
910
  placement: "top",
914
911
  children: (0, r.jsx)(m.Radio.Button, {
915
912
  value: "squarish",
916
- children: (0, r.jsx)(F.EmIcons, { icon: "SquareView" })
913
+ children: (0, r.jsx)(N.EmIcons, { icon: "SquareView" })
917
914
  })
918
915
  })
919
916
  ]
@@ -927,57 +924,57 @@ __useblocks__.define("static/core/31e98e6e.js", [
927
924
  {
928
925
  value: "",
929
926
  colorClass: "all-colors",
930
- label: y("All")
927
+ label: A("All")
931
928
  },
932
929
  {
933
930
  value: "black",
934
931
  colorClass: "black-color",
935
- label: y("Black")
932
+ label: A("Black")
936
933
  },
937
934
  {
938
935
  value: "black_and_white",
939
936
  colorClass: "bw-color",
940
- label: y("Black and White")
937
+ label: A("Black and White")
941
938
  },
942
939
  {
943
940
  value: "white",
944
941
  colorClass: "white-color",
945
- label: y("White")
942
+ label: A("White")
946
943
  },
947
944
  {
948
945
  value: "orange",
949
946
  colorClass: "orange-color",
950
- label: y("Orange")
947
+ label: A("Orange")
951
948
  },
952
949
  {
953
950
  value: "red",
954
951
  colorClass: "red-color",
955
- label: y("Red")
952
+ label: A("Red")
956
953
  },
957
954
  {
958
955
  value: "purple",
959
956
  colorClass: "purple-color",
960
- label: y("Purple")
957
+ label: A("Purple")
961
958
  },
962
959
  {
963
960
  value: "magenta",
964
961
  colorClass: "magenta-color",
965
- label: y("Magenta")
962
+ label: A("Magenta")
966
963
  },
967
964
  {
968
965
  value: "green",
969
966
  colorClass: "green-color",
970
- label: y("Green")
967
+ label: A("Green")
971
968
  },
972
969
  {
973
970
  value: "teal",
974
971
  colorClass: "teal-color",
975
- label: y("Teal")
972
+ label: A("Teal")
976
973
  },
977
974
  {
978
975
  value: "blue",
979
976
  colorClass: "blue-color",
980
- label: y("Blue")
977
+ label: A("Blue")
981
978
  }
982
979
  ],
983
980
  tooltipPlacement: "top"
@@ -1005,32 +1002,32 @@ __useblocks__.define("static/core/31e98e6e.js", [
1005
1002
  lineHeight: "0",
1006
1003
  boxSizing: "unset"
1007
1004
  },
1008
- children: (0, r.jsx)(tt, {
1005
+ children: (0, r.jsx)($e, {
1009
1006
  dataLength: i && i.length,
1010
- next: M,
1007
+ next: z,
1011
1008
  hasMore: i,
1012
1009
  endMessage: (0, r.jsxs)(m.Divider, {
1013
1010
  plain: !0,
1014
- children: [y("That`s all we could find."), " 🤐"]
1011
+ children: [A("That`s all we could find."), " 🤐"]
1015
1012
  }),
1016
1013
  scrollableTarget: "scrollableDiv",
1017
1014
  style: { overflow: "visible" },
1018
1015
  loader: null,
1019
- children: (0, r.jsx)(Ge, {
1016
+ children: (0, r.jsx)(Ne, {
1020
1017
  breakpointCols: { default: 3 },
1021
1018
  className: "my-masonry-grid",
1022
1019
  columnClassName: "my-masonry-grid_column",
1023
1020
  children: i.map((s) => (0, r.jsxs)("div", {
1024
1021
  className: "list-item",
1025
- onClick: () => q(s.urls, s.links, s.id),
1022
+ onClick: () => K(s.urls, s.links, s.id),
1026
1023
  children: [
1027
1024
  (0, r.jsx)("img", {
1028
1025
  className: ee === s.id ? "loaded-image" : "",
1029
1026
  width: "322px",
1030
- src: E(s),
1027
+ src: j(s),
1031
1028
  alt: s.description,
1032
- onLoad: L(s),
1033
- onError: J(s)
1029
+ onLoad: U(s),
1030
+ onError: _(s)
1034
1031
  }),
1035
1032
  (0, r.jsxs)("p", {
1036
1033
  className: "creator-info",
@@ -1040,7 +1037,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
1040
1037
  " ",
1041
1038
  (0, r.jsx)("a", {
1042
1039
  target: "_blank",
1043
- href: `${s.user.links.html}?utm_source=${st}&utm_medium=referral`,
1040
+ href: `${s.user.links.html}?utm_source=${nt}&utm_medium=referral`,
1044
1041
  rel: "noreferrer",
1045
1042
  children: s.user.name
1046
1043
  }),
@@ -1049,7 +1046,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
1049
1046
  " ",
1050
1047
  (0, r.jsx)("a", {
1051
1048
  target: "_blank",
1052
- href: `https://unsplash.com/?utm_source=${st}&utm_medium=referral`,
1049
+ href: `https://unsplash.com/?utm_source=${nt}&utm_medium=referral`,
1053
1050
  rel: "noreferrer",
1054
1051
  children: "Unsplash"
1055
1052
  })
@@ -1067,14 +1064,14 @@ __useblocks__.define("static/core/31e98e6e.js", [
1067
1064
  })]
1068
1065
  });
1069
1066
  };
1070
- function at(t) {
1067
+ function rt(t) {
1071
1068
  return /^(https?:)?\/\//i.test(t.trim());
1072
1069
  }
1073
- function Bt(t) {
1070
+ function Lt(t) {
1074
1071
  const e = t.trim();
1075
- return at(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
1072
+ return rt(e) || /^data:/i.test(e) ? e : `data:image/jpeg;base64, ${t}`;
1076
1073
  }
1077
- var Ut = ({ images: t, transitionDuration: e = 1e3 }) => {
1074
+ var Dt = ({ images: t, transitionDuration: e = 1e3 }) => {
1078
1075
  const [o, a] = (0, n.useState)([]);
1079
1076
  return (0, n.useEffect)(() => {
1080
1077
  if (t.length > 0) {
@@ -1083,7 +1080,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
1083
1080
  src: i,
1084
1081
  opacity: 0
1085
1082
  }]), setTimeout(() => {
1086
- a((l) => l.map((b, g) => g === l.length - 1 ? {
1083
+ a((l) => l.map((b, p) => p === l.length - 1 ? {
1087
1084
  ...b,
1088
1085
  opacity: 1
1089
1086
  } : b));
@@ -1092,7 +1089,7 @@ __useblocks__.define("static/core/31e98e6e.js", [
1092
1089
  }, [t]), (0, r.jsx)("div", {
1093
1090
  className: "slideshow-container",
1094
1091
  children: o.map((i, l) => (0, r.jsx)("img", {
1095
- src: Bt(i.src),
1092
+ src: Lt(i.src),
1096
1093
  alt: `Slide ${l + 1}`,
1097
1094
  className: "slideshow-image",
1098
1095
  style: {
@@ -1102,115 +1099,115 @@ __useblocks__.define("static/core/31e98e6e.js", [
1102
1099
  }, l))
1103
1100
  });
1104
1101
  };
1105
- function Mt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: g, isLoadingAi: d, setIsLoadingAi: R, onPluginAiImageLimitExceeded: x, onImageGenerateLimitExceeded: p }) {
1106
- const { __: w } = m.useI18n(), j = u.useAppConfig(), C = m.useNotification(), U = u.usePushToDataLayer(), { emailId: y, blockId: D, projectId: O } = (0, Ne.useParams)(), [T] = _.useLazySendAiImageRequestQuery(), [Q, { data: N = [] }] = _.useLazyGetAiImageSSEQuery(), [M] = _.useLazyGetLimitsStatsByTypeQuery(), z = j?.sendAIImageRequest || T, ee = j?.trigger || Q, K = j?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [k, P] = (0, n.useState)(0), [E, I] = (0, n.useState)(null), [A, L] = (0, n.useState)(!1), [J, q] = (0, n.useState)(w("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = y || D, { limits: ce } = j?.limits ? j : { limits: { ai_img_limit: 0 } }, { ai_img_limit: Z } = ce, $ = !!(j.limits && j.counters) && u.PLUGIN.isPlugin, X = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), H = ne.shouldCountAiUsage({
1107
- limitsInPlugin: $,
1108
- hostedAiActive: X
1109
- }), ie = !X && Z > 0 && k >= Z, he = (0, n.useCallback)(() => {
1110
- K.fire({
1102
+ function Bt({ setModalHeight: t, customRequest: e, aiTabRef: o, isImageUploaded: a, setIsImageUploaded: i, aiImageRequest: l, imageAiList: b, setImageAiList: p, isLoadingAi: d, setIsLoadingAi: v, onPluginAiImageLimitExceeded: I, onImageGenerateLimitExceeded: w }) {
1103
+ const { __: C } = m.useI18n(), R = u.useAppConfig(), y = m.useNotification(), L = u.usePushToDataLayer(), { emailId: A, blockId: G, projectId: O } = u.useParams(), [D] = Z.useLazySendAiImageRequestQuery(), [H, { data: B = [] }] = Z.useLazyGetAiImageSSEQuery(), [z] = Z.useLazyGetLimitsStatsByTypeQuery(), V = R?.sendAIImageRequest || D, ee = R?.trigger || H, q = R?.handleLimitUsageEmitter || u.useEventEmitter(u.events.ON_LIMIT_ID), [E, P] = (0, n.useState)(0), [j, x] = (0, n.useState)(null), [S, U] = (0, n.useState)(!1), [_, K] = (0, n.useState)(C("Evaluating the task")), [s, h] = (0, n.useState)(!1), W = A || G, { limits: me } = R?.limits ? R : { limits: { ai_img_limit: 0 } }, { ai_img_limit: T } = me, J = !!(R.limits && R.counters) && u.PLUGIN.isPlugin, $ = u.useEventEmitter(u.events.AI_IMAGE_REQUEST_ID).hasListeners(), F = ne.shouldCountAiUsage({
1104
+ limitsInPlugin: J,
1105
+ hostedAiActive: $
1106
+ }), he = !$ && T > 0 && E >= T, ie = (0, n.useCallback)(() => {
1107
+ q.fire({
1111
1108
  name: "AiImgCount",
1112
- count: k + 1
1109
+ count: E + 1
1113
1110
  });
1114
- }, [K, k]), ye = (0, n.useMemo)(() => !ie && (!H || Z === 0 || k < Z), [
1115
- ie,
1116
- H,
1117
- k,
1118
- Z
1119
- ]), ue = (0, n.useCallback)(async () => {
1120
- q(w("Evaluating the task")), l !== "" && !d && (R(!0), h(!0), g([]), U({
1111
+ }, [q, E]), pe = (0, n.useMemo)(() => !he && (!F || T === 0 || E < T), [
1112
+ he,
1113
+ F,
1114
+ E,
1115
+ T
1116
+ ]), Ae = (0, n.useCallback)(async () => {
1117
+ K(C("Evaluating the task")), l !== "" && !d && (v(!0), h(!0), p([]), L({
1121
1118
  event: "submit_form",
1122
1119
  action: "ai_image_generation",
1123
- entity_id: y,
1120
+ entity_id: A,
1124
1121
  project_id: O
1125
- }), z({ body: {
1122
+ }), V({ body: {
1126
1123
  project_id: O,
1127
1124
  request: "create-image",
1128
1125
  connection: "midjourney",
1129
1126
  message: l
1130
- } }).then(({ data: v, error: te }) => {
1127
+ } }).then(({ data: g, error: te }) => {
1131
1128
  if (te) throw te;
1132
- if (v.data.status === 401) throw new Error(u.ERROR);
1133
- if (v?.data?._eventResult) {
1134
- g(v.data.task.images), R(!1), h(!1), q(w("Evaluating the task"));
1129
+ if (g.data.status === 401) throw new Error(u.ERROR);
1130
+ if (g?.data?._eventResult) {
1131
+ p(g.data.task.images), v(!1), h(!1), K(C("Evaluating the task"));
1135
1132
  return;
1136
1133
  }
1137
- v?.data.status === 200 ? (v?.data.task.id && (q(v.data.task.message), I(v.data.task.id)), v.message && C.success({
1134
+ g?.data.status === 200 ? (g?.data.task.id && (K(g.data.task.message), x(g.data.task.id)), g.message && y.success({
1138
1135
  id: "AI_IMAGE_SEND_SUCCESS",
1139
- title: v.message,
1136
+ title: g.message,
1140
1137
  placement: "bottomRight",
1141
1138
  data: l
1142
1139
  }), ee({
1143
- task_id: v?.data.task.id,
1140
+ task_id: g?.data.task.id,
1144
1141
  entity_id: W
1145
- })) : (R(!1), h(!1), C.error({
1142
+ })) : (v(!1), h(!1), y.error({
1146
1143
  id: "AI_IMAGE_SEND_ERROR",
1147
- title: v?.message || w("Something went wrong, please try again"),
1144
+ title: g?.message || C("Something went wrong, please try again"),
1148
1145
  placement: "bottomRight",
1149
1146
  data: l,
1150
- innerException: v
1147
+ innerException: g
1151
1148
  }));
1152
- }).catch((v) => {
1153
- R(!1), h(!1), (v?.error || v?.data) && C.fromError("AI_IMAGE_SEND_ERROR", l, v.error || v);
1149
+ }).catch((g) => {
1150
+ v(!1), h(!1), (g?.error || g?.data) && y.fromError("AI_IMAGE_SEND_ERROR", l, g.error || g);
1154
1151
  }));
1155
1152
  }, [
1156
1153
  l,
1157
1154
  d,
1158
- R,
1155
+ v,
1159
1156
  h,
1160
- g,
1161
- U,
1162
- y,
1157
+ p,
1158
+ L,
1159
+ A,
1163
1160
  O,
1164
- z,
1165
- C,
1161
+ V,
1162
+ y,
1166
1163
  ee,
1167
1164
  W,
1168
- w
1165
+ C
1169
1166
  ]), Y = (0, n.useCallback)(async () => {
1170
- if (ye) {
1171
- if (!u.PLUGIN.isPlugin && !X) {
1172
- const v = F.resolveLimitActionPreflightExceededForType("image_generate", (await M("image_generate")).data?.stats);
1173
- if (v) {
1174
- p?.(v);
1167
+ if (pe) {
1168
+ if (!u.PLUGIN.isPlugin && !$) {
1169
+ const g = N.resolveLimitActionPreflightExceededForType("image_generate", (await z("image_generate")).data?.stats);
1170
+ if (g) {
1171
+ w?.(g);
1175
1172
  return;
1176
1173
  }
1177
1174
  }
1178
- H && (P((v) => v + 1), he()), ue();
1179
- } else $ && (x ? x() : C.error({
1180
- title: w("The usage limit has been exceeded"),
1181
- description: w(`The maximum number of requests for the current subscription period has been reached.
1175
+ F && (P((g) => g + 1), ie()), Ae();
1176
+ } else J && (I ? I() : y.error({
1177
+ title: C("The usage limit has been exceeded"),
1178
+ description: C(`The maximum number of requests for the current subscription period has been reached.
1182
1179
  Select the appropriate plan to fulfil more requests`),
1183
1180
  placement: "bottomRight"
1184
1181
  }));
1185
1182
  }, [
1186
- ye,
1183
+ pe,
1184
+ J,
1187
1185
  $,
1188
- X,
1189
- H,
1190
- M,
1191
- p,
1186
+ F,
1187
+ z,
1188
+ w,
1192
1189
  P,
1193
- he,
1194
- ue,
1190
+ ie,
1191
+ Ae,
1192
+ y,
1195
1193
  C,
1196
- w,
1197
- x
1194
+ I
1198
1195
  ]);
1199
1196
  (0, n.useEffect)(() => {
1200
- $ && P(j?.counters?.ai_img_counter || 0);
1201
- }, [j, $]);
1202
- const se = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1197
+ J && P(R?.counters?.ai_img_counter || 0);
1198
+ }, [R, J]);
1199
+ const re = u.useEventEmitter(u.events.AI_IMAGE_PROGRESS_ID);
1203
1200
  (0, n.useEffect)(() => {
1204
- const v = se.event(({ progress: te, status: G }) => {
1205
- q(G || `${Math.round(te)}%`);
1201
+ const g = re.event(({ progress: te, status: X }) => {
1202
+ K(X || `${Math.round(te)}%`);
1206
1203
  });
1207
- return () => v.dispose();
1208
- }, [se]);
1209
- const B = (0, n.useCallback)(async (v) => {
1204
+ return () => g.dispose();
1205
+ }, [re]);
1206
+ const M = (0, n.useCallback)(async (g) => {
1210
1207
  if (!a) {
1211
1208
  i(!0);
1212
1209
  try {
1213
- const te = at(v) ? await (await fetch(v)).blob() : $e(v);
1210
+ const te = rt(g) ? await (await fetch(g)).blob() : Xe(g);
1214
1211
  e({ file: new File([te], "image.jpeg", { type: te.type || "image/jpeg" }) });
1215
1212
  } catch {
1216
1213
  i(!1);
@@ -1220,63 +1217,63 @@ Select the appropriate plan to fulfil more requests`),
1220
1217
  a,
1221
1218
  i,
1222
1219
  e
1223
- ]), ae = (0, n.useCallback)((v) => {
1224
- v.status !== "error" && v.status !== "Canceled" ? v.images ? (q(v.status), v.progress === 100 && (g(v.images), q(w("Evaluating the task")), I(null), h(!1))) : (g([v.data]), R(!1)) : (R(!1), h(!1), C.error({
1220
+ ]), ae = (0, n.useCallback)((g) => {
1221
+ g.status !== "error" && g.status !== "Canceled" ? g.images ? (K(g.status), g.progress === 100 && (p(g.images), K(C("Evaluating the task")), x(null), h(!1))) : (p([g.data]), v(!1)) : (v(!1), h(!1), y.error({
1225
1222
  id: "AI_IMAGE_GET_ERROR",
1226
- title: w("Something went wrong, please try again"),
1223
+ title: C("Something went wrong, please try again"),
1227
1224
  placement: "bottomRight",
1228
- data: E
1225
+ data: j
1229
1226
  }));
1230
1227
  }, [
1231
- g,
1232
- q,
1233
- w,
1234
- R,
1235
- t,
1236
- E,
1228
+ p,
1229
+ K,
1237
1230
  C,
1231
+ v,
1232
+ t,
1233
+ j,
1234
+ y,
1238
1235
  h
1239
1236
  ]);
1240
1237
  return (0, n.useEffect)(() => {
1241
- N.length > 1 && ae(N[N.length - 1]);
1242
- }, [N, ae]), (0, n.useEffect)(() => {
1238
+ B.length > 1 && ae(B[B.length - 1]);
1239
+ }, [B, ae]), (0, n.useEffect)(() => {
1243
1240
  (d || b.length > 0) && setTimeout(() => {
1244
- let v = 550;
1245
- o.current && (v = o.current.offsetHeight + 68), t(v);
1241
+ let g = 550;
1242
+ o.current && (g = o.current.offsetHeight + 68), t(g);
1246
1243
  }, 0);
1247
1244
  }, [
1248
1245
  o,
1249
- N,
1246
+ B,
1250
1247
  b.length,
1251
1248
  d,
1252
1249
  t
1253
1250
  ]), {
1254
- aiImageCounter: k,
1251
+ aiImageCounter: E,
1255
1252
  setAiImageCounter: P,
1256
- currentAiImgLimits: Z,
1257
- isFieldsDisabled: ie,
1258
- canGenerateImage: ye,
1253
+ currentAiImgLimits: T,
1254
+ isFieldsDisabled: he,
1255
+ canGenerateImage: pe,
1259
1256
  aiImageRequest: l,
1260
1257
  imageAiList: b,
1261
- setImageAiList: g,
1258
+ setImageAiList: p,
1262
1259
  isLoadingAi: d,
1263
- setIsLoadingAi: R,
1260
+ setIsLoadingAi: v,
1264
1261
  loadingDuringGeneration: s,
1265
1262
  setLoadingDuringGeneration: h,
1266
- requestStatus: J,
1267
- setRequestStatus: q,
1263
+ requestStatus: _,
1264
+ setRequestStatus: K,
1268
1265
  handleGenerate: Y,
1269
- handleLimitAiImgCount: he,
1270
- convertBase64ToFile: B,
1271
- isShiftPressed: A,
1272
- setIsShiftPressed: L,
1273
- currentReqId: E,
1274
- setCurrentReqId: I,
1275
- limitsInPlugin: $
1266
+ handleLimitAiImgCount: ie,
1267
+ convertBase64ToFile: M,
1268
+ isShiftPressed: S,
1269
+ setIsShiftPressed: U,
1270
+ currentReqId: j,
1271
+ setCurrentReqId: x,
1272
+ limitsInPlugin: J
1276
1273
  };
1277
1274
  }
1278
- var Pt = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: g, imageAiList: d, setImageAiList: R, isLoadingAi: x, setIsLoadingAi: p }) => {
1279
- const w = (0, Ne.useNavigate)(), j = u.useDispatch(), { __: C, _n: U } = m.useI18n(), y = u.useAppConfig(), [D, O] = (0, n.useState)(!1), [T, Q] = (0, n.useState)(null), { aiImageCounter: N, currentAiImgLimits: M, loadingDuringGeneration: z, requestStatus: ee, handleGenerate: K, convertBase64ToFile: k, isShiftPressed: P, setIsShiftPressed: E, limitsInPlugin: I } = Mt({
1275
+ var Ut = ({ setModalHeight: t, customRequest: e, aiTabRef: o, inputAiRef: a, isImageUploaded: i, setIsImageUploaded: l, aiImageRequest: b, setAiImageRequest: p, imageAiList: d, setImageAiList: v, isLoadingAi: I, setIsLoadingAi: w }) => {
1276
+ const C = u.useNavigate(), R = u.useDispatch(), { __: y, _n: L } = m.useI18n(), A = u.useAppConfig(), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(null), { aiImageCounter: B, currentAiImgLimits: z, loadingDuringGeneration: V, requestStatus: ee, handleGenerate: q, convertBase64ToFile: E, isShiftPressed: P, setIsShiftPressed: j, limitsInPlugin: x } = Bt({
1280
1277
  setModalHeight: t,
1281
1278
  customRequest: e,
1282
1279
  aiTabRef: o,
@@ -1284,58 +1281,58 @@ Select the appropriate plan to fulfil more requests`),
1284
1281
  setIsImageUploaded: l,
1285
1282
  aiImageRequest: b,
1286
1283
  imageAiList: d,
1287
- setImageAiList: R,
1288
- isLoadingAi: x,
1289
- setIsLoadingAi: p,
1284
+ setImageAiList: v,
1285
+ isLoadingAi: I,
1286
+ setIsLoadingAi: w,
1290
1287
  onPluginAiImageLimitExceeded: () => O(!0),
1291
- onImageGenerateLimitExceeded: Q
1292
- }), A = D && M > 0 ? ne.getAiTariffUpgradeStep(M) : null, L = A ? F.getLimitUpgradePresetDefinition(A.presetId) : null, J = T ? F.getLimitUpgradePresetDefinition(T.presetId) : null, [q, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), ce = (0, n.useCallback)((H) => g(H.target.value), [g]), Z = (0, n.useCallback)((H) => {
1293
- H.key === "Shift" ? E(!0) : H.key === "Enter" && !P && (H.preventDefault(), K());
1288
+ onImageGenerateLimitExceeded: H
1289
+ }), S = G && z > 0 ? ne.getAiTariffUpgradeStep(z) : null, U = S ? N.getLimitUpgradePresetDefinition(S.presetId) : null, _ = D ? N.getLimitUpgradePresetDefinition(D.presetId) : null, [K, s] = (0, n.useState)(!1), h = (0, n.useCallback)(() => s(!0), []), W = (0, n.useCallback)(() => s(!1), []), me = (0, n.useCallback)((F) => p(F.target.value), [p]), T = (0, n.useCallback)((F) => {
1290
+ F.key === "Shift" ? j(!0) : F.key === "Enter" && !P && (F.preventDefault(), q());
1294
1291
  }, [
1295
1292
  P,
1296
- K,
1297
- E
1298
- ]), $ = (0, n.useCallback)((H) => {
1299
- H.key === "Shift" && E(!1);
1300
- }, [E]), X = d[d.length - 1];
1293
+ q,
1294
+ j
1295
+ ]), J = (0, n.useCallback)((F) => {
1296
+ F.key === "Shift" && j(!1);
1297
+ }, [j]), $ = d[d.length - 1];
1301
1298
  return (0, r.jsxs)("div", {
1302
1299
  className: "image-ai",
1303
1300
  children: [
1304
- L && A ? (0, r.jsx)(F.LimitUpgradeModal, {
1301
+ U && S ? (0, r.jsx)(N.LimitUpgradeModal, {
1305
1302
  open: !0,
1306
1303
  onClose: () => O(!1),
1307
- title: C(L.titleKey),
1308
- subtitle: C(L.subtitleKey),
1309
- usageResource: L.usageResource,
1310
- previousDisplay: F.presetLimitDisplay(A.previousLimit),
1311
- nextDisplay: F.presetLimitDisplay(A.nextLimit),
1304
+ title: y(U.titleKey),
1305
+ subtitle: y(U.subtitleKey),
1306
+ usageResource: U.usageResource,
1307
+ previousDisplay: N.presetLimitDisplay(S.previousLimit),
1308
+ nextDisplay: N.presetLimitDisplay(S.nextLimit),
1312
1309
  onChangePlan: () => {
1313
- O(!1), document.body.classList.remove("editor"), w("/billing"), j(_.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1310
+ O(!1), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1314
1311
  }
1315
1312
  }) : null,
1316
- J && T ? (0, r.jsx)(F.LimitUpgradeModal, {
1313
+ _ && D ? (0, r.jsx)(N.LimitUpgradeModal, {
1317
1314
  open: !0,
1318
- onClose: () => Q(null),
1319
- title: C(J.titleKey),
1320
- subtitle: C(J.subtitleKey),
1321
- usageResource: J.usageResource,
1322
- previousDisplay: F.presetLimitDisplay(T.previousLimit),
1323
- nextDisplay: F.presetLimitDisplay(T.nextLimit),
1315
+ onClose: () => H(null),
1316
+ title: y(_.titleKey),
1317
+ subtitle: y(_.subtitleKey),
1318
+ usageResource: _.usageResource,
1319
+ previousDisplay: N.presetLimitDisplay(D.previousLimit),
1320
+ nextDisplay: N.presetLimitDisplay(D.nextLimit),
1324
1321
  onChangePlan: () => {
1325
- Q(null), document.body.classList.remove("editor"), w("/billing"), j(_.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1322
+ H(null), document.body.classList.remove("editor"), C("/billing"), R(Z.openModal(u.MODALS.SWITCH_TO_PLAN_MODAL));
1326
1323
  }
1327
1324
  }) : null,
1328
- I && (0, r.jsx)(m.LimitsCounter, {
1329
- text: `${N} ${C("of")} ${M > 0 ? M : "∞"} images ${U("was used", "were used", N)}`,
1330
- exceeded: M > 0 && N >= M,
1325
+ x && (0, r.jsx)(m.LimitsCounter, {
1326
+ text: `${B} ${y("of")} ${z > 0 ? z : "∞"} images ${L("was used", "were used", B)}`,
1327
+ exceeded: z > 0 && B >= z,
1331
1328
  style: { marginTop: -25 },
1332
1329
  extra: (0, r.jsx)("span", {
1333
1330
  style: {
1334
1331
  textDecoration: "underline",
1335
1332
  cursor: "pointer"
1336
1333
  },
1337
- onClick: () => w(y.billingPageUrl || u.APP_ROUTES.billing),
1338
- children: C("Need more?")
1334
+ onClick: () => C(A.billingPageUrl || u.APP_ROUTES.billing),
1335
+ children: y("Need more?")
1339
1336
  })
1340
1337
  }),
1341
1338
  (0, r.jsx)(m.Row, {
@@ -1346,43 +1343,43 @@ Select the appropriate plan to fulfil more requests`),
1346
1343
  children: (0, r.jsx)(m.Form.Item, {
1347
1344
  style: { margin: 0 },
1348
1345
  children: (0, r.jsxs)("span", {
1349
- className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${q ? " ant-input-affix-wrapper-focused" : ""}`,
1346
+ className: `ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${K ? " ant-input-affix-wrapper-focused" : ""}`,
1350
1347
  children: [(0, r.jsx)(m.TextArea, {
1351
1348
  ref: a,
1352
- onKeyDown: Z,
1353
- onKeyUp: $,
1349
+ onKeyDown: T,
1350
+ onKeyUp: J,
1354
1351
  onFocus: h,
1355
1352
  onBlur: W,
1356
1353
  autoSize: !0,
1357
1354
  allowClear: !0,
1358
1355
  className: "text-area-input-hybrid image-ai__textarea",
1359
- placeholder: C("Generate image"),
1356
+ placeholder: y("Generate image"),
1360
1357
  value: b,
1361
- onChange: ce,
1358
+ onChange: me,
1362
1359
  spellCheck: "false"
1363
1360
  }), (0, r.jsx)("span", {
1364
1361
  className: "ant-input-suffix image-ai__input-suffix",
1365
- children: x || z ? (0, r.jsx)(F.EmIcons, {
1362
+ children: I || V ? (0, r.jsx)(N.EmIcons, {
1366
1363
  icon: "LoadingOutlined",
1367
1364
  className: "input-icon image-ai__input-icon",
1368
1365
  spin: !0
1369
- }) : (0, r.jsx)(F.EmIcons, {
1366
+ }) : (0, r.jsx)(N.EmIcons, {
1370
1367
  icon: "AI",
1371
1368
  className: "input-icon image-ai__input-icon",
1372
- onClick: K
1369
+ onClick: q
1373
1370
  })
1374
1371
  })]
1375
1372
  })
1376
1373
  })
1377
1374
  })
1378
1375
  }),
1379
- (x || d.length > 0) && (0, r.jsxs)("div", {
1376
+ (I || d.length > 0) && (0, r.jsxs)("div", {
1380
1377
  className: "image-ai__preview",
1381
- children: [x && d.length === 0 && (0, r.jsx)("div", {
1378
+ children: [I && d.length === 0 && (0, r.jsx)("div", {
1382
1379
  className: "image-ai__loading",
1383
1380
  children: (0, r.jsxs)("div", {
1384
1381
  className: "spin",
1385
- children: [(0, r.jsx)(F.EmIcons, {
1382
+ children: [(0, r.jsx)(N.EmIcons, {
1386
1383
  icon: "LoadingOutlined",
1387
1384
  style: { fontSize: 48 },
1388
1385
  spin: !0
@@ -1393,77 +1390,77 @@ Select the appropriate plan to fulfil more requests`),
1393
1390
  })
1394
1391
  }), d.length > 0 && (0, r.jsxs)("div", {
1395
1392
  className: "image-ai__image-item",
1396
- children: [(0, r.jsx)(Ut, { images: d }), (0, r.jsx)("div", {
1393
+ children: [(0, r.jsx)(Dt, { images: d }), (0, r.jsx)("div", {
1397
1394
  className: "buttons",
1398
1395
  children: (0, r.jsx)(m.Button, {
1399
- onClick: () => k(X),
1400
- icon: (0, r.jsx)(F.EmIcons, { icon: "CheckOutlined" }),
1401
- children: C("Use this one")
1396
+ onClick: () => E($),
1397
+ icon: (0, r.jsx)(N.EmIcons, { icon: "CheckOutlined" }),
1398
+ children: y("Use this one")
1402
1399
  })
1403
1400
  })]
1404
1401
  })]
1405
1402
  })
1406
1403
  ]
1407
1404
  });
1408
- }, Tt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: g, inputRef: d, setStockLink: R, customRequest: x }) => {
1409
- const { __: p } = m.useI18n(), w = u.useAppConfig(), j = u.useIsStandalone(), C = m.useNotification(), [U, y] = (0, n.useState)(null), [D, O] = (0, n.useState)(!1), [T, Q] = (0, n.useState)(25), [N] = _.useLazyGetSearchGifQuery(), M = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : p("Failed to load GIFs through the configured proxy chain."), [p]), z = (0, n.useCallback)((s) => {
1410
- C.error({
1405
+ }, Mt = ({ setNewLink: t, setCurrentImageLink: e, setModalHeight: o, setModalWidth: a, setImageGifList: i, imageGifList: l, currentReqGif: b, setCurrentReqGif: p, inputRef: d, setStockLink: v, customRequest: I }) => {
1406
+ const { __: w } = m.useI18n(), C = u.useAppConfig(), R = u.useIsStandalone(), y = m.useNotification(), [L, A] = (0, n.useState)(null), [G, O] = (0, n.useState)(!1), [D, H] = (0, n.useState)(25), [B] = Z.useLazyGetSearchGifQuery(), z = (0, n.useCallback)((s) => s instanceof Error || typeof s?.message == "string" && s.message ? s.message : typeof s?.error?.message == "string" && s.error.message ? s.error.message : w("Failed to load GIFs through the configured proxy chain."), [w]), V = (0, n.useCallback)((s) => {
1407
+ y.error({
1411
1408
  id: "STOCK_GIFS_SEARCH_FAILED",
1412
- title: p("Failed to load GIFs"),
1413
- description: M(s)
1409
+ title: w("Failed to load GIFs"),
1410
+ description: z(s)
1414
1411
  });
1415
1412
  }, [
1416
- p,
1417
- M,
1418
- C
1413
+ w,
1414
+ z,
1415
+ y
1419
1416
  ]), ee = async () => {
1420
- D || (O(!0), N({
1417
+ G || (O(!0), B({
1421
1418
  query: b,
1422
- page: T
1419
+ page: D
1423
1420
  }).then((s) => {
1424
1421
  if (s?.error) {
1425
- z(s.error), O(!1);
1422
+ V(s.error), O(!1);
1426
1423
  return;
1427
1424
  }
1428
- i((h) => [...h, ...s.data.data]), O(!1), Q((h) => h + 25);
1425
+ i((h) => [...h, ...s.data.data]), O(!1), H((h) => h + 25);
1429
1426
  }).catch(() => {
1430
1427
  O(!1);
1431
1428
  }));
1432
- }, K = async () => {
1433
- const s = await N({
1429
+ }, q = async () => {
1430
+ const s = await B({
1434
1431
  query: b,
1435
1432
  page: 0
1436
1433
  });
1437
1434
  if (s?.error) {
1438
- z(s.error), i([]);
1435
+ V(s.error), i([]);
1439
1436
  return;
1440
1437
  }
1441
1438
  s?.data?.data?.length > 0 && (i(s.data.data), setTimeout(() => {
1442
1439
  o("84vh"), a(1060);
1443
1440
  }, 0));
1444
- }, k = (s, h) => {
1445
- y(h), setTimeout(() => {
1446
- y(null);
1447
- }, 2e3), R(`${s}`), e(`${s}`), x(`${s}`);
1448
- }, P = { default: 3 }, E = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1449
- config: w,
1450
- standalone: j,
1441
+ }, E = (s, h) => {
1442
+ A(h), setTimeout(() => {
1443
+ A(null);
1444
+ }, 2e3), v(`${s}`), e(`${s}`), I(`${s}`);
1445
+ }, P = { default: 3 }, j = (0, n.useCallback)((s) => u.getProxiedUrl(s, {
1446
+ config: C,
1447
+ standalone: R,
1451
1448
  resourceType: "generic",
1452
1449
  intent: "display"
1453
- }), [w, j]), { getDisplaySrc: I, handleLoad: A, handleError: L } = rt({
1450
+ }), [C, R]), { getDisplaySrc: x, handleLoad: S, handleError: U } = tt({
1454
1451
  items: l,
1455
1452
  getItemId: (0, n.useCallback)((s) => s.id, []),
1456
1453
  getRequestUrl: (0, n.useCallback)((s) => s.images.downsized.url, []),
1457
- createController: E
1458
- }), J = (s) => (h) => {
1459
- A(s), h.target.parentNode.classList.add("loaded");
1460
- }, q = (s) => () => {
1461
- L(s);
1454
+ createController: j
1455
+ }), _ = (s) => (h) => {
1456
+ S(s), h.target.parentNode.classList.add("loaded");
1457
+ }, K = (s) => () => {
1458
+ U(s);
1462
1459
  };
1463
1460
  return (0, r.jsxs)("div", {
1464
1461
  className: "stock-tab",
1465
1462
  children: [(0, r.jsxs)(m.Form, {
1466
- onValuesChange: K,
1463
+ onValuesChange: q,
1467
1464
  className: l.length > 0 ? "serach-results" : "",
1468
1465
  children: [(0, r.jsx)(m.Row, {
1469
1466
  gutter: 24,
@@ -1472,12 +1469,12 @@ Select the appropriate plan to fulfil more requests`),
1472
1469
  children: (0, r.jsx)(m.Form.Item, {
1473
1470
  className: "stock-search-input",
1474
1471
  children: (0, r.jsx)(m.SearchInput, {
1475
- onSearch: K,
1472
+ onSearch: q,
1476
1473
  allowClear: !0,
1477
1474
  size: l.length > 0 ? "medium" : "large",
1478
- placeholder: p("Search GIFs"),
1475
+ placeholder: w("Search GIFs"),
1479
1476
  value: b.keywords,
1480
- onChange: (s) => g((h) => ({
1477
+ onChange: (s) => p((h) => ({
1481
1478
  ...h,
1482
1479
  keywords: s.target.value
1483
1480
  })),
@@ -1510,32 +1507,32 @@ Select the appropriate plan to fulfil more requests`),
1510
1507
  lineHeight: "0",
1511
1508
  boxSizing: "unset"
1512
1509
  },
1513
- children: (0, r.jsx)(tt, {
1510
+ children: (0, r.jsx)($e, {
1514
1511
  dataLength: l && l.length,
1515
1512
  next: ee,
1516
1513
  hasMore: l,
1517
1514
  endMessage: (0, r.jsxs)(m.Divider, {
1518
1515
  plain: !0,
1519
- children: [p("That`s all we could find."), " 🤐"]
1516
+ children: [w("That`s all we could find."), " 🤐"]
1520
1517
  }),
1521
1518
  scrollableTarget: "scrollableDiv",
1522
1519
  style: { overflow: "visible" },
1523
1520
  loader: (0, r.jsx)(m.Spin, { size: "small" }),
1524
- children: (0, r.jsx)(Ge, {
1521
+ children: (0, r.jsx)(Ne, {
1525
1522
  breakpointCols: P,
1526
1523
  className: "my-masonry-grid",
1527
1524
  columnClassName: "my-masonry-grid_column",
1528
1525
  children: l.map((s, h) => (0, r.jsxs)("div", {
1529
1526
  className: "list-item",
1530
- onClick: () => k(s.images.downsized.url, s.id),
1527
+ onClick: () => E(s.images.downsized.url, s.id),
1531
1528
  children: [
1532
1529
  (0, r.jsx)("img", {
1533
- className: U === s.id ? "loaded-image" : "",
1530
+ className: L === s.id ? "loaded-image" : "",
1534
1531
  width: "322px",
1535
- src: I(s),
1532
+ src: x(s),
1536
1533
  alt: s.title,
1537
- onLoad: J(s),
1538
- onError: q(s)
1534
+ onLoad: _(s),
1535
+ onError: K(s)
1539
1536
  }),
1540
1537
  (0, r.jsx)("a", {
1541
1538
  rel: "noreferrer",
@@ -1547,7 +1544,7 @@ Select the appropriate plan to fulfil more requests`),
1547
1544
  style: { backgroundImage: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)" }
1548
1545
  })
1549
1546
  }),
1550
- U === s.id && (0, r.jsx)(m.Spin, {
1547
+ L === s.id && (0, r.jsx)(m.Spin, {
1551
1548
  className: "ant-spin",
1552
1549
  size: "small"
1553
1550
  })
@@ -1559,10 +1556,10 @@ Select the appropriate plan to fulfil more requests`),
1559
1556
  })]
1560
1557
  });
1561
1558
  };
1562
- function Nt(t) {
1559
+ function Pt(t) {
1563
1560
  if (!(t == null || t === "")) return t;
1564
1561
  }
1565
- async function Ft(t, e) {
1562
+ async function Tt(t, e) {
1566
1563
  if (t) {
1567
1564
  if (t.url) return t.url;
1568
1565
  if (typeof e.getFileById == "function" && t.id) {
@@ -1582,10 +1579,10 @@ Select the appropriate plan to fulfil more requests`),
1582
1579
  return t.thumbnail || t.thumbnailUrl;
1583
1580
  }
1584
1581
  }
1585
- function Gt(t) {
1582
+ function Nt(t) {
1586
1583
  if (!(!t?.success || !Array.isArray(t.detailed))) return t.detailed.find((e) => e?.success && e.data)?.data;
1587
1584
  }
1588
- function zt(t, e, o) {
1585
+ function Gt(t, e, o) {
1589
1586
  if (t) return {
1590
1587
  id: t.id,
1591
1588
  name: t.name || e.name,
@@ -1605,11 +1602,11 @@ Select the appropriate plan to fulfil more requests`),
1605
1602
  childrenCount: t.childrenCount
1606
1603
  };
1607
1604
  }
1608
- async function Kt(t, e, o) {
1605
+ async function Ft(t, e, o) {
1609
1606
  if (!e) return;
1610
- const a = Nt(o ?? e.rootId);
1607
+ const a = Pt(o ?? e.rootId);
1611
1608
  let i;
1612
- typeof e.uploadFiles == "function" ? i = Gt(await e.uploadFiles({
1609
+ typeof e.uploadFiles == "function" ? i = Nt(await e.uploadFiles({
1613
1610
  folderId: a,
1614
1611
  items: [{
1615
1612
  name: t.name,
@@ -1618,307 +1615,305 @@ Select the appropriate plan to fulfil more requests`),
1618
1615
  folderId: a,
1619
1616
  data: t
1620
1617
  }]
1621
- })) : typeof e.uploadFile == "function" && (i = zt(await e.uploadFile({
1618
+ })) : typeof e.uploadFile == "function" && (i = Gt(await e.uploadFile({
1622
1619
  name: t.name,
1623
1620
  size: t.size,
1624
1621
  type: t.type,
1625
1622
  folderId: a,
1626
1623
  data: t
1627
1624
  }), t, a));
1628
- const l = await Ft(i, e);
1625
+ const l = await Tt(i, e);
1629
1626
  return l ? {
1630
1627
  item: i,
1631
1628
  url: l
1632
1629
  } : void 0;
1633
1630
  }
1634
- var ot = "IMG", it = "BACKGROUND", Wt = "GALLERY", Ae = "EDITOR", pe = "UPLOAD", Ke = "STOCK", We = "GIF", He = "AI", Ht = { mode: "select" }, Vt = { mode: "save" }, { Dragger: Qt } = m.Upload, qt = (t, e = "image") => _.decodeFileNameFromUrl(t) ?? e, ke = ne.normalizeImageFormatForDisplay, Yt = (t, e) => {
1635
- const o = ke(e);
1631
+ var st = "IMG", at = "BACKGROUND", zt = "GALLERY", we = "EDITOR", fe = "UPLOAD", Fe = "STOCK", ze = "GIF", Ke = "AI", Kt = { mode: "select" }, Wt = { mode: "save" }, { Dragger: Ht } = m.Upload, Vt = (t, e = "image") => Z.decodeFileNameFromUrl(t) ?? e, je = ne.normalizeImageFormatForDisplay, qt = (t, e) => {
1632
+ const o = je(e);
1636
1633
  return !o || t.includes(".") ? t : `${t}.${o}`;
1637
- }, _t = (t, e) => new File([t], Yt(qt(e), t.type), { type: t.type || "application/octet-stream" }), lt = ({ dataProvider: t }) => {
1638
- const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = (0, Ne.useParams)(), [b] = _.useLazyGetImageInfoQuery(), { modal: g } = m.App.useApp(), d = m.useNotification(), R = u.useSelector(u.selectedIsUserPaySmth), x = u.useSelector(u.selectedCurrentUser), p = u.useSelector(_.selectActiveModal), { request: w, resolveImagePicker: j } = F.useImagePicker(), [C, U] = (0, n.useState)(""), [y, D] = (0, n.useState)(""), [O, T] = (0, n.useState)(""), [Q, N] = (0, n.useState)(""), [M, z] = (0, n.useState)(pe), [ee, K] = (0, n.useState)({
1634
+ }, Qt = (t, e) => new File([t], qt(Vt(e), t.type), { type: t.type || "application/octet-stream" }), ot = ({ dataProvider: t }) => {
1635
+ const e = u.useAppConfig(), o = u.useIsStandalone(), { __: a } = m.useI18n(), i = u.useDispatch(), { projectId: l } = u.useParams(), [b] = Z.useLazyGetImageInfoQuery(), { modal: p } = m.App.useApp(), d = m.useNotification(), v = u.useSelector(Z.selectActiveModal), { request: I, resolveImagePicker: w } = N.useImagePicker(), [C, R] = (0, n.useState)(""), [y, L] = (0, n.useState)(""), [A, G] = (0, n.useState)(""), [O, D] = (0, n.useState)(""), [H, B] = (0, n.useState)(fe), [z, V] = (0, n.useState)({
1639
1636
  width: "",
1640
1637
  height: "",
1641
1638
  size: "",
1642
1639
  format: ""
1643
- }), [k, P] = (0, n.useState)("success"), [E, I] = (0, n.useState)(!1), A = n.default.useRef(null), L = n.default.useRef(null), J = n.default.useRef(null), q = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), ce = n.default.useRef(null), Z = n.default.useRef(null), [$, X] = (0, n.useState)("auto"), [H, ie] = (0, n.useState)(572), [he, ye] = (0, n.useState)(!1), [ue, Y] = (0, n.useState)({
1640
+ }), [ee, q] = (0, n.useState)("success"), [E, P] = (0, n.useState)(!1), j = n.default.useRef(null), x = n.default.useRef(null), S = n.default.useRef(null), U = n.default.useRef(null), _ = n.default.useRef(null), K = n.default.useRef(null), s = n.default.useRef(null), h = n.default.useRef(null), W = n.default.useRef(null), [me, T] = (0, n.useState)("auto"), [J, $] = (0, n.useState)(572), [F, he] = (0, n.useState)(!1), [ie, pe] = (0, n.useState)({
1644
1641
  keywords: "",
1645
1642
  color: "",
1646
1643
  orientation: ""
1647
- }), [se, B] = (0, n.useState)({ keywords: "" }), [ae, v] = (0, n.useState)([]), [te, G] = (0, n.useState)([]), [fe, Zt] = (0, n.useState)([]), [ct, ut] = (0, n.useState)(!1), [dt, Ve] = (0, n.useState)(""), [Xt, Ee] = (0, n.useState)(!1), [Jt, Be] = (0, n.useState)(0), Qe = u.useSelector(u.selectProject), ft = Qe?.id !== void 0 ? String(Qe.id) : l || "", mt = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), qe = n.default.useRef(""), be = n.default.useRef(0), xe = n.default.useRef(""), [$t, pt] = (0, n.useState)(""), [en, gt] = (0, n.useState)(null), [tn, Ye] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1644
+ }), [Ae, Y] = (0, n.useState)({ keywords: "" }), [re, M] = (0, n.useState)([]), [ae, g] = (0, n.useState)([]), [te, X] = (0, n.useState)([]), [ce, it] = (0, n.useState)(!1), [lt, We] = (0, n.useState)(""), [_t, Ee] = (0, n.useState)(!1), [Yt, Be] = (0, n.useState)(0), He = u.useSelector(u.selectProject), ct = He?.id !== void 0 ? String(He.id) : l || "", ut = u.useEventEmitter(u.events.UPLOAD_EVENT_ID), Ie = n.default.useRef(ne.createImageUrlBlobResolver()), Ve = n.default.useRef(""), Ce = n.default.useRef(0), xe = n.default.useRef(""), [Zt, dt] = (0, n.useState)(""), [Xt, ft] = (0, n.useState)(null), [Jt, qe] = (0, n.useState)(""), Ue = (0, n.useCallback)((c) => {
1648
1645
  if (!(c instanceof Blob)) return;
1649
1646
  xe.current && URL.revokeObjectURL(xe.current);
1650
1647
  const f = URL.createObjectURL(c);
1651
- xe.current = f, pt(f), gt(c);
1648
+ xe.current = f, dt(f), ft(c);
1652
1649
  }, []), ge = (0, n.useCallback)(() => {
1653
- xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), pt(""), gt(null);
1654
- }, []), de = (0, n.useCallback)(() => {
1655
- Ye("");
1656
- }, []);
1657
- let ve = !(R || !F.isProjectOwner(Qe, x));
1658
- const nn = (c) => {
1659
- D(c.target.value);
1660
- }, Me = (0, n.useCallback)((c, f, S = a("The image could not be uploaded.")) => {
1661
- const V = f instanceof Error ? f.message : S;
1650
+ xe.current && (URL.revokeObjectURL(xe.current), xe.current = ""), dt(""), ft(null);
1651
+ }, []), le = (0, n.useCallback)(() => {
1652
+ qe("");
1653
+ }, []), ye = N.isEditorLockedByPlan(He, { isPlugin: u.PLUGIN.isPlugin }), $t = (c) => {
1654
+ L(c.target.value);
1655
+ }, Me = (0, n.useCallback)((c, f, k = a("The image could not be uploaded.")) => {
1656
+ const Q = f instanceof Error ? f.message : k;
1662
1657
  d.error({
1663
1658
  id: "IMAGE_UPLOAD_ERROR",
1664
1659
  data: c,
1665
1660
  title: a("Upload failed"),
1666
- description: V
1661
+ description: Q
1667
1662
  });
1668
- }, [a, d]), rn = (0, n.useCallback)(async (c) => F.pickUploadImageUrlFromFireResults(await mt.fire({
1663
+ }, [a, d]), en = (0, n.useCallback)(async (c) => N.pickUploadImageUrlFromFireResults(await ut.fire({
1669
1664
  file: c,
1670
- project: ft
1671
- })), [ft, mt]), we = ne.useImageBlobFetch(), sn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, we), [we]), Pe = async (c) => {
1665
+ project: ct
1666
+ })), [ct, ut]), be = ne.useImageBlobFetch(), tn = (0, n.useCallback)((c) => Ie.current.resolve(ne.canonicalImageUrlKey(c), void 0, be), [be]), Pe = async (c) => {
1672
1667
  if (c) try {
1673
- const f = await an(c);
1674
- f && Ze(f) ? await Oe({ file: f }) : f || Me({ url: c }, null, a("Failed to download image from URL."));
1668
+ const f = await nn(c);
1669
+ f && _e(f) ? await Oe({ file: f }) : f || Me({ url: c }, null, a("Failed to download image from URL."));
1675
1670
  } catch (f) {
1676
1671
  Me({ url: c }, f, a("Failed to process image URL."));
1677
1672
  }
1678
- }, ht = n.default.useRef(Pe);
1679
- ht.current = Pe, n.default.useEffect(() => {
1680
- if (M !== pe || !Q) return;
1673
+ }, mt = n.default.useRef(Pe);
1674
+ mt.current = Pe, n.default.useEffect(() => {
1675
+ if (H !== fe || !O) return;
1681
1676
  const c = y.trim();
1682
1677
  if (!c || !c.toLowerCase().startsWith("http")) return;
1683
1678
  const f = setTimeout(() => {
1684
- ht.current(c);
1679
+ mt.current(c);
1685
1680
  }, 1e3);
1686
1681
  return () => {
1687
1682
  clearTimeout(f);
1688
1683
  };
1689
1684
  }, [
1690
1685
  y,
1691
- M,
1692
- Q
1686
+ H,
1687
+ O
1693
1688
  ]);
1694
- const an = async (c) => {
1689
+ const nn = async (c) => {
1695
1690
  try {
1696
1691
  const f = ne.canonicalImageUrlKey(c);
1697
- return _t(await Ie.current.resolve(f, void 0, we), f);
1692
+ return Qt(await Ie.current.resolve(f, void 0, be), f);
1698
1693
  } catch {}
1699
1694
  };
1700
1695
  document.onpaste = function(c) {
1701
1696
  const f = c.clipboardData?.items?.[0];
1702
- if (M === pe && Q) {
1697
+ if (H === fe && O) {
1703
1698
  if (f?.type?.indexOf("image") === 0 && e.imageCenterLocalUploadEnabled !== !1) {
1704
- const V = f.getAsFile();
1705
- Ze(V);
1706
- const oe = { file: V };
1707
- D(""), Oe(oe);
1699
+ const Q = f.getAsFile();
1700
+ _e(Q);
1701
+ const oe = { file: Q };
1702
+ L(""), Oe(oe);
1708
1703
  return;
1709
1704
  }
1710
- const S = c.clipboardData?.getData("text/plain");
1711
- if (S && S.trim().toLowerCase().startsWith("http")) {
1712
- c.preventDefault(), c.stopPropagation(), D(S.trim());
1705
+ const k = c.clipboardData?.getData("text/plain");
1706
+ if (k && k.trim().toLowerCase().startsWith("http")) {
1707
+ c.preventDefault(), c.stopPropagation(), L(k.trim());
1713
1708
  return;
1714
1709
  }
1715
- f?.type?.indexOf("text") === 0 && f.getAsString((V) => {
1716
- if (V.trim().toLowerCase().startsWith("http")) D(V.trim());
1717
- else if (V.toString().slice(1, 5) === "meta") {
1718
- const oe = V.toString().split("\"")[1];
1719
- oe && D(oe);
1710
+ f?.type?.indexOf("text") === 0 && f.getAsString((Q) => {
1711
+ if (Q.trim().toLowerCase().startsWith("http")) L(Q.trim());
1712
+ else if (Q.toString().slice(1, 5) === "meta") {
1713
+ const oe = Q.toString().split("\"")[1];
1714
+ oe && L(oe);
1720
1715
  }
1721
1716
  });
1722
1717
  }
1723
1718
  }, (0, n.useEffect)(() => {
1724
1719
  const c = (f) => {
1725
- let S = null;
1726
- w?.kind === "background" ? (S = it, N(it)) : w?.kind === "img" && (N(ot), S = ot), w?.currentUrl && S && (U(w.currentUrl), z(f));
1720
+ let k = null;
1721
+ I?.kind === "background" ? (k = at, D(at)) : I?.kind === "img" && (D(st), k = st), I?.currentUrl && k && (R(I.currentUrl), B(f));
1727
1722
  };
1728
- p === u.MODALS.UPLOAD_IMAGE_MODAL || p === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(Ae) : p === u.MODALS.UPLOAD_IMAGE_MODAL_AI || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ve ? (Ee(!0), Be(2)) : c(He), setTimeout(() => Z.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(pe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ve ? (Ee(!0), Be(3)) : c(Ke), setTimeout(() => ce.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ve ? (Ee(!0), Be(3)) : c(We), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : p === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || p === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ve ? (Ee(!0), Be(5)) : c(Ae), i(_.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : N("");
1723
+ v === u.MODALS.UPLOAD_IMAGE_MODAL || v === u.MODALS.UPLOAD_BACKGROUND_MODAL ? c(we) : v === u.MODALS.UPLOAD_IMAGE_MODAL_AI || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_AI ? (ye ? (Ee(!0), Be(2)) : c(Ke), setTimeout(() => W.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD ? (c(fe), setTimeout(() => K.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_STOCK || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK ? (ye ? (Ee(!0), Be(3)) : c(Fe), setTimeout(() => h.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_GIF || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_GIF ? (ye ? (Ee(!0), Be(3)) : c(ze), setTimeout(() => s.current?.focus({ cursor: "start" }), 100)) : v === u.MODALS.UPLOAD_IMAGE_MODAL_EDIT || v === u.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT ? (ye ? (Ee(!0), Be(5)) : c(we), i(Z.openSecondModal(u.MODALS.IMAGE_EDITOR_MODAL))) : D("");
1729
1724
  }, [
1730
- p,
1725
+ v,
1731
1726
  i,
1732
- ve,
1733
- w
1727
+ ye,
1728
+ I
1734
1729
  ]);
1735
- const _e = (0, n.useCallback)(({ url: c = C || "", meta: f = Ht }) => {
1736
- U(c), j({
1730
+ const Qe = (0, n.useCallback)(({ url: c = C || "", meta: f = Kt }) => {
1731
+ R(c), w({
1737
1732
  url: c,
1738
1733
  meta: f
1739
1734
  }), setTimeout(() => {
1740
- de(), ge(), Y({
1735
+ le(), ge(), pe({
1741
1736
  keywords: "",
1742
1737
  color: "",
1743
1738
  orientation: ""
1744
- }), B({ keywords: "" }), G([]), v([]), N(""), Ve(""), ut(!1), T(""), D(""), z(pe);
1745
- }, 200), i(_.closeModal()), i(_.closeSecondModal());
1739
+ }), Y({ keywords: "" }), g([]), M([]), D(""), We(""), it(!1), G(""), L(""), B(fe);
1740
+ }, 200), i(Z.closeModal()), i(Z.closeSecondModal());
1746
1741
  }, [
1747
1742
  C,
1748
- de,
1743
+ le,
1749
1744
  i,
1750
- j,
1745
+ w,
1751
1746
  ge
1752
- ]), yt = (0, n.useCallback)((c, f) => (X("auto"), I(!1), _e({
1747
+ ]), pt = (0, n.useCallback)((c, f) => (T("auto"), P(!1), Qe({
1753
1748
  url: c,
1754
- meta: Vt
1749
+ meta: Wt
1755
1750
  }), d.success({
1756
1751
  id: "IMAGE_UPLOAD_SUCCESS",
1757
1752
  data: f,
1758
1753
  title: a("The image was successfully uploaded.")
1759
1754
  }), c), [
1760
1755
  a,
1761
- _e,
1756
+ Qe,
1762
1757
  d
1763
1758
  ]);
1764
1759
  (0, n.useEffect)(() => {
1765
- const c = y || O, f = ne.canonicalImageUrlKey(c);
1760
+ const c = y || A, f = ne.canonicalImageUrlKey(c);
1766
1761
  if (!c || !f) {
1767
- P(""), qe.current = "", de(), ge(), Ie.current.invalidateAll();
1762
+ q(""), Ve.current = "", le(), ge(), Ie.current.invalidateAll();
1768
1763
  return;
1769
1764
  }
1770
- const S = qe.current;
1771
- S && S !== f && (Ie.current.abandonKey(S), de(), ge()), qe.current = f;
1772
- const V = new AbortController(), oe = y ? 800 : 0, re = ++be.current, Xe = setTimeout(async () => {
1765
+ const k = Ve.current;
1766
+ k && k !== f && (Ie.current.abandonKey(k), le(), ge()), Ve.current = f;
1767
+ const Q = new AbortController(), oe = y ? 800 : 0, se = ++Ce.current, Ye = setTimeout(async () => {
1773
1768
  try {
1774
1769
  const Se = async () => {
1775
- const me = await Ie.current.resolve(f, V.signal, we);
1776
- if (re !== be.current) return;
1777
- const { width: Ce, height: un } = await ne.getImageDimensionsFromBlob(me);
1778
- re === be.current && (K({
1779
- width: Ce,
1780
- height: un,
1781
- size: (me.size / 1024).toFixed(2),
1782
- format: ke(me.type)
1783
- }), de(), Ue(me));
1770
+ const ue = await Ie.current.resolve(f, Q.signal, be);
1771
+ if (se !== Ce.current) return;
1772
+ const { width: ve, height: on } = await ne.getImageDimensionsFromBlob(ue);
1773
+ se === Ce.current && (V({
1774
+ width: ve,
1775
+ height: on,
1776
+ size: (ue.size / 1024).toFixed(2),
1777
+ format: je(ue.type)
1778
+ }), le(), Ue(ue));
1784
1779
  };
1785
1780
  if (o) await Se();
1786
1781
  else {
1787
- const me = await ne.resolveDataProviderPreview(t, f);
1788
- if (me?.previewUrl && re === be.current) {
1789
- Ye(me.previewUrl), ge();
1782
+ const ue = await ne.resolveDataProviderPreview(t, f);
1783
+ if (ue?.previewUrl && se === Ce.current) {
1784
+ qe(ue.previewUrl), ge();
1790
1785
  try {
1791
- const { data: Ce } = await b(f);
1792
- if (re !== be.current) return;
1793
- Ce ? K({
1794
- width: Ce?.width,
1795
- height: Ce?.height,
1796
- size: Ce?.fileSize != null ? (Ce.fileSize / 1024).toFixed(2) : "",
1797
- format: ke(Ce?.format)
1786
+ const { data: ve } = await b(f);
1787
+ if (se !== Ce.current) return;
1788
+ ve ? V({
1789
+ width: ve?.width,
1790
+ height: ve?.height,
1791
+ size: ve?.fileSize != null ? (ve.fileSize / 1024).toFixed(2) : "",
1792
+ format: je(ve?.format)
1798
1793
  }) : await Se();
1799
1794
  } catch {
1800
1795
  await Se();
1801
1796
  }
1802
1797
  } else await Se();
1803
1798
  }
1804
- if (re !== be.current) return;
1805
- P("success"), U(c), ie(572), setTimeout(() => {
1806
- let me = 0;
1807
- L.current && (me = L.current.offsetHeight + 62), X(me);
1799
+ if (se !== Ce.current) return;
1800
+ q("success"), R(c), $(572), setTimeout(() => {
1801
+ let ue = 0;
1802
+ x.current && (ue = x.current.offsetHeight + 62), T(ue);
1808
1803
  }, 0);
1809
1804
  } catch (Se) {
1810
- if (Se?.name === "AbortError" || V.signal.aborted || re !== be.current) return;
1811
- de(), ge(), P("error");
1805
+ if (Se?.name === "AbortError" || Q.signal.aborted || se !== Ce.current) return;
1806
+ le(), ge(), q("error");
1812
1807
  }
1813
1808
  }, oe);
1814
1809
  return () => {
1815
- clearTimeout(Xe), V.abort();
1810
+ clearTimeout(Ye), Q.abort();
1816
1811
  };
1817
1812
  }, [
1818
1813
  y,
1819
- O,
1814
+ A,
1820
1815
  o,
1821
- de,
1822
- we,
1816
+ le,
1817
+ be,
1823
1818
  b,
1824
1819
  ge,
1825
1820
  t,
1826
1821
  Ue
1827
1822
  ]), (0, n.useEffect)(() => {
1828
- if (!C || y || O) return;
1823
+ if (!C || y || A) return;
1829
1824
  const c = ne.canonicalImageUrlKey(C), f = new AbortController();
1830
- let S = !1;
1831
- const V = async () => {
1832
- const oe = await Ie.current.resolve(c, f.signal, we);
1833
- if (S) return;
1834
- const { width: re, height: Xe } = await ne.getImageDimensionsFromBlob(oe);
1835
- S || (de(), Ue(oe), K({
1836
- width: re,
1837
- height: Xe,
1825
+ let k = !1;
1826
+ const Q = async () => {
1827
+ const oe = await Ie.current.resolve(c, f.signal, be);
1828
+ if (k) return;
1829
+ const { width: se, height: Ye } = await ne.getImageDimensionsFromBlob(oe);
1830
+ k || (le(), Ue(oe), V({
1831
+ width: se,
1832
+ height: Ye,
1838
1833
  size: (oe.size / 1024).toFixed(2),
1839
- format: ke(oe.type)
1834
+ format: je(oe.type)
1840
1835
  }));
1841
1836
  };
1842
1837
  return (async () => {
1843
1838
  try {
1844
1839
  if (!o) {
1845
1840
  const oe = await ne.resolveDataProviderPreview(t, c);
1846
- if (oe?.previewUrl && !S) {
1847
- Ye(oe.previewUrl), ge();
1841
+ if (oe?.previewUrl && !k) {
1842
+ qe(oe.previewUrl), ge();
1848
1843
  try {
1849
- const { data: re } = await b(c);
1850
- if (S) return;
1851
- re ? K({
1852
- width: re?.width,
1853
- height: re?.height,
1854
- size: re?.fileSize != null ? (re.fileSize / 1024).toFixed(2) : "",
1855
- format: ke(re?.format)
1856
- }) : await V();
1844
+ const { data: se } = await b(c);
1845
+ if (k) return;
1846
+ se ? V({
1847
+ width: se?.width,
1848
+ height: se?.height,
1849
+ size: se?.fileSize != null ? (se.fileSize / 1024).toFixed(2) : "",
1850
+ format: je(se?.format)
1851
+ }) : await Q();
1857
1852
  return;
1858
1853
  } catch {
1859
- await V();
1854
+ await Q();
1860
1855
  }
1861
1856
  }
1862
1857
  }
1863
- await V();
1858
+ await Q();
1864
1859
  } catch {
1865
- S || de();
1860
+ k || le();
1866
1861
  }
1867
1862
  })(), () => {
1868
- S = !0, f.abort();
1863
+ k = !0, f.abort();
1869
1864
  };
1870
1865
  }, [
1871
1866
  o,
1872
- de,
1867
+ le,
1873
1868
  C,
1874
- we,
1869
+ be,
1875
1870
  b,
1876
1871
  t,
1877
1872
  y,
1878
- O,
1873
+ A,
1879
1874
  Ue
1880
1875
  ]);
1881
- const on = () => {
1882
- i(_.closeModal()), setTimeout(() => {
1883
- de(), ge(), U(""), D(""), G([]), G([]), Y({
1876
+ const rn = () => {
1877
+ i(Z.closeModal()), setTimeout(() => {
1878
+ le(), ge(), R(""), L(""), g([]), g([]), pe({
1884
1879
  keywords: "",
1885
1880
  color: "",
1886
1881
  orientation: ""
1887
- }), B({ keywords: "" }), X("auto"), !ct && Ve(""), ie(572), z(pe);
1882
+ }), Y({ keywords: "" }), T("auto"), !ce && We(""), $(572), B(fe);
1888
1883
  }, 200);
1889
- }, ln = (c) => {
1890
- c === Wt ? g.success({
1884
+ }, sn = (c) => {
1885
+ c === zt ? p.success({
1891
1886
  mask: { closable: !0 },
1892
1887
  centered: !0,
1893
1888
  title: a("Coming soon"),
1894
1889
  content: a("The feature is under development."),
1895
1890
  okText: a("Ok. I'll be waiting"),
1896
1891
  onOk: () => {}
1897
- }) : c === Ae && C === "" ? g.warning({
1892
+ }) : c === we && C === "" ? p.warning({
1898
1893
  mask: { closable: !0 },
1899
1894
  centered: !0,
1900
1895
  title: a(""),
1901
1896
  content: a("To preview and edit the uploaded image"),
1902
1897
  okText: a("Upload Image"),
1903
1898
  onOk: () => {
1904
- z(pe);
1899
+ B(fe);
1905
1900
  }
1906
1901
  }) : (setTimeout(() => {
1907
- let f = 0, S = 0;
1908
- c === pe && A.current ? (ue.keywords === "" && h.current?.focus({ cursor: "start" }), f = 300, S = 572) : c === Ae && L.current ? (f = L.current.offsetHeight + 62, S = 572) : c === Ke && J.current ? (ue.keywords === "" && ce.current?.focus({ cursor: "start" }), f = 130, S = 572, te.length > 0 && (S = 1060, f = "84vh")) : c === We && q.current ? (ue.keywords === "" && W.current?.focus({ cursor: "start" }), f = 130, S = 572, ae.length > 0 && (S = 1060, f = "84vh")) : c === He && s.current && (dt === "" && fe.length === 0 ? (Z.current?.focus({ cursor: "start" }), f = 130) : f = s.current.offsetHeight + 82, S = 572), X(f), ie(S);
1909
- }, 0), z(c));
1902
+ let f = 0, k = 0;
1903
+ c === fe && j.current ? (ie.keywords === "" && K.current?.focus({ cursor: "start" }), f = 300, k = 572) : c === we && x.current ? (f = x.current.offsetHeight + 62, k = 572) : c === Fe && S.current ? (ie.keywords === "" && h.current?.focus({ cursor: "start" }), f = 130, k = 572, ae.length > 0 && (k = 1060, f = "84vh")) : c === ze && U.current ? (ie.keywords === "" && s.current?.focus({ cursor: "start" }), f = 130, k = 572, re.length > 0 && (k = 1060, f = "84vh")) : c === Ke && _.current && (lt === "" && te.length === 0 ? (W.current?.focus({ cursor: "start" }), f = 130) : f = _.current.offsetHeight + 82, k = 572), T(f), $(k);
1904
+ }, 0), B(c));
1910
1905
  };
1911
1906
  (0, n.useEffect)(() => {
1912
- ue.keywords === "" && (h?.current?.focus({ cursor: "start" }), G([]), setTimeout(() => {
1913
- X("auto"), ie(572);
1907
+ ie.keywords === "" && (K?.current?.focus({ cursor: "start" }), g([]), setTimeout(() => {
1908
+ T("auto"), $(572);
1914
1909
  }, 0));
1915
1910
  }, [
1916
- ue,
1917
- G,
1918
- X,
1919
- ie
1911
+ ie,
1912
+ g,
1913
+ T,
1914
+ $
1920
1915
  ]);
1921
- const Ze = (c) => {
1916
+ const _e = (c) => {
1922
1917
  const f = c.type === "image/jpeg" || c.type === "image/png" || c.type === "image/jpg" || c.type === "image/webp" || c.type === "image/gif" || c.type === "image/svg+xml";
1923
1918
  return f || d.error({
1924
1919
  id: "IMAGE_UPLOAD_WRONG_FORMAT",
@@ -1928,30 +1923,30 @@ Select the appropriate plan to fulfil more requests`),
1928
1923
  }), f;
1929
1924
  }, Oe = async ({ file: c }) => {
1930
1925
  try {
1931
- ye(!0);
1932
- const f = await ne.prepareImageForEditorUpload(c, e), S = await rn(f);
1933
- if (S) return yt(S, f), S;
1934
- const V = await Kt(f, t);
1935
- if (V?.url) return yt(V.url, f), V.url;
1926
+ he(!0);
1927
+ const f = await ne.prepareImageForEditorUpload(c, e), k = await en(f);
1928
+ if (k) return pt(k, f), k;
1929
+ const Q = await Ft(f, t);
1930
+ if (Q?.url) return pt(Q.url, f), Q.url;
1936
1931
  Me(f, null);
1937
1932
  return;
1938
1933
  } catch (f) {
1939
1934
  Me(c, f);
1940
1935
  return;
1941
1936
  } finally {
1942
- ye(!1);
1937
+ he(!1);
1943
1938
  }
1944
- }, cn = (c) => Oe({ file: c });
1939
+ }, an = (c) => Oe({ file: c });
1945
1940
  let Le = [{
1946
1941
  label: a("Upload"),
1947
- key: pe,
1942
+ key: fe,
1948
1943
  children: (0, r.jsxs)("div", {
1949
- ref: A,
1944
+ ref: j,
1950
1945
  style: { paddingBottom: 24 },
1951
- children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Qt, {
1946
+ children: [e.imageCenterLocalUploadEnabled !== !1 && (0, r.jsxs)(Ht, {
1952
1947
  showUploadList: !1,
1953
1948
  name: "Image",
1954
- beforeUpload: Ze,
1949
+ beforeUpload: _e,
1955
1950
  customRequest: Oe,
1956
1951
  style: { marginBottom: 10 },
1957
1952
  multiple: !1,
@@ -1959,7 +1954,7 @@ Select the appropriate plan to fulfil more requests`),
1959
1954
  children: [
1960
1955
  (0, r.jsx)("p", {
1961
1956
  className: "ant-upload-drag-icon",
1962
- children: (0, r.jsx)(F.EmIcons, { icon: "InboxOutlined" })
1957
+ children: (0, r.jsx)(N.EmIcons, { icon: "InboxOutlined" })
1963
1958
  }),
1964
1959
  (0, r.jsx)("p", {
1965
1960
  className: "ant-upload-text",
@@ -1973,123 +1968,123 @@ Select the appropriate plan to fulfil more requests`),
1973
1968
  }), (0, r.jsx)(m.Form, {
1974
1969
  style: { padding: "0 2px 0 2px" },
1975
1970
  children: (0, r.jsx)(m.Form.Item, {
1976
- validateStatus: k,
1971
+ validateStatus: ee,
1977
1972
  children: (0, r.jsx)(m.Input, {
1978
- ref: h,
1973
+ ref: K,
1979
1974
  allowClear: !0,
1980
1975
  size: "large",
1981
1976
  placeholder: a("Paste image URL here"),
1982
1977
  value: y,
1983
- onChange: nn,
1978
+ onChange: $t,
1984
1979
  spellCheck: "false"
1985
1980
  })
1986
1981
  })
1987
1982
  })]
1988
1983
  })
1989
1984
  }];
1990
- return e.imageCenterStockEnabled && !ve && Le.push({
1985
+ return e.imageCenterStockEnabled && !ye && Le.push({
1991
1986
  label: a("Stock"),
1992
- key: Ke,
1987
+ key: Fe,
1993
1988
  children: (0, r.jsx)("div", {
1994
- ref: J,
1989
+ ref: S,
1995
1990
  style: { paddingBottom: 24 },
1996
- children: (0, r.jsx)(Dt, {
1997
- currentReq: ue,
1998
- setCurrentReq: Y,
1999
- imageStockList: te,
2000
- setImageStockList: G,
2001
- setModalWidth: ie,
2002
- setModalHeight: X,
2003
- setStockLink: T,
2004
- setCurrentImageLink: U,
2005
- inputRef: ce,
1991
+ children: (0, r.jsx)(Ot, {
1992
+ currentReq: ie,
1993
+ setCurrentReq: pe,
1994
+ imageStockList: ae,
1995
+ setImageStockList: g,
1996
+ setModalWidth: $,
1997
+ setModalHeight: T,
1998
+ setStockLink: G,
1999
+ setCurrentImageLink: R,
2000
+ inputRef: h,
2006
2001
  customRequest: Pe
2007
2002
  })
2008
2003
  })
2009
- }), e.imageCenterGifEnabled && !ve && Le.push({
2004
+ }), e.imageCenterGifEnabled && !ye && Le.push({
2010
2005
  label: a("GIF"),
2011
- key: We,
2006
+ key: ze,
2012
2007
  children: (0, r.jsx)("div", {
2013
- ref: q,
2008
+ ref: U,
2014
2009
  style: { paddingBottom: 24 },
2015
- children: (0, r.jsx)(Tt, {
2016
- currentReqGif: se,
2017
- setCurrentReqGif: B,
2018
- imageGifList: ae,
2019
- setImageGifList: v,
2020
- setModalWidth: ie,
2021
- setModalHeight: X,
2022
- setStockLink: T,
2023
- setCurrentImageLink: U,
2024
- inputRef: W,
2010
+ children: (0, r.jsx)(Mt, {
2011
+ currentReqGif: Ae,
2012
+ setCurrentReqGif: Y,
2013
+ imageGifList: re,
2014
+ setImageGifList: M,
2015
+ setModalWidth: $,
2016
+ setModalHeight: T,
2017
+ setStockLink: G,
2018
+ setCurrentImageLink: R,
2019
+ inputRef: s,
2025
2020
  customRequest: Pe
2026
2021
  })
2027
2022
  })
2028
- }), e.elementAIimageEnabled && !ve && Le.push({
2023
+ }), e.elementAIimageEnabled && !ye && Le.push({
2029
2024
  label: a("AI"),
2030
- key: He,
2025
+ key: Ke,
2031
2026
  children: (0, r.jsx)("div", {
2032
- ref: s,
2027
+ ref: _,
2033
2028
  style: { paddingBottom: 24 },
2034
- children: (0, r.jsx)(Pt, {
2035
- setModalHeight: X,
2029
+ children: (0, r.jsx)(Ut, {
2030
+ setModalHeight: T,
2036
2031
  customRequest: Oe,
2037
- aiImageRequest: dt,
2038
- setAiImageRequest: Ve,
2039
- imageAiList: fe,
2040
- setImageAiList: Zt,
2041
- isLoadingAi: ct,
2042
- setIsLoadingAi: ut,
2043
- aiTabRef: s,
2044
- inputAiRef: Z,
2032
+ aiImageRequest: lt,
2033
+ setAiImageRequest: We,
2034
+ imageAiList: te,
2035
+ setImageAiList: X,
2036
+ isLoadingAi: ce,
2037
+ setIsLoadingAi: it,
2038
+ aiTabRef: _,
2039
+ inputAiRef: W,
2045
2040
  isImageUploaded: E,
2046
- setIsImageUploaded: I
2041
+ setIsImageUploaded: P
2047
2042
  })
2048
2043
  })
2049
2044
  }), e.imageCenterEditorEnabled && Le.push({
2050
2045
  label: "",
2051
- key: Ae,
2046
+ key: we,
2052
2047
  children: (0, r.jsx)("div", {
2053
- ref: L,
2054
- children: (0, r.jsx)(St, {
2048
+ ref: x,
2049
+ children: (0, r.jsx)(It, {
2055
2050
  currentImageLink: C,
2056
2051
  newLink: y,
2057
- previewDisplayUrl: tn,
2058
- resolvedPreviewObjectUrl: $t,
2059
- resolvedPreviewBlob: en,
2060
- resolveImageBlob: sn,
2061
- imageSize: ee,
2062
- onSave: cn,
2063
- uploadImageResultIsLoading: he || !1
2052
+ previewDisplayUrl: Jt,
2053
+ resolvedPreviewObjectUrl: Zt,
2054
+ resolvedPreviewBlob: Xt,
2055
+ resolveImageBlob: tn,
2056
+ imageSize: z,
2057
+ onSave: an,
2058
+ uploadImageResultIsLoading: F || !1
2064
2059
  })
2065
2060
  })
2066
2061
  }), (0, r.jsxs)(r.Fragment, { children: [(0, r.jsx)(m.Modal, {
2067
- width: H,
2062
+ width: J,
2068
2063
  className: "image-center",
2069
2064
  title: a("Image Center"),
2070
2065
  style: { minHeight: 390 },
2071
- open: !!Q,
2072
- onOk: _e,
2073
- onCancel: on,
2074
- footer: M === Ae ? (0, r.jsx)(r.Fragment, {}) : null,
2066
+ open: !!O,
2067
+ onOk: Qe,
2068
+ onCancel: rn,
2069
+ footer: H === we ? (0, r.jsx)(r.Fragment, {}) : null,
2075
2070
  children: (0, r.jsx)(m.Spin, {
2076
- spinning: he,
2071
+ spinning: F,
2077
2072
  children: (0, r.jsx)(m.Tabs, {
2078
- activeKey: M,
2079
- onChange: ln,
2073
+ activeKey: H,
2074
+ onChange: sn,
2080
2075
  items: Le,
2081
2076
  className: "modal-tabs",
2082
2077
  style: {
2083
- height: $,
2078
+ height: me,
2084
2079
  minHeight: 130
2085
2080
  }
2086
2081
  })
2087
2082
  })
2088
- }), (0, r.jsx)(F.ModalToChangeConfigOnFree, {
2089
- open: Xt,
2083
+ }), (0, r.jsx)(N.PlanUpgradePrompt, {
2084
+ open: _t,
2090
2085
  onCancel: () => Ee(!1),
2091
- initialSlide: Jt
2086
+ initialSlide: Yt
2092
2087
  })] });
2093
2088
  };
2094
- lt.propTypes = { dataProvider: Te.default.object }, vt.default = lt;
2089
+ ot.propTypes = { dataProvider: yt.default.object }, gt.default = ot;
2095
2090
  });