@edifice.io/client 2.6.10-develop-b2school.20261021144055 → 2.6.10-develop-integration.20261021201242

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var P = Object.defineProperty;
2
2
  var I = (n, e, t) => e in n ? P(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var u = (n, e, t) => I(n, typeof e != "symbol" ? e + "" : e, t);
3
+ var a = (n, e, t) => I(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import axios from "axios";
5
5
  import { MimeTypeUtils } from "@edifice.io/utilities";
6
6
  import { UAParser } from "ua-parser-js";
@@ -100,8 +100,8 @@ const ERROR_CODE = {
100
100
  // TODO compléter
101
101
  }, C = class C {
102
102
  constructor(e) {
103
- u(this, "name");
104
- u(this, "listeners", /* @__PURE__ */ new Set());
103
+ a(this, "name");
104
+ a(this, "listeners", /* @__PURE__ */ new Set());
105
105
  this.name = e;
106
106
  }
107
107
  /**
@@ -139,11 +139,11 @@ const ERROR_CODE = {
139
139
  this.listeners.clear(), C.channels.delete(this.name);
140
140
  }
141
141
  };
142
- u(C, "channels", /* @__PURE__ */ new Map());
142
+ a(C, "channels", /* @__PURE__ */ new Map());
143
143
  let SimpleChannel = C;
144
144
  class Subscription {
145
145
  constructor(e, t) {
146
- u(this, "revoke");
146
+ a(this, "revoke");
147
147
  this._channel = e, this.revoke = this.setReceiver((s) => t == null ? void 0 : t(s));
148
148
  }
149
149
  setReceiver(e) {
@@ -160,7 +160,7 @@ class Subject {
160
160
  /* We maintain channels for sending messages.
161
161
  * Receiving channels are instantiated per subscription.
162
162
  */
163
- u(this, "publishChannels", /* @__PURE__ */ new Map());
163
+ a(this, "publishChannels", /* @__PURE__ */ new Map());
164
164
  }
165
165
  getChannelName(e) {
166
166
  return "Subject:" + e;
@@ -195,9 +195,9 @@ const ASYNC_DATA_NAME = {
195
195
  class Promisified {
196
196
  constructor() {
197
197
  //-------------------------------------
198
- u(this, "_resolution");
199
- u(this, "_rejection");
200
- u(this, "_promise", new Promise((e, t) => {
198
+ a(this, "_resolution");
199
+ a(this, "_rejection");
200
+ a(this, "_promise", new Promise((e, t) => {
201
201
  this._resolution = e, this._rejection = t;
202
202
  }));
203
203
  }
@@ -214,8 +214,8 @@ class Promisified {
214
214
  class NotifyFramework {
215
215
  constructor() {
216
216
  //-------------------------------------
217
- u(this, "promises", {});
218
- u(this, "subject", new Subject());
217
+ a(this, "promises", {});
218
+ a(this, "subject", new Subject());
219
219
  }
220
220
  asyncData(e) {
221
221
  return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
@@ -246,8 +246,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
246
246
  class Http {
247
247
  constructor(e) {
248
248
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
249
- u(this, "axios");
250
- u(this, "_latestResponse");
249
+ a(this, "axios");
250
+ a(this, "_latestResponse");
251
251
  this.axios = axios.create(e);
252
252
  }
253
253
  setCdn(e) {
@@ -327,8 +327,8 @@ class Http {
327
327
  const r = s ?? "exports", i = this.toAxiosConfig(t);
328
328
  return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
329
329
  try {
330
- const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
331
- return Function(a)();
330
+ const u = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
331
+ return Function(u)();
332
332
  } catch {
333
333
  return o;
334
334
  }
@@ -344,7 +344,7 @@ class Http {
344
344
  }
345
345
  class TransportFramework {
346
346
  constructor() {
347
- u(this, "_http", new Http());
347
+ a(this, "_http", new Http());
348
348
  }
349
349
  get http() {
350
350
  return this._http;
@@ -363,11 +363,11 @@ class ConfigurationFrameworkFactory {
363
363
  const http$2 = transport.http;
364
364
  class Session {
365
365
  constructor() {
366
- u(this, "_me", null);
367
- u(this, "_currentLanguage", "");
368
- u(this, "_notLoggedIn", !0);
369
- u(this, "_description");
370
- u(this, "_profile");
366
+ a(this, "_me", null);
367
+ a(this, "_currentLanguage", "");
368
+ a(this, "_notLoggedIn", !0);
369
+ a(this, "_description");
370
+ a(this, "_profile");
371
371
  }
372
372
  get currentLanguage() {
373
373
  return this._currentLanguage;
@@ -412,7 +412,7 @@ class Session {
412
412
  hasRight(e, t) {
413
413
  if (t === "owner")
414
414
  return e.owner && e.owner.userId === this._me.userId;
415
- const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, o = t.workflow ? this.hasWorkflow(t.workflow) : !0;
415
+ const s = t.right || t, i = e.shared.filter((u) => (this._me.groupsIds || []).indexOf(u.groupId) !== -1 || u.userId === this._me.userId).find((u) => u[s] || u.manager) !== void 0, o = t.workflow ? this.hasWorkflow(t.workflow) : !0;
416
416
  return i && o;
417
417
  }
418
418
  ////////////////////////////////////////////////////////// Storage management
@@ -485,7 +485,7 @@ class Session {
485
485
  }
486
486
  class SessionFramework {
487
487
  constructor() {
488
- u(this, "session", new Session());
488
+ a(this, "session", new Session());
489
489
  }
490
490
  initialize() {
491
491
  return this.session.initialize();
@@ -509,22 +509,22 @@ class SessionFramework {
509
509
  const session = new SessionFramework();
510
510
  class Theme {
511
511
  constructor() {
512
- u(this, "_conf");
513
- u(this, "_loaded");
512
+ a(this, "_conf");
513
+ a(this, "_loaded");
514
514
  // legacy (readonly)
515
- u(this, "skinName", "");
516
- u(this, "themeName", "");
517
- u(this, "skin", "raw");
518
- u(this, "themeUrl", "/assets/themes/raw/default/");
519
- u(this, "templateOverrides", {});
520
- u(this, "portalTemplate", "/assets/themes/raw/portal.html");
521
- u(this, "basePath", "");
522
- u(this, "logoutCallback", "");
523
- u(this, "skins", []);
524
- u(this, "is1D", !1);
525
- u(this, "is2D", !1);
526
- u(this, "_onSkinReady", notify.onSkinReady());
527
- u(this, "_onOverrideReady", notify.onOverridesReady());
515
+ a(this, "skinName", "");
516
+ a(this, "themeName", "");
517
+ a(this, "skin", "raw");
518
+ a(this, "themeUrl", "/assets/themes/raw/default/");
519
+ a(this, "templateOverrides", {});
520
+ a(this, "portalTemplate", "/assets/themes/raw/portal.html");
521
+ a(this, "basePath", "");
522
+ a(this, "logoutCallback", "");
523
+ a(this, "skins", []);
524
+ a(this, "is1D", !1);
525
+ a(this, "is2D", !1);
526
+ a(this, "_onSkinReady", notify.onSkinReady());
527
+ a(this, "_onOverrideReady", notify.onOverridesReady());
528
528
  }
529
529
  initialize(e) {
530
530
  return notify.onSessionReady().promise.then(() => this.load(e));
@@ -858,9 +858,9 @@ class Idiom {
858
858
  const i = new Promisified();
859
859
  promises$1[t] = i.promise;
860
860
  const o = {};
861
- e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((a) => {
862
- Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
863
- }).catch((a) => {
861
+ e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((u) => {
862
+ Object.assign(bundle$1, u), typeof s == "function" && s(), i.resolve();
863
+ }).catch((u) => {
864
864
  typeof s == "function" && s(), i.reject();
865
865
  });
866
866
  }
@@ -896,7 +896,7 @@ class Idiom {
896
896
  class UserPreferences {
897
897
  constructor() {
898
898
  //-------------------------------------
899
- u(this, "data", {});
899
+ a(this, "data", {});
900
900
  }
901
901
  get(e) {
902
902
  return this.data[e];
@@ -923,10 +923,10 @@ class UserPreferences {
923
923
  class User {
924
924
  constructor() {
925
925
  //-------------------------------------
926
- u(this, "_me", null);
927
- u(this, "_keepOpenOnLogout", !1);
928
- u(this, "_preferences", new UserPreferences());
929
- u(this, "_bookmarkedApps", []);
926
+ a(this, "_me", null);
927
+ a(this, "_keepOpenOnLogout", !1);
928
+ a(this, "_preferences", new UserPreferences());
929
+ a(this, "_bookmarkedApps", []);
930
930
  }
931
931
  get keepOpenOnLogout() {
932
932
  return this._keepOpenOnLogout;
@@ -970,7 +970,7 @@ class User {
970
970
  });
971
971
  let r = !0;
972
972
  const i = [];
973
- s.bookmarks.forEach((o, a) => {
973
+ s.bookmarks.forEach((o, u) => {
974
974
  const c = this._me.apps.find((l) => l.name === o);
975
975
  if (c) {
976
976
  const l = Object.assign({}, c);
@@ -978,8 +978,8 @@ class User {
978
978
  } else
979
979
  i.push(o), r = !1;
980
980
  }), i.forEach((o) => {
981
- const a = s.bookmarks.indexOf(o);
982
- a !== -1 && s.bookmarks.splice(a, 1);
981
+ const u = s.bookmarks.indexOf(o);
982
+ u !== -1 && s.bookmarks.splice(u, 1);
983
983
  }), r || transport.http.putJson("/userbook/preference/apps", s);
984
984
  });
985
985
  }
@@ -1000,9 +1000,9 @@ const http$1 = transport == null ? void 0 : transport.http;
1000
1000
  class AppConf {
1001
1001
  constructor() {
1002
1002
  //-------------------------------------
1003
- u(this, "_publicConf", {});
1004
- u(this, "_currentApp");
1005
- u(this, "_appConf", {});
1003
+ a(this, "_publicConf", {});
1004
+ a(this, "_currentApp");
1005
+ a(this, "_appConf", {});
1006
1006
  }
1007
1007
  /**
1008
1008
  * Get the currently initialized App.
@@ -1040,8 +1040,8 @@ class AppConf {
1040
1040
  class Analytics {
1041
1041
  constructor() {
1042
1042
  //-------------------------------------
1043
- u(this, "_status", "void");
1044
- u(this, "_params");
1043
+ a(this, "_status", "void");
1044
+ a(this, "_params");
1045
1045
  }
1046
1046
  get status() {
1047
1047
  return this._status;
@@ -1082,9 +1082,9 @@ class Analytics {
1082
1082
  const t = await notify.onSessionReady().promise, s = session.session.description;
1083
1083
  let r;
1084
1084
  for (const l of t.structures) {
1085
- const h = e.structureMap[l];
1086
- if (h && h.collectiviteId && h.UAI) {
1087
- r = h;
1085
+ const p = e.structureMap[l];
1086
+ if (p && p.collectiviteId && p.UAI) {
1087
+ r = p;
1088
1088
  break;
1089
1089
  }
1090
1090
  }
@@ -1095,11 +1095,11 @@ class Analytics {
1095
1095
  if (!i) return;
1096
1096
  const o = i.xiti;
1097
1097
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
1098
- function a(l) {
1099
- let h = "";
1100
- for (let E = 0; E < l.length; E++)
1101
- h += l.charCodeAt(E);
1102
- return h;
1098
+ function u(l) {
1099
+ let p = "";
1100
+ for (let d = 0; d < l.length; d++)
1101
+ p += l.charCodeAt(d);
1102
+ return p;
1103
1103
  }
1104
1104
  const c = {
1105
1105
  Student: "ELEVE",
@@ -1118,7 +1118,7 @@ class Analytics {
1118
1118
  PROJET: r.projetId ? r.projetId : e.ID_PROJET,
1119
1119
  EXPLOITANT: e.ID_EXPLOITANT,
1120
1120
  PLATFORME: r.plateformeId ? r.plateformeId : e.ID_PLATEFORME,
1121
- ID_PERSO: a(t.userId),
1121
+ ID_PERSO: u(t.userId),
1122
1122
  PROFILE: s.profiles && s.profiles.length > 0 ? c[s.profiles[0]] ?? "" : ""
1123
1123
  };
1124
1124
  }
@@ -1146,12 +1146,12 @@ function detectDevice() {
1146
1146
  if (typeof window > "u")
1147
1147
  return { osName: "", osVersion: "", deviceType: "", deviceName: "" };
1148
1148
  const n = UAParser(), e = isPad(), t = n.device.vendor || "", s = n.device.model || "", r = t && s ? `${t} ${s}` : s || t || "Unknown";
1149
- let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), a = r;
1150
- return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", a = "iPad"), {
1149
+ let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), u = r;
1150
+ return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", u = "iPad"), {
1151
1151
  osName: i,
1152
1152
  osVersion: n.os.version || "Unknown",
1153
1153
  deviceType: o,
1154
- deviceName: a
1154
+ deviceName: u
1155
1155
  };
1156
1156
  }
1157
1157
  function readDeviceCookies() {
@@ -1177,7 +1177,7 @@ function setDeviceCookies() {
1177
1177
  class ConfigurationFramework {
1178
1178
  constructor() {
1179
1179
  //-------------------------------------
1180
- u(this, "Platform", {
1180
+ a(this, "Platform", {
1181
1181
  deploymentTag: "",
1182
1182
  cdnDomain: "",
1183
1183
  apps: new AppConf(),
@@ -1186,16 +1186,16 @@ class ConfigurationFramework {
1186
1186
  idiom: new Idiom(),
1187
1187
  listLanguages: () => transport.http.get("/languages")
1188
1188
  });
1189
- u(this, "School", {
1189
+ a(this, "School", {
1190
1190
  //apps; -> pinnedApps;
1191
1191
  });
1192
- u(this, "User", new User());
1192
+ a(this, "User", new User());
1193
1193
  setDeviceCookies();
1194
1194
  }
1195
1195
  async initialize(e, t) {
1196
1196
  if (!e) {
1197
- const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1198
- e = `${o}${r(a)}${r(c)}`;
1197
+ const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), u = i.getMonth() + 1, c = i.getDate();
1198
+ e = `${o}${r(u)}${r(c)}`;
1199
1199
  }
1200
1200
  const s = e;
1201
1201
  this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
@@ -1233,12 +1233,12 @@ class ConfigurationFramework {
1233
1233
  // }
1234
1234
  }
1235
1235
  const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
1236
- var _;
1237
- const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
1236
+ var D;
1237
+ const me = (D = session == null ? void 0 : session.session) == null ? void 0 : D.user;
1238
1238
  class Notification {
1239
1239
  constructor(e) {
1240
- u(this, "_id");
1241
- u(this, "model");
1240
+ a(this, "_id");
1241
+ a(this, "model");
1242
1242
  e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
1243
1243
  }
1244
1244
  isUnread() {
@@ -1258,14 +1258,14 @@ class Notification {
1258
1258
  class TimelineApp {
1259
1259
  constructor() {
1260
1260
  //-------------------------------------
1261
- u(this, "_notifications", []);
1262
- u(this, "_notificationTypes", []);
1261
+ a(this, "_notifications", []);
1262
+ a(this, "_notificationTypes", []);
1263
1263
  // ex: ["BLOG"]
1264
- u(this, "_flashMessages", []);
1265
- u(this, "_pageNumber", 0);
1266
- u(this, "_lastPage", !1);
1267
- u(this, "_loading", !1);
1268
- u(this, "showMine", !1);
1264
+ a(this, "_flashMessages", []);
1265
+ a(this, "_pageNumber", 0);
1266
+ a(this, "_lastPage", !1);
1267
+ a(this, "_loading", !1);
1268
+ a(this, "showMine", !1);
1269
1269
  }
1270
1270
  get notifications() {
1271
1271
  return this._notifications;
@@ -1324,7 +1324,7 @@ class TimelineApp {
1324
1324
  if (r.number && r.results) {
1325
1325
  const i = r.results.filter(
1326
1326
  (o) => this._notifications.findIndex(
1327
- (a) => a._id === o._id
1327
+ (u) => u._id === o._id
1328
1328
  ) === -1
1329
1329
  ).map((o) => new Notification(o));
1330
1330
  this._notifications = this._notifications.concat(i), this._pageNumber++;
@@ -1355,7 +1355,126 @@ const ReactionTypes = [
1355
1355
  "REACTION_2",
1356
1356
  "REACTION_3",
1357
1357
  "REACTION_4"
1358
+ ], GOOGLE_DRIVE_FOLDER_MIME_TYPE = "application/vnd.google-apps.folder", GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX = "application/vnd.google-apps.", GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES = [
1359
+ "application/vnd.google-apps.document",
1360
+ "application/vnd.google-apps.spreadsheet",
1361
+ "application/vnd.google-apps.presentation"
1358
1362
  ];
1363
+ function toGoogleDriveDocument(n) {
1364
+ const e = n.mimeType === GOOGLE_DRIVE_FOLDER_MIME_TYPE;
1365
+ return {
1366
+ id: n.id,
1367
+ name: n.name,
1368
+ ownerDisplayName: n.ownerDisplayName,
1369
+ contentType: n.mimeType,
1370
+ size: n.size,
1371
+ isFolder: e,
1372
+ canCopyToWorkspace: e || !n.mimeType.startsWith(GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX) || GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES.includes(n.mimeType),
1373
+ lastModified: n.modifiedTime,
1374
+ shared: n.shared
1375
+ };
1376
+ }
1377
+ class GoogleDriveCopyError extends Error {
1378
+ constructor(e, t, s) {
1379
+ super(e), this.copied = t, this.failures = s, this.name = "GoogleDriveCopyError";
1380
+ }
1381
+ }
1382
+ class GoogleDriveService {
1383
+ constructor(e) {
1384
+ this.context = e;
1385
+ }
1386
+ get http() {
1387
+ return this.context.http();
1388
+ }
1389
+ /**
1390
+ * List a user's Google Drive documents and folders inside a given folder.
1391
+ *
1392
+ * Google Drive addresses its entries by opaque id, not by path: `parentId` is
1393
+ * the id of the folder to list. The query param is nonetheless named `path`,
1394
+ * as the backend kept the name it uses for Nextcloud.
1395
+ *
1396
+ * @param userId - the id of the user whose files are listed.
1397
+ * @param parentId - id of the folder to list; the Drive root when omitted.
1398
+ */
1399
+ async listDocuments(e, t) {
1400
+ return (await this.http.get(
1401
+ `/googledrive/files/user/${e}`,
1402
+ { queryParams: t ? { path: t } : void 0 }
1403
+ )).data.map(toGoogleDriveDocument);
1404
+ }
1405
+ /**
1406
+ * List the documents and folders other users shared with a user. Browse the
1407
+ * content of a shared folder with `listDocuments`, from the folder's id.
1408
+ *
1409
+ * As in the legacy workspace, only a document shared for editing can be
1410
+ * copied to the workspace: an owner can forbid readers and commenters to
1411
+ * download a file (copyRequiresWriterPermission), which fails the copy.
1412
+ *
1413
+ * @param userId - the id of the user the documents are shared with.
1414
+ */
1415
+ async listSharedDocuments(e) {
1416
+ return (await this.http.get(`/googledrive/files/user/${e}/shared`)).data.map(({ owners: s, role: r, ...i }) => {
1417
+ var u;
1418
+ const o = toGoogleDriveDocument({
1419
+ ...i,
1420
+ ownerDisplayName: (u = s == null ? void 0 : s[0]) == null ? void 0 : u.displayName
1421
+ });
1422
+ return {
1423
+ ...o,
1424
+ canCopyToWorkspace: o.canCopyToWorkspace && r === "writer"
1425
+ };
1426
+ });
1427
+ }
1428
+ /**
1429
+ * Copy Google Drive documents into the entcore workspace.
1430
+ *
1431
+ * @param userId - the id of the user whose files are copied.
1432
+ * @param ids - Drive ids of the documents to copy.
1433
+ * @param parentId - the workspace folder to copy into; user's root when omitted.
1434
+ * @param params.application - the application the documents are added from.
1435
+ * @param params.visibility - "protected" files the documents under the
1436
+ * documents added from applications, the way an upload does.
1437
+ * @throws GoogleDriveCopyError when the backend reports at least one failure.
1438
+ */
1439
+ async copyDocumentToWorkspace(e, t, s, r) {
1440
+ const i = t.map((d) => `id=${encodeURIComponent(d)}`).join("&"), u = (await this.http.put(
1441
+ `/googledrive/files/user/${e}/copy/workspace?${i}`,
1442
+ void 0,
1443
+ {
1444
+ queryParams: {
1445
+ ...s ? { parentId: s } : {},
1446
+ ...r != null && r.application ? { application: r.application } : {},
1447
+ ...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
1448
+ }
1449
+ }
1450
+ )).data ?? [], c = u.map((d) => d.workspace).filter((d) => !!(d != null && d._id)), l = new Set(u.map((d) => d.id)), p = [
1451
+ ...u.filter((d) => {
1452
+ var h;
1453
+ return d.status === "error" || !((h = d.workspace) != null && h._id);
1454
+ }).map(({ id: d, message: h }) => ({ id: d, message: h })),
1455
+ ...t.filter((d) => !l.has(d)).map((d) => ({ id: d, message: void 0 }))
1456
+ ];
1457
+ if (p.length > 0)
1458
+ throw new GoogleDriveCopyError(
1459
+ `Failed to copy ${p.length} of ${t.length} Google Drive document(s) to the workspace`,
1460
+ c,
1461
+ p
1462
+ );
1463
+ return c;
1464
+ }
1465
+ /**
1466
+ * Build the URL to download/preview a Google Drive document.
1467
+ * There is no dedicated thumbnail endpoint on the backend, so this is also
1468
+ * used as an image preview source for image documents.
1469
+ * @param userId - the id of the user who owns the file.
1470
+ * @param doc - the document to build the URL for.
1471
+ */
1472
+ getFileUrl(e, t) {
1473
+ return `/googledrive/files/user/${e}/file/${encodeURIComponent(
1474
+ t.id
1475
+ )}/download?isFolder=${t.isFolder}`;
1476
+ }
1477
+ }
1359
1478
  class NotifyFrameworkFactory {
1360
1479
  static instance() {
1361
1480
  return notify;
@@ -1414,7 +1533,7 @@ const m = class m {
1414
1533
  //
1415
1534
  // PROTECTED HELPERS
1416
1535
  //
1417
- u(this, "checkHttpResponse", (e) => {
1536
+ a(this, "checkHttpResponse", (e) => {
1418
1537
  if (this.http.latestResponse.status >= 300)
1419
1538
  throw this.http.latestResponse.statusText;
1420
1539
  return e;
@@ -1632,22 +1751,22 @@ const m = class m {
1632
1751
  //
1633
1752
  // STATIC REGISTRY
1634
1753
  //
1635
- u(m, "registry", new ServiceRegistry()), // Expose some useful functions
1636
- u(m, "register", m.registry.register.bind(m.registry)), u(m, "findService", m.registry.findService.bind(m.registry)), u(m, "findMainService", m.registry.findMainService.bind(m.registry)), u(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
1754
+ a(m, "registry", new ServiceRegistry()), // Expose some useful functions
1755
+ a(m, "register", m.registry.register.bind(m.registry)), a(m, "findService", m.registry.findService.bind(m.registry)), a(m, "findMainService", m.registry.findMainService.bind(m.registry)), a(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
1637
1756
  let ResourceService = m;
1638
1757
  const APP$3 = "collaborativeeditor", RESOURCE$3 = "collaborativeeditor";
1639
1758
  class CollaborativeEditorResourceService extends ResourceService {
1640
1759
  async create(e) {
1641
- const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", a = await this.http.post("/collaborativeeditor", {
1760
+ const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", u = await this.http.post("/collaborativeeditor", {
1642
1761
  name: t,
1643
1762
  description: s,
1644
1763
  thumbnail: o,
1645
1764
  folder: i
1646
1765
  });
1647
- return this.checkHttpResponse(a), a;
1766
+ return this.checkHttpResponse(u), u;
1648
1767
  }
1649
1768
  async update(e) {
1650
- const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), a = await this.http.put(
1769
+ const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), u = await this.http.put(
1651
1770
  `/collaborativeeditor/${i}`,
1652
1771
  {
1653
1772
  name: t,
@@ -1655,7 +1774,7 @@ class CollaborativeEditorResourceService extends ResourceService {
1655
1774
  thumbnail: o
1656
1775
  }
1657
1776
  );
1658
- return this.checkHttpResponse(a), { thumbnail: o, entId: i };
1777
+ return this.checkHttpResponse(u), { thumbnail: o, entId: i };
1659
1778
  }
1660
1779
  getResourceType() {
1661
1780
  return RESOURCE$3;
@@ -1910,9 +2029,9 @@ class AnalyticsService {
1910
2029
  let r;
1911
2030
  if (!(t != null && t.structures)) return;
1912
2031
  for (const l of t.structures) {
1913
- const h = n.structureMap[l];
1914
- if (h && h.collectiviteId && h.UAI) {
1915
- r = h;
2032
+ const p = n.structureMap[l];
2033
+ if (p && p.collectiviteId && p.UAI) {
2034
+ r = p;
1916
2035
  break;
1917
2036
  }
1918
2037
  }
@@ -1921,11 +2040,11 @@ class AnalyticsService {
1921
2040
  if (!i) return;
1922
2041
  const o = i.xiti;
1923
2042
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
1924
- function a(l) {
1925
- let h = "";
1926
- for (let E = 0; E < l.length; E++)
1927
- h += l.charCodeAt(E);
1928
- return h;
2043
+ function u(l) {
2044
+ let p = "";
2045
+ for (let d = 0; d < l.length; d++)
2046
+ p += l.charCodeAt(d);
2047
+ return p;
1929
2048
  }
1930
2049
  const c = {
1931
2050
  Student: "ELEVE",
@@ -1944,7 +2063,7 @@ class AnalyticsService {
1944
2063
  PROJET: r.projetId ? r.projetId : n.ID_PROJET,
1945
2064
  EXPLOITANT: n.ID_EXPLOITANT,
1946
2065
  PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
1947
- ID_PERSO: a(t.userId),
2066
+ ID_PERSO: u(t.userId),
1948
2067
  PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
1949
2068
  };
1950
2069
  }
@@ -2179,25 +2298,25 @@ class ConfService {
2179
2298
  conf: t,
2180
2299
  publicTheme: s
2181
2300
  }) {
2182
- var E;
2183
- const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
2184
- (p) => (
2301
+ var d;
2302
+ const r = await this.http.get("/theme"), i = (d = t == null ? void 0 : t.overriding) == null ? void 0 : d.find(
2303
+ (h) => (
2185
2304
  // Fix #WB2-2660:
2186
2305
  // If Public access => get the neo theme
2187
2306
  // Else get the theme from the user preference
2188
- s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
2307
+ s ? h.parent === "theme-open-ent" && h.bootstrapVersion === "ode-bootstrap-neo" : h.child === (r == null ? void 0 : r.themeName)
2189
2308
  )
2190
- ), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), a = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, l = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], h = (i == null ? void 0 : i.parent) === "panda";
2309
+ ), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), u = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, l = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], p = (i == null ? void 0 : i.parent) === "panda";
2191
2310
  return {
2192
- basePath: `${this.cdnDomain}${a}../../`,
2311
+ basePath: `${this.cdnDomain}${u}../../`,
2193
2312
  bootstrapVersion: l,
2194
- is1d: h,
2313
+ is1d: p,
2195
2314
  logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
2196
2315
  skin: i == null ? void 0 : i.child,
2197
2316
  skinName: o,
2198
2317
  skins: c,
2199
2318
  themeName: i == null ? void 0 : i.child,
2200
- themeUrl: a,
2319
+ themeUrl: u,
2201
2320
  npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
2202
2321
  uiOverrides: i == null ? void 0 : i.uiOverrides
2203
2322
  };
@@ -2214,7 +2333,7 @@ class ConfService {
2214
2333
  const SEND_ALL = "*";
2215
2334
  class WebBroker {
2216
2335
  constructor(e) {
2217
- u(this, "subscription");
2336
+ a(this, "subscription");
2218
2337
  this.odeServices = e;
2219
2338
  }
2220
2339
  get http() {
@@ -2246,10 +2365,10 @@ class WebBroker {
2246
2365
  }
2247
2366
  class DataService {
2248
2367
  constructor(e) {
2249
- u(this, "_webBroker");
2250
- u(this, "app");
2251
- u(this, "user");
2252
- u(this, "profile");
2368
+ a(this, "_webBroker");
2369
+ a(this, "app");
2370
+ a(this, "user");
2371
+ a(this, "profile");
2253
2372
  this.odeServices = e;
2254
2373
  }
2255
2374
  get conf() {
@@ -2283,7 +2402,7 @@ class DataService {
2283
2402
  addUserInfos(e) {
2284
2403
  return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
2285
2404
  }
2286
- trackVideoSave(e, t, s, r, i, o, a) {
2405
+ trackVideoSave(e, t, s, r, i, o, u) {
2287
2406
  const c = this.addUserInfos({
2288
2407
  "event-type": "VIDEO_SAVE",
2289
2408
  module: this.app || "video",
@@ -2294,7 +2413,7 @@ class DataService {
2294
2413
  source: r ? "CAPTURED" : "UPLOADED",
2295
2414
  url: i
2296
2415
  });
2297
- a && (c.device_type = a), this.trackWebEvent(c);
2416
+ u && (c.device_type = u), this.trackWebEvent(c);
2298
2417
  }
2299
2418
  trackVideoRead(e, t, s, r, i) {
2300
2419
  const o = this.addUserInfos({
@@ -2362,14 +2481,14 @@ class DirectoryService {
2362
2481
  id: s,
2363
2482
  displayName: r,
2364
2483
  notVisibleCount: o,
2365
- groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
2484
+ groups: t.map(({ name: u, id: c, nbUsers: l }) => ({
2366
2485
  nbUsers: l,
2367
- displayName: a,
2486
+ displayName: u,
2368
2487
  id: c
2369
2488
  })),
2370
- users: i.map(({ displayName: a, id: c, profile: l }) => ({
2489
+ users: i.map(({ displayName: u, id: c, profile: l }) => ({
2371
2490
  profile: l,
2372
- displayName: a,
2491
+ displayName: u,
2373
2492
  // these info are missing from api
2374
2493
  firstName: "",
2375
2494
  lastName: "",
@@ -2384,9 +2503,9 @@ class DirectoryService {
2384
2503
  users: r
2385
2504
  }) {
2386
2505
  this.cache.clearCache("/directory/sharebookmark/all");
2387
- const i = r.map((p) => typeof p == "string" ? p : p.id), o = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
2388
- if (typeof p == "string") {
2389
- const { displayName: y, groups: d, id: g, notVisibleCount: A, users: f } = await this.getBookMarkById(p), w = f.map((D) => D.id), F = d.map((D) => D.id);
2506
+ const i = r.map((h) => typeof h == "string" ? h : h.id), o = s.map((h) => typeof h == "string" ? h : h.id), u = t.map(async (h) => {
2507
+ if (typeof h == "string") {
2508
+ const { displayName: y, groups: E, id: g, notVisibleCount: A, users: f } = await this.getBookMarkById(h), w = f.map((_) => _.id), F = E.map((_) => _.id);
2390
2509
  return {
2391
2510
  displayName: y,
2392
2511
  id: g,
@@ -2394,19 +2513,19 @@ class DirectoryService {
2394
2513
  members: [...F, ...w]
2395
2514
  };
2396
2515
  } else
2397
- return Promise.resolve(p);
2398
- }), l = (await Promise.all(a)).map((p) => p.members).reduce((p, y) => [...p, ...y], []), h = {
2516
+ return Promise.resolve(h);
2517
+ }), l = (await Promise.all(u)).map((h) => h.members).reduce((h, y) => [...h, ...y], []), p = {
2399
2518
  name: e,
2400
2519
  members: [...i, ...o, ...l]
2401
- }, { id: E } = await this.http.postJson(
2520
+ }, { id: d } = await this.http.postJson(
2402
2521
  "/directory/sharebookmark",
2403
- h
2522
+ p
2404
2523
  );
2405
2524
  return {
2406
- id: E,
2525
+ id: d,
2407
2526
  displayName: e,
2408
2527
  notVisibleCount: 0,
2409
- members: h.members
2528
+ members: p.members
2410
2529
  };
2411
2530
  }
2412
2531
  }
@@ -2445,10 +2564,10 @@ class EmbedderService {
2445
2564
  urlIsFromPattern(e, t) {
2446
2565
  const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
2447
2566
  let i = !0;
2448
- const o = t.match(s) || [], a = [];
2449
- return (t.match(r) || []).forEach((l, h) => {
2450
- l.includes("ignore") || a.push(o[h]);
2451
- }), a.forEach((l) => {
2567
+ const o = t.match(s) || [], u = [];
2568
+ return (t.match(r) || []).forEach((l, p) => {
2569
+ l.includes("ignore") || u.push(o[p]);
2570
+ }), u.forEach((l) => {
2452
2571
  if (!e.includes(l)) {
2453
2572
  i = !1;
2454
2573
  return;
@@ -2479,17 +2598,17 @@ class EmbedderService {
2479
2598
  if (this.urlIsFromPattern(t, s)) {
2480
2599
  const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
2481
2600
  let o = e.embed;
2482
- for (const a of i) {
2483
- let c = s.split(a)[0];
2601
+ for (const u of i) {
2602
+ let c = s.split(u)[0];
2484
2603
  const l = c.split("}");
2485
2604
  l.length > 1 && (c = l[l.length - 1]);
2486
- let h = t.split(c)[1];
2487
- if (!h)
2605
+ let p = t.split(c)[1];
2606
+ if (!p)
2488
2607
  continue;
2489
- const E = s.split(a)[1].split("{")[0];
2490
- E && (h = h.split(E)[0]);
2491
- const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
2492
- o = o.replace(p, h);
2608
+ const d = s.split(u)[1].split("{")[0];
2609
+ d && (p = p.split(d)[0]);
2610
+ const h = new RegExp("\\" + u.replace(/}/, "\\}"), "g");
2611
+ o = o.replace(h, p);
2493
2612
  }
2494
2613
  return o;
2495
2614
  }
@@ -2743,9 +2862,9 @@ class IdiomService {
2743
2862
  const i = new Promisified();
2744
2863
  promises[t] = i.promise;
2745
2864
  const o = {};
2746
- e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
2747
- Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
2748
- }).catch((a) => {
2865
+ e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((u) => {
2866
+ Object.assign(bundle, u), typeof s == "function" && s(), i.resolve();
2867
+ }).catch((u) => {
2749
2868
  typeof s == "function" && s(), i.reject();
2750
2869
  });
2751
2870
  }
@@ -2824,7 +2943,7 @@ class NextcloudService {
2824
2943
  * documents added from applications, the way an upload does.
2825
2944
  */
2826
2945
  async copyDocumentToWorkspace(e, t, s, r) {
2827
- const i = t.map((a) => `path=${encodeURIComponent(a)}`).join("&");
2946
+ const i = t.map((u) => `path=${encodeURIComponent(u)}`).join("&");
2828
2947
  return (await this.http.put(
2829
2948
  `/nextcloud/files/user/${e}/copy/workspace?${i}`,
2830
2949
  void 0,
@@ -2835,7 +2954,7 @@ class NextcloudService {
2835
2954
  ...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
2836
2955
  }
2837
2956
  }
2838
- )).data.filter((a) => !!(a != null && a._id));
2957
+ )).data.filter((u) => !!(u != null && u._id));
2839
2958
  }
2840
2959
  /**
2841
2960
  * Check whether a user has an active Nextcloud OAuth2 connection.
@@ -2869,7 +2988,7 @@ class AbstractBehaviourService {
2869
2988
  //-----------------
2870
2989
  //--- Utilities ---
2871
2990
  //-----------------
2872
- u(this, "_cache");
2991
+ a(this, "_cache");
2873
2992
  this.context = e, this._cache = new CacheService(this.context);
2874
2993
  }
2875
2994
  getApplication() {
@@ -2903,8 +3022,8 @@ class AbstractBehaviourService {
2903
3022
  class ActualitesBehaviour extends AbstractBehaviourService {
2904
3023
  constructor() {
2905
3024
  super(...arguments);
2906
- u(this, "APP", "actualites");
2907
- u(this, "RESOURCE", "actualites");
3025
+ a(this, "APP", "actualites");
3026
+ a(this, "RESOURCE", "actualites");
2908
3027
  }
2909
3028
  async loadResources() {
2910
3029
  const [t, s] = await Promise.all([
@@ -2915,10 +3034,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
2915
3034
  /* @__PURE__ */ new Map()
2916
3035
  );
2917
3036
  return t.map((i) => {
2918
- var a;
3037
+ var u;
2919
3038
  let o;
2920
3039
  return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
2921
- title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
3040
+ title: i.title + " [" + ((u = r.get(i.threadId)) == null ? void 0 : u.title) + "]",
2922
3041
  ownerName: i.owner.displayName,
2923
3042
  owner: i.owner.id,
2924
3043
  icon: o,
@@ -2939,8 +3058,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
2939
3058
  class AppointmentsBehaviour extends AbstractBehaviourService {
2940
3059
  constructor() {
2941
3060
  super(...arguments);
2942
- u(this, "APP", "appointments");
2943
- u(this, "RESOURCE", "appointments");
3061
+ a(this, "APP", "appointments");
3062
+ a(this, "RESOURCE", "appointments");
2944
3063
  }
2945
3064
  async loadResources() {
2946
3065
  return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
@@ -2958,8 +3077,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
2958
3077
  class BlogBehaviour extends AbstractBehaviourService {
2959
3078
  constructor() {
2960
3079
  super(...arguments);
2961
- u(this, "APP", "blog");
2962
- u(this, "RESOURCE", "blog");
3080
+ a(this, "APP", "blog");
3081
+ a(this, "RESOURCE", "blog");
2963
3082
  }
2964
3083
  loadResources() {
2965
3084
  return new Promise(async (t, s) => {
@@ -2967,7 +3086,7 @@ class BlogBehaviour extends AbstractBehaviourService {
2967
3086
  const r = await this.httpGet("/blog/linker"), i = [];
2968
3087
  r.forEach((o) => {
2969
3088
  o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
2970
- const a = o.fetchPosts.map((c) => this.dataToResource({
3089
+ const u = o.fetchPosts.map((c) => this.dataToResource({
2971
3090
  owner: o.author.userId,
2972
3091
  ownerName: o.author.username,
2973
3092
  title: c.title + " [" + o.title + "]",
@@ -2977,7 +3096,7 @@ class BlogBehaviour extends AbstractBehaviourService {
2977
3096
  shared: !!(o.shared && o.shared.length >= 0),
2978
3097
  modified: o.modified
2979
3098
  }));
2980
- i.push(...a);
3099
+ i.push(...u);
2981
3100
  }), t(i);
2982
3101
  } catch (r) {
2983
3102
  s(r);
@@ -2988,8 +3107,8 @@ class BlogBehaviour extends AbstractBehaviourService {
2988
3107
  class CollaborativewallBehaviour extends AbstractBehaviourService {
2989
3108
  constructor() {
2990
3109
  super(...arguments);
2991
- u(this, "APP", "collaborativewall");
2992
- u(this, "RESOURCE", "collaborativewall");
3110
+ a(this, "APP", "collaborativewall");
3111
+ a(this, "RESOURCE", "collaborativewall");
2993
3112
  }
2994
3113
  async loadResources() {
2995
3114
  return (await this.httpGet(
@@ -3011,8 +3130,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
3011
3130
  class CommunityBehaviour extends AbstractBehaviourService {
3012
3131
  constructor() {
3013
3132
  super(...arguments);
3014
- u(this, "APP", "community");
3015
- u(this, "RESOURCE", "community");
3133
+ a(this, "APP", "community");
3134
+ a(this, "RESOURCE", "community");
3016
3135
  }
3017
3136
  async loadResources() {
3018
3137
  return (await this.httpGet(
@@ -3036,8 +3155,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
3036
3155
  class ExercizerBehaviour extends AbstractBehaviourService {
3037
3156
  constructor() {
3038
3157
  super(...arguments);
3039
- u(this, "APP", "exercizer");
3040
- u(this, "RESOURCE", "exercizer");
3158
+ a(this, "APP", "exercizer");
3159
+ a(this, "RESOURCE", "exercizer");
3041
3160
  }
3042
3161
  async loadResources() {
3043
3162
  return (await this.httpGet(
@@ -3045,8 +3164,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3045
3164
  )).map((s) => {
3046
3165
  const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
3047
3166
  let i, o = !1;
3048
- const a = JSON.parse(s.scheduled_at);
3049
- return a.groupList.length > 0 ? (o = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (o = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
3167
+ const u = JSON.parse(s.scheduled_at);
3168
+ return u.groupList.length > 0 ? (o = !0, i = u.groupList[0].name) : u.userList.length > 0 ? (o = !0, i = u.userList[0].name) : i = "", u.groupList.length + u.userList.length > 1 && (i += "..."), this.dataToResource({
3050
3169
  title: s.title,
3051
3170
  owner: s.owner,
3052
3171
  ownerName: i,
@@ -3062,8 +3181,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3062
3181
  class FormulaireBehaviour extends AbstractBehaviourService {
3063
3182
  constructor() {
3064
3183
  super(...arguments);
3065
- u(this, "APP", "formulaire");
3066
- u(this, "RESOURCE", "formulaire");
3184
+ a(this, "APP", "formulaire");
3185
+ a(this, "RESOURCE", "formulaire");
3067
3186
  }
3068
3187
  async loadResources() {
3069
3188
  return (await this.httpGet(
@@ -3083,8 +3202,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
3083
3202
  class ForumBehaviour extends AbstractBehaviourService {
3084
3203
  constructor() {
3085
3204
  super(...arguments);
3086
- u(this, "APP", "forum");
3087
- u(this, "RESOURCE", "forum");
3205
+ a(this, "APP", "forum");
3206
+ a(this, "RESOURCE", "forum");
3088
3207
  }
3089
3208
  async loadResources() {
3090
3209
  return (await this.httpGet("/forum/categories")).map(
@@ -3104,8 +3223,8 @@ class ForumBehaviour extends AbstractBehaviourService {
3104
3223
  class HomeworksBehaviour extends AbstractBehaviourService {
3105
3224
  constructor() {
3106
3225
  super(...arguments);
3107
- u(this, "APP", "homeworks");
3108
- u(this, "RESOURCE", "homeworks");
3226
+ a(this, "APP", "homeworks");
3227
+ a(this, "RESOURCE", "homeworks");
3109
3228
  }
3110
3229
  async loadResources() {
3111
3230
  return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
@@ -3123,8 +3242,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
3123
3242
  class MagnetoBehaviour extends AbstractBehaviourService {
3124
3243
  constructor() {
3125
3244
  super(...arguments);
3126
- u(this, "APP", "magneto");
3127
- u(this, "RESOURCE", "magneto");
3245
+ a(this, "APP", "magneto");
3246
+ a(this, "RESOURCE", "magneto");
3128
3247
  }
3129
3248
  async loadResources() {
3130
3249
  const { all: t } = await this.httpGet(
@@ -3145,8 +3264,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
3145
3264
  class MindmapBehaviour extends AbstractBehaviourService {
3146
3265
  constructor() {
3147
3266
  super(...arguments);
3148
- u(this, "APP", "mindmap");
3149
- u(this, "RESOURCE", "mindmap");
3267
+ a(this, "APP", "mindmap");
3268
+ a(this, "RESOURCE", "mindmap");
3150
3269
  }
3151
3270
  async loadResources() {
3152
3271
  return (await this.httpGet("/mindmap/list/all")).map(
@@ -3166,8 +3285,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
3166
3285
  class PagesBehaviour extends AbstractBehaviourService {
3167
3286
  constructor() {
3168
3287
  super(...arguments);
3169
- u(this, "APP", "pages");
3170
- u(this, "RESOURCE", "pages");
3288
+ a(this, "APP", "pages");
3289
+ a(this, "RESOURCE", "pages");
3171
3290
  }
3172
3291
  async loadResources() {
3173
3292
  const t = await this.httpGet("/pages/list/all"), s = [];
@@ -3185,15 +3304,15 @@ class PagesBehaviour extends AbstractBehaviourService {
3185
3304
  shared: typeof r.shared < "u",
3186
3305
  modified: r.modified
3187
3306
  })
3188
- ), (o = r.pages) == null || o.forEach((a) => {
3307
+ ), (o = r.pages) == null || o.forEach((u) => {
3189
3308
  s.push(
3190
3309
  this.dataToResource({
3191
- title: a.title,
3310
+ title: u.title,
3192
3311
  owner: r.owner.userId,
3193
3312
  ownerName: r.owner.displayName,
3194
3313
  icon: i,
3195
- path: "/pages#/website/" + r._id + "/" + a.titleLink,
3196
- _id: r._id + "/" + a.titleLink,
3314
+ path: "/pages#/website/" + r._id + "/" + u.titleLink,
3315
+ _id: r._id + "/" + u.titleLink,
3197
3316
  shared: typeof r.shared < "u",
3198
3317
  modified: r.modified
3199
3318
  })
@@ -3205,8 +3324,8 @@ class PagesBehaviour extends AbstractBehaviourService {
3205
3324
  class PollBehaviour extends AbstractBehaviourService {
3206
3325
  constructor() {
3207
3326
  super(...arguments);
3208
- u(this, "APP", "poll");
3209
- u(this, "RESOURCE", "poll");
3327
+ a(this, "APP", "poll");
3328
+ a(this, "RESOURCE", "poll");
3210
3329
  }
3211
3330
  async loadResources() {
3212
3331
  return (await this.httpGet("/poll/list/all")).map((s) => {
@@ -3227,8 +3346,8 @@ class PollBehaviour extends AbstractBehaviourService {
3227
3346
  class ScrapbookBehaviour extends AbstractBehaviourService {
3228
3347
  constructor() {
3229
3348
  super(...arguments);
3230
- u(this, "APP", "scrapbook");
3231
- u(this, "RESOURCE", "scrapbook");
3349
+ a(this, "APP", "scrapbook");
3350
+ a(this, "RESOURCE", "scrapbook");
3232
3351
  }
3233
3352
  async loadResources() {
3234
3353
  return (await this.httpGet(
@@ -3251,8 +3370,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
3251
3370
  class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3252
3371
  constructor() {
3253
3372
  super(...arguments);
3254
- u(this, "APP", "timelinegenerator");
3255
- u(this, "RESOURCE", "timelinegenerator");
3373
+ a(this, "APP", "timelinegenerator");
3374
+ a(this, "RESOURCE", "timelinegenerator");
3256
3375
  }
3257
3376
  loadResources() {
3258
3377
  return new Promise(async (t, s) => {
@@ -3260,12 +3379,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3260
3379
  const i = (await this.httpGet(
3261
3380
  "/timelinegenerator/timelines"
3262
3381
  )).map((o) => {
3263
- const a = o.icon || "/img/illustrations/timeline-default.png";
3382
+ const u = o.icon || "/img/illustrations/timeline-default.png";
3264
3383
  return this.dataToResource({
3265
3384
  title: o.headline,
3266
3385
  ownerName: o.owner.displayName,
3267
3386
  owner: o.owner.userId,
3268
- icon: a,
3387
+ icon: u,
3269
3388
  path: "/timelinegenerator#/view/" + o._id,
3270
3389
  _id: o._id,
3271
3390
  shared: typeof o.shared < "u",
@@ -3282,8 +3401,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3282
3401
  class WikiBehaviour extends AbstractBehaviourService {
3283
3402
  constructor() {
3284
3403
  super(...arguments);
3285
- u(this, "APP", "wiki");
3286
- u(this, "RESOURCE", "wiki");
3404
+ a(this, "APP", "wiki");
3405
+ a(this, "RESOURCE", "wiki");
3287
3406
  }
3288
3407
  async loadResources() {
3289
3408
  return (await this.httpGet(
@@ -3306,8 +3425,8 @@ class WikiBehaviour extends AbstractBehaviourService {
3306
3425
  class WorkspaceBehaviour extends AbstractBehaviourService {
3307
3426
  constructor() {
3308
3427
  super(...arguments);
3309
- u(this, "APP", "workspace");
3310
- u(this, "RESOURCE", "workspace");
3428
+ a(this, "APP", "workspace");
3429
+ a(this, "RESOURCE", "workspace");
3311
3430
  }
3312
3431
  loadResources({ search: t, asset_id: s }) {
3313
3432
  return new Promise(async (r, i) => {
@@ -3315,12 +3434,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3315
3434
  let o = "/workspace/documents?filter=all&hierarchical=true";
3316
3435
  s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
3317
3436
  const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
3318
- const h = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
3437
+ const p = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
3319
3438
  return this.dataToResource({
3320
3439
  title: l.name,
3321
3440
  ownerName: l.ownerName,
3322
3441
  owner: l.owner,
3323
- icon: h,
3442
+ icon: p,
3324
3443
  path: `/workspace/document/${l._id}`,
3325
3444
  _id: l._id,
3326
3445
  shared: !!(l.shared && l.shared.length >= 0),
@@ -3334,7 +3453,7 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3334
3453
  });
3335
3454
  }
3336
3455
  }
3337
- const b = class b {
3456
+ const R = class R {
3338
3457
  static async initialize(e, t) {
3339
3458
  const s = e.http();
3340
3459
  if (!this.resourceProducingApps.length) {
@@ -3345,7 +3464,7 @@ const b = class b {
3345
3464
  e.session().getUser()
3346
3465
  ]);
3347
3466
  i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
3348
- (o) => i.apps.some((a) => a.address.includes(o))
3467
+ (o) => i.apps.some((u) => u.address.includes(o))
3349
3468
  ));
3350
3469
  } catch (r) {
3351
3470
  console.warn("Failed to load resource-producing apps:", r);
@@ -3428,9 +3547,9 @@ const b = class b {
3428
3547
  //
3429
3548
  // STATIC REGISTRY
3430
3549
  //
3431
- u(b, "registry", new ServiceRegistry()), // Expose some useful functions
3432
- u(b, "findBehaviour", b.registry.findService.bind(b.registry)), u(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), u(b, "resourceProducingApps", []);
3433
- let SnipletsService = b;
3550
+ a(R, "registry", new ServiceRegistry()), // Expose some useful functions
3551
+ a(R, "findBehaviour", R.registry.findService.bind(R.registry)), a(R, "hasBehaviour", R.registry.isRegistered.bind(R.registry)), a(R, "resourceProducingApps", []);
3552
+ let SnipletsService = R;
3434
3553
  class RightService {
3435
3554
  constructor(e) {
3436
3555
  this.context = e;
@@ -3628,14 +3747,14 @@ class SessionService {
3628
3747
  r,
3629
3748
  i,
3630
3749
  o,
3631
- a
3750
+ u
3632
3751
  ] = await Promise.all([
3633
3752
  this.getCurrentLanguage(e),
3634
3753
  this.latestQuotaAndUsage(e),
3635
3754
  this.loadDescription(e),
3636
3755
  this.getUserProfile(),
3637
3756
  this.getBookmarks(e)
3638
- ]), { type: c, ...l } = t || {}, h = {
3757
+ ]), { type: c, ...l } = t || {}, p = {
3639
3758
  ...l,
3640
3759
  profiles: c || ["Guest"],
3641
3760
  // "type" field from /userbook/api/person becomes "profiles"
@@ -3646,9 +3765,9 @@ class SessionService {
3646
3765
  user: e,
3647
3766
  quotaAndUsage: r,
3648
3767
  currentLanguage: s,
3649
- userDescription: h,
3768
+ userDescription: p,
3650
3769
  userProfile: o,
3651
- bookmarkedApps: a
3770
+ bookmarkedApps: u
3652
3771
  };
3653
3772
  }
3654
3773
  login(e, t, s, r) {
@@ -3742,7 +3861,7 @@ class SessionService {
3742
3861
  applications: []
3743
3862
  });
3744
3863
  const i = [];
3745
- return r.bookmarks.forEach((o, a) => {
3864
+ return r.bookmarks.forEach((o, u) => {
3746
3865
  const c = ((e == null ? void 0 : e.apps) || []).find(
3747
3866
  (l) => l.name === o
3748
3867
  );
@@ -3758,11 +3877,11 @@ class SessionService {
3758
3877
  }
3759
3878
  async getPerson(e = {}) {
3760
3879
  var c;
3761
- const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: a } = await this.cache.httpGet(
3880
+ const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: u } = await this.cache.httpGet(
3762
3881
  i,
3763
3882
  t
3764
3883
  );
3765
- return o.status < 200 || o.status >= 300 || typeof a == "string" ? null : ((c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) || null;
3884
+ return o.status < 200 || o.status >= 300 || typeof u == "string" ? null : ((c = u == null ? void 0 : u.result) == null ? void 0 : c[0]) || null;
3766
3885
  }
3767
3886
  async isAdml() {
3768
3887
  const e = await this.getUser();
@@ -3820,38 +3939,38 @@ class ShareService {
3820
3939
  t,
3821
3940
  s,
3822
3941
  r
3823
- ), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
3942
+ ), u = await this.cache.httpGetJson(o), c = u.users.visibles.filter(({ username: h, firstName: y, lastName: E, login: g }) => {
3824
3943
  const A = StringUtils.removeAccents(
3825
- d || ""
3944
+ E || ""
3826
3945
  ).toLowerCase(), f = StringUtils.removeAccents(
3827
3946
  y || ""
3828
3947
  ).toLowerCase(), w = StringUtils.removeAccents(
3829
- p || ""
3948
+ h || ""
3830
3949
  ).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
3831
3950
  return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
3832
- }).map((p) => ({
3833
- avatarUrl: this.directory.getAvatarUrl(p.id, "user"),
3834
- directoryUrl: this.directory.getDirectoryUrl(p.id, "user"),
3835
- displayName: p.username,
3836
- id: p.id,
3837
- profile: p.profile,
3951
+ }).map((h) => ({
3952
+ avatarUrl: this.directory.getAvatarUrl(h.id, "user"),
3953
+ directoryUrl: this.directory.getDirectoryUrl(h.id, "user"),
3954
+ displayName: h.username,
3955
+ id: h.id,
3956
+ profile: h.profile,
3838
3957
  type: "user"
3839
- })), l = a.groups.visibles.filter(({ name: p }) => StringUtils.removeAccents(p || "").toLowerCase().includes(i)).map((p) => ({
3840
- avatarUrl: this.directory.getAvatarUrl(p.id, "group"),
3841
- directoryUrl: this.directory.getDirectoryUrl(p.id, "group"),
3842
- displayName: p.name,
3843
- id: p.id,
3958
+ })), l = u.groups.visibles.filter(({ name: h }) => StringUtils.removeAccents(h || "").toLowerCase().includes(i)).map((h) => ({
3959
+ avatarUrl: this.directory.getAvatarUrl(h.id, "group"),
3960
+ directoryUrl: this.directory.getDirectoryUrl(h.id, "group"),
3961
+ displayName: h.name,
3962
+ id: h.id,
3844
3963
  type: "group",
3845
- structureName: p.structureName
3964
+ structureName: h.structureName
3846
3965
  }));
3847
- return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
3848
- p || ""
3849
- ).toLowerCase().includes(i)).map((p) => ({
3966
+ return [...(await this.directory.getBookMarks()).filter(({ displayName: h }) => StringUtils.removeAccents(
3967
+ h || ""
3968
+ ).toLowerCase().includes(i)).map((h) => ({
3850
3969
  avatarUrl: "",
3851
3970
  directoryUrl: "",
3852
3971
  profile: "",
3853
- displayName: p.displayName,
3854
- id: p.id,
3972
+ displayName: h.displayName,
3973
+ id: h.id,
3855
3974
  type: "sharebookmark"
3856
3975
  })), ...c, ...l];
3857
3976
  }
@@ -3867,10 +3986,10 @@ class ShareService {
3867
3986
  return s;
3868
3987
  }
3869
3988
  getActionsAvailableFor({ id: e, type: t }, s, r) {
3870
- const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
3871
- for (const l of a)
3989
+ const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], u = Object.keys(r), c = [];
3990
+ for (const l of u)
3872
3991
  r[l].filter(
3873
- (p) => o.includes(p)
3992
+ (h) => o.includes(h)
3874
3993
  ).length > 0 && c.push(l);
3875
3994
  return c;
3876
3995
  }
@@ -3882,26 +4001,26 @@ class ShareService {
3882
4001
  s == null ? void 0 : s.getResourceRights
3883
4002
  ), o = await this.cache.httpGetJson(
3884
4003
  i
3885
- ), a = await this.getShareMapping(
4004
+ ), u = await this.getShareMapping(
3886
4005
  e,
3887
4006
  s == null ? void 0 : s.getShareMapping
3888
4007
  ), c = await this.cache.httpGetJson(
3889
4008
  "/infra/public/json/sharing-rights.json"
3890
- ), l = Object.keys(o.users.checked).map((d) => o.users.visibles.find(
3891
- (A) => A.id === d
3892
- )).filter((d) => d !== void 0).map((d) => {
4009
+ ), l = Object.keys(o.users.checked).map((E) => o.users.visibles.find(
4010
+ (A) => A.id === E
4011
+ )).filter((E) => E !== void 0).map((E) => {
3893
4012
  const g = this.getActionsAvailableFor(
3894
- { id: d.id, type: "user" },
4013
+ { id: E.id, type: "user" },
3895
4014
  o,
3896
- a
4015
+ u
3897
4016
  );
3898
4017
  return {
3899
- id: d.id,
4018
+ id: E.id,
3900
4019
  type: "user",
3901
- displayName: d.username,
3902
- profile: d.profile,
3903
- avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
3904
- directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
4020
+ displayName: E.username,
4021
+ profile: E.profile,
4022
+ avatarUrl: this.directory.getAvatarUrl(E.id, "user"),
4023
+ directoryUrl: this.directory.getDirectoryUrl(E.id, "user"),
3905
4024
  actions: g.map((f) => {
3906
4025
  const w = c[f];
3907
4026
  return {
@@ -3911,21 +4030,21 @@ class ShareService {
3911
4030
  };
3912
4031
  })
3913
4032
  };
3914
- }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((d) => o.groups.visibles.find(
3915
- (A) => A.id === d
3916
- )).filter((d) => d !== void 0).map((d) => {
4033
+ }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), p = Object.keys(o.groups.checked).map((E) => o.groups.visibles.find(
4034
+ (A) => A.id === E
4035
+ )).filter((E) => E !== void 0).map((E) => {
3917
4036
  const g = this.getActionsAvailableFor(
3918
- { id: d.id, type: "group" },
4037
+ { id: E.id, type: "group" },
3919
4038
  o,
3920
- a
4039
+ u
3921
4040
  );
3922
4041
  return {
3923
- id: d.id,
4042
+ id: E.id,
3924
4043
  type: "group",
3925
- displayName: d.name,
4044
+ displayName: E.name,
3926
4045
  profile: void 0,
3927
- avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
3928
- directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
4046
+ avatarUrl: this.directory.getAvatarUrl(E.id, "group"),
4047
+ directoryUrl: this.directory.getDirectoryUrl(E.id, "group"),
3929
4048
  actions: g.map((f) => {
3930
4049
  const w = c[f];
3931
4050
  return {
@@ -3935,26 +4054,26 @@ class ShareService {
3935
4054
  };
3936
4055
  })
3937
4056
  };
3938
- }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), E = [...l, ...h], p = o.groups.visibles.map(
3939
- ({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
4057
+ }).sort((E, g) => (E.displayName || "").localeCompare(g.displayName)), d = [...l, ...p], h = o.groups.visibles.map(
4058
+ ({ groupDisplayName: E, id: g, name: A, labels: f }) => ({
3940
4059
  labels: f,
3941
- displayName: d || A,
4060
+ displayName: E || A,
3942
4061
  id: g
3943
4062
  })
3944
4063
  ), y = o.users.visibles.map(
3945
- ({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
4064
+ ({ id: E, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
3946
4065
  displayName: A,
3947
4066
  firstName: f,
3948
4067
  lastName: w,
3949
4068
  login: F,
3950
4069
  profile: g,
3951
- id: d
4070
+ id: E
3952
4071
  })
3953
4072
  );
3954
4073
  return {
3955
- rights: E,
4074
+ rights: d,
3956
4075
  visibleBookmarks: r,
3957
- visibleGroups: p,
4076
+ visibleGroups: h,
3958
4077
  visibleUsers: y
3959
4078
  };
3960
4079
  }
@@ -3965,7 +4084,7 @@ class ShareService {
3965
4084
  bookmarks: {}
3966
4085
  }, i = await this.getShareMapping(e, s);
3967
4086
  for (const o of t) {
3968
- const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
4087
+ const u = o.actions.map((l) => i[l.id]).reduce((l, p) => Array.isArray(p) ? [...l, ...p] : l, []), c = [...new Set(u)];
3969
4088
  c.length > 0 && (o.type === "user" ? r.users[o.id] = c : o.type === "group" ? r.groups[o.id] = c : r.bookmarks[o.id] = c);
3970
4089
  }
3971
4090
  return r;
@@ -3975,40 +4094,40 @@ class ShareService {
3975
4094
  e,
3976
4095
  s,
3977
4096
  r == null ? void 0 : r.getShareMapping
3978
- ), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, a = this.getSearchUrl(
4097
+ ), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, u = this.getSearchUrl(
3979
4098
  e,
3980
4099
  t,
3981
4100
  "",
3982
4101
  r == null ? void 0 : r.getResourceRights
3983
4102
  );
3984
- return this.cache.clearCache(a), await this.http.putJson(o, i);
4103
+ return this.cache.clearCache(u), await this.http.putJson(o, i);
3985
4104
  }
3986
4105
  async getActionsForApp(e, t) {
3987
4106
  const s = await this.cache.httpGetJson(
3988
4107
  "/infra/public/json/sharing-rights.json"
3989
4108
  ), r = await this.getShareMapping(e, t);
3990
4109
  return Object.keys(s).map((o) => {
3991
- const a = s[o];
4110
+ const u = s[o];
3992
4111
  return {
3993
4112
  displayName: o,
3994
4113
  id: o,
3995
- priority: a.priority,
3996
- requires: a.requires
4114
+ priority: u.priority,
4115
+ requires: u.requires
3997
4116
  };
3998
4117
  }).filter((o) => {
3999
- var a;
4000
- return ((a = r[o.id]) == null ? void 0 : a.length) > 0;
4001
- }).sort((o, a) => o.priority - a.priority);
4118
+ var u;
4119
+ return ((u = r[o.id]) == null ? void 0 : u.length) > 0;
4120
+ }).sort((o, u) => o.priority - u.priority);
4002
4121
  }
4003
4122
  }
4004
4123
  const loadedScripts = {};
4005
4124
  class HttpService {
4006
4125
  constructor(e, t) {
4007
4126
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
4008
- u(this, "axios");
4009
- u(this, "baseUrl");
4010
- u(this, "headers", {});
4011
- u(this, "_latestResponse");
4127
+ a(this, "axios");
4128
+ a(this, "baseUrl");
4129
+ a(this, "headers", {});
4130
+ a(this, "_latestResponse");
4012
4131
  this.context = e, this.axios = axios.create(t);
4013
4132
  }
4014
4133
  fixBaseUrl(e) {
@@ -4223,8 +4342,8 @@ class HttpService {
4223
4342
  const r = s ?? "exports", i = this.toAxiosConfig(t);
4224
4343
  return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
4225
4344
  try {
4226
- const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
4227
- return Function(a)();
4345
+ const u = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
4346
+ return Function(u)();
4228
4347
  } catch {
4229
4348
  return o;
4230
4349
  }
@@ -4238,7 +4357,7 @@ class HttpService {
4238
4357
  });
4239
4358
  }
4240
4359
  }
4241
- const R = class R {
4360
+ const b = class b {
4242
4361
  // in minutes. Applies to recorded videos.
4243
4362
  constructor(e) {
4244
4363
  this.context = e;
@@ -4259,8 +4378,8 @@ const R = class R {
4259
4378
  APP$4.VIDEO
4260
4379
  );
4261
4380
  return {
4262
- maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
4263
- maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
4381
+ maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? b.MAX_WEIGHT,
4382
+ maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? b.MAX_DURATION,
4264
4383
  acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
4265
4384
  (s) => s.toUpperCase()
4266
4385
  )) ?? []
@@ -4283,43 +4402,43 @@ const R = class R {
4283
4402
  throw new Error("Invalid video filename");
4284
4403
  const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
4285
4404
  o.append("device", e.device || ""), o.append("browser", i), o.append("url", e.url), o.append("app", t), o.append("file", e.file, e.filename), o.append("weight", "" + e.file.size), o.append("captation", "" + s);
4286
- let a = `/video/encode?captation=${s}`;
4287
- r && (a += `&duration=${r}`);
4405
+ let u = `/video/encode?captation=${s}`;
4406
+ r && (u += `&duration=${r}`);
4288
4407
  const c = await this.http.post(
4289
- a,
4408
+ u,
4290
4409
  o,
4291
4410
  { headers: { "Content-Type": "multipart/form-data" } }
4292
4411
  );
4293
4412
  if (c.state == "running") {
4294
- let l = 0, h = 1;
4413
+ let l = 0, p = 1;
4295
4414
  do {
4296
- const E = h + l;
4415
+ const d = p + l;
4297
4416
  await new Promise(
4298
- (y) => setTimeout(y, E * 1e3)
4299
- ), l = h, h = Math.min(8, E);
4300
- const p = await this.http.get(
4417
+ (y) => setTimeout(y, d * 1e3)
4418
+ ), l = p, p = Math.min(8, d);
4419
+ const h = await this.http.get(
4301
4420
  `/video/status/${c.processid}`
4302
4421
  );
4303
- if (p.state == "succeed")
4304
- return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
4305
- p.videoworkspaceid,
4422
+ if (h.state == "succeed")
4423
+ return h.videoworkspaceid && h.videosize && this.context.data().trackVideoSave(
4424
+ h.videoworkspaceid,
4306
4425
  Math.round(r),
4307
- p.videosize,
4426
+ h.videosize,
4308
4427
  s,
4309
4428
  e.url,
4310
4429
  i,
4311
4430
  e.device
4312
- ), p;
4313
- if (p.state == "error")
4431
+ ), h;
4432
+ if (h.state == "error")
4314
4433
  break;
4315
4434
  } while (!0);
4316
4435
  }
4317
4436
  throw new Error("Video cannot be uploaded.");
4318
4437
  }
4319
4438
  };
4320
- u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
4321
- u(R, "MAX_DURATION", 3);
4322
- let VideoService = R;
4439
+ a(b, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
4440
+ a(b, "MAX_DURATION", 3);
4441
+ let VideoService = b;
4323
4442
  class WidgetService {
4324
4443
  constructor(e) {
4325
4444
  this.context = e;
@@ -4400,7 +4519,7 @@ const defaultMappers = {
4400
4519
  }
4401
4520
  };
4402
4521
  // FIXME add edumedia support
4403
- u(v, "roleMappers", [
4522
+ a(v, "roleMappers", [
4404
4523
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
4405
4524
  ]);
4406
4525
  let DocumentHelper = v;
@@ -4418,29 +4537,29 @@ class WorkspaceService {
4418
4537
  size: e.size,
4419
4538
  extension: i,
4420
4539
  role: DocumentHelper.role(r, !1, i)
4421
- }, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
4422
- return { basename: a, fullname: c, metadata: o };
4540
+ }, u = t.replace("." + o.extension, ""), c = o.extension ? u + "." + o.extension : u;
4541
+ return { basename: u, fullname: c, metadata: o };
4423
4542
  }
4424
4543
  async saveFile(e, t) {
4425
4544
  const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
4426
4545
  i.append("file", e, s);
4427
4546
  const o = [];
4428
4547
  ((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && o.push(`${t.visibility}=true`), t != null && t.application && o.push(`application=${t.application}`), r.role === "img" && o.push("quality=1"), t != null && t.parentId && o.push(`parentId=${t.parentId}`);
4429
- const a = await this.http.postFile(
4548
+ const u = await this.http.postFile(
4430
4549
  `/workspace/document?${o.join("&")}`,
4431
4550
  i
4432
4551
  );
4433
4552
  if (this.http.isResponseError())
4434
4553
  throw this.http.latestResponse.statusText;
4435
- return a;
4554
+ return u;
4436
4555
  }
4437
4556
  async updateFile(e, t, s) {
4438
4557
  const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
4439
4558
  o.append("file", t, r);
4440
- const a = [];
4441
- i.role === "img" && a.push("quality=1"), s != null && s.alt && a.push(`alt=${s.alt}`), s != null && s.legend && a.push(`legend=${s.legend}`), s != null && s.name && a.push(`name=${s.name}`);
4559
+ const u = [];
4560
+ i.role === "img" && u.push("quality=1"), s != null && s.alt && u.push(`alt=${s.alt}`), s != null && s.legend && u.push(`legend=${s.legend}`), s != null && s.name && u.push(`name=${s.name}`);
4442
4561
  const c = await this.http.putFile(
4443
- `/workspace/document/${e}?${a.join("&")}`,
4562
+ `/workspace/document/${e}?${u.join("&")}`,
4444
4563
  o
4445
4564
  );
4446
4565
  if (this.http.isResponseError())
@@ -4491,11 +4610,11 @@ class WorkspaceService {
4491
4610
  );
4492
4611
  if (this.http.isResponseError())
4493
4612
  throw this.http.latestResponse.statusText;
4494
- return r.forEach((o, a) => {
4613
+ return r.forEach((o, u) => {
4495
4614
  const c = e.findIndex(
4496
4615
  (l) => l._id === o._id
4497
4616
  );
4498
- 0 <= c && c < e.length && (e[c] = i[a]);
4617
+ 0 <= c && c < e.length && (e[c] = i[u]);
4499
4618
  }), e.filter((o) => !!o);
4500
4619
  }
4501
4620
  return e;
@@ -4510,12 +4629,12 @@ class WorkspaceService {
4510
4629
  if (typeof e == "string")
4511
4630
  return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
4512
4631
  {
4513
- const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
4632
+ const u = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
4514
4633
  if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
4515
4634
  const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
4516
- return l ? a + l : null;
4635
+ return l ? u + l : null;
4517
4636
  } else
4518
- return a + r;
4637
+ return u + r;
4519
4638
  }
4520
4639
  }
4521
4640
  /**
@@ -4569,23 +4688,24 @@ class WorkspaceService {
4569
4688
  }
4570
4689
  class OdeServices {
4571
4690
  constructor() {
4572
- u(this, "_analytics");
4573
- u(this, "_cache");
4574
- u(this, "_conf");
4575
- u(this, "_data");
4576
- u(this, "_directory");
4577
- u(this, "_http");
4578
- u(this, "_idiom");
4579
- u(this, "_nextcloud");
4580
- u(this, "_notify");
4581
- u(this, "_rights");
4582
- u(this, "_session");
4583
- u(this, "_share");
4584
- u(this, "_video");
4585
- u(this, "_widget");
4586
- u(this, "_workspace");
4587
- u(this, "_embedder");
4588
- this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._nextcloud = new NextcloudService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
4691
+ a(this, "_analytics");
4692
+ a(this, "_cache");
4693
+ a(this, "_conf");
4694
+ a(this, "_data");
4695
+ a(this, "_directory");
4696
+ a(this, "_googledrive");
4697
+ a(this, "_http");
4698
+ a(this, "_idiom");
4699
+ a(this, "_nextcloud");
4700
+ a(this, "_notify");
4701
+ a(this, "_rights");
4702
+ a(this, "_session");
4703
+ a(this, "_share");
4704
+ a(this, "_video");
4705
+ a(this, "_widget");
4706
+ a(this, "_workspace");
4707
+ a(this, "_embedder");
4708
+ this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._googledrive = new GoogleDriveService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._nextcloud = new NextcloudService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
4589
4709
  }
4590
4710
  initialize() {
4591
4711
  return this._data.initialize(), this;
@@ -4608,6 +4728,9 @@ class OdeServices {
4608
4728
  directory() {
4609
4729
  return this._directory;
4610
4730
  }
4731
+ googledrive() {
4732
+ return this._googledrive;
4733
+ }
4611
4734
  http() {
4612
4735
  return this._http;
4613
4736
  }
@@ -4792,10 +4915,10 @@ const isActionAvailable = (n, e) => {
4792
4915
  class WidgetFramework {
4793
4916
  constructor() {
4794
4917
  //-------------------------------------
4795
- u(this, "_initialized");
4796
- u(this, "_widgets", []);
4918
+ a(this, "_initialized");
4919
+ a(this, "_widgets", []);
4797
4920
  ////////////////////////////////////// USER PREFERENCES
4798
- u(this, "_userPrefs", {});
4921
+ a(this, "_userPrefs", {});
4799
4922
  }
4800
4923
  initialize(e, t) {
4801
4924
  return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
@@ -4838,20 +4961,20 @@ class WidgetFramework {
4838
4961
  this._userPrefs = e ?? this._userPrefs;
4839
4962
  const t = configure.Platform.theme, s = [];
4840
4963
  t.listSkins().then((r) => {
4841
- var a;
4842
- const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4964
+ var u;
4965
+ const i = ((u = r.find((c) => c.child === t.skin)) == null ? void 0 : u.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4843
4966
  this._widgets = this._widgets.filter((c, l) => {
4844
- const h = c.platformConf.name;
4845
- return i.indexOf(h) !== -1 ? !1 : (this._userPrefs[h] || (this._userPrefs[h] = {
4846
- index: defaultWidgetOrder[h] ?? 999,
4967
+ const p = c.platformConf.name;
4968
+ return i.indexOf(p) !== -1 ? !1 : (this._userPrefs[p] || (this._userPrefs[p] = {
4969
+ index: defaultWidgetOrder[p] ?? 999,
4847
4970
  show: !0,
4848
4971
  position: c.platformConf.position
4849
- }), c.platformConf.mandatory && (this._userPrefs[h].show = !0, this._userPrefs[h].index = defaultWidgetOrder[h] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[h]), !0);
4972
+ }), c.platformConf.mandatory && (this._userPrefs[p].show = !0, this._userPrefs[p].index = defaultWidgetOrder[p] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[p]), !0);
4850
4973
  });
4851
4974
  const o = new Idiom();
4852
4975
  this._widgets = this._widgets.sort((c, l) => {
4853
- const h = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
4854
- return h < E ? -1 : h > E ? 1 : 0;
4976
+ const p = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), d = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
4977
+ return p < d ? -1 : p > d ? 1 : 0;
4855
4978
  });
4856
4979
  });
4857
4980
  }
@@ -4859,8 +4982,8 @@ class WidgetFramework {
4859
4982
  class Widget {
4860
4983
  //-------------------------------------
4861
4984
  constructor(e) {
4862
- u(this, "_schoolConf", {});
4863
- u(this, "_userPref");
4985
+ a(this, "_schoolConf", {});
4986
+ a(this, "_userPref");
4864
4987
  this._platformConf = e, this._userPref = null;
4865
4988
  }
4866
4989
  get platformConf() {
@@ -4911,6 +5034,8 @@ export {
4911
5034
  ERROR_CODE,
4912
5035
  EVENT_NAME,
4913
5036
  FOLDER,
5037
+ GOOGLE_DRIVE_FOLDER_MIME_TYPE,
5038
+ GoogleDriveCopyError,
4914
5039
  ITimelineFactory,
4915
5040
  LAYER_NAME,
4916
5041
  NotifyFrameworkFactory,