@chaibuilder/sdk 4.0.0-beta.49 → 4.0.0-beta.51

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 (156) hide show
  1. package/README.md +35 -52
  2. package/dist/{2SSKDMRQ-CjvuNdPo.cjs → 2SSKDMRQ-BSYe_xPq.cjs} +1 -1
  3. package/dist/{2SSKDMRQ-Dvf9zadl.js → 2SSKDMRQ-Dv-C_YAA.js} +3 -3
  4. package/dist/{AP7HFJJL-DYFttFoI.cjs → AP7HFJJL-BJolKJBt.cjs} +1 -1
  5. package/dist/{AP7HFJJL-q4dJdyFs.js → AP7HFJJL-DhdVstVC.js} +1 -1
  6. package/dist/{IconPicker-Bf163F7t.js → IconPicker-BBkl0T8b.js} +13 -13
  7. package/dist/{IconPicker-JWhYq2Gp.cjs → IconPicker-C0WWlb8t.cjs} +1 -1
  8. package/dist/{WDYDFRGG-O9GIrtX0.js → WDYDFRGG-CJs2MxSq.js} +4 -4
  9. package/dist/{WDYDFRGG-BEksfGMC.cjs → WDYDFRGG-DRt6Zg7Q.cjs} +1 -1
  10. package/dist/{actions-registery-BHbZHkE3.cjs → actions-registery-CLL3KrNv.cjs} +2 -2
  11. package/dist/{actions-registery-gJb_wq2F.js → actions-registery-CrGIlqUX.js} +88 -88
  12. package/dist/actions.cjs +1 -1
  13. package/dist/actions.js +2 -2
  14. package/dist/{add-new-language-page-BfUp5Ua2.cjs → add-new-language-page-ByMSfRcN.cjs} +1 -1
  15. package/dist/{add-new-language-page-CRR93tLq.js → add-new-language-page-DtVoDNfI.js} +35 -35
  16. package/dist/{add-new-page-B8NGK6WS.cjs → add-new-page-CnuChfJz.cjs} +1 -1
  17. package/dist/add-new-page-DanzzvYo.js +31 -0
  18. package/dist/{ai-panel-default-lang-BXYQye3N.js → ai-panel-default-lang-BaPz2d_6.js} +35 -35
  19. package/dist/{ai-panel-default-lang-VhgmHFoQ.cjs → ai-panel-default-lang-CoIQSz_Y.cjs} +2 -2
  20. package/dist/{ai-panel-other-lang-DaCf-cq4.js → ai-panel-other-lang--i-5z4e2.js} +22 -22
  21. package/dist/{ai-panel-other-lang-Ds0EXeUC.cjs → ai-panel-other-lang-ChlMVodg.cjs} +1 -1
  22. package/dist/{ai-prompt-input-7iWk72w5.js → ai-prompt-input-BQi0VDJC.js} +77 -77
  23. package/dist/{ai-prompt-input-nZ5_Dm7X.cjs → ai-prompt-input-BT5426AB.cjs} +1 -1
  24. package/dist/{ai-translation-prompt-1OUs1P7n.js → ai-translation-prompt-BN78s33t.js} +8 -8
  25. package/dist/{ai-translation-prompt-B16cK-1Q.cjs → ai-translation-prompt-BQPaekp3.cjs} +1 -1
  26. package/dist/{apply-binding-CBSjMYSk.cjs → apply-binding-Cjh1kqMO.cjs} +1 -1
  27. package/dist/{apply-binding-vAuN-TGV.js → apply-binding-v_W4uR3U.js} +28 -28
  28. package/dist/{plugin-BSjgGgwo.js → chai-theme-helpers-BEf2rwE4.js} +83 -83
  29. package/dist/chai-theme-helpers-q3nwoNht.cjs +22 -0
  30. package/dist/{change-password-modal-D5eXjiYq.cjs → change-password-modal-DHUrrKw7.cjs} +1 -1
  31. package/dist/{change-password-modal-CdvJR1Ln.js → change-password-modal-pEp-nMNb.js} +30 -30
  32. package/dist/{code-display-DdWcOQ_i.js → code-display-BaLKScgW.js} +5 -5
  33. package/dist/{code-display-BR-gij5j.cjs → code-display-i7jb2kmw.cjs} +1 -1
  34. package/dist/{code-editor-CyLjDiEp.js → code-editor-CRoniyP0.js} +12 -12
  35. package/dist/{code-editor-SWbfFj1E.cjs → code-editor-gwFRjQ2_.cjs} +1 -1
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +0 -5
  38. package/dist/core.js +49 -49
  39. package/dist/{css-import-modal-Be47CBJn.js → css-import-modal-B3qxX9Iv.js} +14 -14
  40. package/dist/{css-import-modal-Bdwgd05S.cjs → css-import-modal-nAB5FSwn.cjs} +2 -2
  41. package/dist/{delete-page-C99K2qzS.js → delete-page-DbawNFf7.js} +13 -13
  42. package/dist/{delete-page-DLohaU-U.cjs → delete-page-YP1HEAoD.cjs} +1 -1
  43. package/dist/{digital-asset-manager-BZMb6sC7.js → digital-asset-manager-DTD5mf24.js} +388 -357
  44. package/dist/digital-asset-manager-kJnuMqpw.cjs +1 -0
  45. package/dist/{duplicate-page-D5Gtvqdv.cjs → duplicate-page-CxqW_EO7.cjs} +1 -1
  46. package/dist/{duplicate-page-CDc2X0eW.js → duplicate-page-DnRb1y6K.js} +19 -19
  47. package/dist/{dynamic-page-selector-DZHhX008.cjs → dynamic-page-selector-2EqJhUrB.cjs} +1 -1
  48. package/dist/{dynamic-page-selector-DvNBXo6o.js → dynamic-page-selector-D6VLDIN9.js} +17 -17
  49. package/dist/{get-chai-builder-tailwind-config-7CxFxEYL.cjs → get-chai-builder-tailwind-config-DNp8Vhme.cjs} +1 -1
  50. package/dist/{get-chai-builder-tailwind-config-DC4sDOYK.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +3 -3
  51. package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-DLpviqPJ.js} +1 -1
  52. package/dist/get-chai-builder-theme-Du4ARJlw.cjs +1 -0
  53. package/dist/{image-editor-DwhTYkVR.cjs → image-editor-BQcOGsli.cjs} +1 -1
  54. package/dist/{image-editor-BBvvi9Vm.js → image-editor-CMf731xL.js} +15 -15
  55. package/dist/index-BYrRPW_c.cjs +5 -0
  56. package/dist/index-D-r_K4yA.cjs +160 -0
  57. package/dist/{index-OuHV9Ann.js → index-DPV6NiJ-.js} +5894 -6049
  58. package/dist/index-DqzFD1CG.js +4861 -0
  59. package/dist/{mark-as-template-CP_F9ZQ4.js → mark-as-template-D7jqSCXw.js} +28 -28
  60. package/dist/{mark-as-template-B9yLcasI.cjs → mark-as-template-DyB56HzI.cjs} +1 -1
  61. package/dist/{nested-path-selector-content-DmtCI3q9.js → nested-path-selector-content-dwSikrsV.js} +2 -2
  62. package/dist/{nested-path-selector-content-aTdu-o0e.cjs → nested-path-selector-content-g9_Tq_sR.cjs} +1 -1
  63. package/dist/no-language-page-content-BRITuyfN.js +43 -0
  64. package/dist/{no-language-page-content-C-MCdPXt.cjs → no-language-page-content-ZvMNVY-Y.cjs} +1 -1
  65. package/dist/{no-language-page-dialog-D4QIAHnE.cjs → no-language-page-dialog-Cndq8xRP.cjs} +1 -1
  66. package/dist/no-language-page-dialog-D7L9nVb9.js +10 -0
  67. package/dist/page-creator-BAIbU14q.js +652 -0
  68. package/dist/page-creator-qL3-M8g3.cjs +1 -0
  69. package/dist/{page-manager-new-ah6QYar2.cjs → page-manager-new-By3eGO3i.cjs} +1 -1
  70. package/dist/{page-manager-new-ttsrxdW9.js → page-manager-new-YRG89y4f.js} +63 -63
  71. package/dist/page-manager-search-and-filter-BbdgOU9V.cjs +1 -0
  72. package/dist/page-manager-search-and-filter-Cllju4CV.js +184 -0
  73. package/dist/pages.cjs +1 -1
  74. package/dist/pages.d.ts +0 -15
  75. package/dist/pages.js +20 -21
  76. package/dist/{publish-pages-content-KZVMHT6V.js → publish-pages-content-CG5LBUnY.js} +48 -48
  77. package/dist/{publish-pages-content-BrajJUcP.cjs → publish-pages-content-DxMiBxNU.cjs} +1 -1
  78. package/dist/{register-chai-top-bar-DyW9GPzV.cjs → register-chai-top-bar-CCssW5dL.cjs} +1 -1
  79. package/dist/{register-chai-top-bar-D6GjnauV.js → register-chai-top-bar-DWmJ2efT.js} +11 -11
  80. package/dist/render.cjs +1 -1
  81. package/dist/render.js +54 -54
  82. package/dist/{rte-widget-modal-CiTwsXTr.cjs → rte-widget-modal-CsTqFJc_.cjs} +1 -1
  83. package/dist/{rte-widget-modal-IU8JzPuZ.js → rte-widget-modal-DoeTMRtX.js} +2 -2
  84. package/dist/runtime-client.cjs +1 -1
  85. package/dist/runtime-client.js +1 -1
  86. package/dist/runtime.cjs +1 -1
  87. package/dist/runtime.js +1 -1
  88. package/dist/sdk.css +1 -1
  89. package/dist/{selected-block-display-CidmQ-wz.js → selected-block-display-Ck1kkNEi.js} +17 -28
  90. package/dist/{selected-block-display-CAFEOrLV.cjs → selected-block-display-DSow6N4b.cjs} +1 -1
  91. package/dist/seo-panel---mYZmLD.js +559 -0
  92. package/dist/seo-panel-mfX63fua.cjs +1 -0
  93. package/dist/{shared-json-ld-uvMmwCYp.js → shared-json-ld-B3I_RLE2.js} +46 -46
  94. package/dist/{shared-json-ld-CMH-eRUq.cjs → shared-json-ld-CGgwUOlW.cjs} +1 -1
  95. package/dist/{slug-input-DLWTMTsO.js → slug-input-DQ4t3-Tt.js} +5 -5
  96. package/dist/{slug-input-CiHC5l3r.cjs → slug-input-DaNbl597.cjs} +1 -1
  97. package/dist/supabase-actions.cjs +1 -1
  98. package/dist/supabase-actions.js +2 -2
  99. package/dist/types.d.ts +0 -96
  100. package/dist/{unmark-as-template-F7TdgWjI.cjs → unmark-as-template-CZ65AE4v.cjs} +1 -1
  101. package/dist/{unmark-as-template-C5ovsEBP.js → unmark-as-template-DvmoTbVu.js} +11 -11
  102. package/dist/unpublish-page-3--vO5b0.js +28 -0
  103. package/dist/{unpublish-page-CUr8Xub6.cjs → unpublish-page-B46TiWlU.cjs} +1 -1
  104. package/dist/{unpublished-partials-modal-BhNAub_z.js → unpublished-partials-modal-DVMz3q83.js} +18 -15
  105. package/dist/{unpublished-partials-modal-Cv5R9-hi.cjs → unpublished-partials-modal-U5lKBOSR.cjs} +1 -1
  106. package/dist/utils.cjs +1 -1
  107. package/dist/utils.js +2 -2
  108. package/dist/web-blocks.cjs +1 -1
  109. package/dist/web-blocks.js +2 -2
  110. package/dist/{web-preview-D9pXonAv.js → web-preview-D5o5XQo0.js} +2 -2
  111. package/dist/{web-preview-CuMYekVJ.cjs → web-preview-Da3RhcjQ.cjs} +1 -1
  112. package/package.json +1 -1
  113. package/dist/active-in-another-tab-B4Ur0JP7.js +0 -35
  114. package/dist/active-in-another-tab-BPdx4lWh.cjs +0 -1
  115. package/dist/add-new-page-Ppy5-y5j.js +0 -31
  116. package/dist/continue-editing-in-this-client-BrSvK-Ay.js +0 -25
  117. package/dist/continue-editing-in-this-client-Cmi-GkYZ.cjs +0 -1
  118. package/dist/design-token-usage-D1lWCJ3L.js +0 -114
  119. package/dist/design-token-usage-eY2wQ0l3.cjs +0 -1
  120. package/dist/digital-asset-manager-Z5aJxkq0.cjs +0 -1
  121. package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
  122. package/dist/image-compression-DPFITwOL.js +0 -37
  123. package/dist/image-compression-UaU7Bwqe.cjs +0 -1
  124. package/dist/index-BVwFJWDq.cjs +0 -5
  125. package/dist/index-DCJDQs1a.cjs +0 -160
  126. package/dist/index-LBTm1Jmk.js +0 -5199
  127. package/dist/json-diff-viewer-Cb1CmRqP.cjs +0 -8
  128. package/dist/json-diff-viewer-DG6qMOBS.js +0 -261
  129. package/dist/lang-panel-B3USOxGq.js +0 -216
  130. package/dist/lang-panel-DxoJ0v4y.cjs +0 -1
  131. package/dist/manage-design-tokens-6YGIctip.js +0 -446
  132. package/dist/manage-design-tokens-modal-BSSCXH8Y.cjs +0 -1
  133. package/dist/manage-design-tokens-modal-CzsnN49F.js +0 -161
  134. package/dist/manage-design-tokens-udLBvkHA.cjs +0 -1
  135. package/dist/no-language-page-content-D8t5dfgh.js +0 -43
  136. package/dist/no-language-page-dialog-C_fHI2zI.js +0 -10
  137. package/dist/page-creator-Cz_ah-qE.cjs +0 -1
  138. package/dist/page-creator-DKEkuGCO.js +0 -796
  139. package/dist/page-lock-CwZKJ4IE.js +0 -30
  140. package/dist/page-lock-DdCvtA-I.cjs +0 -1
  141. package/dist/page-locked-dialog-CrTDBoC4.cjs +0 -1
  142. package/dist/page-locked-dialog-DqLlooUz.js +0 -136
  143. package/dist/page-manager-search-and-filter-D7AupT6_.cjs +0 -1
  144. package/dist/page-manager-search-and-filter-bsqZ6wnI.js +0 -210
  145. package/dist/page-revisions-content-B6hsIla7.cjs +0 -1
  146. package/dist/page-revisions-content-C5O8_Fms.js +0 -459
  147. package/dist/plugin-DHpuZZXz.cjs +0 -22
  148. package/dist/save-to-lib-DMnv7ENo.js +0 -429
  149. package/dist/save-to-lib-Dc700Aop.cjs +0 -1
  150. package/dist/seo-panel-Br8gxDxu.js +0 -789
  151. package/dist/seo-panel-CMY-adM-.cjs +0 -2
  152. package/dist/take-over-request-IRLgF1dG.cjs +0 -1
  153. package/dist/take-over-request-KdR1_h_K.js +0 -64
  154. package/dist/translation-warning-modal-CLZ9tC1F.cjs +0 -1
  155. package/dist/translation-warning-modal-CzNt6LDO.js +0 -27
  156. package/dist/unpublish-page-0fR1o0b7.js +0 -28
@@ -1,114 +1,145 @@
1
- import { jsxs as r, jsx as e, Fragment as H } from "react/jsx-runtime";
2
- import { B as p, z as me } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { p as V, T as Fe, aw as _, z as q, A as P, E as G, D as Ue, e as Le, f as $e, g as Me, o as _e, q as qe, af as Pe } from "./index-OuHV9Ann.js";
4
- import { f as Ge, c as Oe } from "./image-compression-DPFITwOL.js";
5
- import { find as Be, merge as Ke, pick as Y, first as Qe, isEmpty as Re } from "lodash-es";
6
- import { ChevronLeft as ue, ChevronRight as We, Loader as B, AlertCircle as Ve, Copy as he, Pencil as He, Link as Xe, Search as Ze, RefreshCwIcon as Je, Archive as Ye, Film as et, ImageIcon as tt, Edit as it, Trash2 as at, Check as lt, Upload as rt, AlertTriangle as nt } from "lucide-react";
7
- import fe, { useState as y, useMemo as pe, useEffect as O, useCallback as M, Suspense as st } from "react";
8
- import { useDropzone as ct } from "react-dropzone";
9
- import { ErrorBoundary as ot } from "react-error-boundary";
10
- import { useTranslation as ee } from "react-i18next";
11
- import { toast as A } from "sonner";
12
- import { useQueryClient as te, useMutation as ie, useQuery as ge } from "@tanstack/react-query";
13
- import { aq as K, ar as Q, A as b } from "./index-LBTm1Jmk.js";
14
- import { c as xe } from "./common-functions-D2lMFR6K.js";
15
- const dt = () => {
16
- const s = K(), n = te(), h = Q();
17
- return ie({
18
- mutationFn: async (a) => {
19
- const c = a.map(async (l) => h(s, {
20
- action: b.UPLOAD_ASSET,
21
- data: l
1
+ import { jsxs as n, jsx as e, Fragment as H } from "react/jsx-runtime";
2
+ import { find as $e, merge as Me, pick as Y, first as Le, isEmpty as _e } from "lodash-es";
3
+ import { ChevronLeft as he, ChevronRight as Pe, Loader as G, AlertCircle as qe, Copy as fe, Pencil as Be, Link as Oe, Search as Ge, RefreshCwIcon as Re, Archive as Ke, Film as Qe, ImageIcon as We, Edit as Ve, Trash2 as He, Check as Xe, Upload as Ze, AlertTriangle as Je } from "lucide-react";
4
+ import pe, { useState as y, useMemo as ge, useEffect as O, useCallback as L, Suspense as Ye } from "react";
5
+ import { useDropzone as et } from "react-dropzone";
6
+ import { ErrorBoundary as tt } from "react-error-boundary";
7
+ import { useTranslation as te } from "react-i18next";
8
+ import { toast as w } from "sonner";
9
+ import { B as p, z as xe } from "./register-chai-top-bar-DWmJ2efT.js";
10
+ import { p as V, T as it, ae as _, F as P, G as q, H as B, D as at, e as lt, f as rt, g as nt, o as st, q as ct, af as ot } from "./index-DPV6NiJ-.js";
11
+ import dt from "compressorjs";
12
+ import { useQueryClient as ie, useMutation as ae, useQuery as ve } from "@tanstack/react-query";
13
+ import { ai as R, aj as K, ag as A } from "./index-DqzFD1CG.js";
14
+ import { c as ye } from "./common-functions-D2lMFR6K.js";
15
+ const de = 0.5 * 1024 * 1024, mt = 10 * 1024 * 1024;
16
+ function ee(s) {
17
+ const l = isNaN(s) ? 0 : typeof s == "number" ? s : parseInt(s);
18
+ return l ? l < 1024 ? `${l.toFixed(2)} B` : l < 1024 * 1024 ? `${(l / 1024).toFixed(2)} KB` : `${(l / (1024 * 1024)).toFixed(2)} MB` : "0 B";
19
+ }
20
+ function ut(s) {
21
+ return new Promise((l, u) => {
22
+ if (s.size <= de) {
23
+ l(s);
24
+ return;
25
+ }
26
+ new dt(s, {
27
+ quality: 0.9,
28
+ // 80% quality
29
+ maxWidth: 2048,
30
+ // Limit max width
31
+ maxHeight: 2048,
32
+ // Limit max height
33
+ convertSize: de,
34
+ // Try to keep under 3MB
35
+ success(i) {
36
+ l(i);
37
+ },
38
+ error(i) {
39
+ w.error(
40
+ `Failed to compress image. Image size is ${ee(s.size)}, which exceeds the maximum allowed size of ${ee(mt)}.`
41
+ ), u(i);
42
+ }
43
+ });
44
+ });
45
+ }
46
+ const ht = () => {
47
+ const s = R(), l = ie(), u = K();
48
+ return ae({
49
+ mutationFn: async (i) => {
50
+ const c = i.map(async (r) => u(s, {
51
+ action: A.UPLOAD_ASSET,
52
+ data: r
22
53
  }));
23
54
  return await Promise.all(c);
24
55
  },
25
- onSuccess: (a) => {
56
+ onSuccess: (i) => {
26
57
  var c;
27
- if (a != null && a.some((i) => i.error))
28
- throw new Error(((c = a == null ? void 0 : a.find((i) => i.error)) == null ? void 0 : c.error) || "Failed to upload asset");
58
+ if (i != null && i.some((a) => a.error))
59
+ throw new Error(((c = i == null ? void 0 : i.find((a) => a.error)) == null ? void 0 : c.error) || "Failed to upload asset");
29
60
  {
30
- n.invalidateQueries({
31
- queryKey: [b.GET_ASSETS]
61
+ l.invalidateQueries({
62
+ queryKey: [A.GET_ASSETS]
32
63
  });
33
- const i = a == null ? void 0 : a.length;
34
- A.success(`${i === 1 ? "Asset" : i + " Assets"} uploaded successfully`);
64
+ const a = i == null ? void 0 : i.length;
65
+ w.success(`${a === 1 ? "Asset" : a + " Assets"} uploaded successfully`);
35
66
  }
36
67
  },
37
68
  onError: () => {
38
- A.error("Failed to upload asset");
69
+ w.error("Failed to upload asset");
39
70
  }
40
71
  });
41
- }, mt = () => {
42
- const s = K(), n = te(), h = Q();
43
- return ie({
44
- mutationFn: async (a) => h(s, {
45
- action: b.DELETE_ASSET,
46
- data: { id: a }
72
+ }, ft = () => {
73
+ const s = R(), l = ie(), u = K();
74
+ return ae({
75
+ mutationFn: async (i) => u(s, {
76
+ action: A.DELETE_ASSET,
77
+ data: { id: i }
47
78
  }),
48
- onSuccess: (a) => {
49
- if (a != null && a.error)
50
- throw new Error(a == null ? void 0 : a.error);
51
- n.invalidateQueries({
52
- queryKey: [b.GET_ASSETS]
53
- }), A.success("Asset deleted successfully");
79
+ onSuccess: (i) => {
80
+ if (i != null && i.error)
81
+ throw new Error(i == null ? void 0 : i.error);
82
+ l.invalidateQueries({
83
+ queryKey: [A.GET_ASSETS]
84
+ }), w.success("Asset deleted successfully");
54
85
  },
55
86
  onError: () => {
56
- A.error("Failed to delete asset");
87
+ w.error("Failed to delete asset");
57
88
  }
58
89
  });
59
- }, ut = () => {
60
- const s = K(), n = te(), h = Q();
61
- return ie({
62
- mutationFn: async (a) => h(s, {
63
- action: b.UPDATE_ASSET,
64
- data: a
90
+ }, pt = () => {
91
+ const s = R(), l = ie(), u = K();
92
+ return ae({
93
+ mutationFn: async (i) => u(s, {
94
+ action: A.UPDATE_ASSET,
95
+ data: i
65
96
  }),
66
- onSuccess: (a) => {
67
- if (a != null && a.error)
68
- throw new Error(a == null ? void 0 : a.error);
69
- n.invalidateQueries({
70
- queryKey: [b.GET_ASSETS]
71
- }), a != null && a.id && n.invalidateQueries({
72
- queryKey: [b.GET_ASSET, a.id]
73
- }), A.success("Asset updated successfully");
97
+ onSuccess: (i) => {
98
+ if (i != null && i.error)
99
+ throw new Error(i == null ? void 0 : i.error);
100
+ l.invalidateQueries({
101
+ queryKey: [A.GET_ASSETS]
102
+ }), i != null && i.id && l.invalidateQueries({
103
+ queryKey: [A.GET_ASSET, i.id]
104
+ }), w.success("Asset updated successfully");
74
105
  },
75
106
  onError: () => {
76
- A.error("Failed to update asset");
107
+ w.error("Failed to update asset");
77
108
  }
78
109
  });
79
110
  };
80
- function ht({
111
+ function gt({
81
112
  currentPage: s,
82
- totalPages: n,
83
- onPageChange: h,
84
- pageRangeDisplayed: a = 3,
113
+ totalPages: l,
114
+ onPageChange: u,
115
+ pageRangeDisplayed: i = 3,
85
116
  showPageInput: c = !0,
86
- className: i = ""
117
+ className: a = ""
87
118
  }) {
88
- const [l, I] = y(String(s)), N = pe(() => {
89
- const o = Math.floor(a / 2);
90
- let m = Math.max(1, s - o), d = Math.min(n, s + o);
91
- d - m + 1 < a && (m === 1 ? d = Math.min(n, m + a - 1) : d === n && (m = Math.max(1, d - a + 1)));
119
+ const [r, k] = y(String(s)), N = ge(() => {
120
+ const o = Math.floor(i / 2);
121
+ let m = Math.max(1, s - o), d = Math.min(l, s + o);
122
+ d - m + 1 < i && (m === 1 ? d = Math.min(l, m + i - 1) : d === l && (m = Math.max(1, d - i + 1)));
92
123
  const f = [];
93
124
  m > 1 && (f.push(1), m > 2 && f.push("..."));
94
125
  for (let v = m; v <= d; v++)
95
126
  f.push(v);
96
- return d < n && (d < n - 1 && f.push("..."), f.push(n)), f;
97
- }, [s, n, a]), x = (o) => {
98
- o !== s && o >= 1 && o <= n && (h(o), I(String(o)));
127
+ return d < l && (d < l - 1 && f.push("..."), f.push(l)), f;
128
+ }, [s, l, i]), x = (o) => {
129
+ o !== s && o >= 1 && o <= l && (u(o), k(String(o)));
99
130
  }, g = () => {
100
131
  s > 1 && x(s - 1);
101
- }, w = () => {
102
- s < n && x(s + 1);
132
+ }, b = () => {
133
+ s < l && x(s + 1);
103
134
  }, C = () => {
104
- const o = Number(l);
105
- !isNaN(o) && o >= 1 && o <= n && x(o);
135
+ const o = Number(r);
136
+ !isNaN(o) && o >= 1 && o <= l && x(o);
106
137
  }, S = (o) => {
107
138
  o.key === "Enter" && C();
108
139
  };
109
- return n <= 1 ? null : /* @__PURE__ */ r("div", { className: `flex flex-wrap items-center justify-center gap-3 ${i}`, children: [
110
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
111
- /* @__PURE__ */ r(
140
+ return l <= 1 ? null : /* @__PURE__ */ n("div", { className: `flex flex-wrap items-center justify-center gap-3 ${a}`, children: [
141
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
142
+ /* @__PURE__ */ n(
112
143
  p,
113
144
  {
114
145
  variant: "outline",
@@ -117,7 +148,7 @@ function ht({
117
148
  disabled: s === 1,
118
149
  className: "px-2 py-1 text-sm hover:bg-gray-50",
119
150
  children: [
120
- /* @__PURE__ */ e(ue, { className: "h-4 w-4" }),
151
+ /* @__PURE__ */ e(he, { className: "h-4 w-4" }),
121
152
  "Previous"
122
153
  ]
123
154
  }
@@ -138,33 +169,33 @@ function ht({
138
169
  d
139
170
  );
140
171
  }) }),
141
- /* @__PURE__ */ r(
172
+ /* @__PURE__ */ n(
142
173
  p,
143
174
  {
144
175
  variant: "outline",
145
176
  size: "sm",
146
- onClick: w,
147
- disabled: s === n,
177
+ onClick: b,
178
+ disabled: s === l,
148
179
  className: "px-2 py-1 text-sm hover:bg-gray-50",
149
180
  children: [
150
181
  "Next",
151
- /* @__PURE__ */ e(We, { className: "h-4 w-4" })
182
+ /* @__PURE__ */ e(Pe, { className: "h-4 w-4" })
152
183
  ]
153
184
  }
154
185
  )
155
186
  ] }),
156
- c && /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
187
+ c && /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
157
188
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Go to" }),
158
189
  /* @__PURE__ */ e(
159
- me,
190
+ xe,
160
191
  {
161
192
  type: "number",
162
193
  min: 1,
163
- max: n,
164
- value: l,
194
+ max: l,
195
+ value: r,
165
196
  onChange: (o) => {
166
197
  const m = o.target.value.replace(/[^\d]/g, "");
167
- I(m);
198
+ k(m);
168
199
  },
169
200
  onKeyDown: S,
170
201
  className: "h-8 w-16 px-2 py-1"
@@ -176,153 +207,153 @@ function ht({
176
207
  variant: "outline",
177
208
  size: "sm",
178
209
  onClick: C,
179
- disabled: l === "" || Number(l) < 1 || Number(l) > n,
210
+ disabled: r === "" || Number(r) < 1 || Number(r) > l,
180
211
  children: "Go"
181
212
  }
182
213
  )
183
214
  ] })
184
215
  ] });
185
216
  }
186
- const ft = (s = {}) => {
187
- const n = K(), h = Q(), { search: a, page: c = 1, limit: i = 30 } = s;
188
- return ge({
189
- queryKey: [b.GET_ASSETS, a, c, i],
217
+ const xt = (s = {}) => {
218
+ const l = R(), u = K(), { search: i, page: c = 1, limit: a = 30 } = s;
219
+ return ve({
220
+ queryKey: [A.GET_ASSETS, i, c, a],
190
221
  queryFn: async () => {
191
- const l = await h(n, {
192
- action: b.GET_ASSETS,
222
+ const r = await u(l, {
223
+ action: A.GET_ASSETS,
193
224
  data: {
194
- search: a,
225
+ search: i,
195
226
  page: c,
196
- limit: i
227
+ limit: a
197
228
  }
198
229
  });
199
- return l.page = c, l.limit = i, l;
230
+ return r.page = c, r.limit = a, r;
200
231
  },
201
232
  staleTime: 1 / 0,
202
233
  retry: 1
203
234
  });
204
- }, pt = (s) => {
205
- const n = K(), h = Q();
206
- return ge({
207
- queryKey: [b.GET_ASSET, s],
208
- queryFn: async () => s ? await h(n, {
209
- action: b.GET_ASSET,
235
+ }, vt = (s) => {
236
+ const l = R(), u = K();
237
+ return ve({
238
+ queryKey: [A.GET_ASSET, s],
239
+ queryFn: async () => s ? await u(l, {
240
+ action: A.GET_ASSET,
210
241
  data: { id: s }
211
242
  }) : null,
212
243
  staleTime: 1 / 0,
213
244
  retry: 1
214
245
  });
215
246
  };
216
- function gt(s) {
217
- const n = isNaN(s) ? 0 : typeof s == "number" ? s : parseInt(s);
218
- return n ? n < 1024 ? `${n.toFixed(2)} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(2)} KB` : `${(n / (1024 * 1024)).toFixed(2)} MB` : "0 B";
247
+ function yt(s) {
248
+ const l = isNaN(s) ? 0 : typeof s == "number" ? s : parseInt(s);
249
+ return l ? l < 1024 ? `${l.toFixed(2)} B` : l < 1024 * 1024 ? `${(l / 1024).toFixed(2)} KB` : `${(l / (1024 * 1024)).toFixed(2)} MB` : "0 B";
219
250
  }
220
- function oe(s) {
251
+ function me(s) {
221
252
  if (!s) return "N/A";
222
- const n = new Date(s);
253
+ const l = new Date(s);
223
254
  return new Intl.DateTimeFormat("en-US", {
224
255
  month: "short",
225
256
  day: "numeric",
226
257
  year: "numeric",
227
258
  hour: "2-digit",
228
259
  minute: "2-digit"
229
- }).format(n);
260
+ }).format(l);
230
261
  }
231
- function de(s, n) {
232
- let h = s, a = n == null ? void 0 : n.description;
233
- return (!a || typeof a != "string") && (a = ""), (!h || typeof h != "string") && (h = ""), h !== a;
262
+ function ue(s, l) {
263
+ let u = s, i = l == null ? void 0 : l.description;
264
+ return (!i || typeof i != "string") && (i = ""), (!u || typeof u != "string") && (u = ""), u !== i;
234
265
  }
235
- const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
266
+ const Nt = ({ assetId: s, onBack: l, onEdit: u, onSave: i, isSaving: c }) => {
236
267
  var o, m;
237
- const { t: i } = ee(), { data: l, isLoading: I, isError: N } = pt(s || ""), [x, g] = y(""), [w, C] = y(!1);
268
+ const { t: a } = te(), { data: r, isLoading: k, isError: N } = vt(s || ""), [x, g] = y(""), [b, C] = y(!1);
238
269
  O(() => {
239
270
  const d = new Image();
240
- return d.src = (l == null ? void 0 : l.url) || "", d.onload = () => C(!0), () => {
271
+ return d.src = (r == null ? void 0 : r.url) || "", d.onload = () => C(!0), () => {
241
272
  d.onload = null;
242
273
  };
243
- }, [l]);
274
+ }, [r]);
244
275
  const S = async (d, f) => {
245
276
  try {
246
- await navigator.clipboard.writeText(d), A.success(i("{{type}} copied to clipboard", { type: f }));
277
+ await navigator.clipboard.writeText(d), w.success(a("{{type}} copied to clipboard", { type: f }));
247
278
  } catch (v) {
248
- A.error(i("Failed to copy {{type}}", { type: f }), {
279
+ w.error(a("Failed to copy {{type}}", { type: f }), {
249
280
  description: v == null ? void 0 : v.message
250
281
  });
251
282
  }
252
283
  };
253
- return fe.useEffect(() => {
254
- l != null && l.description && g(l.description);
255
- }, [l]), I || !w ? /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ e(B, { className: "h-8 w-8 animate-spin" }) }) : N || !(l != null && l.id) ? /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ r("div", { className: "mx-auto max-w-md p-6 text-center", children: [
256
- /* @__PURE__ */ e("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ e(Ve, { className: "h-12 w-12 text-gray-400" }) }),
257
- /* @__PURE__ */ e("h3", { className: "mb-2 text-lg font-medium text-gray-900", children: i("No Asset Found") }),
258
- /* @__PURE__ */ e("p", { className: "mb-6 text-sm text-gray-500", children: i(N ? "There was an error loading the asset. Please try again later." : "The asset you're looking for doesn't exist or has been removed.") }),
259
- /* @__PURE__ */ r("div", { className: "flex justify-center gap-4", children: [
260
- /* @__PURE__ */ e(p, { variant: "outline", onClick: n, children: i("Back to Assets") }),
261
- N && /* @__PURE__ */ e(p, { variant: "default", onClick: () => window.location.reload(), children: i("Try Again") })
284
+ return pe.useEffect(() => {
285
+ r != null && r.description && g(r.description);
286
+ }, [r]), k || !b ? /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ e(G, { className: "h-8 w-8 animate-spin" }) }) : N || !(r != null && r.id) ? /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ n("div", { className: "mx-auto max-w-md p-6 text-center", children: [
287
+ /* @__PURE__ */ e("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ e(qe, { className: "h-12 w-12 text-gray-400" }) }),
288
+ /* @__PURE__ */ e("h3", { className: "mb-2 text-lg font-medium text-gray-900", children: a("No Asset Found") }),
289
+ /* @__PURE__ */ e("p", { className: "mb-6 text-sm text-gray-500", children: a(N ? "There was an error loading the asset. Please try again later." : "The asset you're looking for doesn't exist or has been removed.") }),
290
+ /* @__PURE__ */ n("div", { className: "flex justify-center gap-4", children: [
291
+ /* @__PURE__ */ e(p, { variant: "outline", onClick: l, children: a("Back to Assets") }),
292
+ N && /* @__PURE__ */ e(p, { variant: "default", onClick: () => window.location.reload(), children: a("Try Again") })
262
293
  ] })
263
- ] }) }) : /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col gap-y-4 overflow-hidden", children: [
264
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
265
- /* @__PURE__ */ r(p, { variant: "outline", size: "sm", onClick: n, disabled: c, children: [
266
- /* @__PURE__ */ e(ue, { className: "h-4 w-4" }),
267
- i("Back to Assets")
294
+ ] }) }) : /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-y-4 overflow-hidden", children: [
295
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
296
+ /* @__PURE__ */ n(p, { variant: "outline", size: "sm", onClick: l, disabled: c, children: [
297
+ /* @__PURE__ */ e(he, { className: "h-4 w-4" }),
298
+ a("Back to Assets")
268
299
  ] }),
269
- /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
270
- /* @__PURE__ */ e(p, { variant: "outline", onClick: n, disabled: c, children: i("Cancel") }),
271
- /* @__PURE__ */ r(p, { variant: "outline", onClick: () => S(l.url, i("Asset URL")), disabled: c, children: [
272
- /* @__PURE__ */ e(he, { className: "mr-2 h-4 w-4" }),
273
- i("Copy URL")
300
+ /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
301
+ /* @__PURE__ */ e(p, { variant: "outline", onClick: l, disabled: c, children: a("Cancel") }),
302
+ /* @__PURE__ */ n(p, { variant: "outline", onClick: () => S(r.url, a("Asset URL")), disabled: c, children: [
303
+ /* @__PURE__ */ e(fe, { className: "mr-2 h-4 w-4" }),
304
+ a("Copy URL")
274
305
  ] }),
275
- /* @__PURE__ */ r(p, { variant: "default", onClick: () => h(l), disabled: c, children: [
276
- /* @__PURE__ */ e(He, { className: "h-4 w-4" }),
277
- i("Edit Image")
306
+ /* @__PURE__ */ n(p, { variant: "default", onClick: () => u(r), disabled: c, children: [
307
+ /* @__PURE__ */ e(Be, { className: "h-4 w-4" }),
308
+ a("Edit Image")
278
309
  ] })
279
310
  ] })
280
311
  ] }),
281
- /* @__PURE__ */ r("div", { className: "grid flex-1 grid-cols-2 items-start gap-6 overflow-hidden", children: [
312
+ /* @__PURE__ */ n("div", { className: "grid flex-1 grid-cols-2 items-start gap-6 overflow-hidden", children: [
282
313
  /* @__PURE__ */ e("div", { className: "relative flex h-[calc(80vh-200px)] w-full items-start justify-center", children: /* @__PURE__ */ e(
283
314
  "img",
284
315
  {
285
- src: l.url,
286
- alt: l.name,
316
+ src: r.url,
317
+ alt: r.name,
287
318
  className: "h-full max-h-max w-full max-w-max rounded-lg object-contain"
288
319
  }
289
320
  ) }),
290
- /* @__PURE__ */ r("div", { className: "space-y-6", children: [
291
- /* @__PURE__ */ r("div", { className: "grid gap-3 rounded-md border bg-gray-100 pt-2", children: [
292
- /* @__PURE__ */ e(V, { className: "w-full text-center", children: i("Details") }),
321
+ /* @__PURE__ */ n("div", { className: "space-y-6", children: [
322
+ /* @__PURE__ */ n("div", { className: "grid gap-3 rounded-md border bg-gray-100 pt-2", children: [
323
+ /* @__PURE__ */ e(V, { className: "w-full text-center", children: a("Details") }),
293
324
  /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-2 rounded-md border bg-white p-2 text-sm", children: [
294
- { label: i("File Name"), value: l.name },
295
- { label: i("Type"), value: l.type, capitalize: !0 },
325
+ { label: a("File Name"), value: r.name },
326
+ { label: a("Type"), value: r.type, capitalize: !0 },
296
327
  {
297
- label: i("Format"),
298
- value: ((o = l.metadata) == null ? void 0 : o.format) || l.type,
328
+ label: a("Format"),
329
+ value: ((o = r.metadata) == null ? void 0 : o.format) || r.type,
299
330
  capitalize: !0
300
331
  },
301
332
  {
302
- label: i("Size"),
303
- value: gt(l.size)
333
+ label: a("Size"),
334
+ value: yt(r.size)
304
335
  },
305
336
  {
306
- label: i("Dimensions"),
307
- value: `${l.width || 0} × ${l.height || 0}`
337
+ label: a("Dimensions"),
338
+ value: `${r.width || 0} × ${r.height || 0}`
308
339
  },
309
340
  {
310
- label: i("Created"),
311
- value: oe(l.createdAt)
341
+ label: a("Created"),
342
+ value: me(r.createdAt)
312
343
  },
313
344
  {
314
- label: i("Updated"),
315
- value: oe(((m = l.metadata) == null ? void 0 : m.updatedAt) || (l == null ? void 0 : l.updatedAt) || l.createdAt)
345
+ label: a("Updated"),
346
+ value: me(((m = r.metadata) == null ? void 0 : m.updatedAt) || (r == null ? void 0 : r.updatedAt) || r.createdAt)
316
347
  },
317
348
  {
318
- label: i("URL"),
319
- value: l.url,
349
+ label: a("URL"),
350
+ value: r.url,
320
351
  copyable: !0
321
352
  }
322
- ].map((d) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
353
+ ].map((d) => /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
323
354
  /* @__PURE__ */ e(V, { className: "w-1/4 w-max px-2 text-left font-normal text-gray-700", children: d.label }),
324
355
  ":",
325
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
356
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
326
357
  /* @__PURE__ */ e(
327
358
  "div",
328
359
  {
@@ -337,31 +368,31 @@ const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
337
368
  size: "icon",
338
369
  className: "h-6 w-6",
339
370
  onClick: () => S(d.value, d.label),
340
- children: /* @__PURE__ */ e(Xe, { className: "h-3 w-3" })
371
+ children: /* @__PURE__ */ e(Oe, { className: "h-3 w-3" })
341
372
  }
342
373
  )
343
374
  ] })
344
375
  ] }, d.label)) })
345
376
  ] }),
346
- l.usedOn && l.usedOn.length > 0 && /* @__PURE__ */ r("div", { className: "grid gap-3", children: [
347
- /* @__PURE__ */ e(V, { children: i("Used On") }),
348
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-2 rounded-md border p-2 text-sm", children: l.usedOn.map((d, f) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
377
+ r.usedOn && r.usedOn.length > 0 && /* @__PURE__ */ n("div", { className: "grid gap-3", children: [
378
+ /* @__PURE__ */ e(V, { children: a("Used On") }),
379
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-2 rounded-md border p-2 text-sm", children: r.usedOn.map((d, f) => /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
349
380
  /* @__PURE__ */ e("div", { className: "w-max text-left font-medium text-gray-900", children: d.name }),
350
- /* @__PURE__ */ r("div", { className: "text-gray-500", children: [
381
+ /* @__PURE__ */ n("div", { className: "text-gray-500", children: [
351
382
  "(",
352
383
  d.slug,
353
384
  ")"
354
385
  ] })
355
386
  ] }, f)) })
356
387
  ] }),
357
- /* @__PURE__ */ r("div", { className: "relative grid gap-3 rounded-md border bg-gray-100 pt-2", children: [
358
- /* @__PURE__ */ e(V, { className: "w-full text-center", children: i("Description") }),
388
+ /* @__PURE__ */ n("div", { className: "relative grid gap-3 rounded-md border bg-gray-100 pt-2", children: [
389
+ /* @__PURE__ */ e(V, { className: "w-full text-center", children: a("Description") }),
359
390
  /* @__PURE__ */ e(
360
- Fe,
391
+ it,
361
392
  {
362
393
  id: "description",
363
394
  value: x,
364
- placeholder: i("Enter a description for the asset"),
395
+ placeholder: a("Enter a description for the asset"),
365
396
  onChange: (d) => g(d.target.value),
366
397
  rows: 3,
367
398
  disabled: c,
@@ -372,131 +403,131 @@ const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
372
403
  "button",
373
404
  {
374
405
  type: "button",
375
- onClick: () => a(x),
376
- disabled: c || !de(x, l),
377
- className: `rounded-md bg-blue-500 px-3 py-0 py-0.5 text-sm text-white ${c || !de(x, l) ? "cursor-not-allowed opacity-50" : ""}`,
378
- children: c ? /* @__PURE__ */ r(H, { children: [
379
- /* @__PURE__ */ e(B, { className: "mr-2 h-4 w-4 animate-spin" }),
380
- i("Saving...")
381
- ] }) : i("Save")
406
+ onClick: () => i(x),
407
+ disabled: c || !ue(x, r),
408
+ className: `rounded-md bg-blue-500 px-3 py-0 py-0.5 text-sm text-white ${c || !ue(x, r) ? "cursor-not-allowed opacity-50" : ""}`,
409
+ children: c ? /* @__PURE__ */ n(H, { children: [
410
+ /* @__PURE__ */ e(G, { className: "mr-2 h-4 w-4 animate-spin" }),
411
+ a("Saving...")
412
+ ] }) : a("Save")
382
413
  }
383
414
  ) })
384
415
  ] })
385
416
  ] })
386
417
  ] })
387
418
  ] });
388
- }, vt = fe.lazy(() => import("./image-editor-BBvvi9Vm.js")), yt = 25 * 1024 * 1024, Nt = ({ isUpdatingAsset: s, allowedTypes: n, uploadAssets: h, isUploadingAsset: a, onUploaded: c }) => {
389
- const { t: i } = ee(), [l, I] = y(() => {
419
+ }, wt = pe.lazy(() => import("./image-editor-CMf731xL.js")), bt = 25 * 1024 * 1024, At = ({ isUpdatingAsset: s, allowedTypes: l, uploadAssets: u, isUploadingAsset: i, onUploaded: c }) => {
420
+ const { t: a } = te(), [r, k] = y(() => {
390
421
  const o = localStorage.getItem("chai_optimize_images");
391
422
  return o !== null ? o === "true" : !0;
392
423
  });
393
424
  O(() => {
394
- localStorage.setItem("chai_optimize_images", l.toString());
395
- }, [l]);
396
- const N = s || a, x = M(
425
+ localStorage.setItem("chai_optimize_images", r.toString());
426
+ }, [r]);
427
+ const N = s || i, x = L(
397
428
  async (o) => {
398
429
  try {
399
430
  const m = o;
400
431
  if (!m.every((E) => E.type.startsWith("image/")))
401
- return A.error(i("Invalid file type. Please upload a valid file.")), Promise.reject(new Error("Invalid file type"));
432
+ return w.error(a("Invalid file type. Please upload a valid file.")), Promise.reject(new Error("Invalid file type"));
402
433
  const d = m.map(async (E) => {
403
434
  let j = E;
404
- return E.type.startsWith("image/") && l && (j = await Oe(E)), new Promise((X, F) => {
435
+ return E.type.startsWith("image/") && r && (j = await ut(E)), new Promise((X, F) => {
405
436
  const U = new FileReader();
406
437
  U.readAsDataURL(j), U.onload = async () => {
407
438
  X({
408
439
  file: U.result,
409
440
  folderId: void 0,
410
441
  name: E.name,
411
- optimize: l
442
+ optimize: r
412
443
  });
413
444
  }, U.onerror = () => F(null);
414
445
  });
415
- }), f = await Promise.all(d), v = await h(f);
446
+ }), f = await Promise.all(d), v = await u(f);
416
447
  return (v == null ? void 0 : v.length) === 1 && c(v[0]), v;
417
448
  } catch (m) {
418
449
  return Promise.reject(m);
419
450
  }
420
451
  },
421
- [h, l, c, i]
452
+ [u, r, c, a]
422
453
  ), g = (o) => {
423
454
  const m = [];
424
455
  let d = 0;
425
456
  return o.forEach((f) => {
426
- f.size > yt ? d++ : m.push(f);
427
- }), d > 0 && A.error(
428
- `${d === 1 && o.length === 1 ? i("File") : d + i(d === 1 ? " file" : " files")} ${i("exceed the maximum size limit of 10MB.")}`
429
- ), Re(m) ? [] : x(m);
430
- }, { getRootProps: w, getInputProps: C, isDragActive: S } = ct({
457
+ f.size > bt ? d++ : m.push(f);
458
+ }), d > 0 && w.error(
459
+ `${d === 1 && o.length === 1 ? a("File") : d + a(d === 1 ? " file" : " files")} ${a("exceed the maximum size limit of 10MB.")}`
460
+ ), _e(m) ? [] : x(m);
461
+ }, { getRootProps: b, getInputProps: C, isDragActive: S } = et({
431
462
  onDrop: g,
432
463
  accept: {
433
- "image/*": n.includes("image") ? [] : []
464
+ "image/*": l.includes("image") ? [] : []
434
465
  },
435
- disabled: s || a,
466
+ disabled: s || i,
436
467
  multiple: !0
437
468
  });
438
469
  return /* @__PURE__ */ e(
439
470
  "div",
440
471
  {
441
472
  className: `flex h-[60px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-slate-300 p-0 py-2 hover:border-black/50 ${N ? "pointer-events-none bg-gray-100 opacity-90" : "bg-gray-100 hover:border-black/50 hover:bg-gray-100"}`,
442
- children: /* @__PURE__ */ r(
473
+ children: /* @__PURE__ */ n(
443
474
  "div",
444
475
  {
445
- ...w(),
446
- className: xe(
476
+ ...b(),
477
+ className: ye(
447
478
  "flex h-max w-full cursor-pointer flex-col justify-center rounded-lg text-center",
448
479
  N ? "items-start" : "items-center",
449
480
  S ? "border-primary bg-primary/5" : "border-muted-foreground/20"
450
481
  ),
451
482
  children: [
452
483
  /* @__PURE__ */ e("input", { ...C() }),
453
- N ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center px-6", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-2 leading-tight", children: [
454
- /* @__PURE__ */ e("div", { className: "flex items-center justify-center rounded-full bg-indigo-100 p-2", children: /* @__PURE__ */ e(B, { className: "h-4 w-4 animate-spin text-indigo-500" }) }),
455
- /* @__PURE__ */ r("div", { className: "text-left", children: [
456
- /* @__PURE__ */ e("div", { className: "font-medium", children: i(s ? "Updating file..." : "Uploading file...") }),
457
- /* @__PURE__ */ r("div", { className: "text-xs font-light text-muted-foreground", children: [
458
- i("Please wait while we"),
484
+ N ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center px-6", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-center gap-2 leading-tight", children: [
485
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center rounded-full bg-indigo-100 p-2", children: /* @__PURE__ */ e(G, { className: "h-4 w-4 animate-spin text-indigo-500" }) }),
486
+ /* @__PURE__ */ n("div", { className: "text-left", children: [
487
+ /* @__PURE__ */ e("div", { className: "font-medium", children: a(s ? "Updating file..." : "Uploading file...") }),
488
+ /* @__PURE__ */ n("div", { className: "text-xs font-light text-muted-foreground", children: [
489
+ a("Please wait while we"),
459
490
  " ",
460
- i(s ? "update" : "upload"),
491
+ a(s ? "update" : "upload"),
461
492
  " ",
462
- i("your file...")
493
+ a("your file...")
463
494
  ] })
464
495
  ] })
465
- ] }) }) : /* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between px-6", children: [
466
- /* @__PURE__ */ e("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2 leading-tight", children: [
496
+ ] }) }) : /* @__PURE__ */ n("div", { className: "flex w-full items-center justify-between px-6", children: [
497
+ /* @__PURE__ */ e("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2 leading-tight", children: [
467
498
  /* @__PURE__ */ e(
468
499
  "div",
469
500
  {
470
501
  className: "flex items-center justify-center rounded-full border border-indigo-500 bg-indigo-100 p-2",
471
- children: /* @__PURE__ */ e(rt, { className: "h-4 w-4 text-indigo-500" })
502
+ children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4 text-indigo-500" })
472
503
  }
473
504
  ),
474
- /* @__PURE__ */ r("div", { className: "text-left", children: [
475
- /* @__PURE__ */ r("div", { className: "font-medium", children: [
476
- i("Drop your file here or"),
505
+ /* @__PURE__ */ n("div", { className: "text-left", children: [
506
+ /* @__PURE__ */ n("div", { className: "font-medium", children: [
507
+ a("Drop your file here or"),
477
508
  " ",
478
- /* @__PURE__ */ e("span", { className: "cursor-pointer text-indigo-500 hover:underline", children: i("browse") })
509
+ /* @__PURE__ */ e("span", { className: "cursor-pointer text-indigo-500 hover:underline", children: a("browse") })
479
510
  ] }),
480
- /* @__PURE__ */ e("div", { className: "text-xs font-light text-muted-foreground", children: /* @__PURE__ */ r("span", { className: "", children: [
481
- i("Accepted file types:"),
511
+ /* @__PURE__ */ e("div", { className: "text-xs font-light text-muted-foreground", children: /* @__PURE__ */ n("span", { className: "", children: [
512
+ a("Accepted file types:"),
482
513
  " ",
483
- /* @__PURE__ */ e("span", { className: "capitalize text-indigo-400", children: n.join(", ") })
514
+ /* @__PURE__ */ e("span", { className: "capitalize text-indigo-400", children: l.join(", ") })
484
515
  ] }) })
485
516
  ] })
486
517
  ] }) }),
487
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
488
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
489
- /* @__PURE__ */ r("span", { className: "text-xs", children: [
490
- i("Optimization:"),
518
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
519
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
520
+ /* @__PURE__ */ n("span", { className: "text-xs", children: [
521
+ a("Optimization:"),
491
522
  " ",
492
- /* @__PURE__ */ e("span", { className: l ? "text-indigo-600" : "text-gray-400", children: i(l ? "On" : "Off") })
523
+ /* @__PURE__ */ e("span", { className: r ? "text-indigo-600" : "text-gray-400", children: a(r ? "On" : "Off") })
493
524
  ] }),
494
525
  /* @__PURE__ */ e(
495
- Pe,
526
+ ot,
496
527
  {
497
- checked: l,
528
+ checked: r,
498
529
  onCheckedChange: (o) => {
499
- I(o);
530
+ k(o);
500
531
  },
501
532
  onClick: (o) => {
502
533
  o.stopPropagation();
@@ -505,15 +536,15 @@ const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
505
536
  }
506
537
  )
507
538
  ] }),
508
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ r(q, { children: [
509
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
539
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ n(P, { children: [
540
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
510
541
  "span",
511
542
  {
512
- className: `flex cursor-help items-center text-amber-500 ${l ? "invisible" : ""}`,
513
- children: /* @__PURE__ */ e(nt, { className: "mr-1 h-4 w-4" })
543
+ className: `flex cursor-help items-center text-amber-500 ${r ? "invisible" : ""}`,
544
+ children: /* @__PURE__ */ e(Je, { className: "mr-1 h-4 w-4" })
514
545
  }
515
546
  ) }),
516
- /* @__PURE__ */ e(G, { side: "top", children: /* @__PURE__ */ e("p", { className: "text-xs text-white", children: i("Warning: Unoptimized images may affect performance and page load times") }) })
547
+ /* @__PURE__ */ e(B, { side: "top", children: /* @__PURE__ */ e("p", { className: "text-xs text-white", children: a("Warning: Unoptimized images may affect performance and page load times") }) })
517
548
  ] }) })
518
549
  ] })
519
550
  ] })
@@ -523,142 +554,142 @@ const xt = ({ assetId: s, onBack: n, onEdit: h, onSave: a, isSaving: c }) => {
523
554
  }
524
555
  );
525
556
  };
526
- function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
527
- const { t: c } = ee(), i = !1, l = 10, I = pe(() => [h], [h]), [N, x] = y(null), [g, w] = y(null), [C, S] = y(null), [o, m] = y({ show: !1, file: "" }), [d, f] = y(!1), [v, E] = y(a ? "details" : "grid"), [j, X] = y(""), [F, U] = y(""), [R, Z] = y(1), [ae] = y(30), [k, J] = y([]);
557
+ function _t({ close: s, onSelect: l, mode: u = "image", assetId: i }) {
558
+ const { t: c } = te(), a = !1, r = 10, k = ge(() => [u], [u]), [N, x] = y(null), [g, b] = y(null), [C, S] = y(null), [o, m] = y({ show: !1, file: "" }), [d, f] = y(!1), [v, E] = y(i ? "details" : "grid"), [j, X] = y(""), [F, U] = y(""), [Q, Z] = y(1), [le] = y(30), [I, J] = y([]);
528
559
  O(() => {
529
- a && (x(a), E("details"));
530
- }, [a]), O(() => {
560
+ i && (x(i), E("details"));
561
+ }, [i]), O(() => {
531
562
  const t = setTimeout(() => {
532
563
  X(F), Z(1);
533
564
  }, 300);
534
565
  return () => clearTimeout(t);
535
566
  }, [F]);
536
567
  const {
537
- data: L,
568
+ data: $,
538
569
  isLoading: W,
539
- refetch: ve
540
- } = ft({
570
+ refetch: Ne
571
+ } = xt({
541
572
  search: j.toLowerCase().trim(),
542
- page: R,
543
- limit: ae
544
- }), D = (L == null ? void 0 : L.assets) || [], ye = (L == null ? void 0 : L.total) || 0, T = Math.ceil(ye / ae);
573
+ page: Q,
574
+ limit: le
575
+ }), D = ($ == null ? void 0 : $.assets) || [], we = ($ == null ? void 0 : $.total) || 0, T = Math.ceil(we / le);
545
576
  O(() => {
546
577
  W || T <= 0 || Z((t) => t > T ? T : t < 1 ? 1 : t);
547
578
  }, [W, T]);
548
- const Ne = (D == null ? void 0 : D.length) > 0, { mutate: we } = mt(), { mutateAsync: le, isPending: be } = dt(), { mutateAsync: re, isPending: Ae } = ut(), ne = M(
579
+ const be = (D == null ? void 0 : D.length) > 0, { mutate: Ae } = ft(), { mutateAsync: re, isPending: Ce } = ht(), { mutateAsync: ne, isPending: Se } = pt(), se = L(
549
580
  (t) => {
550
- const u = Math.min(Math.max(1, t), Math.max(1, T));
551
- u !== R && Z(u);
581
+ const h = Math.min(Math.max(1, t), Math.max(1, T));
582
+ h !== Q && Z(h);
552
583
  },
553
- [T, R]
554
- ), Ce = (t) => {
584
+ [T, Q]
585
+ ), Ee = (t) => {
555
586
  U(t.target.value);
556
- }, Se = M(
587
+ }, Ie = L(
557
588
  (t) => {
558
- J((u) => Be(u, { id: t.id }) ? [] : [t]);
589
+ J((h) => $e(h, { id: t.id }) ? [] : [t]);
559
590
  },
560
- [i]
561
- ), Ee = M(() => {
591
+ [a]
592
+ ), ke = L(() => {
562
593
  J([]);
563
- }, []), se = (t) => {
564
- (t == null ? void 0 : t.length) !== 0 && (n(Y(Qe(t || k), ["id", "url", "width", "height", "description"])), s());
565
- }, ke = async (t) => {
566
- w(t);
567
- }, Ie = async () => {
568
- g && (S(g == null ? void 0 : g.id), await we(g.id, {
594
+ }, []), ce = (t) => {
595
+ (t == null ? void 0 : t.length) !== 0 && (l(Y(Le(t || I), ["id", "url", "width", "height", "description"])), s());
596
+ }, Te = async (t) => {
597
+ b(t);
598
+ }, ze = async () => {
599
+ g && (S(g == null ? void 0 : g.id), await Ae(g.id, {
569
600
  onSuccess: () => {
570
- S(null), w(null);
601
+ S(null), b(null);
571
602
  },
572
603
  onError: () => {
573
604
  S(null);
574
605
  }
575
- }), w(null));
576
- }, Te = (t) => {
606
+ }), b(null));
607
+ }, De = (t) => {
577
608
  x(t.id), E("details");
578
- }, ze = async (t, u) => {
609
+ }, je = async (t, h) => {
579
610
  try {
580
- const $ = localStorage.getItem("chai_optimize_images") !== "false";
581
- if (u) {
582
- const z = await le([
611
+ const M = localStorage.getItem("chai_optimize_images") !== "false";
612
+ if (h) {
613
+ const z = await re([
583
614
  {
584
615
  file: t,
585
616
  folderId: void 0,
586
617
  name: o.name || "",
587
- optimize: $
618
+ optimize: M
588
619
  }
589
620
  ]);
590
621
  if ((z == null ? void 0 : z.length) > 0) {
591
- const ce = z[0];
592
- n({
593
- ...Y(ce, ["id", "width", "height", "description"]),
594
- url: ce.url
622
+ const oe = z[0];
623
+ l({
624
+ ...Y(oe, ["id", "width", "height", "description"]),
625
+ url: oe.url
595
626
  });
596
627
  }
597
628
  } else {
598
- const z = await re({
629
+ const z = await ne({
599
630
  id: o.id || "",
600
631
  file: t
601
632
  });
602
- z && n({
633
+ z && l({
603
634
  ...Y(z, ["id", "width", "height", "description"]),
604
635
  url: z.url
605
636
  });
606
637
  }
607
638
  m({ show: !1, file: "" }), s();
608
- } catch ($) {
609
- console.error(c("Error saving edited image:"), $);
639
+ } catch (M) {
640
+ console.error(c("Error saving edited image:"), M);
610
641
  }
611
- }, De = M((t) => {
642
+ }, Fe = L((t) => {
612
643
  J([t]);
613
- }, []), je = M(
644
+ }, []), Ue = L(
614
645
  (t) => {
615
- ne(t);
646
+ se(t);
616
647
  },
617
- [ne]
648
+ [se]
618
649
  );
619
- return /* @__PURE__ */ r(H, { children: [
620
- /* @__PURE__ */ r("div", { className: "flex h-[80vh] max-h-[1232px] w-[80vw] max-w-[1232px] flex-col space-y-4", children: [
650
+ return /* @__PURE__ */ n(H, { children: [
651
+ /* @__PURE__ */ n("div", { className: "flex h-[80vh] max-h-[1232px] w-[80vw] max-w-[1232px] flex-col space-y-4", children: [
621
652
  /* @__PURE__ */ e("h1", { className: "text-lg font-medium", children: c("Digital Asset Manager") }),
622
- v === "grid" ? /* @__PURE__ */ r(H, { children: [
653
+ v === "grid" ? /* @__PURE__ */ n(H, { children: [
623
654
  /* @__PURE__ */ e(
624
- Nt,
655
+ At,
625
656
  {
626
- maxFileSize: l,
627
- allowedTypes: I,
628
- uploadAssets: le,
629
- isUpdatingAsset: Ae,
630
- isUploadingAsset: be,
631
- onUploaded: De
657
+ maxFileSize: r,
658
+ allowedTypes: k,
659
+ uploadAssets: re,
660
+ isUpdatingAsset: Se,
661
+ isUploadingAsset: Ce,
662
+ onUploaded: Fe
632
663
  }
633
664
  ),
634
- /* @__PURE__ */ r("div", { className: "relative flex flex-1 flex-col gap-y-3 overflow-hidden rounded-lg border p-2", children: [
635
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3", children: [
636
- /* @__PURE__ */ r("div", { className: "relative w-1/2", children: [
665
+ /* @__PURE__ */ n("div", { className: "relative flex flex-1 flex-col gap-y-3 overflow-hidden rounded-lg border p-2", children: [
666
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-3", children: [
667
+ /* @__PURE__ */ n("div", { className: "relative w-1/2", children: [
637
668
  /* @__PURE__ */ e(
638
- Ze,
669
+ Ge,
639
670
  {
640
671
  strokeWidth: 3,
641
672
  className: `absolute left-2 top-2.5 h-4 w-4 text-muted-foreground ${F.length > 0 ? "text-indigo-800" : ""}`
642
673
  }
643
674
  ),
644
675
  /* @__PURE__ */ e(
645
- me,
676
+ xe,
646
677
  {
647
678
  placeholder: c("Search assets..."),
648
- onChange: Ce,
679
+ onChange: Ee,
649
680
  value: F,
650
681
  className: "pl-8"
651
682
  }
652
683
  )
653
684
  ] }),
654
- /* @__PURE__ */ r("div", { className: "flex items-center gap-x-2", children: [
655
- k.length > 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
656
- k.length > 0 && /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
685
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-x-2", children: [
686
+ I.length > 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
687
+ I.length > 0 && /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
657
688
  p,
658
689
  {
659
690
  variant: "outline",
660
691
  size: "sm",
661
- onClick: () => Ee(),
692
+ onClick: () => ke(),
662
693
  title: c("Clear selection"),
663
694
  children: c("Clear")
664
695
  }
@@ -667,16 +698,16 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
667
698
  p,
668
699
  {
669
700
  size: "sm",
670
- onClick: () => se(k),
671
- disabled: k.length === 0,
701
+ onClick: () => ce(I),
702
+ disabled: I.length === 0,
672
703
  children: c("Select Asset")
673
704
  }
674
705
  )
675
706
  ] }) }) : null,
676
- /* @__PURE__ */ e(p, { variant: "ghost", size: "icon", onClick: () => ve(), children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" }) })
707
+ /* @__PURE__ */ e(p, { variant: "ghost", size: "icon", onClick: () => Ne(), children: /* @__PURE__ */ e(Re, { className: "h-4 w-4" }) })
677
708
  ] })
678
709
  ] }),
679
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto pb-[66px]", children: W ? /* @__PURE__ */ r("div", { className: "columns-1 gap-3 space-y-3 sm:columns-3 md:columns-5", children: [
710
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto pb-[66px]", children: W ? /* @__PURE__ */ n("div", { className: "columns-1 gap-3 space-y-3 sm:columns-3 md:columns-5", children: [
680
711
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
681
712
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
682
713
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
@@ -687,34 +718,34 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
687
718
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
688
719
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" }),
689
720
  /* @__PURE__ */ e("div", { className: "h-64 w-full animate-pulse rounded bg-gray-200" })
690
- ] }) : !W && !Ne ? /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center rounded-lg border", children: [
691
- /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: /* @__PURE__ */ e(Ye, { className: "h-9 w-9 text-indigo-500" }) }),
721
+ ] }) : !W && !be ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center rounded-lg border", children: [
722
+ /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: /* @__PURE__ */ e(Ke, { className: "h-9 w-9 text-indigo-500" }) }),
692
723
  /* @__PURE__ */ e("div", { className: "text-lg text-muted-foreground", children: c("No assets found") }),
693
724
  /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: j.length > 0 ? c("No assets found for your search: {{query}}", { query: j }) : c("Start uploading assets to get started") }),
694
725
  /* @__PURE__ */ e("br", {})
695
- ] }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-3 p-1", children: D == null ? void 0 : D.map((t) => /* @__PURE__ */ r(
726
+ ] }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-3 p-1", children: D == null ? void 0 : D.map((t) => /* @__PURE__ */ n(
696
727
  "div",
697
728
  {
698
- className: xe(
729
+ className: ye(
699
730
  "group relative flex max-h-[180px] max-w-[180px] cursor-pointer flex-col justify-between overflow-hidden rounded-lg border-2 transition-all",
700
- k.some((u) => u.id === t.id) ? "border-blue-500" : "hover:border-black/90",
731
+ I.some((h) => h.id === t.id) ? "border-blue-500" : "hover:border-black/90",
701
732
  C && (g == null ? void 0 : g.id) === t.id ? "pointer-events-none opacity-50" : "",
702
733
  C === t.id ? "pointer-events-none opacity-50" : ""
703
734
  ),
704
- onClick: () => Se(t),
705
- onDoubleClick: () => se([t]),
735
+ onClick: () => Ie(t),
736
+ onDoubleClick: () => ce([t]),
706
737
  children: [
707
- /* @__PURE__ */ r("div", { className: "aspect-square relative overflow-hidden", children: [
708
- C === t.id ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ e(B, { className: "h-8 w-8 animate-spin text-white" }) }) : null,
738
+ /* @__PURE__ */ n("div", { className: "aspect-square relative overflow-hidden", children: [
739
+ C === t.id ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ e(G, { className: "h-8 w-8 animate-spin text-white" }) }) : null,
709
740
  t.type === "image" ? /* @__PURE__ */ e(
710
741
  "img",
711
742
  {
712
743
  src: `${t.thumbnailUrl || "/placeholder.svg"}?v=${(t == null ? void 0 : t.updatedAt) || t.createdAt}`,
713
744
  alt: t.name,
714
- className: `h-full min-h-[80px] w-full object-contain ${k.some((u) => u.id === t.id) ? "" : "group-hover:blur group-hover:contrast-50"}`
745
+ className: `h-full min-h-[80px] w-full object-contain ${I.some((h) => h.id === t.id) ? "" : "group-hover:blur group-hover:contrast-50"}`
715
746
  }
716
- ) : /* @__PURE__ */ r("div", { className: "flex h-full items-center justify-center", children: [
717
- /* @__PURE__ */ e(et, { className: "h-12 w-12 text-muted-foreground" }),
747
+ ) : /* @__PURE__ */ n("div", { className: "flex h-full items-center justify-center", children: [
748
+ /* @__PURE__ */ e(Qe, { className: "h-12 w-12 text-muted-foreground" }),
718
749
  t.thumbnailUrl && /* @__PURE__ */ e(
719
750
  "img",
720
751
  {
@@ -725,97 +756,97 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
725
756
  )
726
757
  ] })
727
758
  ] }),
728
- /* @__PURE__ */ r("div", { className: "flex items-end justify-between border-t-[1px] border-black/10 bg-white px-2 py-1", children: [
759
+ /* @__PURE__ */ n("div", { className: "flex items-end justify-between border-t-[1px] border-black/10 bg-white px-2 py-1", children: [
729
760
  /* @__PURE__ */ e("div", { className: "truncate text-xs leading-tight", title: t.name, children: t.name }),
730
- /* @__PURE__ */ e("div", { className: "flex items-center justify-between whitespace-nowrap text-[9px] font-light text-muted-foreground", children: /* @__PURE__ */ e("span", { children: Ge((t == null ? void 0 : t.size) || 0) }) })
761
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-between whitespace-nowrap text-[9px] font-light text-muted-foreground", children: /* @__PURE__ */ e("span", { children: ee((t == null ? void 0 : t.size) || 0) }) })
731
762
  ] }),
732
- !k.some((u) => u.id === t.id) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-2 p-2", children: [
733
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ r(q, { children: [
734
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
763
+ !I.some((h) => h.id === t.id) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-4 gap-2 p-2", children: [
764
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ n(P, { children: [
765
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
735
766
  p,
736
767
  {
737
768
  variant: "secondary",
738
769
  size: "icon",
739
770
  className: "h-8 w-8 rounded-full",
740
- onClick: (u) => {
741
- u.stopPropagation(), Te(t);
771
+ onClick: (h) => {
772
+ h.stopPropagation(), De(t);
742
773
  },
743
- children: /* @__PURE__ */ e(tt, { className: "h-4 w-4" })
774
+ children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
744
775
  }
745
776
  ) }),
746
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e("p", { children: c("View Details") }) })
777
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("p", { children: c("View Details") }) })
747
778
  ] }) }),
748
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ r(q, { children: [
749
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
779
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ n(P, { children: [
780
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
750
781
  p,
751
782
  {
752
783
  variant: "secondary",
753
784
  size: "icon",
754
785
  className: "h-8 w-8 rounded-full",
755
- onClick: (u) => {
756
- u.stopPropagation(), navigator.clipboard.writeText(t.url), A.success(c("Asset URL copied to clipboard"));
786
+ onClick: (h) => {
787
+ h.stopPropagation(), navigator.clipboard.writeText(t.url), w.success(c("Asset URL copied to clipboard"));
757
788
  },
758
- children: /* @__PURE__ */ e(he, { className: "h-4 w-4" })
789
+ children: /* @__PURE__ */ e(fe, { className: "h-4 w-4" })
759
790
  }
760
791
  ) }),
761
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e("p", { children: c("Copy URL") }) })
792
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("p", { children: c("Copy URL") }) })
762
793
  ] }) }),
763
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ r(q, { children: [
764
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
794
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ n(P, { children: [
795
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
765
796
  p,
766
797
  {
767
798
  variant: "secondary",
768
799
  size: "icon",
769
800
  className: "h-8 w-8 rounded-full",
770
- onClick: (u) => {
771
- u.stopPropagation(), m({
801
+ onClick: (h) => {
802
+ h.stopPropagation(), m({
772
803
  id: t.id,
773
804
  show: !0,
774
805
  file: t.url,
775
806
  name: t.name
776
807
  });
777
808
  },
778
- children: /* @__PURE__ */ e(it, { className: "h-4 w-4" })
809
+ children: /* @__PURE__ */ e(Ve, { className: "h-4 w-4" })
779
810
  }
780
811
  ) }),
781
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e("p", { children: c("Edit Image") }) })
812
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("p", { children: c("Edit Image") }) })
782
813
  ] }) }),
783
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ r(q, { children: [
784
- /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
814
+ /* @__PURE__ */ e(_, { children: /* @__PURE__ */ n(P, { children: [
815
+ /* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
785
816
  p,
786
817
  {
787
818
  variant: "destructive",
788
819
  size: "icon",
789
820
  className: "h-8 w-8 rounded-full",
790
- onClick: (u) => {
791
- u.stopPropagation(), ke(t);
821
+ onClick: (h) => {
822
+ h.stopPropagation(), Te(t);
792
823
  },
793
- children: /* @__PURE__ */ e(at, { className: "h-4 w-4" })
824
+ children: /* @__PURE__ */ e(He, { className: "h-4 w-4" })
794
825
  }
795
826
  ) }),
796
- /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e("p", { children: c("Delete Asset") }) })
827
+ /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("p", { children: c("Delete Asset") }) })
797
828
  ] }) })
798
829
  ] }) }),
799
- k.some((u) => u.id === t.id) && /* @__PURE__ */ e("div", { className: "absolute right-1 top-1 h-max rounded-full border border-white bg-blue-500 p-1", children: /* @__PURE__ */ e(lt, { className: "h-3 w-3 text-white", strokeWidth: 5 }) })
830
+ I.some((h) => h.id === t.id) && /* @__PURE__ */ e("div", { className: "absolute right-1 top-1 h-max rounded-full border border-white bg-blue-500 p-1", children: /* @__PURE__ */ e(Xe, { className: "h-3 w-3 text-white", strokeWidth: 5 }) })
800
831
  ]
801
832
  },
802
833
  t.id
803
834
  )) }) }),
804
- T > 1 && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 border-t bg-white p-4", children: /* @__PURE__ */ e(ot, { fallback: /* @__PURE__ */ e("div", { className: "text-red-500", children: c("Error loading pagination") }), children: /* @__PURE__ */ e(
805
- ht,
835
+ T > 1 && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 border-t bg-white p-4", children: /* @__PURE__ */ e(tt, { fallback: /* @__PURE__ */ e("div", { className: "text-red-500", children: c("Error loading pagination") }), children: /* @__PURE__ */ e(
836
+ gt,
806
837
  {
807
- currentPage: R,
838
+ currentPage: Q,
808
839
  totalPages: T,
809
- onPageChange: je,
840
+ onPageChange: Ue,
810
841
  pageRangeDisplayed: 3,
811
842
  showPageInput: !0
812
843
  }
813
844
  ) }) })
814
845
  ] })
815
846
  ] }) : /* @__PURE__ */ e(
816
- xt,
847
+ Nt,
817
848
  {
818
- assetId: N || a || "",
849
+ assetId: N || i || "",
819
850
  onBack: () => {
820
851
  E("grid"), x(null);
821
852
  },
@@ -831,8 +862,8 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
831
862
  if (N) {
832
863
  f(!0);
833
864
  try {
834
- const u = D.find(($) => $.id === N);
835
- u && await re(Ke(u, { description: t }));
865
+ const h = D.find((M) => M.id === N);
866
+ h && await ne(Me(h, { description: t }));
836
867
  } finally {
837
868
  f(!1);
838
869
  }
@@ -843,14 +874,14 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
843
874
  )
844
875
  ] }),
845
876
  o.show && /* @__PURE__ */ e(
846
- st,
877
+ Ye,
847
878
  {
848
- fallback: /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(B, { className: "h-8 w-8 animate-spin" }) }),
879
+ fallback: /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(G, { className: "h-8 w-8 animate-spin" }) }),
849
880
  children: /* @__PURE__ */ e(
850
- vt,
881
+ wt,
851
882
  {
852
883
  imageUrl: o.file,
853
- onSave: ze,
884
+ onSave: je,
854
885
  onClose: () => m({ show: !1, file: "" }),
855
886
  defaultSavedImageName: o.name,
856
887
  isEditing: !!o.id
@@ -858,20 +889,20 @@ function Lt({ close: s, onSelect: n, mode: h = "image", assetId: a }) {
858
889
  )
859
890
  }
860
891
  ),
861
- g && /* @__PURE__ */ e(Ue, { open: !!g, onOpenChange: () => w(null), children: /* @__PURE__ */ r(Le, { children: [
862
- /* @__PURE__ */ r($e, { children: [
863
- /* @__PURE__ */ e(Me, { children: c("Delete Asset") }),
864
- /* @__PURE__ */ e(_e, { children: c('Are you sure you want to delete "{{name}}"? This action cannot be undone.', {
892
+ g && /* @__PURE__ */ e(at, { open: !!g, onOpenChange: () => b(null), children: /* @__PURE__ */ n(lt, { children: [
893
+ /* @__PURE__ */ n(rt, { children: [
894
+ /* @__PURE__ */ e(nt, { children: c("Delete Asset") }),
895
+ /* @__PURE__ */ e(st, { children: c('Are you sure you want to delete "{{name}}"? This action cannot be undone.', {
865
896
  name: g.name
866
897
  }) })
867
898
  ] }),
868
- /* @__PURE__ */ r(qe, { className: "gap-2 sm:gap-0", children: [
869
- /* @__PURE__ */ e(p, { variant: "outline", onClick: () => w(null), children: c("Cancel") }),
870
- /* @__PURE__ */ e(p, { variant: "destructive", onClick: Ie, children: c("Delete") })
899
+ /* @__PURE__ */ n(ct, { className: "gap-2 sm:gap-0", children: [
900
+ /* @__PURE__ */ e(p, { variant: "outline", onClick: () => b(null), children: c("Cancel") }),
901
+ /* @__PURE__ */ e(p, { variant: "destructive", onClick: ze, children: c("Delete") })
871
902
  ] })
872
903
  ] }) })
873
904
  ] });
874
905
  }
875
906
  export {
876
- Lt as default
907
+ _t as default
877
908
  };