@orangelogic/design-system 2.78.0 → 2.79.0-ci.2

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 (184) hide show
  1. package/library/chunks/{AxisLabelRadial.BTpA5dYy.js → AxisLabelRadial.Bs1P_q_F.js} +1 -1
  2. package/library/chunks/{BaseColumnSeries.hIO71GLG.js → BaseColumnSeries.C7jwOxIJ.js} +1 -1
  3. package/library/chunks/{CandlestickSeries.w9C0GR9v.js → CandlestickSeries.CkXGtRWE.js} +2 -2
  4. package/library/chunks/{Circle.tOnnO-F-.js → Circle.DBa5Ok8V.js} +1 -1
  5. package/library/chunks/{ColumnSeries.Ckz75x1M.js → ColumnSeries.DGazbfza.js} +2 -2
  6. package/library/chunks/{EditableAxisLabel.CCMTJT7K.js → EditableAxisLabel.wN0t_G2B.js} +2 -2
  7. package/library/chunks/{EditableLabel.DPmicdjK.js → EditableLabel.BWeq6fgX.js} +1 -1
  8. package/library/chunks/{Gradient.BrDBLm8v.js → Gradient.CdcsPIru.js} +1 -1
  9. package/library/chunks/{LinearGradient.CxfXxvMw.js → LinearGradient.B1z9AGUt.js} +2 -2
  10. package/library/chunks/{Picture.BNASYM-P.js → Picture.YSPC0l0Q.js} +1 -1
  11. package/library/chunks/{Polygon.Dr-GV2hn.js → Polygon.BwMvXN2H.js} +1 -1
  12. package/library/chunks/{ProgressPie.4mPA6xqm.js → ProgressPie.DlCwXN17.js} +5 -5
  13. package/library/chunks/{RadialLabel.HfsGiN4x.js → RadialLabel.DyVOf2K8.js} +1 -1
  14. package/library/chunks/{Scrollbar.Bgg-RhjP.js → Scrollbar.BdZVb_Z-.js} +1 -1
  15. package/library/chunks/{Slice.Dm56LTKj.js → Slice.DiEswWa6.js} +1 -1
  16. package/library/chunks/{Slider.FKJwoPq2.js → Slider.C20No2z5.js} +1 -1
  17. package/library/chunks/{SpriteResizer.-qJDgug8.js → SpriteResizer.DFnmcy0h.js} +1 -1
  18. package/library/chunks/{Triangle.BECgi7mc.js → Triangle.BaOef7HV.js} +1 -1
  19. package/library/chunks/{ZoomTools.cgwuIB0e.js → ZoomTools.D5JPehoL.js} +1 -1
  20. package/library/chunks/{am-chart.oZVBmpnn.js → am-chart.H2jnOzFc.js} +253 -261
  21. package/library/chunks/{animation.DU8t6mrk.js → animation.7ifl4x2S.js} +3 -7
  22. package/library/chunks/{button.DS64Tr8Z.js → button.B-ktz-w4.js} +7 -40
  23. package/library/chunks/button.styles.CKqn956w.js +5 -0
  24. package/library/chunks/{color-swatch-group.C7T6-sY7.js → color-swatch-group.DvllHUil.js} +46 -216
  25. package/library/chunks/{color-swatch.BuUP5yG4.js → color-swatch.Bx-HOp9f.js} +18 -202
  26. package/library/chunks/{colorPicker.C4w_vDjh.js → colorPicker.06n6P3aK.js} +5 -5
  27. package/library/chunks/component.styles.CRO4Odto.js +5 -0
  28. package/library/chunks/confirm-popover.BbHneK19.js +121 -0
  29. package/library/chunks/{cropper.D1lO3pl-.js → cropper.DTokTzP9.js} +2533 -2904
  30. package/library/chunks/{dialog.BdXQkCKY.js → dialog.B1nzoJak.js} +40 -251
  31. package/library/chunks/dot-pagination.C26bQ3vy.js +204 -0
  32. package/library/chunks/{exporting.BdjsEGF8.js → exporting.Chnl3UWi.js} +2 -2
  33. package/library/chunks/file-on-demand.D_Mia7M9.js +1956 -0
  34. package/library/chunks/{flow.D0FqdfOy.js → flow.D2CqFQa7.js} +5 -5
  35. package/library/chunks/{folder-select.B2qxSKA5.js → folder-select.DOsefkAC.js} +20 -226
  36. package/library/chunks/form-control.styles.CaGWmeAS.js +5 -0
  37. package/library/chunks/{gantt.DfUM7Gvb.js → gantt.DSHD2gjO.js} +8 -8
  38. package/library/chunks/header.D68fIfe2.js +170 -0
  39. package/library/chunks/{hierarchy.5kfBCoGt.js → hierarchy.DwVsMmsP.js} +5 -5
  40. package/library/chunks/icon-button.BuhCp--_.js +149 -0
  41. package/library/chunks/iframe.BQFZQMTe.js +73 -0
  42. package/library/chunks/{image.DHBgKeJp.js → image.4eLWAZ3-.js} +16 -272
  43. package/library/chunks/{index.BkoLctE9.js → index.C9khsiad.js} +17 -17
  44. package/library/chunks/{json.BjaT7cyo.js → json.zyETMOw-.js} +3 -3
  45. package/library/chunks/{list-editor.DluUZa06.js → list-editor.DNa6ROgr.js} +45 -360
  46. package/library/chunks/{map.DbgNAGxD.js → map.CqM2O6LB.js} +2 -2
  47. package/library/chunks/option.DljDoFx4.js +123 -0
  48. package/library/chunks/{overlayscrollbars.XhGWx9Zk.js → overlayscrollbars.BMav4RQ4.js} +252 -958
  49. package/library/chunks/{pagination.g4zErKN2.js → pagination.BiRyMwhM.js} +45 -141
  50. package/library/chunks/{percent.DO4FjAdu.js → percent.DuQwbCCg.js} +3 -3
  51. package/library/chunks/{radar.Dd5fJVMg.js → radar.FpYl3UH5.js} +4 -4
  52. package/library/chunks/{sliceGrouper.DA3aeuJ-.js → sliceGrouper.BsE7fGMt.js} +1 -1
  53. package/library/chunks/{stock.BfI5MUyK.js → stock.BR-ag4Pt.js} +9 -9
  54. package/library/chunks/{tab-group.Dg6a82ei.js → tab-group.9HbDE1AF.js} +30 -581
  55. package/library/chunks/{table.CcqrVieF.js → table.B8LpbiGE.js} +192 -2133
  56. package/library/chunks/{timeline.BxMLjB5J.js → timeline.DkzkmgEM.js} +5 -5
  57. package/library/chunks/{tree.OXvhEOjS.js → tree.q7xRVYyh.js} +31 -399
  58. package/library/chunks/typography.DJC_UXgs.js +52 -0
  59. package/library/chunks/{venn.CxFupTb9.js → venn.D739bOV3.js} +1 -1
  60. package/library/chunks/{wc.ThQubbN2.js → wc.DzW311D-.js} +1 -1
  61. package/library/chunks/{xy.q6e68du3.js → xy.DCRDfTsa.js} +10 -10
  62. package/library/components/alert.js +9 -177
  63. package/library/components/am-chart.js +2 -2
  64. package/library/components/animated-image.js +12 -100
  65. package/library/components/animation.js +2 -2
  66. package/library/components/array-line-clamp.js +7 -88
  67. package/library/components/asset-link-format.js +48 -626
  68. package/library/components/atoms.js +17 -17
  69. package/library/components/avatar.js +5 -94
  70. package/library/components/badge.js +11 -139
  71. package/library/components/bicolor-picker.js +4 -23
  72. package/library/components/border-input-group.js +4 -25
  73. package/library/components/breadcrumb-item.js +24 -155
  74. package/library/components/breadcrumb.js +3 -21
  75. package/library/components/button-group.js +3 -28
  76. package/library/components/button.js +3 -3
  77. package/library/components/card.js +4 -126
  78. package/library/components/checkbox.js +11 -252
  79. package/library/components/color-picker.js +54 -725
  80. package/library/components/color-swatch-group.js +5 -5
  81. package/library/components/color-swatch.js +3 -3
  82. package/library/components/confirm-popover.js +5 -5
  83. package/library/components/copy-button.js +9 -254
  84. package/library/components/corner-position-input-group.js +4 -57
  85. package/library/components/cropper.js +2 -2
  86. package/library/components/details.js +6 -152
  87. package/library/components/dialog.js +4 -4
  88. package/library/components/divider.js +5 -67
  89. package/library/components/dot-pagination.js +2 -2
  90. package/library/components/dot-status.js +25 -95
  91. package/library/components/drawer.js +8 -239
  92. package/library/components/dropdown.js +47 -149
  93. package/library/components/dynamic-select.js +7 -72
  94. package/library/components/e-chart.js +6 -49
  95. package/library/components/element-clamp.js +5 -78
  96. package/library/components/file-on-demand.js +9 -9
  97. package/library/components/folder-select.js +3 -3
  98. package/library/components/format-date.js +2 -6
  99. package/library/components/format-time.js +2 -12
  100. package/library/components/grid-item.js +4 -171
  101. package/library/components/grid.js +5 -41
  102. package/library/components/header.js +2 -2
  103. package/library/components/icon-button.js +2 -2
  104. package/library/components/icon.js +8 -2448
  105. package/library/components/iframe.js +2 -2
  106. package/library/components/image-comparer.js +7 -127
  107. package/library/components/image.js +2 -2
  108. package/library/components/include.js +2 -6
  109. package/library/components/input-group.js +4 -29
  110. package/library/components/input.js +21 -715
  111. package/library/components/line-clamp.js +7 -83
  112. package/library/components/list-editor.js +7 -7
  113. package/library/components/markdown.js +1 -3
  114. package/library/components/masonry.js +22 -221
  115. package/library/components/menu-item.js +9 -309
  116. package/library/components/menu-label.js +3 -20
  117. package/library/components/menu-section.js +3 -17
  118. package/library/components/menu.js +4 -112
  119. package/library/components/molecules.js +5 -5
  120. package/library/components/mutation-observer.js +2 -6
  121. package/library/components/option.js +2 -2
  122. package/library/components/organisms.js +2 -2
  123. package/library/components/padding-input-group.js +5 -16
  124. package/library/components/pagination.js +5 -5
  125. package/library/components/popup.js +204 -538
  126. package/library/components/position-picker.js +3 -93
  127. package/library/components/progress-bar.js +18 -135
  128. package/library/components/progress-ring.js +3 -94
  129. package/library/components/qr-code.js +4 -16
  130. package/library/components/radio-button.js +4 -24
  131. package/library/components/radio-card.js +7 -175
  132. package/library/components/radio-group.js +20 -151
  133. package/library/components/radio.js +13 -170
  134. package/library/components/range.js +120 -657
  135. package/library/components/rating.js +56 -236
  136. package/library/components/relative-time.js +2 -12
  137. package/library/components/resize-observer.js +3 -7
  138. package/library/components/select.js +225 -933
  139. package/library/components/shadow-input-group.js +5 -24
  140. package/library/components/share-option-list.js +18 -310
  141. package/library/components/sidebar.js +14 -220
  142. package/library/components/size-input-group.js +10 -75
  143. package/library/components/skeleton.js +7 -80
  144. package/library/components/space.js +6 -143
  145. package/library/components/spinner.js +6 -75
  146. package/library/components/split-panel.js +16 -123
  147. package/library/components/step.js +21 -272
  148. package/library/components/stepper-wizard.js +9 -43
  149. package/library/components/stepper.js +16 -33
  150. package/library/components/switch.js +11 -274
  151. package/library/components/tab-group.js +4 -4
  152. package/library/components/tab-panel.js +4 -31
  153. package/library/components/tab.js +9 -255
  154. package/library/components/table.js +6 -6
  155. package/library/components/tag.js +14 -165
  156. package/library/components/textarea.js +14 -363
  157. package/library/components/timecode.js +4 -23
  158. package/library/components/tooltip.js +8 -92
  159. package/library/components/tree-item.js +2 -2
  160. package/library/components/tree.js +2 -2
  161. package/library/components/typeface.js +18 -117
  162. package/library/components/types.js +777 -12001
  163. package/library/components/typography.js +2 -2
  164. package/library/components/video.js +3522 -5919
  165. package/library/components/visually-hidden.js +3 -15
  166. package/library/package.json +4 -1
  167. package/library/packages/atoms/src/components/pagination/pagination.d.ts +2 -1
  168. package/library/packages/atoms/src/components/select/select.d.ts +11 -0
  169. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
  170. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +32 -1
  171. package/library/packages/types/src/table.d.ts +2 -0
  172. package/library/react-web-component.d.ts +7 -3
  173. package/package.json +4 -1
  174. package/library/chunks/button.styles.Dl5IQLHU.js +0 -718
  175. package/library/chunks/component.styles.DMSLciL5.js +0 -71
  176. package/library/chunks/confirm-popover.BNjRvnN0.js +0 -288
  177. package/library/chunks/dot-pagination.CIVxMAAS.js +0 -325
  178. package/library/chunks/file-on-demand.BTTdth3o.js +0 -3802
  179. package/library/chunks/form-control.styles.CUGhvlfT.js +0 -67
  180. package/library/chunks/header.m7v3M94Z.js +0 -777
  181. package/library/chunks/icon-button.C3eqeQl9.js +0 -683
  182. package/library/chunks/iframe.CNEyWhcM.js +0 -160
  183. package/library/chunks/option.Csqefux_.js +0 -296
  184. package/library/chunks/typography.oDzoLbZS.js +0 -149
@@ -1,3802 +0,0 @@
1
- import J from "../components/icon.js";
2
- import Q from "../components/line-clamp.js";
3
- import { C as yt, s as bt, a as $t, b as lt } from "./tree.OXvhEOjS.js";
4
- import { n as d, C as H } from "./lib-cortex-element.CVMmyPMC.js";
5
- import { c as tt } from "./component.styles.DMSLciL5.js";
6
- import { c as W } from "./custom-element.L4WJXn1j.js";
7
- import { L as q } from "./i18n.BUW7B9hr.js";
8
- import { k as zt, h as St, i as wt, w as P, j as Et, l as Lt, f as Ft, g as Ut, d as Rt, m as kt, n as Ot } from "./watch.BCJD77bD.js";
9
- import { p as R } from "./string.B_rEG27K.js";
10
- import { x as n, i as at, E as Nt } from "./lit-element.jLBm65_O.js";
11
- import { r as u } from "./state.CSDxrqLd.js";
12
- import { e as z } from "./query.BBf1UFkC.js";
13
- import { e as C } from "./class-map.BiVq-cVR.js";
14
- import { c as U } from "./repeat.DbF2p5ae.js";
15
- import { n as p } from "./when.Dr1es41R.js";
16
- import { a as jt, i as It, c as Bt, b as dt } from "./_baseUniq.BUihBa8c.js";
17
- import Mt from "../components/avatar.js";
18
- import { C as Vt } from "./button.DS64Tr8Z.js";
19
- import { C as Ht } from "./dialog.BdXQkCKY.js";
20
- import Wt from "../components/divider.js";
21
- import ot from "../components/format-bytes.js";
22
- import { C as Ct } from "./icon-button.C3eqeQl9.js";
23
- import qt from "../components/input.js";
24
- import { C as Gt } from "./option.Csqefux_.js";
25
- import At from "../components/relative-time.js";
26
- import Yt from "../components/select.js";
27
- import Kt from "../components/space.js";
28
- import Xt from "../components/tab.js";
29
- import { C as Zt } from "./tab-group.Dg6a82ei.js";
30
- import Jt from "../components/tab-panel.js";
31
- import Dt from "../components/tooltip.js";
32
- import { C as nt } from "./typography.oDzoLbZS.js";
33
- import { C as Qt } from "./confirm-popover.BNjRvnN0.js";
34
- import { d as te } from "./debounce.DaHuiSGU.js";
35
- import { a as et } from "./number.CjNxU7Xs.js";
36
- import { i as K, a as ht } from "./url.Cj9cIQXJ.js";
37
- import { a as ee } from "./toString.CL_lYXbK.js";
38
- import { S as pt, i as se } from "./isObjectLike.z36Fu426.js";
39
- import ie from "../components/progress-bar.js";
40
- import ae from "../components/spinner.js";
41
- import { o as oe } from "./style-map.llVFPd__.js";
42
- import { r as ne } from "./choose.BTbF6BAn.js";
43
- function re(t, e, i, a) {
44
- for (var s = -1, o = t == null ? 0 : t.length; ++s < o; ) {
45
- var c = t[s];
46
- e(a, c, i(c), t);
47
- }
48
- return a;
49
- }
50
- function ce(t) {
51
- return function(e, i, a) {
52
- for (var s = -1, o = Object(e), c = a(e), h = c.length; h--; ) {
53
- var _ = c[++s];
54
- if (i(o[_], _, o) === !1)
55
- break;
56
- }
57
- return e;
58
- };
59
- }
60
- var le = ce();
61
- function de(t, e) {
62
- return t && le(t, e, zt);
63
- }
64
- function he(t, e) {
65
- return function(i, a) {
66
- if (i == null)
67
- return i;
68
- if (!St(i))
69
- return t(i, a);
70
- for (var s = i.length, o = -1, c = Object(i); ++o < s && a(c[o], o, c) !== !1; )
71
- ;
72
- return i;
73
- };
74
- }
75
- var pe = he(de);
76
- function ue(t, e, i, a) {
77
- return pe(t, function(s, o, c) {
78
- e(a, s, i(s), c);
79
- }), a;
80
- }
81
- function ge(t, e) {
82
- return function(i, a) {
83
- var s = wt(i) ? re : ue, o = e ? e() : {};
84
- return s(i, t, jt(a), o);
85
- };
86
- }
87
- var xe = ge(function(t, e, i) {
88
- t[i ? 0 : 1].push(e);
89
- }, function() {
90
- return [[], []];
91
- });
92
- const me = {
93
- error: "Upload error",
94
- loaded: "Up-to-date",
95
- loading: "Syncing"
96
- }, x = {
97
- FAVORITES: "favorites",
98
- PINNED: "pinned",
99
- RECENT: "recent",
100
- UPLOADS: "uploads"
101
- }, X = 20, _e = {
102
- GET_CONTENT: "/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1"
103
- }, A = {
104
- ASSET_PATH: "Document.AssetPath",
105
- CHILD_COUNT: "Document.ChildCount",
106
- CORTEX_PATH: "Document.CortexPath",
107
- DOC_TYPE: "CoreField.DocType",
108
- HAS_BROWSER_CHILDREN: "Document.HasBrowserChildren",
109
- PARENT_FOLDER_IDENTIFIER: "Document.ParentRecordID",
110
- TITLE_WITH_FALLBACK: "CoreField.TitleWithFallback"
111
- }, Z = "GB", O = 6e4, fe = ["album", "story", "project", "merchandise"], ut = (t) => {
112
- const e = /* @__PURE__ */ new Date(), i = new Date(
113
- e.getFullYear(),
114
- e.getMonth(),
115
- e.getDate()
116
- ).getTime(), a = new Date(
117
- e.getFullYear(),
118
- e.getMonth(),
119
- e.getDate() + 1
120
- ).getTime();
121
- return xe(
122
- t.toSorted((s, o) => o.uploadTimestamp - s.uploadTimestamp),
123
- (s) => s.uploadTimestamp >= i && s.uploadTimestamp < a
124
- );
125
- }, ve = ({
126
- excludesRecordIDs: t,
127
- searchText: e
128
- }) => {
129
- let i = "";
130
- e?.trim() && (i = `Story_Title:${e}`);
131
- let a = "";
132
- t?.length && (a = t.map((o) => `RecordID:NOT ${o}`).join(" AND "));
133
- let s = i ? ` AND (${[i].filter(Boolean).join(" OR ")})` : "";
134
- return a && (s = `${s} AND (${a})`), `(MediaType:Story OR MediaType:Album)${s}`;
135
- }, ye = 10, Tt = async ({
136
- excludes: t = [],
137
- folderId: e,
138
- folderPath: i = [],
139
- folderPathsSet: a,
140
- limit: s = ye,
141
- searchText: o,
142
- seeThru: c,
143
- siteUrl: h,
144
- start: _ = 0,
145
- token: m
146
- }) => {
147
- if (!h)
148
- return { data: [], totalCount: 0 };
149
- let g = h;
150
- g.endsWith("/") && (g = g.slice(0, -1));
151
- const $ = _e.GET_CONTENT, f = [
152
- ["Token", m],
153
- [
154
- "extraFilters",
155
- ve({
156
- excludesRecordIDs: t,
157
- searchText: o
158
- })
159
- ],
160
- ["fields", A.ASSET_PATH],
161
- ["fields", A.CORTEX_PATH],
162
- ["fields", A.DOC_TYPE],
163
- ["fields", A.TITLE_WITH_FALLBACK],
164
- ["fields", A.HAS_BROWSER_CHILDREN],
165
- ["fields", A.PARENT_FOLDER_IDENTIFIER],
166
- ["fields", A.CHILD_COUNT],
167
- ["objectRecordID", e],
168
- ["seeThru", o?.trim() || c ? "true" : "false"],
169
- ["limit", s.toString()],
170
- ["start", _.toString()]
171
- ], F = new URL(`${g}${$}`);
172
- f.forEach(([I, E]) => {
173
- F.searchParams.append(I, E);
174
- });
175
- const k = await fetch(F.toString(), {
176
- headers: {
177
- Authorization: `Bearer ${m}`
178
- },
179
- method: "GET"
180
- });
181
- if (!k.ok) {
182
- const I = new Error();
183
- throw I.message = "Failed to fetch", I;
184
- }
185
- const G = await k.json();
186
- let Y = /* @__PURE__ */ new Set();
187
- a && (Y = Se(a));
188
- const rt = G.contentItems?.map((I) => {
189
- let E = M(
190
- I.fields,
191
- A.TITLE_WITH_FALLBACK
192
- ) ?? "", B = $e(
193
- (M(
194
- I.fields,
195
- A.ASSET_PATH
196
- ) ?? "").replace(/^Root\//i, "")
197
- ) || E;
198
- if (a) {
199
- if (a.has(B)) {
200
- const ct = B.split("/"), Pt = ct.pop();
201
- B = `${ct.join("/")}/${I.recordID}-${Pt}`, E = `${I.recordID}-${E}`;
202
- }
203
- o?.trim() && Y.has(E) && (E = B), a.add(B), Y.add(E);
204
- }
205
- return {
206
- childCount: Number(
207
- M(
208
- I.fields,
209
- A.CHILD_COUNT
210
- ) ?? 0
211
- ),
212
- children: [],
213
- docType: M(
214
- I.fields,
215
- A.DOC_TYPE
216
- ) ?? "",
217
- fullPath: B,
218
- hasChildren: M(
219
- I.fields,
220
- A.HAS_BROWSER_CHILDREN
221
- ) === "1",
222
- id: I.recordID,
223
- parentFolderIdentifier: M(
224
- I.fields,
225
- A.PARENT_FOLDER_IDENTIFIER
226
- ) ?? "",
227
- parents: [],
228
- path: [...i, E],
229
- title: E
230
- };
231
- }) ?? [];
232
- return { data: rt, totalCount: G.totalCount ?? rt.length };
233
- };
234
- function M(t, e) {
235
- const i = e.toLowerCase(), a = Object.keys(t).find(
236
- (s) => s.toLowerCase() === i
237
- );
238
- return a ? t[a] : void 0;
239
- }
240
- const it = "-", S = (t) => {
241
- const e = t.split(it), i = e.pop() ?? "", a = e.join(it);
242
- return { id: i, path: a };
243
- }, N = ({ id: t, path: e }) => [e, t].join(it), be = (t) => {
244
- const e = t.split(".");
245
- return e.length > 1 ? e.pop() ?? "" : "";
246
- }, gt = (t) => {
247
- const e = t.match(/(?:V\.?)?(\d+(?:\.\d+)*)/);
248
- return e ? e[1] : "";
249
- }, xt = (t, e) => {
250
- let i = e?.trim();
251
- const a = e ? e.split("/").length : 0;
252
- return (t ? t.length : 0) >= a && (i = t.join("/") ?? ""), i;
253
- }, $e = (t) => t.split("/").map((e) => e.trim()).join("/"), Se = (t) => {
254
- const e = /* @__PURE__ */ new Set();
255
- for (const i of t) {
256
- const a = i.split("/"), s = a[a.length - 1];
257
- s && e.add(s);
258
- }
259
- return e;
260
- }, we = (t, e) => {
261
- const i = t.split("/"), a = e.split("/");
262
- return i.slice(0, a.length + 1).join("/");
263
- };
264
- function mt(t) {
265
- return t.toSorted((e, i) => i.uploadTimestamp - e.uploadTimestamp);
266
- }
267
- var Ie = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, D = (t, e, i, a) => {
268
- for (var s = a > 1 ? void 0 : a ? Ce(e, i) : e, o = t.length - 1, c; o >= 0; o--)
269
- (c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
270
- return a && s && Ie(e, i, s), s;
271
- };
272
- let y = class extends H {
273
- constructor() {
274
- super(...arguments), this.localize = new q(this), this.role = "treeitem", this.siteUrl = "", this.token = "", this.searchText = "", this.folder = null, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.folderPathsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.data = null, this.totalCount = 0, this.isLoading = !1, this.fetchFolders = async ({
275
- folderId: t,
276
- start: e = 0
277
- }) => await Tt({
278
- folderId: t,
279
- folderPath: this.folder?.path ?? [],
280
- folderPathsSet: this.folderPathsSet,
281
- siteUrl: this.siteUrl,
282
- start: e,
283
- token: this.token
284
- }), this.loadMore = async (t) => {
285
- t?.stopPropagation();
286
- const e = this.data?.length ?? 0;
287
- if (e >= this.totalCount)
288
- return;
289
- this.isLoading = !0;
290
- const { data: i, totalCount: a } = await this.fetchFolders({
291
- folderId: this.folder?.id ?? "",
292
- start: e
293
- });
294
- this.data = [...this.data ?? [], ...i], this.totalCount = a, this.isLoading = !1;
295
- }, this.onLazyLoad = async (t) => {
296
- if (t.target !== this.treeItem)
297
- return;
298
- const { data: e, totalCount: i } = await this.fetchFolders({
299
- folderId: this.folder?.id ?? ""
300
- });
301
- if (this.data = e, this.totalCount = i, await this.updateComplete, !this.treeItem.selected && !this.treeItem.indeterminate) {
302
- let a = !0, s = !0;
303
- for (const o of this.treeItem.getChildrenItems())
304
- o.selected ? (bt(o, !0, "multiple"), s = !1) : a = !1;
305
- this.treeItem.indeterminate = !a && !s;
306
- }
307
- };
308
- }
309
- get selected() {
310
- return this.treeItem.selected;
311
- }
312
- set selected(t) {
313
- this.treeItem.selected = t;
314
- }
315
- get expanded() {
316
- return this.treeItem.expanded;
317
- }
318
- set expanded(t) {
319
- this.treeItem.expanded = t;
320
- }
321
- get indeterminate() {
322
- return this.treeItem.indeterminate;
323
- }
324
- set indeterminate(t) {
325
- this.treeItem.indeterminate = t;
326
- }
327
- // this is so that external cx-tree can query select the cx-tree-item inside
328
- createRenderRoot() {
329
- return this;
330
- }
331
- getChildrenItems() {
332
- return this.treeItem.getChildrenItems();
333
- }
334
- async syncBoxes() {
335
- if (await this.updateComplete, !this.treeItem)
336
- return;
337
- let t = !1;
338
- const e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = xt(this.folder?.path ?? [], this.folder?.fullPath ?? ""), s = [...this.currentRootIDsSet], o = (m, g) => {
339
- m.forEach(($) => {
340
- const f = S($);
341
- if (!f.path.trim() || !f.id.trim())
342
- return !1;
343
- const F = R(f.path), k = R(a);
344
- a && F.startsWith(k) && F !== k && g.add(we(f.path, a));
345
- });
346
- };
347
- o(this.removedIDs, i), o(s, e);
348
- let c = !!s.some((m) => {
349
- const g = S(m);
350
- if (!g.path.trim() || !g.id.trim())
351
- return !1;
352
- const $ = N({
353
- id: this.folder?.id ?? "",
354
- path: a
355
- }), f = R(g.path), F = R(a), k = g.id === this.folder?.id, G = !this.removedIDs.includes($) && F.startsWith(f);
356
- return k || G;
357
- });
358
- const h = this.folder?.childCount && e.size === this.folder?.childCount;
359
- if (this.folder?.childCount && i.size === this.folder?.childCount) {
360
- this.currentRootIDsSet.delete(
361
- N({
362
- id: this.folder?.id ?? "",
363
- path: a
364
- })
365
- );
366
- const m = this.parentElement?.parentElement;
367
- m && m instanceof y && m.syncBoxes(), c = !1;
368
- } else if (!c)
369
- if (h) {
370
- this.currentRootIDsSet.add(
371
- N({
372
- id: this.folder?.id ?? "",
373
- path: a
374
- })
375
- );
376
- const m = this.parentElement?.parentElement;
377
- m && m instanceof y && m.syncBoxes(), c = !0;
378
- } else e.size > 0 && (t = !0);
379
- c ? (t = i.size > 0, this.treeItem.selected = !0) : (t = e.size > 0, this.treeItem.selected = !1, await this.treeItem.updateComplete), t ? (this.treeItem.selected = !1, await this.treeItem.updateComplete, this.treeItem.indeterminate = !0) : this.treeItem.indeterminate = !1;
380
- }
381
- render() {
382
- const t = xt(this.folder?.path ?? [], this.folder?.fullPath ?? "");
383
- return n`
384
- <cx-tree-item
385
- aria-label=${this.folder?.title ?? ""}
386
- class=${C({
387
- "folder-tree__item": !0,
388
- selectable: !0
389
- })}
390
- data-id=${this.folder?.id}
391
- data-path=${t}
392
- ?lazy=${this.folder?.hasChildren && this.data === null}
393
- @cx-lazy-load=${this.onLazyLoad}
394
- >
395
- <div class="folder-tree__label">
396
- <cx-icon class="folder-tree__icon" name="folder"></cx-icon>
397
- <cx-line-clamp lines="1" class="folder-tree__label__value">
398
- ${this.folder?.title}
399
- </cx-line-clamp>
400
- </div>
401
- ${U(
402
- this.data ?? [],
403
- (e) => e.id,
404
- (e) => n`<cx-folder-item
405
- slot="children"
406
- .folder=${e}
407
- .siteUrl=${this.siteUrl}
408
- .token=${this.token}
409
- .removedIDs=${this.removedIDs}
410
- .currentRootIDsSet=${this.currentRootIDsSet}
411
- .folderPathsSet=${this.folderPathsSet}
412
- ></cx-folder-item>`
413
- )}
414
- ${p(
415
- this.data && this.data.length < this.totalCount,
416
- () => n`
417
- <div slot="children" class="load-more-button">
418
- <cx-button
419
- data-testid="load-more-button"
420
- variant="text"
421
- @click=${this.loadMore}
422
- ?loading=${this.isLoading}
423
- >
424
- ${this.localize.term("more")}
425
- </cx-button>
426
- </div>
427
- `
428
- )}
429
- </cx-tree-item>
430
- `;
431
- }
432
- };
433
- y.styles = [tt];
434
- y.dependencies = {
435
- "cx-icon": J,
436
- "cx-line-clamp": Q,
437
- "cx-tree-item": yt
438
- };
439
- D([
440
- z("cx-tree-item")
441
- ], y.prototype, "treeItem", 2);
442
- D([
443
- d({
444
- attribute: "site-url",
445
- reflect: !0,
446
- type: String
447
- })
448
- ], y.prototype, "siteUrl", 2);
449
- D([
450
- d({ reflect: !0, type: String })
451
- ], y.prototype, "token", 2);
452
- D([
453
- d({ attribute: "search-text", reflect: !0, type: String })
454
- ], y.prototype, "searchText", 2);
455
- D([
456
- d({ type: Object })
457
- ], y.prototype, "folder", 2);
458
- D([
459
- d({
460
- attribute: "current-root-ids-set",
461
- type: Object
462
- })
463
- ], y.prototype, "currentRootIDsSet", 2);
464
- D([
465
- d({ attribute: "folder-paths-set", type: Object })
466
- ], y.prototype, "folderPathsSet", 2);
467
- D([
468
- d({
469
- attribute: "removed-ids",
470
- converter: {
471
- fromAttribute: (t) => t.split(" "),
472
- toAttribute: (t) => t.join(" ")
473
- },
474
- type: String
475
- })
476
- ], y.prototype, "removedIDs", 2);
477
- D([
478
- u()
479
- ], y.prototype, "data", 2);
480
- D([
481
- u()
482
- ], y.prototype, "totalCount", 2);
483
- D([
484
- u()
485
- ], y.prototype, "isLoading", 2);
486
- D([
487
- P(["currentRootIDsSet", "removedIDs"])
488
- ], y.prototype, "syncBoxes", 1);
489
- y = D([
490
- W("cx-folder-item")
491
- ], y);
492
- const Ae = at`
493
- .folder-tree {
494
- overflow: auto;
495
- flex: 1;
496
- }
497
-
498
- .folder-tree:not(.selectable) {
499
- max-height: 200px;
500
- }
501
-
502
- .folder-tree__item::part(label) {
503
- width: 100%;
504
- overflow: hidden;
505
- }
506
-
507
- .folder-tree__icon {
508
- font-size: var(--cx-font-size-large);
509
- color: var(--cx-color-neutral-600);
510
- }
511
-
512
- .folder-tree__label {
513
- display: flex;
514
- width: 100%;
515
- overflow: hidden;
516
- gap: var(--cx-spacing-x-small);
517
- line-height: var(--cx-line-height-medium);
518
- }
519
-
520
- .folder-tree__label__value {
521
- flex-grow: 1;
522
- flex-shrink: 1;
523
- overflow: hidden;
524
- --tooltip-max-width: min(80vw, 640px);
525
- }
526
-
527
- /**
528
- * align load more button with the folder tree item
529
- * 1em = .tree-item__indentation's width
530
- * var(--cx-spacing-x-small) = .tree-item__item's padding-left
531
- * 1rem = .tree-item__expand-button's width
532
- * var(--cx-spacing-x-small) * 2 = .tree-item__expand-button's padding-left and padding-right
533
- */
534
- .load-more-button {
535
- margin-left: calc(
536
- 1em + var(--cx-spacing-x-small) + 1rem + var(--cx-spacing-x-small) * 2
537
- );
538
- }
539
-
540
- /**
541
- * reset line-height so as not to be affected by nested "em" units inside folder-tree
542
- */
543
- .load-more-button cx-button {
544
- line-height: var(--cx-line-height-small);
545
- }
546
- `;
547
- var De = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, w = (t, e, i, a) => {
548
- for (var s = a > 1 ? void 0 : a ? Te(e, i) : e, o = t.length - 1, c; o >= 0; o--)
549
- (c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
550
- return a && s && De(e, i, s), s;
551
- };
552
- let b = class extends H {
553
- constructor() {
554
- super(...arguments), this.localize = new q(this), this.role = "tree", this.siteUrl = "", this.bearerToken = "", this.token = "", this.searchText = "", this.folders = [], this.rootIDs = [], this.totalCount = 0, this.loadMore = () => {
555
- }, this.isLoading = !1, this.folderPathsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.renderFolder = (t) => n`<cx-folder-item
556
- .currentRootIDsSet=${this.currentRootIDsSet}
557
- .folder=${t}
558
- .folderPathsSet=${this.folderPathsSet}
559
- .removedIDs=${this.removedIDs}
560
- bearer-token=${this.bearerToken}
561
- search-text=${this.searchText}
562
- site-url=${this.siteUrl}
563
- token=${this.token}
564
- ></cx-folder-item>`;
565
- }
566
- get currentRootIDs() {
567
- return Array.from(this.currentRootIDsSet);
568
- }
569
- handleRootIDsChange() {
570
- this.currentRootIDsSet = new Set(this.rootIDs);
571
- }
572
- resetTree() {
573
- this.currentRootIDsSet = new Set(this.rootIDs), this.tree.querySelectorAll("cx-folder-item").forEach((t) => {
574
- t.selected = this.currentRootIDsSet.has(
575
- N({
576
- id: t.id,
577
- path: t.dataset.path ?? ""
578
- })
579
- ), t.expanded = !1, t.indeterminate = !1;
580
- });
581
- }
582
- async handleSelectedChange(t) {
583
- const e = t.target, i = e.dataset.id ?? "", a = e.dataset.path ?? "";
584
- if (await e.updateComplete, !i.trim() || !a.trim())
585
- return;
586
- const s = N({
587
- id: i,
588
- path: a
589
- });
590
- if (!(e.indeterminate && !e.selected)) {
591
- if (e.selected) {
592
- if (!this.currentRootIDsSet.has(s)) {
593
- lt(e, "multiple"), this.currentRootIDsSet.add(s);
594
- for (const o of e.getChildrenItems())
595
- !o.id.trim() || !o.dataset.path?.trim() || this.currentRootIDsSet.add(
596
- N({
597
- id: o.id,
598
- path: o.dataset.path ?? ""
599
- })
600
- );
601
- }
602
- this.removedIDs = this.removedIDs.filter(
603
- (o) => o !== s && !S(o).path.startsWith(a + "/")
604
- );
605
- } else
606
- this.removedIDs.push(s), this.currentRootIDsSet.has(s) && (this.currentRootIDsSet.delete(s), lt(e, "multiple"));
607
- [...this.currentRootIDsSet].forEach((o) => {
608
- const c = R(a), h = S(o).path, _ = R(h);
609
- _.startsWith(c) && _ !== c && (e.selected || this.currentRootIDsSet.delete(o));
610
- }), this.currentRootIDsSet = new Set(this.currentRootIDsSet);
611
- }
612
- }
613
- render() {
614
- return n`
615
- <div class="folder-tree selectable">
616
- <cx-tree
617
- class=${C({
618
- selectable: !0
619
- })}
620
- @cx-selected-change=${this.handleSelectedChange}
621
- selection="multiple"
622
- disabled-auto-expand
623
- disabled-sync-checkboxes
624
- >
625
- ${U(
626
- this.folders,
627
- (t) => t.id,
628
- (t) => this.renderFolder(t)
629
- )}
630
- ${p(
631
- this.folders && this.folders.length < this.totalCount,
632
- () => n`
633
- <div class="load-more-button">
634
- <cx-button
635
- variant="text"
636
- @click=${this.loadMore}
637
- ?loading=${this.isLoading}
638
- >
639
- ${this.localize.term("more")}
640
- </cx-button>
641
- </div>
642
- `
643
- )}
644
- </cx-tree>
645
- </div>
646
- `;
647
- }
648
- };
649
- b.styles = [tt, Ae];
650
- b.dependencies = {
651
- "cx-folder-item": y,
652
- "cx-tree": $t
653
- };
654
- w([
655
- z("cx-tree")
656
- ], b.prototype, "tree", 2);
657
- w([
658
- d({ attribute: "site-url", reflect: !0, type: String })
659
- ], b.prototype, "siteUrl", 2);
660
- w([
661
- d({ attribute: "bearer-token", reflect: !0, type: String })
662
- ], b.prototype, "bearerToken", 2);
663
- w([
664
- d({ attribute: "token", reflect: !0, type: String })
665
- ], b.prototype, "token", 2);
666
- w([
667
- d({ attribute: "search-text", reflect: !0, type: String })
668
- ], b.prototype, "searchText", 2);
669
- w([
670
- d({ type: Array })
671
- ], b.prototype, "folders", 2);
672
- w([
673
- d({ attribute: "root-ids", reflect: !0, type: Array })
674
- ], b.prototype, "rootIDs", 2);
675
- w([
676
- d({ attribute: "total-count", reflect: !0, type: Number })
677
- ], b.prototype, "totalCount", 2);
678
- w([
679
- d({ attribute: "load-more", type: Function })
680
- ], b.prototype, "loadMore", 2);
681
- w([
682
- d({ attribute: "is-loading", reflect: !0, type: Boolean })
683
- ], b.prototype, "isLoading", 2);
684
- w([
685
- d({ attribute: "folder-paths-set", type: Object })
686
- ], b.prototype, "folderPathsSet", 2);
687
- w([
688
- u()
689
- ], b.prototype, "removedIDs", 2);
690
- w([
691
- u()
692
- ], b.prototype, "currentRootIDsSet", 2);
693
- w([
694
- P("rootIDs")
695
- ], b.prototype, "handleRootIDsChange", 1);
696
- b = w([
697
- W("cx-folder-tree")
698
- ], b);
699
- function Pe(t, e, i) {
700
- switch (i.length) {
701
- case 0:
702
- return t.call(e);
703
- case 1:
704
- return t.call(e, i[0]);
705
- case 2:
706
- return t.call(e, i[0], i[1]);
707
- case 3:
708
- return t.call(e, i[0], i[1], i[2]);
709
- }
710
- return t.apply(e, i);
711
- }
712
- var _t = Math.max;
713
- function ze(t, e, i) {
714
- return e = _t(e === void 0 ? t.length - 1 : e, 0), function() {
715
- for (var a = arguments, s = -1, o = _t(a.length - e, 0), c = Array(o); ++s < o; )
716
- c[s] = a[e + s];
717
- s = -1;
718
- for (var h = Array(e + 1); ++s < e; )
719
- h[s] = a[s];
720
- return h[e] = i(c), Pe(t, this, h);
721
- };
722
- }
723
- function Ee(t) {
724
- return function() {
725
- return t;
726
- };
727
- }
728
- var ft = function() {
729
- try {
730
- var t = Et(Object, "defineProperty");
731
- return t({}, "", {}), t;
732
- } catch {
733
- }
734
- }(), Le = ft ? function(t, e) {
735
- return ft(t, "toString", {
736
- configurable: !0,
737
- enumerable: !1,
738
- value: Ee(e),
739
- writable: !0
740
- });
741
- } : It, Fe = 800, Ue = 16, Re = Date.now;
742
- function ke(t) {
743
- var e = 0, i = 0;
744
- return function() {
745
- var a = Re(), s = Ue - (a - i);
746
- if (i = a, s > 0) {
747
- if (++e >= Fe)
748
- return arguments[0];
749
- } else
750
- e = 0;
751
- return t.apply(void 0, arguments);
752
- };
753
- }
754
- var Oe = ke(Le);
755
- function Ne(t, e) {
756
- return Oe(ze(t, e, It), t + "");
757
- }
758
- var je = 200;
759
- function Be(t, e, i, a) {
760
- var s = -1, o = Bt, c = !0, h = t.length, _ = [], m = e.length;
761
- if (!h)
762
- return _;
763
- i && (e = ee(e, Lt(i))), e.length >= je && (o = Ut, c = !1, e = new Ft(e));
764
- t:
765
- for (; ++s < h; ) {
766
- var g = t[s], $ = i == null ? g : i(g);
767
- if (g = g !== 0 ? g : 0, c && $ === $) {
768
- for (var f = m; f--; )
769
- if (e[f] === $)
770
- continue t;
771
- _.push(g);
772
- } else o(e, $, a) || _.push(g);
773
- }
774
- return _;
775
- }
776
- var vt = pt ? pt.isConcatSpreadable : void 0;
777
- function Me(t) {
778
- return wt(t) || Rt(t) || !!(vt && t && t[vt]);
779
- }
780
- function Ve(t, e, i, a, s) {
781
- var o = -1, c = t.length;
782
- for (i || (i = Me), s || (s = []); ++o < c; ) {
783
- var h = t[o];
784
- i(h) ? kt(s, h) : a || (s[s.length] = h);
785
- }
786
- return s;
787
- }
788
- function He(t, e, i) {
789
- var a = t.length;
790
- if (a < 2)
791
- return a ? dt(t[0]) : [];
792
- for (var s = -1, o = Array(a); ++s < a; )
793
- for (var c = t[s], h = -1; ++h < a; )
794
- h != s && (o[s] = Be(o[s] || c, t[h], e, i));
795
- return dt(Ve(o), e, i);
796
- }
797
- function We(t) {
798
- return se(t) && St(t);
799
- }
800
- var st = Ne(function(t) {
801
- return He(Ot(t, We));
802
- }), v = /* @__PURE__ */ ((t) => (t.Canceled = "CANCELED", t.Failed = "FAILED", t.InProgress = "INPROGRESS", t.PendingComplete = "PENDINGCOMPLETE", t.Success = "SUCCESS", t))(v || {}), qe = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, j = (t, e, i, a) => {
803
- for (var s = a > 1 ? void 0 : a ? Ge(e, i) : e, o = t.length - 1, c; o >= 0; o--)
804
- (c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
805
- return a && s && qe(e, i, s), s;
806
- };
807
- let T = class extends H {
808
- constructor() {
809
- super(...arguments), this.localize = new q(this), this.size = 0, this.remainingSize = 0, this.childrenCount = 0, this.assetsCount = 0;
810
- }
811
- get cachedSize() {
812
- return Math.max(0, this.size - this.remainingSize);
813
- }
814
- get percentage() {
815
- return this.size ? Math.round(this.cachedSize / this.size * 100) : 0;
816
- }
817
- createRenderRoot() {
818
- return this;
819
- }
820
- renderFolderSuccessText() {
821
- return n`${this.childrenCount} ${this.localize.term("subfolders")},
822
- ${this.assetsCount} ${this.localize.term("assets")}`;
823
- }
824
- renderSuccess() {
825
- return n`<div class="file-on-demand-pinned-status__success progress">
826
- <cx-icon name="file_download" variant="filled"></cx-icon>
827
- <cx-typography variant="small">
828
- <cx-line-clamp lines="1">
829
- ${p(this.isFolder, this.renderFolderSuccessText.bind(this), () => n`${this.localize.term("cached")}`)}
830
- </cx-line-clamp>
831
- </cx-typography>
832
- </div>`;
833
- }
834
- renderFailed() {
835
- return n`<div class="file-on-demand-pinned-status__failed progress">
836
- <cx-icon name="file_download_off" variant="filled"></cx-icon>
837
- <cx-typography variant="small">
838
- <cx-line-clamp lines="1">
839
- ${this.localize.term("syncFailedCacheFull")}
840
- </cx-line-clamp>
841
- </cx-typography>
842
- </div>`;
843
- }
844
- renderCanceled() {
845
- return n`<div class="file-on-demand-pinned-status__canceled progress">
846
- <cx-icon name="file_download_off" variant="filled"></cx-icon>
847
- <cx-typography variant="small">
848
- <cx-line-clamp lines="1">
849
- ${this.localize.term("syncCanceled")}
850
- </cx-line-clamp>
851
- </cx-typography>
852
- </div>`;
853
- }
854
- renderInProgress() {
855
- return n`<div class="file-on-demand-pinned-status__in-progress progress">
856
- <cx-icon name="downloading" variant="filled"></cx-icon>
857
- <cx-typography variant="small">
858
- <cx-line-clamp lines="1">
859
- ${this.localize.term("caching")} ${this.percentage}% (<cx-format-bytes .value=${this.cachedSize}></cx-format-bytes>/
860
- <cx-format-bytes .value=${this.size}></cx-format-bytes>)
861
- </cx-line-clamp>
862
- </cx-typography>
863
- </div>`;
864
- }
865
- render() {
866
- return n`<div class="file-on-demand-pinned-status">
867
- ${ne(this.uploadStatus, [
868
- [v.Success, this.renderSuccess.bind(this)],
869
- [v.Failed, this.renderFailed.bind(this)],
870
- [v.InProgress, this.renderInProgress.bind(this)],
871
- [v.PendingComplete, this.renderInProgress.bind(this)],
872
- [v.Canceled, this.renderCanceled.bind(this)]
873
- ])}
874
- </div>`;
875
- }
876
- };
877
- T.styles = [tt];
878
- T.dependencies = {
879
- "cx-format-bytes": ot,
880
- "cx-icon": J,
881
- "cx-line-clamp": Q,
882
- "cx-typography": nt
883
- };
884
- j([
885
- d({
886
- attribute: "upload-status",
887
- type: String
888
- })
889
- ], T.prototype, "uploadStatus", 2);
890
- j([
891
- d({ type: Number })
892
- ], T.prototype, "size", 2);
893
- j([
894
- d({
895
- attribute: "remaining-size",
896
- type: Number
897
- })
898
- ], T.prototype, "remainingSize", 2);
899
- j([
900
- d({
901
- attribute: "is-folder",
902
- type: Boolean
903
- })
904
- ], T.prototype, "isFolder", 2);
905
- j([
906
- d({
907
- attribute: "children-count",
908
- type: Number
909
- })
910
- ], T.prototype, "childrenCount", 2);
911
- j([
912
- d({
913
- attribute: "assets-count",
914
- type: Number
915
- })
916
- ], T.prototype, "assetsCount", 2);
917
- T = j([
918
- W("cx-file-on-demand-pinned-status")
919
- ], T);
920
- const Ye = at`
921
- :host {
922
- padding: var(--cx-spacing-2x-small) var(--cx-spacing-small);
923
- display: block;
924
- }
925
-
926
- .asset {
927
- max-height: var(--asset-height);
928
- display: flex;
929
- gap: var(--cx-spacing-small);
930
- }
931
- :host(:hover) {
932
- background-color: var(--cx-input-filled-background-color-hover);
933
- }
934
-
935
- .asset__description {
936
- flex: 1;
937
- width: 0;
938
- display: flex;
939
- flex-direction: column;
940
- justify-content: center;
941
- }
942
- .asset__description__label {
943
- display: flex;
944
- }
945
- .asset__description__label__text {
946
- flex-grow: 1;
947
- flex-shrink: 1;
948
- overflow: hidden;
949
- }
950
- .asset__description__status {
951
- color: var(--cx-color-neutral-500);
952
- line-height: var(--cx-line-height-medium);
953
- }
954
-
955
- .asset__actions {
956
- display: flex;
957
- min-width: 64px;
958
- justify-content: flex-end;
959
- align-items: center;
960
- }
961
- .asset:hover .asset__actions {
962
- visibility: visible;
963
- opacity: 1;
964
- }
965
- .asset__actions {
966
- visibility: hidden;
967
- opacity: 0;
968
- }
969
-
970
- .asset__actions__spinner {
971
- min-height: var(--cx-input-height-medium);
972
- min-width: var(--cx-input-height-medium);
973
- display: flex;
974
- justify-content: center;
975
- align-items: center;
976
- }
977
- .asset__actions__spinner::part(base) {
978
- flex-grow: 0;
979
- }
980
-
981
- .asset__thumbnail {
982
- width: 56px;
983
- height: var(--asset-height);
984
- display: flex;
985
- justify-content: center;
986
- align-items: center;
987
- position: relative;
988
- border-radius: var(--cx-border-radius-medium);
989
- }
990
- .asset__thumbnail--placeholder {
991
- background-color: var(--cx-color-primary-50);
992
- }
993
- .asset__thumbnail--folder {
994
- background-color: var(--cx-color-neutral-100);
995
- }
996
-
997
- .asset__thumbnail__image {
998
- height: 100%;
999
- width: 100%;
1000
- object-fit: cover;
1001
- flex-shrink: 0;
1002
- border-radius: var(--cx-border-radius-medium);
1003
- }
1004
- .asset__thumbnail__icon {
1005
- --font-size: 38px;
1006
- display: none;
1007
- color: var(--cx-color-primary-400);
1008
- }
1009
-
1010
- .asset__folder__icon {
1011
- --font-size: var(--cx-font-size-x-large);
1012
- color: var(--cx-color-neutral-600);
1013
- }
1014
-
1015
- .asset__thumbnail__extension {
1016
- display: none;
1017
- position: absolute;
1018
- bottom: var(--cx-spacing-3x-small);
1019
- left: 50%;
1020
- transform: translateX(-50%);
1021
- width: 26px;
1022
- color: var(--cx-color-primary-50);
1023
- }
1024
-
1025
- .asset__thumbnail__extension__line-clamp {
1026
- width: 100%;
1027
- text-align: center;
1028
- }
1029
-
1030
- .asset__thumbnail__extension__text {
1031
- flex-grow: 1;
1032
- flex-shrink: 1;
1033
- overflow: hidden;
1034
- text-transform: uppercase;
1035
- display: contents;
1036
- }
1037
-
1038
- .asset__thumbnail--placeholder .asset__thumbnail__image {
1039
- display: none;
1040
- }
1041
-
1042
- .asset__thumbnail--placeholder .asset__thumbnail__icon,
1043
- .asset__thumbnail--placeholder .asset__thumbnail__extension {
1044
- display: flex;
1045
- }
1046
-
1047
- /** uploads assets */
1048
- cx-progress-bar {
1049
- --height: 4px;
1050
- --indicator-color: var(--color);
1051
- --track-color: var(--cx-color-neutral-300);
1052
- z-index: 0;
1053
- }
1054
- .progress {
1055
- display: flex;
1056
- align-items: center;
1057
- width: 100%;
1058
- gap: var(--cx-spacing-2x-small);
1059
- margin-top: var(--cx-spacing-3x-small);
1060
- }
1061
-
1062
- .syncing-progress,
1063
- .completed-progress,
1064
- .failed-progress,
1065
- .canceled-progress {
1066
- margin-top: var(--cx-spacing-2x-small);
1067
- }
1068
-
1069
- .progress * {
1070
- white-space: nowrap;
1071
- }
1072
-
1073
- .progress cx-icon {
1074
- --font-size: var(--cx-font-size-medium);
1075
- }
1076
-
1077
- .progress cx-typography::part(base) {
1078
- line-height: var(--cx-font-size-medium);
1079
- }
1080
-
1081
- .uploading-progress.in-progress cx-icon {
1082
- color: var(--cx-color-primary-500);
1083
- }
1084
-
1085
- .uploading-progress.paused cx-icon {
1086
- color: var(--cx-color-warning-500);
1087
- }
1088
-
1089
- .syncing-progress cx-icon {
1090
- color: var(--cx-color-warning);
1091
- }
1092
-
1093
- .completed-progress cx-icon {
1094
- color: var(--cx-color-success);
1095
- }
1096
-
1097
- .failed-progress cx-icon,
1098
- .failed-progress__text {
1099
- color: var(--cx-color-danger);
1100
- cursor: help;
1101
- }
1102
-
1103
- .canceled-progress cx-icon {
1104
- color: var(--cx-color-neutral-600);
1105
- }
1106
-
1107
- .file-on-demand-pinned-status__success cx-icon,
1108
- .file-on-demand-pinned-status__in-progress cx-icon {
1109
- color: var(--cx-color-success-500);
1110
- }
1111
-
1112
- .file-on-demand-pinned-status__failed cx-icon {
1113
- color: var(--cx-color-danger-500);
1114
- }
1115
-
1116
- .file-on-demand-pinned-status__canceled cx-icon {
1117
- color: var(--cx-color-neutral-500);
1118
- }
1119
- `;
1120
- var Ke = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, V = (t, e, i, a) => {
1121
- for (var s = a > 1 ? void 0 : a ? Xe(e, i) : e, o = t.length - 1, c; o >= 0; o--)
1122
- (c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
1123
- return a && s && Ke(e, i, s), s;
1124
- };
1125
- let L = class extends H {
1126
- constructor() {
1127
- super(...arguments), this.localize = new q(this), this.favoriteInProgressAssets = [], this.pinInProgressAssets = [], this.thumbnailLoadError = !1;
1128
- }
1129
- /** Failed or canceled uploads: show open-in-drive and retry. */
1130
- get showRetryableUploadActions() {
1131
- return this.listType === x.PINNED ? !1 : this.asset.uploadStatus === v.Failed || this.asset.uploadStatus === v.Canceled;
1132
- }
1133
- get showInProgressActions() {
1134
- return this.listType === x.PINNED ? !1 : this.asset.uploadStatus === v.InProgress;
1135
- }
1136
- get showNormalActions() {
1137
- return this.listType === x.PINNED ? !1 : [v.Success, v.PendingComplete].includes(
1138
- this.asset.uploadStatus
1139
- ) || !this.asset.uploadStatus?.trim();
1140
- }
1141
- get showPinnedActions() {
1142
- return this.listType === x.PINNED;
1143
- }
1144
- get isFolder() {
1145
- return fe.includes((this.asset.docType ?? "").toLowerCase());
1146
- }
1147
- get thumbnailUrl() {
1148
- return this.asset.thumbnail?.trim() ?? "";
1149
- }
1150
- get showThumbnailPlaceholder() {
1151
- return !this.thumbnailUrl || this.thumbnailLoadError;
1152
- }
1153
- willUpdate(t) {
1154
- if (super.willUpdate(t), !t.has("asset"))
1155
- return;
1156
- (t.get("asset")?.thumbnail?.trim() ?? "") !== this.thumbnailUrl && (this.thumbnailLoadError = !1);
1157
- }
1158
- handleImgError() {
1159
- this.thumbnailLoadError = !0;
1160
- }
1161
- handleImgLoad() {
1162
- this.thumbnailLoadError = !1;
1163
- }
1164
- handleOpenDriveClick() {
1165
- this.openDrive(this.asset);
1166
- }
1167
- openDrive(t) {
1168
- this.emit("cx-open-drive", {
1169
- detail: {
1170
- asset: t
1171
- }
1172
- });
1173
- }
1174
- unmarkFavorite(t) {
1175
- this.emit("cx-unmark-favorite", {
1176
- detail: {
1177
- assetId: t
1178
- }
1179
- });
1180
- }
1181
- markFavorite(t) {
1182
- this.emit("cx-mark-favorite", {
1183
- detail: {
1184
- assetId: t
1185
- }
1186
- });
1187
- }
1188
- pinAsset(t) {
1189
- this.emit("cx-file-on-demand-pin", {
1190
- detail: {
1191
- assetId: t
1192
- }
1193
- });
1194
- }
1195
- unpinAsset(t) {
1196
- this.emit("cx-file-on-demand-unpin", {
1197
- detail: {
1198
- assetId: t
1199
- }
1200
- });
1201
- }
1202
- handlePinClick() {
1203
- this.asset.isPinned ? this.unpinAsset(this.asset.recordId) : this.pinAsset(this.asset.recordId);
1204
- }
1205
- handleFavoriteClick() {
1206
- this.asset.isInFavorite ? this.unmarkFavorite(this.asset.recordId) : this.markFavorite(this.asset.recordId);
1207
- }
1208
- retryUpload(t) {
1209
- this.emit("cx-retry-upload", {
1210
- detail: {
1211
- assetId: t
1212
- }
1213
- });
1214
- }
1215
- handleRetryUploadClick() {
1216
- this.asset.uploadId && this.retryUpload(this.asset.uploadId);
1217
- }
1218
- resumeUpload(t) {
1219
- this.emit("cx-resume-upload", {
1220
- detail: {
1221
- assetId: t
1222
- }
1223
- });
1224
- }
1225
- pauseUpload(t) {
1226
- this.emit("cx-pause-upload", {
1227
- detail: {
1228
- assetId: t
1229
- }
1230
- });
1231
- }
1232
- cancelUpload(t) {
1233
- this.emit("cx-cancel-upload", {
1234
- detail: {
1235
- assetId: t
1236
- }
1237
- });
1238
- }
1239
- handlePauseUploadClick() {
1240
- this.asset.uploadId && (this.asset.isPaused ? this.resumeUpload(this.asset.uploadId) : this.pauseUpload(this.asset.uploadId));
1241
- }
1242
- handleCancelUploadClick() {
1243
- this.asset.uploadId && this.cancelUpload(this.asset.uploadId);
1244
- }
1245
- renderProgress({
1246
- isPaused: t = !1,
1247
- progress: e = 0,
1248
- remainingTime: i,
1249
- size: a = 0,
1250
- timestamp: s = Date.now(),
1251
- uploadErrorMessage: o,
1252
- uploadStatus: c = v.InProgress
1253
- }) {
1254
- const h = a > 0 ? e * 100 / a : 0, _ = c === v.InProgress ? h : 100, m = n`
1255
- <div class=${C({
1256
- "in-progress": c === v.InProgress,
1257
- paused: t,
1258
- progress: !0,
1259
- "uploading-progress": !0
1260
- })}>
1261
- ${p(t, () => n`<cx-icon name="pause" variant="filled"></cx-icon>`, () => n`<cx-icon name="arrow_upward"></cx-icon>`)}
1262
- <cx-typography variant="small">
1263
- <cx-line-clamp lines="1">
1264
- ${p(t, () => n`${this.localize.term("paused")} ‧`)}
1265
- <cx-format-bytes .value=${e}></cx-format-bytes>
1266
- ${this.localize.term("of")}
1267
- <cx-format-bytes .value=${a}></cx-format-bytes>
1268
- (${Math.round(h)}%)
1269
- ${p(
1270
- !!i && !t,
1271
- () => n`‧
1272
- <cx-relative-time
1273
- format="narrow"
1274
- numeric="always"
1275
- date=${new Date(Date.now() + (i ?? 0))}
1276
- sync
1277
- sync-interval=${O}
1278
- ></cx-relative-time>`
1279
- )}
1280
- </cx-line-clamp>
1281
- </cx-typography>
1282
- </div>
1283
- `, g = n`
1284
- <div class="progress syncing-progress">
1285
- <cx-icon name="cached"></cx-icon>
1286
- <cx-typography variant="small">
1287
- <cx-line-clamp lines="1">
1288
- ${this.localize.term("syncing")} ‧
1289
- <cx-relative-time
1290
- format="narrow"
1291
- numeric="always"
1292
- date=${new Date(s)}
1293
- sync
1294
- sync-interval=${O}
1295
- ></cx-relative-time>
1296
- </cx-line-clamp>
1297
- </cx-typography>
1298
- </div>
1299
- `, $ = n`
1300
- <div class="progress completed-progress">
1301
- <cx-icon name="check"></cx-icon>
1302
- <cx-typography variant="small">
1303
- <cx-line-clamp lines="1">
1304
- ${this.localize.term("readyToUse")} ‧
1305
- <cx-relative-time
1306
- format="narrow"
1307
- numeric="always"
1308
- date=${new Date(s)}
1309
- sync
1310
- sync-interval=${O}
1311
- ></cx-relative-time>
1312
- </cx-line-clamp>
1313
- </cx-typography>
1314
- </div>
1315
- `, f = n`
1316
- <div class="progress failed-progress">
1317
- <cx-typography variant="small">
1318
- <cx-line-clamp lines="1">
1319
- <cx-tooltip
1320
- content=${o || this.localize.term("uploadFailed")}
1321
- >
1322
- <span class="failed-progress__text">
1323
- ${this.localize.term("uploadFailed")} ‧
1324
- </span>
1325
- </cx-tooltip>
1326
- <cx-relative-time
1327
- format="narrow"
1328
- numeric="always"
1329
- date=${new Date(s)}
1330
- sync
1331
- sync-interval=${O}
1332
- ></cx-relative-time>
1333
- </cx-line-clamp>
1334
- </cx-typography>
1335
- </div>
1336
- `, F = n`
1337
- <div class="progress canceled-progress">
1338
- <cx-icon name="cancel"></cx-icon>
1339
- <cx-typography variant="small">
1340
- <cx-line-clamp lines="1">
1341
- ${this.localize.term("canceled")} ‧
1342
- <cx-relative-time
1343
- format="narrow"
1344
- numeric="always"
1345
- date=${new Date(s)}
1346
- sync
1347
- sync-interval=${O}
1348
- ></cx-relative-time>
1349
- </cx-line-clamp>
1350
- </cx-typography>
1351
- </div>
1352
- `;
1353
- return n`
1354
- ${p(
1355
- c === v.InProgress,
1356
- () => n`<cx-progress-bar
1357
- style=${oe({
1358
- "--color": t ? "var(--cx-color-warning-500)" : "var(--cx-color-primary-500)"
1359
- })}
1360
- .value=${_.toFixed(0)}
1361
- class="progress-bar"
1362
- ></cx-progress-bar
1363
- >${m}`
1364
- )}
1365
- ${p(
1366
- c === v.PendingComplete,
1367
- () => g
1368
- )}
1369
- ${p(c === v.Success, () => $)}
1370
- ${p(c === v.Failed, () => f)}
1371
- ${p(c === v.Canceled, () => F)}
1372
- `;
1373
- }
1374
- renderUploadingStatus() {
1375
- return n`
1376
- ${this.renderProgress({
1377
- isPaused: this.asset.isPaused,
1378
- progress: (this.asset.size ?? 0) - (this.asset.remainingSize ?? 0),
1379
- remainingTime: this.asset.remainingTime,
1380
- size: this.asset.size ?? 0,
1381
- timestamp: this.asset.uploadTimestamp,
1382
- uploadErrorMessage: this.asset.uploadErrorMessage,
1383
- uploadStatus: this.asset.uploadStatus
1384
- })}
1385
- `;
1386
- }
1387
- renderPinnedStatus() {
1388
- return n`<cx-file-on-demand-pinned-status
1389
- size=${this.asset.size ?? 0}
1390
- remaining-size=${this.asset.remainingSize ?? 0}
1391
- upload-status=${this.asset.uploadStatus}
1392
- ?is-folder=${this.isFolder}
1393
- children-count=${this.asset.childrenCount ?? 0}
1394
- assets-count=${this.asset.assetsCount ?? 0}
1395
- ></cx-file-on-demand-pinned-status>`;
1396
- }
1397
- renderThumbnailContent() {
1398
- return this.isFolder ? this.listType === x.FAVORITES ? n`<cx-icon
1399
- class="asset__folder__icon"
1400
- name="folder_special"
1401
- ></cx-icon>` : n`<cx-icon class="asset__folder__icon" name="topic"></cx-icon>` : n`${p(
1402
- !!this.thumbnailUrl,
1403
- () => n`<img
1404
- alt=${this.asset.fileName}
1405
- class="asset__thumbnail__image"
1406
- src=${this.thumbnailUrl}
1407
- @error=${this.handleImgError}
1408
- @load=${this.handleImgLoad}
1409
- />`
1410
- )}
1411
- <cx-icon
1412
- class="asset__thumbnail__icon"
1413
- name="insert_drive_file"
1414
- variant="filled"
1415
- ></cx-icon>
1416
- <div class="asset__thumbnail__extension">
1417
- <cx-line-clamp
1418
- class="asset__thumbnail__extension__line-clamp"
1419
- lines="1"
1420
- >
1421
- <cx-typography
1422
- class="asset__thumbnail__extension__text"
1423
- variant="small"
1424
- >
1425
- ${be(this.asset.fileName)}
1426
- </cx-typography>
1427
- </cx-line-clamp>
1428
- </div>`;
1429
- }
1430
- renderThumbnail() {
1431
- return n`<div
1432
- class=${C({
1433
- asset__thumbnail: !0,
1434
- "asset__thumbnail--folder": this.isFolder,
1435
- "asset__thumbnail--placeholder": this.showThumbnailPlaceholder
1436
- })}
1437
- >
1438
- ${this.renderThumbnailContent()}
1439
- </div>`;
1440
- }
1441
- renderOpenDriveButton() {
1442
- return n`<cx-tooltip content=${this.localize.term("openInDrive")} hoist>
1443
- <cx-icon-button
1444
- data-testid="asset__drive-button"
1445
- name="folder_open"
1446
- @click=${this.handleOpenDriveClick}
1447
- ></cx-icon-button>
1448
- </cx-tooltip>`;
1449
- }
1450
- renderNormalActions() {
1451
- return n`${this.renderOpenDriveButton()}
1452
- ${p(
1453
- this.favoriteInProgressAssets.includes(this.asset.recordId),
1454
- () => n`<cx-spinner class="asset__actions__spinner"></cx-spinner>`,
1455
- () => n`<cx-tooltip
1456
- content=${this.asset.isInFavorite ? this.localize.term("unfavorite") : this.localize.term("favorite")}
1457
- hoist
1458
- >
1459
- <cx-icon-button
1460
- data-testid="asset__favorite-button"
1461
- name="star"
1462
- variant=${this.asset.isInFavorite ? "filled" : "outlined"}
1463
- @click=${this.handleFavoriteClick}
1464
- ></cx-icon-button>
1465
- </cx-tooltip>`
1466
- )} `;
1467
- }
1468
- renderRetryableUploadActions() {
1469
- return n`${this.renderOpenDriveButton()}
1470
- <cx-tooltip content=${this.localize.term("retry")} hoist>
1471
- <cx-icon-button
1472
- data-testid="asset__retry-button"
1473
- name="refresh"
1474
- @click=${this.handleRetryUploadClick}
1475
- ></cx-icon-button>
1476
- </cx-tooltip>`;
1477
- }
1478
- renderInProgressActions() {
1479
- return n`
1480
- <cx-tooltip
1481
- content=${this.asset.isPaused ? this.localize.term("resume") : this.localize.term("pause")}
1482
- hoist
1483
- >
1484
- <cx-icon-button
1485
- data-testid=${this.asset.isPaused ? "asset__resume-button" : "asset__pause-button"}
1486
- name=${this.asset.isPaused ? "play_arrow" : "pause"}
1487
- variant="filled"
1488
- @click=${this.handlePauseUploadClick}
1489
- ></cx-icon-button>
1490
- </cx-tooltip>
1491
- <cx-tooltip content=${this.localize.term("cancel")} hoist>
1492
- <cx-icon-button
1493
- data-testid="asset__cancel-button"
1494
- name="close"
1495
- @click=${this.handleCancelUploadClick}
1496
- ></cx-icon-button>
1497
- </cx-tooltip>
1498
- `;
1499
- }
1500
- renderPinnedActions() {
1501
- return n`${p(
1502
- this.pinInProgressAssets.includes(this.asset.recordId),
1503
- () => n`<cx-spinner class="asset__actions__spinner"></cx-spinner>`,
1504
- () => n`<cx-tooltip
1505
- content=${this.asset.isPinned ? this.localize.term("unpin") : this.localize.term("pin")}
1506
- hoist
1507
- >
1508
- <cx-icon-button
1509
- data-testid="asset__pin-button"
1510
- name="keep"
1511
- variant=${this.asset.isPinned ? "filled" : "outlined"}
1512
- @click=${this.handlePinClick}
1513
- ></cx-icon-button>
1514
- </cx-tooltip>`
1515
- )} `;
1516
- }
1517
- render() {
1518
- return n`
1519
- <div
1520
- data-id=${this.asset.recordId}
1521
- data-testid=${`asset-${this.asset.uploadStatus}`}
1522
- class="asset"
1523
- >
1524
- ${this.renderThumbnail()}
1525
- <div class="asset__description">
1526
- <div class="asset__description__label">
1527
- <cx-line-clamp class="asset__description__label__text" lines="1">
1528
- <cx-typography variant="body3"
1529
- >${this.asset.fileName}</cx-typography
1530
- >
1531
- </cx-line-clamp>
1532
- </div>
1533
- <div class="asset__description__status">
1534
- ${p(
1535
- this.listType === x.RECENT,
1536
- () => n`
1537
- <cx-typography
1538
- variant="small"
1539
- class="asset__description__status__time"
1540
- >
1541
- <cx-relative-time
1542
- format="narrow"
1543
- numeric="always"
1544
- date=${new Date(this.asset.uploadTimestamp)}
1545
- sync
1546
- sync-interval=${O}
1547
- ></cx-relative-time>
1548
- </cx-typography>
1549
- `
1550
- )}
1551
- ${p(
1552
- this.listType === x.UPLOADS,
1553
- () => this.renderUploadingStatus()
1554
- )}
1555
- ${p(
1556
- this.listType === x.PINNED,
1557
- () => this.renderPinnedStatus()
1558
- )}
1559
- </div>
1560
- </div>
1561
- <div class="asset__actions">
1562
- ${p(this.showNormalActions, () => this.renderNormalActions())}
1563
- ${p(
1564
- this.showInProgressActions,
1565
- () => this.renderInProgressActions()
1566
- )}
1567
- ${p(
1568
- this.showRetryableUploadActions,
1569
- () => this.renderRetryableUploadActions()
1570
- )}
1571
- ${p(this.showPinnedActions, () => this.renderPinnedActions())}
1572
- </div>
1573
- </div>
1574
- `;
1575
- }
1576
- };
1577
- L.styles = [tt, Ye];
1578
- L.dependencies = {
1579
- "cx-file-on-demand-pinned-status": T,
1580
- "cx-format-bytes": ot,
1581
- "cx-icon": J,
1582
- "cx-icon-button": Ct,
1583
- "cx-line-clamp": Q,
1584
- "cx-progress-bar": ie,
1585
- "cx-relative-time": At,
1586
- "cx-spinner": ae,
1587
- "cx-tooltip": Dt,
1588
- "cx-typography": nt
1589
- };
1590
- V([
1591
- d({ type: Object })
1592
- ], L.prototype, "asset", 2);
1593
- V([
1594
- d({
1595
- attribute: "list-type",
1596
- type: String
1597
- })
1598
- ], L.prototype, "listType", 2);
1599
- V([
1600
- d({
1601
- attribute: "favorite-in-progress-assets",
1602
- converter: {
1603
- fromAttribute: (t) => t.split(" ").filter(Boolean),
1604
- toAttribute: (t) => t.join(" ")
1605
- },
1606
- type: String
1607
- })
1608
- ], L.prototype, "favoriteInProgressAssets", 2);
1609
- V([
1610
- d({
1611
- attribute: "pin-in-progress-assets",
1612
- converter: {
1613
- fromAttribute: (t) => t.split(" ").filter(Boolean),
1614
- toAttribute: (t) => t.join(" ")
1615
- },
1616
- type: String
1617
- })
1618
- ], L.prototype, "pinInProgressAssets", 2);
1619
- V([
1620
- u()
1621
- ], L.prototype, "thumbnailLoadError", 2);
1622
- L = V([
1623
- W("cx-file-on-demand-asset")
1624
- ], L);
1625
- const Ze = at`
1626
- :host {
1627
- --asset-height: 40px;
1628
- display: block;
1629
- color: var(--cx-color-neutral-900);
1630
- height: 100%;
1631
- --cx-button-text-transform: none;
1632
- --tooltip-max-width: min(80vw, 640px);
1633
- }
1634
-
1635
- .container {
1636
- display: block;
1637
- height: 100%;
1638
- }
1639
-
1640
- .container--user-interaction-blocked {
1641
- pointer-events: none;
1642
- user-select: none;
1643
- }
1644
-
1645
- .loading-overlay {
1646
- position: absolute;
1647
- top: 0;
1648
- left: 0;
1649
- width: 100%;
1650
- height: 100%;
1651
- background-color: var(--cx-color-neutral-50);
1652
- opacity: 0.8;
1653
- display: flex;
1654
- justify-content: center;
1655
- align-items: center;
1656
- z-index: var(--cx-z-index-tooltip); /* Ensure it is above other content */
1657
- }
1658
-
1659
- .assets,
1660
- .welcome {
1661
- height: 100%;
1662
- display: flex;
1663
- flex-direction: column;
1664
- }
1665
-
1666
- /* #region Icons */
1667
- .assets-list__tab-group .empty-icon {
1668
- color: var(--cx-color-neutral-600);
1669
- font-size: var(--cx-font-size-3x-large);
1670
- }
1671
-
1672
- cx-tab {
1673
- line-height: var(--cx-line-height-large);
1674
- }
1675
-
1676
- .assets-list__tab-group cx-tab {
1677
- width: calc(100% / 4);
1678
- }
1679
-
1680
- .settings__tab-group cx-tab {
1681
- width: calc(100% / 2);
1682
- }
1683
-
1684
- cx-tab::part(base) {
1685
- display: flex;
1686
- justify-content: center;
1687
- }
1688
-
1689
- cx-tab::part(label) {
1690
- text-align: center;
1691
- }
1692
-
1693
- cx-tab-panel {
1694
- --padding: 0 0 var(--cx-spacing-x-small) 0;
1695
- }
1696
-
1697
- cx-icon[slot='prefix'] {
1698
- font-size: var(--cx-font-size-large);
1699
- }
1700
-
1701
- .error-message {
1702
- color: var(--cx-color-danger);
1703
- min-height: 1ch;
1704
- }
1705
-
1706
- /** welcome */
1707
- .welcome {
1708
- justify-content: center;
1709
- align-items: center;
1710
- padding: var(--cx-spacing-x-large) var(--cx-spacing-medium)
1711
- var(--cx-spacing-medium) var(--cx-spacing-medium);
1712
- gap: var(--cx-spacing-x-large);
1713
- }
1714
-
1715
- .welcome__message {
1716
- display: flex;
1717
- flex-direction: column;
1718
- justify-content: center;
1719
- align-items: center;
1720
- gap: var(--cx-spacing-x-small);
1721
- }
1722
-
1723
- .welcome__actions {
1724
- width: 100%;
1725
- display: flex;
1726
- flex-direction: column;
1727
- justify-content: center;
1728
- gap: var(--cx-spacing-x-small);
1729
- }
1730
-
1731
- .welcome__connect-button,
1732
- .welcome__cancel-connection-button,
1733
- .welcome__input {
1734
- width: 100%;
1735
- }
1736
-
1737
- .welcome__connect-button--disabled::part(base) {
1738
- cursor: help;
1739
- }
1740
-
1741
- .welcome .error-message {
1742
- text-align: center;
1743
- }
1744
-
1745
- /** header */
1746
- .header {
1747
- display: flex;
1748
- justify-content: space-between;
1749
- background-color: var(--cx-color-neutral-50);
1750
- padding: var(--cx-spacing-x-small) var(--cx-spacing-small);
1751
- line-height: 1;
1752
- }
1753
- .header__user {
1754
- display: flex;
1755
- align-items: center;
1756
- gap: var(--cx-spacing-x-small);
1757
- overflow: hidden;
1758
- }
1759
- .header__username {
1760
- display: flex;
1761
- overflow: hidden;
1762
- }
1763
- .header__username__text {
1764
- flex-grow: 1;
1765
- flex-shrink: 1;
1766
- overflow: hidden;
1767
- }
1768
- .header__avatar {
1769
- --size: 24px;
1770
- }
1771
- .header__actions {
1772
- min-width: fit-content;
1773
- }
1774
-
1775
- .settings__version__badge::part(base) {
1776
- width: var(--cx-spacing-x-small);
1777
- padding: 0;
1778
- }
1779
-
1780
- /** assets list */
1781
- .assets-list {
1782
- flex: 1;
1783
- height: 0;
1784
- }
1785
-
1786
- /** Make sure the overflown element is .recent__list
1787
- * to trigger scroll event for infinite scroll
1788
- */
1789
- .assets-list__tab-group,
1790
- .assets-list__tab-group::part(base),
1791
- .assets-list__tab-group::part(body),
1792
- .assets-list__tab-group cx-tab-panel,
1793
- .assets-list__tab-group cx-tab-panel::part(base) {
1794
- height: 100%;
1795
- overflow: hidden;
1796
- }
1797
- .assets-list__tab-group .assets-list__tab-group__empty-message {
1798
- display: flex;
1799
- flex-direction: column;
1800
- justify-content: center;
1801
- align-items: center;
1802
- gap: var(--cx-spacing-medium);
1803
- font-size: var(--cx-font-size-x-large);
1804
- padding: var(--cx-spacing-large) 0;
1805
- text-align: center;
1806
- }
1807
-
1808
- .assets-list__tab-group .assets-list__tab-group__empty-message:not(.favorites-empty) {
1809
- margin-top: 40px; /** to that they are aligned with favorite tab */
1810
- }
1811
-
1812
- .assets-list__tab-group .recent__list,
1813
- .assets-list__tab-group .favorites__list,
1814
- .assets-list__tab-group .uploads__list,
1815
- .assets-list__tab-group .pinned__list {
1816
- height: 100%;
1817
- display: flex;
1818
- flex-direction: column;
1819
- overflow-y: auto;
1820
- overflow-x: hidden;
1821
- padding: 0 0 var(--cx-spacing-x-small) 0;
1822
- }
1823
-
1824
- .favorites-tab-panel__content,
1825
- .pinned-tab-panel__content {
1826
- display: flex;
1827
- flex-direction: column;
1828
- height: 100%;
1829
- }
1830
-
1831
- .favorites__sync-time {
1832
- display: flex;
1833
- justify-content: center;
1834
- align-items: center;
1835
- }
1836
-
1837
- .assets-list__tab-group .favorites__list,
1838
- .assets-list__tab-group .pinned__list {
1839
- flex: 1;
1840
- height: 0;
1841
- }
1842
-
1843
- .recent__other.empty,
1844
- .uploads__other.empty,
1845
- .recent__today.empty,
1846
- .uploads__today.empty {
1847
- display: none;
1848
- }
1849
-
1850
- /** status footer */
1851
- .status-footer {
1852
- padding: 0 var(--cx-spacing-small) var(--cx-spacing-small)
1853
- var(--cx-spacing-small);
1854
- display: flex;
1855
- flex-direction: column;
1856
- gap: var(--cx-spacing-2x-small);
1857
- }
1858
- .status-footer cx-typography {
1859
- line-height: 1;
1860
- }
1861
- .status-footer cx-line-clamp {
1862
- line-height: 1;
1863
- }
1864
- .status-footer .label {
1865
- color: var(--cx-color-neutral-600);
1866
- }
1867
- .status-footer .cache-usage,
1868
- .status-footer .connected-url,
1869
- .status-footer .connection-status,
1870
- .status-footer .asset-index-sync-status {
1871
- display: flex;
1872
- justify-content: space-between;
1873
- align-items: center;
1874
- }
1875
-
1876
- .status-footer .label {
1877
- color: var(--cx-color-neutral-600);
1878
- }
1879
-
1880
- .status-footer__divider {
1881
- --spacing: 0;
1882
- margin-bottom: var(--cx-spacing-small);
1883
- }
1884
-
1885
- .connected-url .label {
1886
- white-space: nowrap;
1887
- }
1888
-
1889
- .connected-url .value-line-clamp {
1890
- padding: 0 var(--cx-spacing-2x-small);
1891
- }
1892
-
1893
- .connected-url .value::part(base) {
1894
- font-weight: var(--cx-font-weight-medium);
1895
- color: var(--cx-color-neutral-900);
1896
- }
1897
-
1898
- .cache-usage__warning-icon {
1899
- color: var(--cx-color-warning-500);
1900
- }
1901
-
1902
- .status-footer .cache-usage .label {
1903
- color: var(--cx-color-primary-600);
1904
- }
1905
-
1906
- .connection-status__value {
1907
- display: flex;
1908
- align-items: center;
1909
- justify-content: center;
1910
- gap: var(--cx-spacing-2x-small);
1911
- cursor: help;
1912
- }
1913
- .connection-status__value cx-typography {
1914
- display: inline-flex;
1915
- }
1916
- .connection-status__value cx-typography::part(base) {
1917
- text-transform: capitalize;
1918
- font-weight: var(--cx-font-weight-medium);
1919
- }
1920
- .connection-status--excellent .connection-status__value {
1921
- color: var(--cx-color-success);
1922
- }
1923
- .connection-status--good .connection-status__value {
1924
- color: var(--cx-color-warning);
1925
- }
1926
- .connection-status--bad .connection-status__value {
1927
- color: var(--cx-color-danger);
1928
- }
1929
- .connection-status cx-icon {
1930
- font-size: var(--cx-font-size-medium);
1931
- }
1932
-
1933
- .asset-index-sync-status .value {
1934
- display: flex;
1935
- align-items: center;
1936
- justify-content: center;
1937
- gap: var(--cx-spacing-2x-small);
1938
- }
1939
- .asset-index-sync-status .value cx-typography {
1940
- display: inline-flex;
1941
- }
1942
- .asset-index-sync-status .value cx-typography::part(base) {
1943
- text-transform: capitalize;
1944
- font-weight: var(--cx-font-weight-medium);
1945
- }
1946
- .asset-index-sync-status--loaded .value {
1947
- color: var(--cx-color-success);
1948
- }
1949
- .asset-index-sync-status--loading .value {
1950
- color: var(--cx-color-warning);
1951
- }
1952
- .asset-index-sync-status--error .value {
1953
- color: var(--cx-color-danger);
1954
- }
1955
- .asset-index-sync-status cx-icon {
1956
- font-size: var(--cx-font-size-medium);
1957
- }
1958
-
1959
-
1960
- /** asset */
1961
- .uploads__list .asset-group__label {
1962
- display: flex;
1963
- justify-content: space-between;
1964
- align-items: center;
1965
- }
1966
-
1967
- .asset-group__clear-button::part(base) {
1968
- color: var(--cx-color-primary-500);
1969
- font-size: var(--cx-font-size-x-small);
1970
- }
1971
-
1972
- .asset-group__label {
1973
- padding: var(--cx-spacing-x-small) var(--cx-spacing-small);
1974
- color: var(--cx-color-neutral-400);
1975
- line-height: var(--cx-line-height-large);
1976
- }
1977
-
1978
- /** #region Settings */
1979
- .settings {
1980
- height: 100%;
1981
- }
1982
- .settings .error-message {
1983
- text-align: center;
1984
- }
1985
- .settings__form {
1986
- height: 100%;
1987
- display: flex;
1988
- flex-direction: column;
1989
- }
1990
- .settings__tab-group {
1991
- flex: 1;
1992
- height: 0;
1993
- }
1994
- .settings__tab-group::part(base),
1995
- .settings__tab-group::part(body) {
1996
- height: 100%;
1997
- overflow: hidden;
1998
- }
1999
- .settings__tab-group cx-tab-panel {
2000
- padding: var(--cx-spacing-medium) var(--cx-spacing-large)
2001
- var(--cx-spacing-large) var(--cx-spacing-large);
2002
- height: 100%;
2003
- overflow-y: auto;
2004
- }
2005
- .settings-group {
2006
- display: flex;
2007
- flex-direction: column;
2008
- gap: var(--cx-spacing-x-small);
2009
- }
2010
- .settings__general,
2011
- .settings__advanced {
2012
- display: flex;
2013
- flex-direction: column;
2014
- gap: calc(var(--cx-spacing-small) * 2);
2015
- }
2016
- .settings__footer {
2017
- border-top: 1px solid var(--cx-color-neutral-200);
2018
- padding: var(--cx-spacing-x-small) var(--cx-spacing-small);
2019
- display: flex;
2020
- justify-content: flex-end;
2021
- }
2022
-
2023
- .settings__footer__actions {
2024
- display: flex;
2025
- gap: var(--cx-spacing-x-small);
2026
- }
2027
-
2028
- .settings__connection-url {
2029
- display: flex;
2030
- justify-content: space-between;
2031
- }
2032
- .settings__connection-url__value {
2033
- padding: 0 var(--cx-spacing-small);
2034
- flex-grow: 1;
2035
- flex-shrink: 1;
2036
- overflow: hidden;
2037
- }
2038
-
2039
- .settings__software__version {
2040
- display: flex;
2041
- flex-direction: column;
2042
- gap: var(--cx-spacing-small);
2043
- }
2044
- .settings__software__version__value {
2045
- display: flex;
2046
- align-items: center;
2047
- justify-content: space-between;
2048
- gap: var(--cx-spacing-2x-small);
2049
- }
2050
- .settings__software__version__value__text {
2051
- flex-grow: 1;
2052
- flex-shrink: 1;
2053
- overflow: hidden;
2054
- }
2055
- .settings__software__version__install-button {
2056
- flex-shrink: 0;
2057
- }
2058
-
2059
- .settings__about {
2060
- text-align: center;
2061
- color: var(--cx-color-neutral-500);
2062
- }
2063
-
2064
- .settings__disconnect-button {
2065
- width: 100%;
2066
- }
2067
- .settings__disconnect-button::part(base),
2068
- .settings__disconnect-button cx-icon {
2069
- color: var(--cx-color-danger);
2070
- }
2071
-
2072
- .settings__cache__size {
2073
- display: flex;
2074
- gap: var(--cx-spacing-x-small);
2075
- justify-content: center;
2076
- flex-direction: column;
2077
- }
2078
- .settings__cache__size cx-input {
2079
- width: 150px;
2080
- }
2081
- .settings__cache__location {
2082
- display: flex;
2083
- flex-direction: column;
2084
- gap: var(--cx-spacing-small);
2085
- }
2086
- .settings__cache__location__label,
2087
- .settings__cache__size__label {
2088
- --color: var(--cx-color-neutral-600);
2089
- }
2090
- .settings__cache__location__value {
2091
- display: flex;
2092
- align-items: center;
2093
- justify-content: space-between;
2094
- }
2095
- .settings__cache__location__value__text {
2096
- padding: 0 var(--cx-spacing-small);
2097
- flex-grow: 1;
2098
- flex-shrink: 1;
2099
- overflow: hidden;
2100
- }
2101
- .settings__cache__location__actions {
2102
- flex-wrap: nowrap;
2103
- }
2104
- .settings__cache__location__change-button {
2105
- flex-shrink: 0;
2106
- }
2107
- /** #endregion */
2108
-
2109
- cx-tree-item:not(.selectable) {
2110
- --selected-color: var(--cx-color-neutral-700);
2111
- }
2112
-
2113
- cx-tree-item:not(:hover):not(.selectable)::part(item) {
2114
- background-color: unset;
2115
- color: var(--cx-color-neutral-700);
2116
- }
2117
-
2118
- .folder-tree {
2119
- overflow: auto;
2120
- flex: 1;
2121
- }
2122
-
2123
- .folder-tree:not(.selectable) {
2124
- max-height: 200px;
2125
- }
2126
-
2127
- .folder-tree__item::part(label) {
2128
- width: 100%;
2129
- overflow: hidden;
2130
- }
2131
-
2132
- .folder-tree__icon {
2133
- font-size: var(--cx-font-size-large);
2134
- color: var(--cx-color-neutral-600);
2135
- }
2136
-
2137
- .folder-tree__label {
2138
- display: flex;
2139
- width: 100%;
2140
- overflow: hidden;
2141
- gap: var(--cx-spacing-x-small);
2142
- line-height: var(--cx-line-height-medium);
2143
- }
2144
-
2145
- .folder-tree__label__value {
2146
- flex-grow: 1;
2147
- flex-shrink: 1;
2148
- overflow: hidden;
2149
- }
2150
-
2151
- .select-folders-popup::part(body) {
2152
- display: flex;
2153
- flex-direction: column;
2154
- gap: var(--cx-spacing-medium);
2155
- overflow: hidden;
2156
- }
2157
- .select-folders-popup .selectable-folder-tree {
2158
- flex: 1;
2159
- overflow: auto;
2160
- }
2161
- .select-folders-popup__actions {
2162
- display: flex;
2163
- justify-content: flex-end;
2164
- }
2165
- `;
2166
- var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, l = (t, e, i, a) => {
2167
- for (var s = a > 1 ? void 0 : a ? Qe(e, i) : e, o = t.length - 1, c; o >= 0; o--)
2168
- (c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
2169
- return a && s && Je(e, i, s), s;
2170
- };
2171
- let r = class extends H {
2172
- constructor() {
2173
- super(...arguments), this.localize = new q(this), this.connectionEstablished = !1, this.connectionStatus = "excellent", this.connectionStatusTooltip = "", this.assetIndexSyncStatus = "loading", this.userAvatarUrl = "", this.username = "", this.recentAssets = { assets: [], hasMore: !1 }, this.favoriteAssets = { assets: [], hasMore: !1 }, this.favoritesLastSync = Date.now(), this.favoriteInProgressAssets = [], this.pinInProgressAssets = [], this.uploadingAssets = { assets: [], hasMore: !1 }, this.pinnedAssets = { assets: [], hasMore: !1 }, this.availableFolderIdentifiers = [], this.isLoading = !1, this.settings = {
2174
- cacheLocation: "Default",
2175
- cacheSize: 0,
2176
- cacheUsage: 0,
2177
- config: {
2178
- latestVersion: "",
2179
- monitoringActivated: !1,
2180
- mountPoint: "",
2181
- mountProxy: !1,
2182
- proxyTypes: [],
2183
- rootIDs: [],
2184
- siteUrl: "",
2185
- version: ""
2186
- // unlimitedDownloadRate: false,
2187
- // unlimitedUploadRate: false,
2188
- // maxDownloadRate: 0,
2189
- // maxUploadRate: 0,
2190
- }
2191
- }, this.pickCacheLocation = async () => "Default", this.hasNewVersion = !1, this.aboutContent = "", this.token = "", this.userInteractionBlocked = !1, this.isConnecting = !1, this.isCancellingConnection = !1, this.isDisconnecting = !1, this.isUpgrading = !1, this.isSettingsOpened = !1, this.rootIDs = this.settings.config.rootIDs, this._activeFoldersMode = this.rootIDs.length > 0, this.removedIds = [], this.cacheSize = et({
2192
- decimals: 2,
2193
- inputUnit: "B",
2194
- targetUnit: Z,
2195
- value: this.settings.cacheSize ?? 0
2196
- }), this.cacheLocation = this.settings.cacheLocation, this.proxyTypes = this.settings.config.proxyTypes ?? [], this.siteUrl = this.settings.config.siteUrl, this.isRecentAssetsLoading = !1, this.isFavoriteAssetsLoading = !1, this.isUploadingAssetsLoading = !1, this.isPinnedAssetsLoading = !1, this.connectError = "", this.disconnectError = "", this.upgradeError = "", this.totalCount = 0, this.folderPathsSet = /* @__PURE__ */ new Set(), this.validConnectionUrl = !1, this.isAddingRootIDs = !1, this.fetchFolders = async ({
2197
- excludes: t = [],
2198
- folderId: e,
2199
- folderPathsSet: i,
2200
- limit: a = void 0,
2201
- start: s = 0
2202
- }) => {
2203
- try {
2204
- return await Tt({
2205
- excludes: t,
2206
- folderId: e,
2207
- folderPathsSet: i,
2208
- limit: a,
2209
- searchText: this.searchText,
2210
- siteUrl: this.settings.config.siteUrl,
2211
- start: s,
2212
- token: this.token
2213
- });
2214
- } catch (o) {
2215
- o instanceof Error && o.message === "Failed to fetch" && this.emit("cx-renew-token");
2216
- }
2217
- return {
2218
- data: this.availableFolderIdentifiers,
2219
- totalCount: this.availableFolderIdentifiers.length
2220
- };
2221
- }, this.searchText = "", this.loadMore = async () => {
2222
- const t = this.availableFolderIdentifiers?.length ?? 0;
2223
- if (t >= this.totalCount)
2224
- return;
2225
- this.isLoading = !0;
2226
- const { data: e, totalCount: i } = await this.fetchFolders({
2227
- folderId: "",
2228
- folderPathsSet: this.folderPathsSet,
2229
- start: t
2230
- });
2231
- this.availableFolderIdentifiers = [
2232
- ...this.availableFolderIdentifiers ?? [],
2233
- ...e
2234
- ], this.totalCount = i, this.isLoading = !1;
2235
- };
2236
- }
2237
- connectedCallback() {
2238
- super.connectedCallback();
2239
- }
2240
- runFirstUpdated() {
2241
- this.settings.config.siteUrl && this.connect();
2242
- }
2243
- fetchData() {
2244
- if (!this.connectionEstablished) {
2245
- this.validConnectionUrl = K(this.settings.config.siteUrl);
2246
- return;
2247
- }
2248
- this.folderPathsSet = /* @__PURE__ */ new Set(), this.fetchFolders({
2249
- folderId: "",
2250
- folderPathsSet: this.folderPathsSet
2251
- }).then((t) => {
2252
- this.availableFolderIdentifiers = t.data, this.totalCount = t.totalCount;
2253
- });
2254
- }
2255
- // set recent tab as active when connection is established
2256
- async showRecentTab() {
2257
- this.connectionEstablished && (await this.updateComplete, await this.assetsListTabGroup?.updateComplete, this.assetsListTabGroup?.show(x.RECENT));
2258
- }
2259
- updateSettingsStates() {
2260
- this._activeFoldersMode = this.settings.config.rootIDs?.length > 0, this.rootIDs = this.settings.config.rootIDs ?? [], this.cacheSize = et({
2261
- decimals: 2,
2262
- inputUnit: "B",
2263
- targetUnit: Z,
2264
- value: this.settings.cacheSize ?? 0
2265
- }), this.cacheLocation = this.settings.cacheLocation ?? "Default", this.proxyTypes = this.settings.config.proxyTypes ?? [], this.siteUrl = this.settings.config.siteUrl ?? "", this.validConnectionUrl = K(this.settings.config.siteUrl);
2266
- }
2267
- get formHasChanges() {
2268
- return this.settings.cacheSize !== this.cacheSize || this.settings.cacheLocation !== this.cacheLocation || !!st(this.settings.config.proxyTypes, this.proxyTypes).length || !!st(this.settings.config.rootIDs, this.rootIDs).length;
2269
- }
2270
- connect(t = null) {
2271
- if (t?.preventDefault(), this.connectError = "", !this.siteUrl?.trim())
2272
- return;
2273
- const e = ht(this.siteUrl);
2274
- if (!K(e)) {
2275
- this.connectError = this.localize.term("pleaseEnterAValidUrl");
2276
- return;
2277
- }
2278
- this.settings.config.siteUrl = e, this.emit("cx-connect", {
2279
- detail: {
2280
- connectionUrl: this.settings.config.siteUrl
2281
- }
2282
- });
2283
- }
2284
- cancelConnection() {
2285
- this.emit("cx-cancel-connection", {
2286
- detail: {
2287
- connectionUrl: this.settings.config.siteUrl
2288
- }
2289
- });
2290
- }
2291
- disconnect() {
2292
- this.emit("cx-disconnect", {
2293
- detail: {
2294
- connectionUrl: this.settings.config.siteUrl
2295
- }
2296
- });
2297
- }
2298
- upgrade() {
2299
- this.emit("cx-upgrade");
2300
- }
2301
- clearCache() {
2302
- this.emit("cx-clear-cache");
2303
- }
2304
- importSettings() {
2305
- this.emit("cx-import-settings");
2306
- }
2307
- exportSettings() {
2308
- this.emit("cx-export-settings");
2309
- }
2310
- viewLogs(t = "") {
2311
- this.emit("cx-view-logs", {
2312
- detail: {
2313
- assetId: t
2314
- }
2315
- });
2316
- }
2317
- clearUpload() {
2318
- this.emit("cx-clear-upload");
2319
- }
2320
- saveSettings() {
2321
- this.emit("cx-save-settings", {
2322
- detail: {
2323
- settings: {
2324
- cacheLocation: this.cacheLocation,
2325
- cacheSize: et({
2326
- decimals: 2,
2327
- inputUnit: Z,
2328
- targetUnit: "B",
2329
- value: this.cacheSize
2330
- }),
2331
- cacheUsage: this.settings.cacheUsage,
2332
- config: {
2333
- latestVersion: this.settings.config.latestVersion,
2334
- monitoringActivated: this.settings.config.monitoringActivated,
2335
- mountPoint: this.settings.config.mountPoint,
2336
- mountProxy: this.settings.config.mountProxy,
2337
- proxyTypes: this.proxyTypes,
2338
- rootIDs: this.rootIDs.filter(
2339
- (t) => !this.removedIds.includes(t)
2340
- ),
2341
- siteUrl: this.settings.config.siteUrl,
2342
- version: this.settings.config.version
2343
- // maxDownloadRate: this._maxDownloadRate,
2344
- // maxUploadRate: this._maxUploadRate,
2345
- // unlimitedDownloadRate: this._unlimitedDownloadRate,
2346
- // unlimitedUploadRate: this._unlimitedUploadRate,
2347
- }
2348
- }
2349
- }
2350
- });
2351
- }
2352
- openSearch() {
2353
- this.emit("cx-open-search");
2354
- }
2355
- openDrive(t) {
2356
- this.emit("cx-open-drive", {
2357
- detail: {
2358
- asset: t
2359
- }
2360
- });
2361
- }
2362
- openCacheLocation() {
2363
- this.emit("cx-open-cache-location");
2364
- }
2365
- hideSettings() {
2366
- this.isSettingsOpened = !1, this.isDisconnecting = !1, this.disconnectError = "", this.isUpgrading = !1, this.upgradeError = "", this.updateSettingsStates();
2367
- }
2368
- showSettings() {
2369
- this.isSettingsOpened = !0;
2370
- }
2371
- requestMoreRecentAssets() {
2372
- if (!this.recentAssetsList)
2373
- return;
2374
- const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.recentAssetsList;
2375
- !this.isRecentAssetsLoading && this.recentAssets.hasMore && i + t >= e - X && (this.isRecentAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
2376
- detail: {
2377
- type: "recent"
2378
- }
2379
- }));
2380
- }
2381
- onRecentAssetsChanged() {
2382
- this.isRecentAssetsLoading = !1;
2383
- }
2384
- requestMoreFavoriteAssets() {
2385
- if (!this.favoritesAssetsList)
2386
- return;
2387
- const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.favoritesAssetsList;
2388
- !this.isFavoriteAssetsLoading && this.favoriteAssets.hasMore && i + t >= e - X && (this.isFavoriteAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
2389
- detail: {
2390
- type: "favorites"
2391
- }
2392
- }));
2393
- }
2394
- requestMorePinnedAssets() {
2395
- if (!this.pinnedAssetsList)
2396
- return;
2397
- const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.pinnedAssetsList;
2398
- !this.isPinnedAssetsLoading && this.pinnedAssets.hasMore && i + t >= e - X && (this.isPinnedAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
2399
- detail: {
2400
- type: "pinned"
2401
- }
2402
- }));
2403
- }
2404
- onPinnedAssetsChanged() {
2405
- this.isPinnedAssetsLoading = !1;
2406
- }
2407
- onFavoriteAssetsChanged() {
2408
- this.isFavoriteAssetsLoading = !1;
2409
- }
2410
- requestMoreUploadingAssets() {
2411
- if (!this.uploadsAssetsList)
2412
- return;
2413
- const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.uploadsAssetsList;
2414
- !this.isUploadingAssetsLoading && this.uploadingAssets.hasMore && i + t >= e - X && (this.isUploadingAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
2415
- detail: {
2416
- type: "uploads"
2417
- }
2418
- }));
2419
- }
2420
- onUploadingAssetsChanged() {
2421
- this.isUploadingAssetsLoading = !1;
2422
- }
2423
- async updateActiveFolderIdentifiers(t) {
2424
- const e = this.rootIDs;
2425
- this.rootIDs = t, await this.updateComplete;
2426
- const i = this.container.querySelectorAll("cx-tree-item"), a = st(this.rootIDs, e);
2427
- i.forEach((s) => {
2428
- a.includes(s.dataset.id ?? "") && bt(s);
2429
- });
2430
- }
2431
- // #region Render
2432
- renderHeader() {
2433
- const t = () => {
2434
- this.openDrive();
2435
- };
2436
- return n`
2437
- <div class="header">
2438
- <div class="header__user">
2439
- <cx-avatar
2440
- class="header__avatar"
2441
- image=${this.userAvatarUrl}
2442
- label=${this.username}
2443
- ></cx-avatar>
2444
- <div class="header__username">
2445
- <cx-line-clamp lines="1" class="header__username__text">
2446
- <cx-typography variant="body3">${this.username}</cx-typography>
2447
- </cx-line-clamp>
2448
- </div>
2449
- </div>
2450
- <div class="header__actions">
2451
- <cx-tooltip content=${this.localize.term("search")} hoist>
2452
- <cx-icon-button
2453
- data-testid="header__search-button"
2454
- name="search"
2455
- @click=${this.openSearch}
2456
- ></cx-icon-button>
2457
- </cx-tooltip>
2458
- <cx-tooltip content=${this.localize.term("openDrive")} hoist>
2459
- <cx-icon-button
2460
- data-testid="header__drive-button"
2461
- name="folder_open"
2462
- @click=${t}
2463
- ></cx-icon-button>
2464
- </cx-tooltip>
2465
- <cx-tooltip content=${this.localize.term("settings")} hoist>
2466
- <cx-icon-button
2467
- data-testid="header__settings-button"
2468
- class="header__settings"
2469
- name="settings"
2470
- @click=${this.showSettings}
2471
- >
2472
- ${p(
2473
- this.hasNewVersion,
2474
- () => n`<cx-badge
2475
- class="settings__version__badge"
2476
- slot="badge"
2477
- variant="danger"
2478
- pill
2479
- size="x-small"
2480
- ></cx-badge>`
2481
- )}
2482
- </cx-icon-button>
2483
- </cx-tooltip>
2484
- </div>
2485
- </div>
2486
- `;
2487
- }
2488
- // #region Assets
2489
- renderAsset(t, e) {
2490
- return n`<cx-file-on-demand-asset
2491
- .asset=${t}
2492
- .listType=${e}
2493
- .favoriteInProgressAssets=${this.favoriteInProgressAssets}
2494
- .pinInProgressAssets=${this.pinInProgressAssets}
2495
- ></cx-file-on-demand-asset>`;
2496
- }
2497
- renderRecentAssets() {
2498
- const t = n`
2499
- <div class="recent-empty assets-list__tab-group__empty-message">
2500
- <cx-icon class="empty-icon" name="explore"></cx-icon>
2501
- <cx-typography variant="body2">
2502
- ${this.localize.term("allViewedAssetsWillBeVisibleHere")}
2503
- </cx-typography>
2504
- </div>
2505
- `, [e, i] = ut(
2506
- this.recentAssets.assets
2507
- ), a = n`
2508
- <div class="recent__list" @scroll=${this.requestMoreRecentAssets}>
2509
- <div
2510
- class=${C({
2511
- empty: e.length === 0,
2512
- recent__today: !0
2513
- })}
2514
- data-testid="recent__today"
2515
- >
2516
- <div class="asset-group__label">
2517
- <cx-typography variant="small">
2518
- ${this.localize.term("today")}
2519
- </cx-typography>
2520
- </div>
2521
- ${U(
2522
- e,
2523
- (s) => s.recordId,
2524
- (s) => this.renderAsset(s, x.RECENT)
2525
- )}
2526
- </div>
2527
- <div
2528
- class=${C({
2529
- empty: i.length === 0,
2530
- recent__other: !0
2531
- })}
2532
- >
2533
- <div class="asset-group__label">
2534
- <cx-typography variant="small">
2535
- ${this.localize.term("allOther")}
2536
- </cx-typography>
2537
- </div>
2538
- ${U(
2539
- i,
2540
- (s) => s.recordId,
2541
- (s) => this.renderAsset(s, x.RECENT)
2542
- )}
2543
- </div>
2544
- </div>
2545
- `;
2546
- return n`
2547
- <cx-tab-panel
2548
- name=${x.RECENT}
2549
- class="assets-list__recent-tab-panel"
2550
- >
2551
- ${p(
2552
- this.recentAssets.assets.length > 0,
2553
- () => a,
2554
- () => t
2555
- )}
2556
- </cx-tab-panel>
2557
- `;
2558
- }
2559
- renderFavoriteAssets() {
2560
- const t = n`
2561
- <div class="favorites-empty assets-list__tab-group__empty-message">
2562
- <cx-icon class="empty-icon" name="star"></cx-icon>
2563
- <cx-typography variant="body2">
2564
- ${this.localize.term("allFavoriteAssetsWillBeVisibleHere")}
2565
- </cx-typography>
2566
- </div>
2567
- `, e = mt(this.favoriteAssets.assets), i = n`
2568
- <div class="favorites__list" @scroll=${this.requestMoreFavoriteAssets}>
2569
- ${U(
2570
- e,
2571
- (a) => a.recordId,
2572
- (a) => this.renderAsset(a, x.FAVORITES)
2573
- )}
2574
- </div>
2575
- `;
2576
- return n`
2577
- <cx-tab-panel
2578
- name=${x.FAVORITES}
2579
- class="assets-list__favorites-tab-panel"
2580
- >
2581
- <div class="favorites-tab-panel__content">
2582
- <div class="asset-group__label favorites__sync-time">
2583
- <cx-typography variant="small">
2584
- ${this.localize.term("favoritesSync")} -
2585
- <cx-relative-time
2586
- format="narrow"
2587
- numeric="always"
2588
- date=${new Date(this.favoritesLastSync)}
2589
- sync
2590
- sync-interval=${O}
2591
- ></cx-relative-time>
2592
- </cx-typography>
2593
- </div>
2594
- ${p(
2595
- e.length > 0,
2596
- () => i,
2597
- () => t
2598
- )}
2599
- </div>
2600
- </cx-tab-panel>
2601
- `;
2602
- }
2603
- renderUploadingAssets() {
2604
- const t = n`
2605
- <div class="uploads-empty assets-list__tab-group__empty-message">
2606
- <cx-icon class="empty-icon" name="arrow_upward"></cx-icon>
2607
- <cx-typography variant="body2">
2608
- ${this.localize.term("allAssetUploadsWillBeVisibleHere")}
2609
- </cx-typography>
2610
- </div>
2611
- `, [e, i] = ut(
2612
- this.uploadingAssets.assets
2613
- ), a = n`
2614
- <div class="uploads__list" @scroll=${this.requestMoreUploadingAssets}>
2615
- <div
2616
- class=${C({
2617
- empty: e.length === 0,
2618
- recent__today: !0
2619
- })}
2620
- data-testid="uploads__today"
2621
- >
2622
- <div class="asset-group__label">
2623
- <cx-typography variant="small">
2624
- ${this.localize.term("today")}
2625
- </cx-typography>
2626
- <cx-button
2627
- class="asset-group__clear-button"
2628
- variant="text"
2629
- size="small"
2630
- @click=${this.clearUpload}
2631
- >
2632
- ${this.localize.term("clearAll")}
2633
- </cx-button>
2634
- </div>
2635
- ${U(
2636
- e,
2637
- (s) => s.recordId,
2638
- (s) => this.renderAsset(s, x.UPLOADS)
2639
- )}
2640
- </div>
2641
- <div
2642
- class=${C({
2643
- empty: i.length === 0,
2644
- uploads__other: !0
2645
- })}
2646
- >
2647
- <div class="asset-group__label">
2648
- <cx-typography variant="small">
2649
- ${this.localize.term("allOther")}
2650
- </cx-typography>
2651
- </div>
2652
- ${U(
2653
- i,
2654
- (s) => s.recordId,
2655
- (s) => this.renderAsset(s, x.UPLOADS)
2656
- )}
2657
- </div>
2658
- </div>
2659
- `;
2660
- return n`
2661
- <cx-tab-panel
2662
- name=${x.UPLOADS}
2663
- class="assets-list__uploads-tab-panel"
2664
- >
2665
- ${p(
2666
- this.uploadingAssets.assets.length > 0,
2667
- () => a,
2668
- () => t
2669
- )}
2670
- </cx-tab-panel>
2671
- `;
2672
- }
2673
- renderPinnedAssets() {
2674
- const t = n`
2675
- <div class="pinned-empty assets-list__tab-group__empty-message">
2676
- <cx-icon class="empty-icon" name="keep"></cx-icon>
2677
- <cx-typography variant="body2">
2678
- ${this.localize.term("allPinnedAssetsWillBeVisibleHere")}
2679
- </cx-typography>
2680
- </div>
2681
- `, e = mt(this.pinnedAssets.assets), i = n`
2682
- <div class="pinned__list" @scroll=${this.requestMorePinnedAssets}>
2683
- ${U(
2684
- e,
2685
- (a) => a.recordId,
2686
- (a) => this.renderAsset(a, x.PINNED)
2687
- )}
2688
- </div>
2689
- `;
2690
- return n`
2691
- <cx-tab-panel
2692
- name=${x.PINNED}
2693
- class="assets-list__pinned-tab-panel"
2694
- >
2695
- <div class="pinned-tab-panel__content">
2696
- ${p(
2697
- e.length > 0,
2698
- () => i,
2699
- () => t
2700
- )}
2701
- </div>
2702
- </cx-tab-panel>
2703
- `;
2704
- }
2705
- renderAssetsList() {
2706
- return n`
2707
- <div class="assets-list">
2708
- <cx-tab-group
2709
- @cx-tab-show=${async (e) => {
2710
- switch (await e.target.updateComplete, e.detail.name) {
2711
- case x.RECENT:
2712
- this.requestMoreRecentAssets();
2713
- break;
2714
- case x.FAVORITES:
2715
- this.requestMoreFavoriteAssets();
2716
- break;
2717
- case x.UPLOADS:
2718
- this.requestMoreUploadingAssets();
2719
- break;
2720
- case x.PINNED:
2721
- this.requestMorePinnedAssets();
2722
- break;
2723
- }
2724
- }}
2725
- no-scroll-controls
2726
- class="assets-list__tab-group"
2727
- >
2728
- <cx-tab
2729
- active
2730
- data-testid="assets-list__recent-tab"
2731
- slot="nav"
2732
- panel=${x.RECENT}
2733
- >
2734
- ${this.localize.term("recent")}
2735
- </cx-tab>
2736
- <cx-tab
2737
- data-testid="assets-list__pins-tab"
2738
- slot="nav"
2739
- panel=${x.PINNED}
2740
- >
2741
- ${this.localize.term("pins")}
2742
- </cx-tab>
2743
- <cx-tab
2744
- data-testid="assets-list__favorites-tab"
2745
- slot="nav"
2746
- panel=${x.FAVORITES}
2747
- >
2748
- ${this.localize.term("favorites")}
2749
- </cx-tab>
2750
- <cx-tab
2751
- data-testid="assets-list__uploads-tab"
2752
- slot="nav"
2753
- panel=${x.UPLOADS}
2754
- >
2755
- ${this.localize.term("uploads")}
2756
- </cx-tab>
2757
- ${this.renderRecentAssets()} ${this.renderFavoriteAssets()}
2758
- ${this.renderUploadingAssets()} ${this.renderPinnedAssets()}
2759
- </cx-tab-group>
2760
- </div>
2761
- `;
2762
- }
2763
- renderAssetsView() {
2764
- return n`
2765
- <div class="assets">
2766
- ${this.renderHeader()}${this.renderAssetsList()}${this.renderStatusFooter()}
2767
- </div>
2768
- `;
2769
- }
2770
- onSearch() {
2771
- this.folderPathsSet = /* @__PURE__ */ new Set(), this.fetchFolders({
2772
- folderId: "",
2773
- folderPathsSet: this.folderPathsSet
2774
- }).then((t) => {
2775
- this.availableFolderIdentifiers = t.data, this.totalCount = t.totalCount;
2776
- });
2777
- }
2778
- renderSelectFoldersPopup() {
2779
- const t = () => {
2780
- this.folderTree.rootIDs = this.rootIDs, this.dialog.show();
2781
- }, e = (s = null) => {
2782
- s?.target && s.target !== this.dialog || (this.folderTree.resetTree(), this.folderTree.rootIDs = [], this.folderTree.removedIDs = [], this.dialog.hide(), this.searchText = "");
2783
- }, i = async () => {
2784
- this.isAddingRootIDs = !0, await this.updateComplete, this.searchText = "";
2785
- const s = this.rootIDs.filter((h) => {
2786
- if (!this.folderTree.shadowRoot?.querySelector(
2787
- `[data-id="${S(h).id}"]`
2788
- ))
2789
- return !0;
2790
- }), o = /* @__PURE__ */ new Set([
2791
- ...this.folderTree.currentRootIDs,
2792
- ...s
2793
- ]);
2794
- for (const h of o) {
2795
- const _ = R(S(h).path), m = this.folderTree.removedIDs.filter(
2796
- (g) => R(S(g).path).startsWith(_)
2797
- );
2798
- if (m.length > 0) {
2799
- const { totalCount: g } = await this.fetchFolders({
2800
- excludes: m.map((f) => S(f).id),
2801
- folderId: S(h).id,
2802
- start: 0
2803
- }), { data: $ } = await this.fetchFolders({
2804
- excludes: m.map((f) => S(f).id),
2805
- folderId: S(h).id,
2806
- limit: g || 10,
2807
- start: 0
2808
- });
2809
- $.forEach((f) => {
2810
- o.add(
2811
- N({ id: f.id, path: f.fullPath })
2812
- );
2813
- }), o.delete(h);
2814
- }
2815
- }
2816
- const c = Array.from(o);
2817
- this.updateActiveFolderIdentifiers(c), this.removedIds = c.filter(
2818
- (h) => [...c].some((_) => {
2819
- const m = S(h), g = S(_), $ = R(g.path);
2820
- return _ !== h && m.path.startsWith($);
2821
- })
2822
- ), e(), this.isAddingRootIDs = !1;
2823
- }, a = (s) => {
2824
- const o = s.target;
2825
- this.searchText = (o.value ?? "").trim();
2826
- };
2827
- return n`
2828
- <cx-dialog
2829
- class="select-folders-popup"
2830
- no-header
2831
- @cx-after-hide=${e}
2832
- .boundary=${this.container}
2833
- >
2834
- <cx-input
2835
- autofocus
2836
- clearable
2837
- @cx-input=${a}
2838
- value=${this.searchText}
2839
- placeholder=${this.localize.term("search")}
2840
- >
2841
- <cx-icon name="search" slot="prefix"></cx-icon>
2842
- </cx-input>
2843
- ${this.renderSelectableFolderTree()}
2844
- <div class="select-folders-popup__actions">
2845
- <cx-button
2846
- ?loading=${this.isAddingRootIDs}
2847
- variant="primary"
2848
- @click=${i}
2849
- >
2850
- ${this.localize.term("add")}
2851
- </cx-button>
2852
- </div>
2853
- </cx-dialog>
2854
- <cx-button
2855
- data-testid="settings__select-folders-button"
2856
- @click=${t}
2857
- >
2858
- <cx-icon name="folder" slot="prefix"></cx-icon>
2859
- ${this.localize.term("selectFolders")}
2860
- </cx-button>
2861
- `;
2862
- }
2863
- renderSelectableFolderTree() {
2864
- const t = this.availableFolderIdentifiers;
2865
- return n`
2866
- <cx-folder-tree
2867
- class="selectable-folder-tree"
2868
- .siteUrl=${this.settings.config.siteUrl}
2869
- .token=${this.token}
2870
- .searchText=${this.searchText}
2871
- .folders=${t}
2872
- .rootIDs=${this.rootIDs}
2873
- .totalCount=${this.totalCount}
2874
- .loadMore=${this.loadMore}
2875
- .folderPathsSet=${this.folderPathsSet}
2876
- ?isLoading=${this.isLoading}
2877
- ></cx-folder-tree>
2878
- `;
2879
- }
2880
- renderRootFolderTree() {
2881
- if (!this.rootIDs.length)
2882
- return Nt;
2883
- const t = this.rootIDs.filter(
2884
- (a) => !this.removedIds.includes(a)
2885
- ), e = (a) => {
2886
- this.updateActiveFolderIdentifiers(
2887
- t.filter(
2888
- (s) => S(s).id !== a
2889
- )
2890
- ), this.folderTree.rootIDs = this.rootIDs, this.folderTree.resetTree();
2891
- }, i = (a) => {
2892
- const { id: s, path: o } = S(a), c = () => {
2893
- e(s);
2894
- };
2895
- return n`
2896
- <cx-tree-item
2897
- data-id=${s}
2898
- class=${C({
2899
- "folder-tree__item": !0
2900
- })}
2901
- >
2902
- <div class="folder-tree__label">
2903
- <cx-icon class="folder-tree__icon" name="folder"></cx-icon>
2904
- <cx-line-clamp lines="1" class="folder-tree__label__value">
2905
- ${o}
2906
- </cx-line-clamp>
2907
- </div>
2908
- <cx-tooltip
2909
- slot="actions"
2910
- content=${this.localize.term("removeFolder", 1)}
2911
- hoist
2912
- >
2913
- <cx-icon-button
2914
- @click=${c}
2915
- name="close"
2916
- ></cx-icon-button>
2917
- </cx-tooltip>
2918
- </cx-tree-item>
2919
- `;
2920
- };
2921
- return n`
2922
- <div data-testid="root-folder-tree" class="folder-tree">
2923
- <cx-tree selection="none">
2924
- ${U(
2925
- t,
2926
- (a) => a,
2927
- (a) => i(a)
2928
- )}
2929
- >
2930
- </cx-tree>
2931
- </div>
2932
- `;
2933
- }
2934
- handleActiveFolderChange(t) {
2935
- t.target.value === "custom" ? (this._activeFoldersMode = !0, this.rootIDs = this.settings.config.rootIDs ?? []) : (this._activeFoldersMode = !1, this.rootIDs = []);
2936
- }
2937
- renderGeneralSettings() {
2938
- const t = n`
2939
- <div class="settings-group settings__active-folder">
2940
- <cx-typography variant="h5">
2941
- ${this.localize.term("activeFolders")}
2942
- </cx-typography>
2943
- <cx-typography variant="body3">
2944
- ${this.localize.term("activeFoldersHelpText")}
2945
- </cx-typography>
2946
- <cx-select
2947
- data-testid="settings__active-folder-select"
2948
- hoist
2949
- input-behavior="none"
2950
- value=${this._activeFoldersMode ? "custom" : "all"}
2951
- @cx-change=${this.handleActiveFolderChange}
2952
- >
2953
- <cx-option value="all">
2954
- ${this.localize.term("allFoldersDefault")}
2955
- </cx-option>
2956
- <cx-option value="custom">${this.localize.term("custom")}</cx-option>
2957
- </cx-select>
2958
- ${p(
2959
- this._activeFoldersMode,
2960
- () => n`
2961
- ${this.renderRootFolderTree()} ${this.renderSelectFoldersPopup()}
2962
- `
2963
- )}
2964
- </div>
2965
- `;
2966
- return n`
2967
- <div class="settings__general">
2968
- ${t}
2969
- <div class="settings-group settings__software">
2970
- <cx-typography variant="h5">
2971
- ${this.localize.term("software")}
2972
- </cx-typography>
2973
- <div class="settings__software__version">
2974
- <div class="settings__software__version__value">
2975
- <cx-line-clamp
2976
- lines="1"
2977
- class="settings__software__version__value__text"
2978
- >
2979
- <cx-typography variant="body3">
2980
- ${this.localize.term("currentVersion")}
2981
- ${gt(this.settings.config.version ?? "")}
2982
- </cx-typography>
2983
- </cx-line-clamp>
2984
- </div>
2985
- ${p(
2986
- this.hasNewVersion,
2987
- () => n`<div class="settings__software__version__value">
2988
- <cx-badge
2989
- class="settings__version__badge"
2990
- slot="badge"
2991
- variant="danger"
2992
- pill
2993
- size="x-small"
2994
- ></cx-badge>
2995
-
2996
- <cx-line-clamp
2997
- lines="1"
2998
- class="settings__software__version__value__text"
2999
- >
3000
- <cx-typography variant="body3">
3001
- ${this.localize.term(
3002
- "newVersionAvailable",
3003
- gt(
3004
- this.settings.config.latestVersion ?? ""
3005
- )
3006
- )}
3007
- </cx-typography>
3008
- </cx-line-clamp>
3009
- <cx-button
3010
- size="small"
3011
- ?loading=${this.isUpgrading}
3012
- class="settings__software__version__install-button"
3013
- outline
3014
- @click=${this.upgrade}
3015
- >
3016
- <cx-icon name="install_desktop" slot="prefix"></cx-icon>
3017
- ${this.localize.term("download")}
3018
- </cx-button>
3019
- </div>`
3020
- )}
3021
- </div>
3022
- </div>
3023
- <div class="settings-group settings__connection">
3024
- <cx-typography variant="h5">
3025
- ${this.localize.term("connection")}
3026
- </cx-typography>
3027
- <div class="settings__connection-url">
3028
- <cx-typography variant="body3">URL:</cx-typography>
3029
- <cx-line-clamp class="settings__connection-url__value" lines="1">
3030
- <cx-typography variant="body3">
3031
- ${this.settings.config.siteUrl}
3032
- </cx-typography>
3033
- </cx-line-clamp>
3034
- </div>
3035
- </div>
3036
- <cx-space direction="vertical">
3037
- <div class="settings__disconnect">
3038
- <cx-button
3039
- slot="trigger"
3040
- ?loading=${this.isDisconnecting}
3041
- text
3042
- variant="text"
3043
- class="settings__disconnect-button"
3044
- @click=${this.disconnect}
3045
- >
3046
- <cx-icon name="cloud_off" slot="prefix"></cx-icon>
3047
- ${this.localize.term("disconnect")}
3048
- </cx-button>
3049
- <cx-typography class="error-message" variant="body3">
3050
- ${this.disconnectError}
3051
- </cx-typography>
3052
- </div>
3053
- </cx-space>
3054
- <div class="settings-group settings__about">
3055
- <div data-testid="settings__about__content">
3056
- <cx-typography variant="small">${this.aboutContent}</cx-typography>
3057
- </div>
3058
- </div>
3059
- </div>
3060
- `;
3061
- }
3062
- handleProxyChange(t) {
3063
- const i = t.target.value;
3064
- i.includes("All") ? this.proxyTypes = ["All"] : this.proxyTypes = i;
3065
- }
3066
- handleCacheSizeKeydown(t) {
3067
- const e = /\d/;
3068
- // Block minus sign and non-numeric characters
3069
- (t.key === "Minus" || // for key="-" (Firefox)
3070
- t.key === "-" || // for key="-" (Chrome)
3071
- t.key.length === 1 && !e.test(t.key)) && t.preventDefault();
3072
- }
3073
- handleCacheSizeChange(t) {
3074
- const e = t.target;
3075
- if (Number(e.value) < 0) {
3076
- e.setCustomValidity(this.localize.term("cacheSizeCannotBeNegative"));
3077
- return;
3078
- }
3079
- this.cacheSize = Number(e.value);
3080
- }
3081
- async handleCacheLocationClick() {
3082
- const t = await this.pickCacheLocation();
3083
- this.cacheLocation = t;
3084
- }
3085
- async handleCacheLocationChange() {
3086
- await this.updateComplete, this.cacheLocationValueText?.handleResize();
3087
- }
3088
- renderAdvancedSettings() {
3089
- const t = n`<cx-tooltip
3090
- content=${this.localize.term("openDrive")}
3091
- hoist
3092
- >
3093
- <cx-icon-button
3094
- data-testid="settings__cache__location__open-button"
3095
- name="folder_open"
3096
- outline
3097
- @click=${this.openCacheLocation}
3098
- ></cx-icon-button>
3099
- </cx-tooltip>`;
3100
- return n`
3101
- <div class="settings__advanced">
3102
- <div class="settings-group settings__proxy">
3103
- <cx-typography variant="h5">Proxy</cx-typography>
3104
- <cx-select
3105
- class="settings__proxy__select"
3106
- label=${this.localize.term("types")}
3107
- multiple
3108
- input-behavior="none"
3109
- value=${(this.proxyTypes ?? []).join(" ")}
3110
- @cx-change=${this.handleProxyChange}
3111
- >
3112
- <cx-option
3113
- value="Image"
3114
- ?disabled=${(this.proxyTypes ?? []).includes("All")}
3115
- >${this.localize.term("image")}</cx-option
3116
- >
3117
- <cx-option
3118
- value="Video"
3119
- ?disabled=${(this.proxyTypes ?? []).includes("All")}
3120
- >${this.localize.term("video")}</cx-option
3121
- >
3122
- <cx-option
3123
- value="Audio"
3124
- ?disabled=${(this.proxyTypes ?? []).includes("All")}
3125
- >${this.localize.term("audio")}</cx-option
3126
- >
3127
- <cx-option value="All">${this.localize.term("all")}</cx-option>
3128
- </cx-select>
3129
- <cx-typography variant="small">
3130
- ${this.localize.term(
3131
- "itCanTakeAFewMinutesForThisSettingToTakeEffect"
3132
- )}
3133
- </cx-typography>
3134
- </div>
3135
- <div class="settings-group settings__cache">
3136
- <cx-typography variant="h5">
3137
- ${this.localize.term("cache")}
3138
- </cx-typography>
3139
- <div class="settings__cache__size">
3140
- <cx-typography
3141
- variant="body3"
3142
- class="settings__cache__size__label"
3143
- >
3144
- ${this.localize.term("currentUsage")}: <cx-format-bytes .value=${this.settings.cacheUsage}></cx-format-bytes>
3145
- </cx-typography>
3146
- <cx-typography
3147
- variant="body3"
3148
- class="settings__cache__size__label"
3149
- >
3150
- ${this.localize.term("capacity")}
3151
- </cx-typography>
3152
- <cx-input
3153
- data-testid="settings__cache__size__input"
3154
- label=${this.localize.term("size")}
3155
- type="number"
3156
- no-spin-buttons
3157
- min="0"
3158
- step="any"
3159
- value=${this.cacheSize}
3160
- @keydown=${this.handleCacheSizeKeydown}
3161
- @cx-change=${this.handleCacheSizeChange}
3162
- >
3163
- <cx-typography slot="suffix" variant="body2"
3164
- >${Z}</cx-typography
3165
- >
3166
- </cx-input>
3167
- </div>
3168
- <div class="settings__cache__location">
3169
- <cx-typography
3170
- variant="body3"
3171
- class="settings__cache__location__label"
3172
- >
3173
- ${this.localize.term("location")}
3174
- </cx-typography>
3175
- <div class="settings__cache__location__value">
3176
- <cx-line-clamp
3177
- lines="1"
3178
- class="settings__cache__location__value__text"
3179
- >
3180
- <cx-typography variant="body3">
3181
- ${this.cacheLocation}
3182
- </cx-typography>
3183
- </cx-line-clamp>
3184
- <cx-space
3185
- spacing="x-small"
3186
- class="settings__cache__location__actions"
3187
- >
3188
- <cx-button
3189
- class="settings__cache__location__change-button"
3190
- outline
3191
- @click=${this.handleCacheLocationClick}
3192
- >
3193
- <cx-icon name="edit" slot="prefix"></cx-icon>
3194
- ${this.localize.term("change")}
3195
- </cx-button>
3196
- ${t}
3197
- </cx-space>
3198
- </div>
3199
- </div>
3200
-
3201
- <div class="settings__cache__buttons">
3202
- <cx-button
3203
- data-testid="settings__cache__clear-button"
3204
- @click=${this.clearCache}
3205
- >
3206
- <cx-icon name="delete" slot="prefix"></cx-icon>
3207
- ${this.localize.term("clearCache")}
3208
- </cx-button>
3209
- </div>
3210
- </div>
3211
- <div class="settings-group settings__config">
3212
- <cx-typography variant="h5">
3213
- ${this.localize.term("config")}
3214
- </cx-typography>
3215
- <div class="settings__config__buttons">
3216
- <cx-button
3217
- data-testid="settings__config__export-button"
3218
- @click=${this.exportSettings}
3219
- >
3220
- <cx-icon name="file_download" slot="prefix"></cx-icon>
3221
- ${this.localize.term("export")}
3222
- </cx-button>
3223
- <cx-button
3224
- @click=${this.importSettings}
3225
- data-testid="settings__config__import-button"
3226
- >
3227
- <cx-icon name="file_upload" slot="prefix"></cx-icon>
3228
- ${this.localize.term("import")}
3229
- </cx-button>
3230
- </div>
3231
- </div>
3232
- <div class="settings-group settings__logs">
3233
- <cx-typography variant="h5">
3234
- ${this.localize.term("logs")}
3235
- </cx-typography>
3236
- <div class="settings__logs__buttons">
3237
- <cx-button
3238
- data-testid="settings__logs__view-button"
3239
- @click=${this.viewLogs}
3240
- >
3241
- <cx-icon name="code" slot="prefix"></cx-icon>
3242
- ${this.localize.term("view")}
3243
- </cx-button>
3244
- </div>
3245
- </div>
3246
- </div>
3247
- `;
3248
- }
3249
- renderSettingsView() {
3250
- const t = () => {
3251
- this.hideSettings();
3252
- };
3253
- return n`
3254
- <div class="settings">
3255
- <form class="settings__form" @submit=${(i) => {
3256
- i.preventDefault(), this.saveSettings();
3257
- }}>
3258
- <cx-tab-group no-scroll-controls class="settings__tab-group">
3259
- <cx-tab
3260
- active
3261
- class="settings_general-tab"
3262
- slot="nav"
3263
- panel="general"
3264
- >
3265
- ${this.localize.term("general")}
3266
- </cx-tab>
3267
- <cx-tab
3268
- data-testid="settings_advanced-tab"
3269
- slot="nav"
3270
- panel="advanced"
3271
- >
3272
- ${this.localize.term("advanced")}
3273
- </cx-tab>
3274
- <cx-tab-panel name="general">
3275
- ${this.renderGeneralSettings()}
3276
- </cx-tab-panel>
3277
- <cx-tab-panel name="advanced" class="settings_advanced-tab-panel">
3278
- ${this.renderAdvancedSettings()}
3279
- </cx-tab-panel>
3280
- </cx-tab-group>
3281
- <div class="settings__footer">
3282
- <div class="settings__footer__actions">
3283
- <cx-button
3284
- data-testid="settings__cancel-button"
3285
- type="button"
3286
- @click=${t}
3287
- >
3288
- ${this.localize.term("cancel")}
3289
- </cx-button>
3290
- <cx-button
3291
- data-testid="settings__save-button"
3292
- ?disabled=${!this.formHasChanges}
3293
- type="submit"
3294
- variant="primary"
3295
- >
3296
- ${this.localize.term("save")}
3297
- </cx-button>
3298
- </div>
3299
- </div>
3300
- </form>
3301
- </div>
3302
- `;
3303
- }
3304
- // #endregion
3305
- renderStatusFooter() {
3306
- const t = n`
3307
- <cx-typography class="error-message" variant="small">
3308
- ${this.localize.term("fileOnDemandSyncErrorMessage")}
3309
- </cx-typography>
3310
- `, e = () => {
3311
- switch (this.connectionStatus) {
3312
- case "excellent":
3313
- return n`
3314
- <cx-icon variant="filled" name="check_circle"></cx-icon>
3315
- `;
3316
- case "good":
3317
- return n` <cx-icon variant="filled" name="circle"></cx-icon> `;
3318
- case "bad":
3319
- return n` <cx-icon variant="filled" name="circle"></cx-icon> `;
3320
- }
3321
- }, i = () => {
3322
- switch (this.assetIndexSyncStatus) {
3323
- case "loaded":
3324
- return n`
3325
- <cx-icon variant="filled" name="check_circle"></cx-icon>
3326
- `;
3327
- case "loading":
3328
- return n` <cx-icon variant="filled" name="cached"></cx-icon> `;
3329
- case "error":
3330
- return n` <cx-icon variant="filled" name="error"></cx-icon> `;
3331
- }
3332
- }, a = n`<div
3333
- class=${C({
3334
- "connection-status": !0,
3335
- "connection-status--bad": this.connectionStatus === "bad",
3336
- "connection-status--excellent": this.connectionStatus === "excellent",
3337
- "connection-status--good": this.connectionStatus === "good"
3338
- })}
3339
- >
3340
- <cx-typography class="label" variant="small">
3341
- ${this.localize.term("connection")}
3342
- </cx-typography>
3343
- <cx-tooltip
3344
- class="connection-status__tooltip"
3345
- content=${this.connectionStatusTooltip}
3346
- hoist
3347
- ?disabled=${!this.connectionStatusTooltip.trim()}
3348
- >
3349
- <div class="connection-status__value">
3350
- <cx-typography variant="small">
3351
- ${this.connectionStatus}
3352
- </cx-typography>
3353
- ${e()}
3354
- </div>
3355
- </cx-tooltip>
3356
- </div>`, s = this.settings.cacheUsage >= this.settings.cacheSize;
3357
- return n`
3358
- <cx-divider class="status-footer__divider"></cx-divider>
3359
- <div class="status-footer">
3360
- <div class="connected-url">
3361
- <cx-typography class="label" variant="small">
3362
- ${this.localize.term("connectedTo")}
3363
- </cx-typography>
3364
- <cx-line-clamp class="value-line-clamp" lines="1">
3365
- <cx-typography class="value" variant="small">
3366
- ${this.settings.config.siteUrl}
3367
- </cx-typography>
3368
- </cx-line-clamp>
3369
- </div>
3370
- ${a}
3371
- <div
3372
- class=${C({
3373
- "asset-index-sync-status": !0,
3374
- "asset-index-sync-status--error": this.assetIndexSyncStatus === "error",
3375
- "asset-index-sync-status--loaded": this.assetIndexSyncStatus === "loaded",
3376
- "asset-index-sync-status--loading": this.assetIndexSyncStatus === "loading"
3377
- })}
3378
- >
3379
- <cx-typography class="label" variant="small">
3380
- ${this.localize.term("assetIndexSync")}
3381
- </cx-typography>
3382
- <div class="value">
3383
- <cx-typography variant="small">
3384
- ${me[this.assetIndexSyncStatus]}
3385
- </cx-typography>
3386
- ${i()}
3387
- </div>
3388
- </div>
3389
- <div class="cache-usage">
3390
- <cx-typography class="label" variant="small">
3391
- ${this.localize.term("cache")}
3392
- </cx-typography>
3393
- <cx-tooltip ?disabled=${!s} content=${this.localize.term("cacheUsageWarning")}>
3394
- <cx-space spacing="3x-small">
3395
- <cx-line-clamp class="value-line-clamp" lines="1">
3396
- <cx-typography class="value" variant="small">
3397
- <cx-format-bytes .value=${this.settings.cacheUsage}></cx-format-bytes>
3398
- /
3399
- <cx-format-bytes .value=${this.settings.cacheSize}></cx-format-bytes>
3400
- </cx-typography>
3401
- </cx-line-clamp>
3402
- ${p(s, () => n`<cx-icon class="cache-usage__warning-icon" name="warning" variant="filled"></cx-icon>`)}
3403
- </cx-space>
3404
- </cx-tooltip>
3405
- </div>
3406
- ${p(this.assetIndexSyncStatus === "error", () => t)}
3407
- </div>
3408
- `;
3409
- }
3410
- handleConnectionURLInput(t) {
3411
- this.validConnectionUrl = !0, this.siteUrl = t.target.value.trim();
3412
- const e = ht(this.siteUrl);
3413
- K(e) || (this.validConnectionUrl = !1);
3414
- }
3415
- renderWelcomeView() {
3416
- return n`
3417
- <div class="welcome">
3418
- <div class="welcome__message">
3419
- <cx-typography variant="h5">
3420
- ${this.localize.term("welcomeToFileOnDemand")}
3421
- </cx-typography>
3422
- <cx-typography variant="body3">
3423
- ${this.localize.term("enterYourSiteUrlToConnect")}
3424
- </cx-typography>
3425
- </div>
3426
- <form class="welcome__actions" @submit=${this.connect}>
3427
- <cx-input
3428
- aria-label=${this.localize.term("connectionURLInput")}
3429
- class="welcome__input"
3430
- placeholder="Ex: https://cortex.orangelogic.com/"
3431
- value=${this.settings.config.siteUrl}
3432
- @cx-input=${this.handleConnectionURLInput}
3433
- ></cx-input>
3434
- <cx-tooltip
3435
- class="welcome__connect-button__tooltip"
3436
- ?disabled=${this.siteUrl.trim() && this.validConnectionUrl}
3437
- content=${this.siteUrl.trim() ? this.localize.term("pleaseEnterAValidUrl") : this.localize.term("connectionCannotBeEmpty")}
3438
- >
3439
- <cx-button
3440
- type="submit"
3441
- ?loading=${this.isConnecting}
3442
- variant="primary"
3443
- class=${C({
3444
- "welcome__connect-button": !0,
3445
- "welcome__connect-button--disabled": !this.siteUrl.trim() || !this.validConnectionUrl
3446
- })}
3447
- ?disabled=${!this.siteUrl.trim() || !this.validConnectionUrl}
3448
- >
3449
- ${this.localize.term("connect")}
3450
- </cx-button>
3451
- </cx-tooltip>
3452
- <cx-button
3453
- type="button"
3454
- ?loading=${this.isCancellingConnection}
3455
- variant="text"
3456
- class=${C({
3457
- "welcome__cancel-connection-button": !0
3458
- })}
3459
- ?disabled=${!this.isConnecting}
3460
- @click=${this.cancelConnection}
3461
- >
3462
- ${this.localize.term("cancel")}
3463
- </cx-button>
3464
- <cx-typography class="error-message" variant="body3">
3465
- ${p(
3466
- this.connectError,
3467
- () => this.connectError,
3468
- () => " "
3469
- )}
3470
- </cx-typography>
3471
- </form>
3472
- </div>
3473
- `;
3474
- }
3475
- renderView() {
3476
- return this.connectionEstablished ? this.isSettingsOpened ? this.renderSettingsView() : this.renderAssetsView() : this.renderWelcomeView();
3477
- }
3478
- renderLoadingOverlay() {
3479
- return n`
3480
- <div class="loading-overlay">
3481
- <cx-spinner></cx-spinner>
3482
- </div>
3483
- `;
3484
- }
3485
- render() {
3486
- return n`
3487
- <div
3488
- class=${C({
3489
- container: !0,
3490
- "container--connected": this.connectionEstablished,
3491
- "container--user-interaction-blocked": this.userInteractionBlocked
3492
- })}
3493
- >
3494
- ${this.renderView()}
3495
- ${p(this.userInteractionBlocked, () => this.renderLoadingOverlay())}
3496
- </div>
3497
- `;
3498
- }
3499
- // #endregion
3500
- };
3501
- r.styles = Ze;
3502
- r.dependencies = {
3503
- "cx-avatar": Mt,
3504
- "cx-button": Vt,
3505
- "cx-confirm-popover": Qt,
3506
- "cx-dialog": Ht,
3507
- "cx-divider": Wt,
3508
- "cx-file-on-demand-asset": L,
3509
- "cx-folder-tree": b,
3510
- "cx-format-bytes": ot,
3511
- "cx-icon": J,
3512
- "cx-icon-button": Ct,
3513
- "cx-input": qt,
3514
- "cx-line-clamp": Q,
3515
- "cx-option": Gt,
3516
- "cx-relative-time": At,
3517
- "cx-select": Yt,
3518
- "cx-space": Kt,
3519
- "cx-tab": Xt,
3520
- "cx-tab-group": Zt,
3521
- "cx-tab-panel": Jt,
3522
- "cx-tooltip": Dt,
3523
- "cx-tree": $t,
3524
- "cx-tree-item": yt,
3525
- "cx-typography": nt
3526
- };
3527
- l([
3528
- z(".container")
3529
- ], r.prototype, "container", 2);
3530
- l([
3531
- z("cx-folder-tree")
3532
- ], r.prototype, "folderTree", 2);
3533
- l([
3534
- z("cx-dialog")
3535
- ], r.prototype, "dialog", 2);
3536
- l([
3537
- z(".recent__list")
3538
- ], r.prototype, "recentAssetsList", 2);
3539
- l([
3540
- z(".favorites__list")
3541
- ], r.prototype, "favoritesAssetsList", 2);
3542
- l([
3543
- z(".uploads__list")
3544
- ], r.prototype, "uploadsAssetsList", 2);
3545
- l([
3546
- z(".pinned__list")
3547
- ], r.prototype, "pinnedAssetsList", 2);
3548
- l([
3549
- z(".assets-list__tab-group")
3550
- ], r.prototype, "assetsListTabGroup", 2);
3551
- l([
3552
- z(".settings__cache__location__value__text")
3553
- ], r.prototype, "cacheLocationValueText", 2);
3554
- l([
3555
- d({
3556
- attribute: "connection-established",
3557
- type: Boolean
3558
- })
3559
- ], r.prototype, "connectionEstablished", 2);
3560
- l([
3561
- d({
3562
- attribute: "connection-status",
3563
- reflect: !0,
3564
- type: String
3565
- })
3566
- ], r.prototype, "connectionStatus", 2);
3567
- l([
3568
- d({
3569
- attribute: "connection-status-tooltip",
3570
- type: String
3571
- })
3572
- ], r.prototype, "connectionStatusTooltip", 2);
3573
- l([
3574
- d({
3575
- attribute: "asset-index-sync-status",
3576
- reflect: !0,
3577
- type: String
3578
- })
3579
- ], r.prototype, "assetIndexSyncStatus", 2);
3580
- l([
3581
- d({
3582
- attribute: "user-avatar-url",
3583
- type: String
3584
- })
3585
- ], r.prototype, "userAvatarUrl", 2);
3586
- l([
3587
- d({
3588
- type: String
3589
- })
3590
- ], r.prototype, "username", 2);
3591
- l([
3592
- d({
3593
- attribute: "recent-assets",
3594
- type: Object
3595
- })
3596
- ], r.prototype, "recentAssets", 2);
3597
- l([
3598
- d({
3599
- attribute: "favorite-assets",
3600
- type: Object
3601
- })
3602
- ], r.prototype, "favoriteAssets", 2);
3603
- l([
3604
- d({
3605
- attribute: "favorite-last-sync",
3606
- type: Number
3607
- })
3608
- ], r.prototype, "favoritesLastSync", 2);
3609
- l([
3610
- d({
3611
- attribute: "favorite-in-progress-assets",
3612
- converter: {
3613
- fromAttribute: (t) => t.split(" ").filter(Boolean),
3614
- toAttribute: (t) => t.join(" ")
3615
- },
3616
- type: String
3617
- })
3618
- ], r.prototype, "favoriteInProgressAssets", 2);
3619
- l([
3620
- d({
3621
- attribute: "pin-in-progress-assets",
3622
- converter: {
3623
- fromAttribute: (t) => t.split(" ").filter(Boolean),
3624
- toAttribute: (t) => t.join(" ")
3625
- },
3626
- type: String
3627
- })
3628
- ], r.prototype, "pinInProgressAssets", 2);
3629
- l([
3630
- d({
3631
- attribute: "uploading-assets",
3632
- type: Object
3633
- })
3634
- ], r.prototype, "uploadingAssets", 2);
3635
- l([
3636
- d({
3637
- attribute: "pinned-assets",
3638
- type: Object
3639
- })
3640
- ], r.prototype, "pinnedAssets", 2);
3641
- l([
3642
- u()
3643
- ], r.prototype, "availableFolderIdentifiers", 2);
3644
- l([
3645
- u()
3646
- ], r.prototype, "isLoading", 2);
3647
- l([
3648
- d({
3649
- attribute: "settings",
3650
- type: Object
3651
- })
3652
- ], r.prototype, "settings", 2);
3653
- l([
3654
- d({ attribute: "pick-cache-location", type: Function })
3655
- ], r.prototype, "pickCacheLocation", 2);
3656
- l([
3657
- d({
3658
- attribute: "has-new-version",
3659
- type: Boolean
3660
- })
3661
- ], r.prototype, "hasNewVersion", 2);
3662
- l([
3663
- d({
3664
- attribute: "about-content",
3665
- type: String
3666
- })
3667
- ], r.prototype, "aboutContent", 2);
3668
- l([
3669
- d({ type: String })
3670
- ], r.prototype, "token", 2);
3671
- l([
3672
- d({
3673
- attribute: "user-interaction-blocked",
3674
- type: Boolean
3675
- })
3676
- ], r.prototype, "userInteractionBlocked", 2);
3677
- l([
3678
- d({
3679
- attribute: "is-connecting",
3680
- type: Boolean
3681
- })
3682
- ], r.prototype, "isConnecting", 2);
3683
- l([
3684
- d({
3685
- attribute: "is-cancelling-connection",
3686
- type: Boolean
3687
- })
3688
- ], r.prototype, "isCancellingConnection", 2);
3689
- l([
3690
- d({
3691
- attribute: "is-disconnecting",
3692
- type: Boolean
3693
- })
3694
- ], r.prototype, "isDisconnecting", 2);
3695
- l([
3696
- d({
3697
- attribute: "is-upgrading",
3698
- type: Boolean
3699
- })
3700
- ], r.prototype, "isUpgrading", 2);
3701
- l([
3702
- u()
3703
- ], r.prototype, "isSettingsOpened", 2);
3704
- l([
3705
- u()
3706
- ], r.prototype, "rootIDs", 2);
3707
- l([
3708
- u()
3709
- ], r.prototype, "_activeFoldersMode", 2);
3710
- l([
3711
- u()
3712
- ], r.prototype, "removedIds", 2);
3713
- l([
3714
- u()
3715
- ], r.prototype, "cacheSize", 2);
3716
- l([
3717
- u()
3718
- ], r.prototype, "cacheLocation", 2);
3719
- l([
3720
- u()
3721
- ], r.prototype, "proxyTypes", 2);
3722
- l([
3723
- u()
3724
- ], r.prototype, "siteUrl", 2);
3725
- l([
3726
- u()
3727
- ], r.prototype, "isRecentAssetsLoading", 2);
3728
- l([
3729
- u()
3730
- ], r.prototype, "isFavoriteAssetsLoading", 2);
3731
- l([
3732
- u()
3733
- ], r.prototype, "isUploadingAssetsLoading", 2);
3734
- l([
3735
- u()
3736
- ], r.prototype, "isPinnedAssetsLoading", 2);
3737
- l([
3738
- u()
3739
- ], r.prototype, "connectError", 2);
3740
- l([
3741
- u()
3742
- ], r.prototype, "disconnectError", 2);
3743
- l([
3744
- u()
3745
- ], r.prototype, "upgradeError", 2);
3746
- l([
3747
- u()
3748
- ], r.prototype, "totalCount", 2);
3749
- l([
3750
- u()
3751
- ], r.prototype, "folderPathsSet", 2);
3752
- l([
3753
- u()
3754
- ], r.prototype, "validConnectionUrl", 2);
3755
- l([
3756
- u()
3757
- ], r.prototype, "isAddingRootIDs", 2);
3758
- l([
3759
- P(["connectionEstablished", "token"])
3760
- ], r.prototype, "fetchData", 1);
3761
- l([
3762
- P(["connectionEstablished"])
3763
- ], r.prototype, "showRecentTab", 1);
3764
- l([
3765
- P("settings")
3766
- ], r.prototype, "updateSettingsStates", 1);
3767
- l([
3768
- P("recentAssets")
3769
- ], r.prototype, "onRecentAssetsChanged", 1);
3770
- l([
3771
- P("pinnedAssets")
3772
- ], r.prototype, "onPinnedAssetsChanged", 1);
3773
- l([
3774
- P("favoriteAssets")
3775
- ], r.prototype, "onFavoriteAssetsChanged", 1);
3776
- l([
3777
- P("uploadingAssets")
3778
- ], r.prototype, "onUploadingAssetsChanged", 1);
3779
- l([
3780
- u()
3781
- ], r.prototype, "searchText", 2);
3782
- l([
3783
- P(["searchText"]),
3784
- te(200)
3785
- ], r.prototype, "onSearch", 1);
3786
- l([
3787
- P("cacheLocation")
3788
- ], r.prototype, "handleCacheLocationChange", 1);
3789
- r = l([
3790
- W("cx-file-on-demand")
3791
- ], r);
3792
- export {
3793
- r as C,
3794
- Ve as a,
3795
- Ne as b,
3796
- Be as c,
3797
- ft as d,
3798
- He as e,
3799
- We as i,
3800
- ze as o,
3801
- Oe as s
3802
- };