@edifice.io/client 2.6.10-develop-integration.20261021201512 → 2.6.10-develop-pedago.20261022103835

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 a = (n, e, t) => I(n, typeof e != "symbol" ? e + "" : e, t);
3
+ var u = (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";
@@ -98,10 +98,10 @@ const ERROR_CODE = {
98
98
  INFOTIP: "infotip",
99
99
  RGPD_COOKIES: "rgpdCookies"
100
100
  // TODO compléter
101
- }, C = class C {
101
+ }, R = class R {
102
102
  constructor(e) {
103
- a(this, "name");
104
- a(this, "listeners", /* @__PURE__ */ new Set());
103
+ u(this, "name");
104
+ u(this, "listeners", /* @__PURE__ */ new Set());
105
105
  this.name = e;
106
106
  }
107
107
  /**
@@ -110,8 +110,8 @@ const ERROR_CODE = {
110
110
  * @returns the channel instance
111
111
  */
112
112
  static getChannel(e) {
113
- let t = C.channels.get(e);
114
- return t || (t = new C(e), C.channels.set(e, t)), t;
113
+ let t = R.channels.get(e);
114
+ return t || (t = new R(e), R.channels.set(e, t)), t;
115
115
  }
116
116
  /**
117
117
  * Add a listener and return a revocation function to remove it.
@@ -136,14 +136,14 @@ const ERROR_CODE = {
136
136
  * Close this channel: remove listeners and unregister from global map.
137
137
  */
138
138
  close() {
139
- this.listeners.clear(), C.channels.delete(this.name);
139
+ this.listeners.clear(), R.channels.delete(this.name);
140
140
  }
141
141
  };
142
- a(C, "channels", /* @__PURE__ */ new Map());
143
- let SimpleChannel = C;
142
+ u(R, "channels", /* @__PURE__ */ new Map());
143
+ let SimpleChannel = R;
144
144
  class Subscription {
145
145
  constructor(e, t) {
146
- a(this, "revoke");
146
+ u(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
- a(this, "publishChannels", /* @__PURE__ */ new Map());
163
+ u(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
- a(this, "_resolution");
199
- a(this, "_rejection");
200
- a(this, "_promise", new Promise((e, t) => {
198
+ u(this, "_resolution");
199
+ u(this, "_rejection");
200
+ u(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
- a(this, "promises", {});
218
- a(this, "subject", new Subject());
217
+ u(this, "promises", {});
218
+ u(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
- a(this, "axios");
250
- a(this, "_latestResponse");
249
+ u(this, "axios");
250
+ u(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 u = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
331
- return Function(u)();
330
+ const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
331
+ return Function(a)();
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
- a(this, "_http", new Http());
347
+ u(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
- a(this, "_me", null);
367
- a(this, "_currentLanguage", "");
368
- a(this, "_notLoggedIn", !0);
369
- a(this, "_description");
370
- a(this, "_profile");
366
+ u(this, "_me", null);
367
+ u(this, "_currentLanguage", "");
368
+ u(this, "_notLoggedIn", !0);
369
+ u(this, "_description");
370
+ u(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((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;
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;
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
- a(this, "session", new Session());
488
+ u(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
- a(this, "_conf");
513
- a(this, "_loaded");
512
+ u(this, "_conf");
513
+ u(this, "_loaded");
514
514
  // legacy (readonly)
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());
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());
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((u) => {
862
- Object.assign(bundle$1, u), typeof s == "function" && s(), i.resolve();
863
- }).catch((u) => {
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) => {
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
- a(this, "data", {});
899
+ u(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
- a(this, "_me", null);
927
- a(this, "_keepOpenOnLogout", !1);
928
- a(this, "_preferences", new UserPreferences());
929
- a(this, "_bookmarkedApps", []);
926
+ u(this, "_me", null);
927
+ u(this, "_keepOpenOnLogout", !1);
928
+ u(this, "_preferences", new UserPreferences());
929
+ u(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, u) => {
973
+ s.bookmarks.forEach((o, a) => {
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 u = s.bookmarks.indexOf(o);
982
- u !== -1 && s.bookmarks.splice(u, 1);
981
+ const a = s.bookmarks.indexOf(o);
982
+ a !== -1 && s.bookmarks.splice(a, 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
- a(this, "_publicConf", {});
1004
- a(this, "_currentApp");
1005
- a(this, "_appConf", {});
1003
+ u(this, "_publicConf", {});
1004
+ u(this, "_currentApp");
1005
+ u(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
- a(this, "_status", "void");
1044
- a(this, "_params");
1043
+ u(this, "_status", "void");
1044
+ u(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 p = e.structureMap[l];
1086
- if (p && p.collectiviteId && p.UAI) {
1087
- r = p;
1085
+ const h = e.structureMap[l];
1086
+ if (h && h.collectiviteId && h.UAI) {
1087
+ r = h;
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 u(l) {
1099
- let p = "";
1100
- for (let d = 0; d < l.length; d++)
1101
- p += l.charCodeAt(d);
1102
- return p;
1098
+ function a(l) {
1099
+ let h = "";
1100
+ for (let E = 0; E < l.length; E++)
1101
+ h += l.charCodeAt(E);
1102
+ return h;
1103
1103
  }
1104
1104
  const c = {
1105
1105
  Student: "ELEVE",
@@ -1118,26 +1118,15 @@ 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: u(t.userId),
1121
+ ID_PERSO: a(t.userId),
1122
1122
  PROFILE: s.profiles && s.profiles.length > 0 ? c[s.profiles[0]] ?? "" : ""
1123
1123
  };
1124
1124
  }
1125
1125
  }
1126
1126
  function setCookie(n, e) {
1127
1127
  if (typeof document > "u") return;
1128
- const t = location.protocol === "https:" ? "; Secure" : "";
1129
- document.cookie = `${n}=${encodeURIComponent(e)}; path=/; SameSite=Strict${t}`;
1130
- }
1131
- function getCookie(n) {
1132
- if (typeof document > "u") return null;
1133
- const e = document.cookie.match(new RegExp("(^| )" + n + "=([^;]+)"));
1134
- if (e)
1135
- try {
1136
- return decodeURIComponent(e[2]);
1137
- } catch {
1138
- return e[2];
1139
- }
1140
- return null;
1128
+ const t = location.protocol === "https:" ? "None; Secure" : "Lax";
1129
+ document.cookie = `${n}=${encodeURIComponent(e)}; path=/; SameSite=${t}`;
1141
1130
  }
1142
1131
  function isPad() {
1143
1132
  return typeof window < "u" && "ongesturechange" in window;
@@ -1146,25 +1135,18 @@ function detectDevice() {
1146
1135
  if (typeof window > "u")
1147
1136
  return { osName: "", osVersion: "", deviceType: "", deviceName: "" };
1148
1137
  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"), u = r;
1150
- return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", u = "iPad"), {
1138
+ let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), a = r;
1139
+ return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", a = "iPad"), {
1151
1140
  osName: i,
1152
1141
  osVersion: n.os.version || "Unknown",
1153
1142
  deviceType: o,
1154
- deviceName: u
1143
+ deviceName: a
1155
1144
  };
1156
1145
  }
1157
- function readDeviceCookies() {
1158
- const n = getCookie("osName"), e = getCookie("osVersion"), t = getCookie("deviceType"), s = getCookie("deviceName");
1159
- return n && e && t && s ? { osName: n, osVersion: e, deviceType: t, deviceName: s } : null;
1160
- }
1161
1146
  function setDeviceCookies() {
1162
1147
  try {
1163
- const n = readDeviceCookies();
1164
- if (n != null)
1165
- return n;
1166
- const e = detectDevice();
1167
- return setCookie("osName", e.osName), setCookie("osVersion", e.osVersion), setCookie("deviceType", e.deviceType), setCookie("deviceName", e.deviceName), e;
1148
+ const n = detectDevice();
1149
+ return setCookie("osName", n.osName), setCookie("osVersion", n.osVersion), setCookie("deviceType", n.deviceType), setCookie("deviceName", n.deviceName), n;
1168
1150
  } catch (n) {
1169
1151
  return console.warn("Device detection failed, using Unknown values:", n), {
1170
1152
  osName: "Unknown",
@@ -1177,7 +1159,7 @@ function setDeviceCookies() {
1177
1159
  class ConfigurationFramework {
1178
1160
  constructor() {
1179
1161
  //-------------------------------------
1180
- a(this, "Platform", {
1162
+ u(this, "Platform", {
1181
1163
  deploymentTag: "",
1182
1164
  cdnDomain: "",
1183
1165
  apps: new AppConf(),
@@ -1186,16 +1168,16 @@ class ConfigurationFramework {
1186
1168
  idiom: new Idiom(),
1187
1169
  listLanguages: () => transport.http.get("/languages")
1188
1170
  });
1189
- a(this, "School", {
1171
+ u(this, "School", {
1190
1172
  //apps; -> pinnedApps;
1191
1173
  });
1192
- a(this, "User", new User());
1174
+ u(this, "User", new User());
1193
1175
  setDeviceCookies();
1194
1176
  }
1195
1177
  async initialize(e, t) {
1196
1178
  if (!e) {
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)}`;
1179
+ const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
1180
+ e = `${o}${r(a)}${r(c)}`;
1199
1181
  }
1200
1182
  const s = e;
1201
1183
  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 +1215,12 @@ class ConfigurationFramework {
1233
1215
  // }
1234
1216
  }
1235
1217
  const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
1236
- var D;
1237
- const me = (D = session == null ? void 0 : session.session) == null ? void 0 : D.user;
1218
+ var _;
1219
+ const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
1238
1220
  class Notification {
1239
1221
  constructor(e) {
1240
- a(this, "_id");
1241
- a(this, "model");
1222
+ u(this, "_id");
1223
+ u(this, "model");
1242
1224
  e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
1243
1225
  }
1244
1226
  isUnread() {
@@ -1258,14 +1240,14 @@ class Notification {
1258
1240
  class TimelineApp {
1259
1241
  constructor() {
1260
1242
  //-------------------------------------
1261
- a(this, "_notifications", []);
1262
- a(this, "_notificationTypes", []);
1243
+ u(this, "_notifications", []);
1244
+ u(this, "_notificationTypes", []);
1263
1245
  // ex: ["BLOG"]
1264
- a(this, "_flashMessages", []);
1265
- a(this, "_pageNumber", 0);
1266
- a(this, "_lastPage", !1);
1267
- a(this, "_loading", !1);
1268
- a(this, "showMine", !1);
1246
+ u(this, "_flashMessages", []);
1247
+ u(this, "_pageNumber", 0);
1248
+ u(this, "_lastPage", !1);
1249
+ u(this, "_loading", !1);
1250
+ u(this, "showMine", !1);
1269
1251
  }
1270
1252
  get notifications() {
1271
1253
  return this._notifications;
@@ -1324,7 +1306,7 @@ class TimelineApp {
1324
1306
  if (r.number && r.results) {
1325
1307
  const i = r.results.filter(
1326
1308
  (o) => this._notifications.findIndex(
1327
- (u) => u._id === o._id
1309
+ (a) => a._id === o._id
1328
1310
  ) === -1
1329
1311
  ).map((o) => new Notification(o));
1330
1312
  this._notifications = this._notifications.concat(i), this._pageNumber++;
@@ -1355,126 +1337,7 @@ const ReactionTypes = [
1355
1337
  "REACTION_2",
1356
1338
  "REACTION_3",
1357
1339
  "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"
1362
1340
  ];
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
- }
1478
1341
  class NotifyFrameworkFactory {
1479
1342
  static instance() {
1480
1343
  return notify;
@@ -1533,7 +1396,7 @@ const m = class m {
1533
1396
  //
1534
1397
  // PROTECTED HELPERS
1535
1398
  //
1536
- a(this, "checkHttpResponse", (e) => {
1399
+ u(this, "checkHttpResponse", (e) => {
1537
1400
  if (this.http.latestResponse.status >= 300)
1538
1401
  throw this.http.latestResponse.statusText;
1539
1402
  return e;
@@ -1751,22 +1614,22 @@ const m = class m {
1751
1614
  //
1752
1615
  // STATIC REGISTRY
1753
1616
  //
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));
1617
+ u(m, "registry", new ServiceRegistry()), // Expose some useful functions
1618
+ 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));
1756
1619
  let ResourceService = m;
1757
1620
  const APP$3 = "collaborativeeditor", RESOURCE$3 = "collaborativeeditor";
1758
1621
  class CollaborativeEditorResourceService extends ResourceService {
1759
1622
  async create(e) {
1760
- const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", u = await this.http.post("/collaborativeeditor", {
1623
+ const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", a = await this.http.post("/collaborativeeditor", {
1761
1624
  name: t,
1762
1625
  description: s,
1763
1626
  thumbnail: o,
1764
1627
  folder: i
1765
1628
  });
1766
- return this.checkHttpResponse(u), u;
1629
+ return this.checkHttpResponse(a), a;
1767
1630
  }
1768
1631
  async update(e) {
1769
- const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), u = await this.http.put(
1632
+ const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), a = await this.http.put(
1770
1633
  `/collaborativeeditor/${i}`,
1771
1634
  {
1772
1635
  name: t,
@@ -1774,7 +1637,7 @@ class CollaborativeEditorResourceService extends ResourceService {
1774
1637
  thumbnail: o
1775
1638
  }
1776
1639
  );
1777
- return this.checkHttpResponse(u), { thumbnail: o, entId: i };
1640
+ return this.checkHttpResponse(a), { thumbnail: o, entId: i };
1778
1641
  }
1779
1642
  getResourceType() {
1780
1643
  return RESOURCE$3;
@@ -2029,9 +1892,9 @@ class AnalyticsService {
2029
1892
  let r;
2030
1893
  if (!(t != null && t.structures)) return;
2031
1894
  for (const l of t.structures) {
2032
- const p = n.structureMap[l];
2033
- if (p && p.collectiviteId && p.UAI) {
2034
- r = p;
1895
+ const h = n.structureMap[l];
1896
+ if (h && h.collectiviteId && h.UAI) {
1897
+ r = h;
2035
1898
  break;
2036
1899
  }
2037
1900
  }
@@ -2040,11 +1903,11 @@ class AnalyticsService {
2040
1903
  if (!i) return;
2041
1904
  const o = i.xiti;
2042
1905
  if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
2043
- function u(l) {
2044
- let p = "";
2045
- for (let d = 0; d < l.length; d++)
2046
- p += l.charCodeAt(d);
2047
- return p;
1906
+ function a(l) {
1907
+ let h = "";
1908
+ for (let E = 0; E < l.length; E++)
1909
+ h += l.charCodeAt(E);
1910
+ return h;
2048
1911
  }
2049
1912
  const c = {
2050
1913
  Student: "ELEVE",
@@ -2063,7 +1926,7 @@ class AnalyticsService {
2063
1926
  PROJET: r.projetId ? r.projetId : n.ID_PROJET,
2064
1927
  EXPLOITANT: n.ID_EXPLOITANT,
2065
1928
  PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
2066
- ID_PERSO: u(t.userId),
1929
+ ID_PERSO: a(t.userId),
2067
1930
  PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
2068
1931
  };
2069
1932
  }
@@ -2298,25 +2161,25 @@ class ConfService {
2298
2161
  conf: t,
2299
2162
  publicTheme: s
2300
2163
  }) {
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) => (
2164
+ var E;
2165
+ const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
2166
+ (p) => (
2304
2167
  // Fix #WB2-2660:
2305
2168
  // If Public access => get the neo theme
2306
2169
  // Else get the theme from the user preference
2307
- s ? h.parent === "theme-open-ent" && h.bootstrapVersion === "ode-bootstrap-neo" : h.child === (r == null ? void 0 : r.themeName)
2170
+ s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
2308
2171
  )
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";
2172
+ ), 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";
2310
2173
  return {
2311
- basePath: `${this.cdnDomain}${u}../../`,
2174
+ basePath: `${this.cdnDomain}${a}../../`,
2312
2175
  bootstrapVersion: l,
2313
- is1d: p,
2176
+ is1d: h,
2314
2177
  logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
2315
2178
  skin: i == null ? void 0 : i.child,
2316
2179
  skinName: o,
2317
2180
  skins: c,
2318
2181
  themeName: i == null ? void 0 : i.child,
2319
- themeUrl: u,
2182
+ themeUrl: a,
2320
2183
  npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
2321
2184
  uiOverrides: i == null ? void 0 : i.uiOverrides
2322
2185
  };
@@ -2333,7 +2196,7 @@ class ConfService {
2333
2196
  const SEND_ALL = "*";
2334
2197
  class WebBroker {
2335
2198
  constructor(e) {
2336
- a(this, "subscription");
2199
+ u(this, "subscription");
2337
2200
  this.odeServices = e;
2338
2201
  }
2339
2202
  get http() {
@@ -2365,10 +2228,10 @@ class WebBroker {
2365
2228
  }
2366
2229
  class DataService {
2367
2230
  constructor(e) {
2368
- a(this, "_webBroker");
2369
- a(this, "app");
2370
- a(this, "user");
2371
- a(this, "profile");
2231
+ u(this, "_webBroker");
2232
+ u(this, "app");
2233
+ u(this, "user");
2234
+ u(this, "profile");
2372
2235
  this.odeServices = e;
2373
2236
  }
2374
2237
  get conf() {
@@ -2402,7 +2265,7 @@ class DataService {
2402
2265
  addUserInfos(e) {
2403
2266
  return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
2404
2267
  }
2405
- trackVideoSave(e, t, s, r, i, o, u) {
2268
+ trackVideoSave(e, t, s, r, i, o, a) {
2406
2269
  const c = this.addUserInfos({
2407
2270
  "event-type": "VIDEO_SAVE",
2408
2271
  module: this.app || "video",
@@ -2413,7 +2276,7 @@ class DataService {
2413
2276
  source: r ? "CAPTURED" : "UPLOADED",
2414
2277
  url: i
2415
2278
  });
2416
- u && (c.device_type = u), this.trackWebEvent(c);
2279
+ a && (c.device_type = a), this.trackWebEvent(c);
2417
2280
  }
2418
2281
  trackVideoRead(e, t, s, r, i) {
2419
2282
  const o = this.addUserInfos({
@@ -2481,14 +2344,14 @@ class DirectoryService {
2481
2344
  id: s,
2482
2345
  displayName: r,
2483
2346
  notVisibleCount: o,
2484
- groups: t.map(({ name: u, id: c, nbUsers: l }) => ({
2347
+ groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
2485
2348
  nbUsers: l,
2486
- displayName: u,
2349
+ displayName: a,
2487
2350
  id: c
2488
2351
  })),
2489
- users: i.map(({ displayName: u, id: c, profile: l }) => ({
2352
+ users: i.map(({ displayName: a, id: c, profile: l }) => ({
2490
2353
  profile: l,
2491
- displayName: u,
2354
+ displayName: a,
2492
2355
  // these info are missing from api
2493
2356
  firstName: "",
2494
2357
  lastName: "",
@@ -2503,9 +2366,9 @@ class DirectoryService {
2503
2366
  users: r
2504
2367
  }) {
2505
2368
  this.cache.clearCache("/directory/sharebookmark/all");
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);
2369
+ 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) => {
2370
+ if (typeof p == "string") {
2371
+ 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);
2509
2372
  return {
2510
2373
  displayName: y,
2511
2374
  id: g,
@@ -2513,19 +2376,19 @@ class DirectoryService {
2513
2376
  members: [...F, ...w]
2514
2377
  };
2515
2378
  } else
2516
- return Promise.resolve(h);
2517
- }), l = (await Promise.all(u)).map((h) => h.members).reduce((h, y) => [...h, ...y], []), p = {
2379
+ return Promise.resolve(p);
2380
+ }), l = (await Promise.all(a)).map((p) => p.members).reduce((p, y) => [...p, ...y], []), h = {
2518
2381
  name: e,
2519
2382
  members: [...i, ...o, ...l]
2520
- }, { id: d } = await this.http.postJson(
2383
+ }, { id: E } = await this.http.postJson(
2521
2384
  "/directory/sharebookmark",
2522
- p
2385
+ h
2523
2386
  );
2524
2387
  return {
2525
- id: d,
2388
+ id: E,
2526
2389
  displayName: e,
2527
2390
  notVisibleCount: 0,
2528
- members: p.members
2391
+ members: h.members
2529
2392
  };
2530
2393
  }
2531
2394
  }
@@ -2564,10 +2427,10 @@ class EmbedderService {
2564
2427
  urlIsFromPattern(e, t) {
2565
2428
  const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
2566
2429
  let i = !0;
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) => {
2430
+ const o = t.match(s) || [], a = [];
2431
+ return (t.match(r) || []).forEach((l, h) => {
2432
+ l.includes("ignore") || a.push(o[h]);
2433
+ }), a.forEach((l) => {
2571
2434
  if (!e.includes(l)) {
2572
2435
  i = !1;
2573
2436
  return;
@@ -2598,17 +2461,17 @@ class EmbedderService {
2598
2461
  if (this.urlIsFromPattern(t, s)) {
2599
2462
  const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
2600
2463
  let o = e.embed;
2601
- for (const u of i) {
2602
- let c = s.split(u)[0];
2464
+ for (const a of i) {
2465
+ let c = s.split(a)[0];
2603
2466
  const l = c.split("}");
2604
2467
  l.length > 1 && (c = l[l.length - 1]);
2605
- let p = t.split(c)[1];
2606
- if (!p)
2468
+ let h = t.split(c)[1];
2469
+ if (!h)
2607
2470
  continue;
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);
2471
+ const E = s.split(a)[1].split("{")[0];
2472
+ E && (h = h.split(E)[0]);
2473
+ const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
2474
+ o = o.replace(p, h);
2612
2475
  }
2613
2476
  return o;
2614
2477
  }
@@ -2862,9 +2725,9 @@ class IdiomService {
2862
2725
  const i = new Promisified();
2863
2726
  promises[t] = i.promise;
2864
2727
  const o = {};
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) => {
2728
+ e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
2729
+ Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
2730
+ }).catch((a) => {
2868
2731
  typeof s == "function" && s(), i.reject();
2869
2732
  });
2870
2733
  }
@@ -2943,7 +2806,7 @@ class NextcloudService {
2943
2806
  * documents added from applications, the way an upload does.
2944
2807
  */
2945
2808
  async copyDocumentToWorkspace(e, t, s, r) {
2946
- const i = t.map((u) => `path=${encodeURIComponent(u)}`).join("&");
2809
+ const i = t.map((a) => `path=${encodeURIComponent(a)}`).join("&");
2947
2810
  return (await this.http.put(
2948
2811
  `/nextcloud/files/user/${e}/copy/workspace?${i}`,
2949
2812
  void 0,
@@ -2954,7 +2817,7 @@ class NextcloudService {
2954
2817
  ...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
2955
2818
  }
2956
2819
  }
2957
- )).data.filter((u) => !!(u != null && u._id));
2820
+ )).data.filter((a) => !!(a != null && a._id));
2958
2821
  }
2959
2822
  /**
2960
2823
  * Check whether a user has an active Nextcloud OAuth2 connection.
@@ -2988,7 +2851,7 @@ class AbstractBehaviourService {
2988
2851
  //-----------------
2989
2852
  //--- Utilities ---
2990
2853
  //-----------------
2991
- a(this, "_cache");
2854
+ u(this, "_cache");
2992
2855
  this.context = e, this._cache = new CacheService(this.context);
2993
2856
  }
2994
2857
  getApplication() {
@@ -3022,8 +2885,8 @@ class AbstractBehaviourService {
3022
2885
  class ActualitesBehaviour extends AbstractBehaviourService {
3023
2886
  constructor() {
3024
2887
  super(...arguments);
3025
- a(this, "APP", "actualites");
3026
- a(this, "RESOURCE", "actualites");
2888
+ u(this, "APP", "actualites");
2889
+ u(this, "RESOURCE", "actualites");
3027
2890
  }
3028
2891
  async loadResources() {
3029
2892
  const [t, s] = await Promise.all([
@@ -3034,10 +2897,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
3034
2897
  /* @__PURE__ */ new Map()
3035
2898
  );
3036
2899
  return t.map((i) => {
3037
- var u;
2900
+ var a;
3038
2901
  let o;
3039
2902
  return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
3040
- title: i.title + " [" + ((u = r.get(i.threadId)) == null ? void 0 : u.title) + "]",
2903
+ title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
3041
2904
  ownerName: i.owner.displayName,
3042
2905
  owner: i.owner.id,
3043
2906
  icon: o,
@@ -3058,8 +2921,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
3058
2921
  class AppointmentsBehaviour extends AbstractBehaviourService {
3059
2922
  constructor() {
3060
2923
  super(...arguments);
3061
- a(this, "APP", "appointments");
3062
- a(this, "RESOURCE", "appointments");
2924
+ u(this, "APP", "appointments");
2925
+ u(this, "RESOURCE", "appointments");
3063
2926
  }
3064
2927
  async loadResources() {
3065
2928
  return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
@@ -3077,8 +2940,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
3077
2940
  class BlogBehaviour extends AbstractBehaviourService {
3078
2941
  constructor() {
3079
2942
  super(...arguments);
3080
- a(this, "APP", "blog");
3081
- a(this, "RESOURCE", "blog");
2943
+ u(this, "APP", "blog");
2944
+ u(this, "RESOURCE", "blog");
3082
2945
  }
3083
2946
  loadResources() {
3084
2947
  return new Promise(async (t, s) => {
@@ -3086,7 +2949,7 @@ class BlogBehaviour extends AbstractBehaviourService {
3086
2949
  const r = await this.httpGet("/blog/linker"), i = [];
3087
2950
  r.forEach((o) => {
3088
2951
  o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
3089
- const u = o.fetchPosts.map((c) => this.dataToResource({
2952
+ const a = o.fetchPosts.map((c) => this.dataToResource({
3090
2953
  owner: o.author.userId,
3091
2954
  ownerName: o.author.username,
3092
2955
  title: c.title + " [" + o.title + "]",
@@ -3096,7 +2959,7 @@ class BlogBehaviour extends AbstractBehaviourService {
3096
2959
  shared: !!(o.shared && o.shared.length >= 0),
3097
2960
  modified: o.modified
3098
2961
  }));
3099
- i.push(...u);
2962
+ i.push(...a);
3100
2963
  }), t(i);
3101
2964
  } catch (r) {
3102
2965
  s(r);
@@ -3107,8 +2970,8 @@ class BlogBehaviour extends AbstractBehaviourService {
3107
2970
  class CollaborativewallBehaviour extends AbstractBehaviourService {
3108
2971
  constructor() {
3109
2972
  super(...arguments);
3110
- a(this, "APP", "collaborativewall");
3111
- a(this, "RESOURCE", "collaborativewall");
2973
+ u(this, "APP", "collaborativewall");
2974
+ u(this, "RESOURCE", "collaborativewall");
3112
2975
  }
3113
2976
  async loadResources() {
3114
2977
  return (await this.httpGet(
@@ -3130,8 +2993,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
3130
2993
  class CommunityBehaviour extends AbstractBehaviourService {
3131
2994
  constructor() {
3132
2995
  super(...arguments);
3133
- a(this, "APP", "community");
3134
- a(this, "RESOURCE", "community");
2996
+ u(this, "APP", "community");
2997
+ u(this, "RESOURCE", "community");
3135
2998
  }
3136
2999
  async loadResources() {
3137
3000
  return (await this.httpGet(
@@ -3155,8 +3018,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
3155
3018
  class ExercizerBehaviour extends AbstractBehaviourService {
3156
3019
  constructor() {
3157
3020
  super(...arguments);
3158
- a(this, "APP", "exercizer");
3159
- a(this, "RESOURCE", "exercizer");
3021
+ u(this, "APP", "exercizer");
3022
+ u(this, "RESOURCE", "exercizer");
3160
3023
  }
3161
3024
  async loadResources() {
3162
3025
  return (await this.httpGet(
@@ -3164,8 +3027,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3164
3027
  )).map((s) => {
3165
3028
  const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
3166
3029
  let i, o = !1;
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({
3030
+ const a = JSON.parse(s.scheduled_at);
3031
+ 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({
3169
3032
  title: s.title,
3170
3033
  owner: s.owner,
3171
3034
  ownerName: i,
@@ -3181,8 +3044,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
3181
3044
  class FormulaireBehaviour extends AbstractBehaviourService {
3182
3045
  constructor() {
3183
3046
  super(...arguments);
3184
- a(this, "APP", "formulaire");
3185
- a(this, "RESOURCE", "formulaire");
3047
+ u(this, "APP", "formulaire");
3048
+ u(this, "RESOURCE", "formulaire");
3186
3049
  }
3187
3050
  async loadResources() {
3188
3051
  return (await this.httpGet(
@@ -3202,8 +3065,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
3202
3065
  class ForumBehaviour extends AbstractBehaviourService {
3203
3066
  constructor() {
3204
3067
  super(...arguments);
3205
- a(this, "APP", "forum");
3206
- a(this, "RESOURCE", "forum");
3068
+ u(this, "APP", "forum");
3069
+ u(this, "RESOURCE", "forum");
3207
3070
  }
3208
3071
  async loadResources() {
3209
3072
  return (await this.httpGet("/forum/categories")).map(
@@ -3223,8 +3086,8 @@ class ForumBehaviour extends AbstractBehaviourService {
3223
3086
  class HomeworksBehaviour extends AbstractBehaviourService {
3224
3087
  constructor() {
3225
3088
  super(...arguments);
3226
- a(this, "APP", "homeworks");
3227
- a(this, "RESOURCE", "homeworks");
3089
+ u(this, "APP", "homeworks");
3090
+ u(this, "RESOURCE", "homeworks");
3228
3091
  }
3229
3092
  async loadResources() {
3230
3093
  return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
@@ -3242,8 +3105,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
3242
3105
  class MagnetoBehaviour extends AbstractBehaviourService {
3243
3106
  constructor() {
3244
3107
  super(...arguments);
3245
- a(this, "APP", "magneto");
3246
- a(this, "RESOURCE", "magneto");
3108
+ u(this, "APP", "magneto");
3109
+ u(this, "RESOURCE", "magneto");
3247
3110
  }
3248
3111
  async loadResources() {
3249
3112
  const { all: t } = await this.httpGet(
@@ -3264,8 +3127,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
3264
3127
  class MindmapBehaviour extends AbstractBehaviourService {
3265
3128
  constructor() {
3266
3129
  super(...arguments);
3267
- a(this, "APP", "mindmap");
3268
- a(this, "RESOURCE", "mindmap");
3130
+ u(this, "APP", "mindmap");
3131
+ u(this, "RESOURCE", "mindmap");
3269
3132
  }
3270
3133
  async loadResources() {
3271
3134
  return (await this.httpGet("/mindmap/list/all")).map(
@@ -3285,8 +3148,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
3285
3148
  class PagesBehaviour extends AbstractBehaviourService {
3286
3149
  constructor() {
3287
3150
  super(...arguments);
3288
- a(this, "APP", "pages");
3289
- a(this, "RESOURCE", "pages");
3151
+ u(this, "APP", "pages");
3152
+ u(this, "RESOURCE", "pages");
3290
3153
  }
3291
3154
  async loadResources() {
3292
3155
  const t = await this.httpGet("/pages/list/all"), s = [];
@@ -3304,15 +3167,15 @@ class PagesBehaviour extends AbstractBehaviourService {
3304
3167
  shared: typeof r.shared < "u",
3305
3168
  modified: r.modified
3306
3169
  })
3307
- ), (o = r.pages) == null || o.forEach((u) => {
3170
+ ), (o = r.pages) == null || o.forEach((a) => {
3308
3171
  s.push(
3309
3172
  this.dataToResource({
3310
- title: u.title,
3173
+ title: a.title,
3311
3174
  owner: r.owner.userId,
3312
3175
  ownerName: r.owner.displayName,
3313
3176
  icon: i,
3314
- path: "/pages#/website/" + r._id + "/" + u.titleLink,
3315
- _id: r._id + "/" + u.titleLink,
3177
+ path: "/pages#/website/" + r._id + "/" + a.titleLink,
3178
+ _id: r._id + "/" + a.titleLink,
3316
3179
  shared: typeof r.shared < "u",
3317
3180
  modified: r.modified
3318
3181
  })
@@ -3324,8 +3187,8 @@ class PagesBehaviour extends AbstractBehaviourService {
3324
3187
  class PollBehaviour extends AbstractBehaviourService {
3325
3188
  constructor() {
3326
3189
  super(...arguments);
3327
- a(this, "APP", "poll");
3328
- a(this, "RESOURCE", "poll");
3190
+ u(this, "APP", "poll");
3191
+ u(this, "RESOURCE", "poll");
3329
3192
  }
3330
3193
  async loadResources() {
3331
3194
  return (await this.httpGet("/poll/list/all")).map((s) => {
@@ -3346,8 +3209,8 @@ class PollBehaviour extends AbstractBehaviourService {
3346
3209
  class ScrapbookBehaviour extends AbstractBehaviourService {
3347
3210
  constructor() {
3348
3211
  super(...arguments);
3349
- a(this, "APP", "scrapbook");
3350
- a(this, "RESOURCE", "scrapbook");
3212
+ u(this, "APP", "scrapbook");
3213
+ u(this, "RESOURCE", "scrapbook");
3351
3214
  }
3352
3215
  async loadResources() {
3353
3216
  return (await this.httpGet(
@@ -3370,8 +3233,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
3370
3233
  class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3371
3234
  constructor() {
3372
3235
  super(...arguments);
3373
- a(this, "APP", "timelinegenerator");
3374
- a(this, "RESOURCE", "timelinegenerator");
3236
+ u(this, "APP", "timelinegenerator");
3237
+ u(this, "RESOURCE", "timelinegenerator");
3375
3238
  }
3376
3239
  loadResources() {
3377
3240
  return new Promise(async (t, s) => {
@@ -3379,12 +3242,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3379
3242
  const i = (await this.httpGet(
3380
3243
  "/timelinegenerator/timelines"
3381
3244
  )).map((o) => {
3382
- const u = o.icon || "/img/illustrations/timeline-default.png";
3245
+ const a = o.icon || "/img/illustrations/timeline-default.png";
3383
3246
  return this.dataToResource({
3384
3247
  title: o.headline,
3385
3248
  ownerName: o.owner.displayName,
3386
3249
  owner: o.owner.userId,
3387
- icon: u,
3250
+ icon: a,
3388
3251
  path: "/timelinegenerator#/view/" + o._id,
3389
3252
  _id: o._id,
3390
3253
  shared: typeof o.shared < "u",
@@ -3401,8 +3264,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
3401
3264
  class WikiBehaviour extends AbstractBehaviourService {
3402
3265
  constructor() {
3403
3266
  super(...arguments);
3404
- a(this, "APP", "wiki");
3405
- a(this, "RESOURCE", "wiki");
3267
+ u(this, "APP", "wiki");
3268
+ u(this, "RESOURCE", "wiki");
3406
3269
  }
3407
3270
  async loadResources() {
3408
3271
  return (await this.httpGet(
@@ -3425,8 +3288,8 @@ class WikiBehaviour extends AbstractBehaviourService {
3425
3288
  class WorkspaceBehaviour extends AbstractBehaviourService {
3426
3289
  constructor() {
3427
3290
  super(...arguments);
3428
- a(this, "APP", "workspace");
3429
- a(this, "RESOURCE", "workspace");
3291
+ u(this, "APP", "workspace");
3292
+ u(this, "RESOURCE", "workspace");
3430
3293
  }
3431
3294
  loadResources({ search: t, asset_id: s }) {
3432
3295
  return new Promise(async (r, i) => {
@@ -3434,12 +3297,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3434
3297
  let o = "/workspace/documents?filter=all&hierarchical=true";
3435
3298
  s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
3436
3299
  const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
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";
3300
+ const h = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
3438
3301
  return this.dataToResource({
3439
3302
  title: l.name,
3440
3303
  ownerName: l.ownerName,
3441
3304
  owner: l.owner,
3442
- icon: p,
3305
+ icon: h,
3443
3306
  path: `/workspace/document/${l._id}`,
3444
3307
  _id: l._id,
3445
3308
  shared: !!(l.shared && l.shared.length >= 0),
@@ -3453,7 +3316,7 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
3453
3316
  });
3454
3317
  }
3455
3318
  }
3456
- const R = class R {
3319
+ const b = class b {
3457
3320
  static async initialize(e, t) {
3458
3321
  const s = e.http();
3459
3322
  if (!this.resourceProducingApps.length) {
@@ -3464,7 +3327,7 @@ const R = class R {
3464
3327
  e.session().getUser()
3465
3328
  ]);
3466
3329
  i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
3467
- (o) => i.apps.some((u) => u.address.includes(o))
3330
+ (o) => i.apps.some((a) => a.address.includes(o))
3468
3331
  ));
3469
3332
  } catch (r) {
3470
3333
  console.warn("Failed to load resource-producing apps:", r);
@@ -3547,9 +3410,9 @@ const R = class R {
3547
3410
  //
3548
3411
  // STATIC REGISTRY
3549
3412
  //
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;
3413
+ u(b, "registry", new ServiceRegistry()), // Expose some useful functions
3414
+ u(b, "findBehaviour", b.registry.findService.bind(b.registry)), u(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), u(b, "resourceProducingApps", []);
3415
+ let SnipletsService = b;
3553
3416
  class RightService {
3554
3417
  constructor(e) {
3555
3418
  this.context = e;
@@ -3747,14 +3610,14 @@ class SessionService {
3747
3610
  r,
3748
3611
  i,
3749
3612
  o,
3750
- u
3613
+ a
3751
3614
  ] = await Promise.all([
3752
3615
  this.getCurrentLanguage(e),
3753
3616
  this.latestQuotaAndUsage(e),
3754
3617
  this.loadDescription(e),
3755
3618
  this.getUserProfile(),
3756
3619
  this.getBookmarks(e)
3757
- ]), { type: c, ...l } = t || {}, p = {
3620
+ ]), { type: c, ...l } = t || {}, h = {
3758
3621
  ...l,
3759
3622
  profiles: c || ["Guest"],
3760
3623
  // "type" field from /userbook/api/person becomes "profiles"
@@ -3765,9 +3628,9 @@ class SessionService {
3765
3628
  user: e,
3766
3629
  quotaAndUsage: r,
3767
3630
  currentLanguage: s,
3768
- userDescription: p,
3631
+ userDescription: h,
3769
3632
  userProfile: o,
3770
- bookmarkedApps: u
3633
+ bookmarkedApps: a
3771
3634
  };
3772
3635
  }
3773
3636
  login(e, t, s, r) {
@@ -3861,7 +3724,7 @@ class SessionService {
3861
3724
  applications: []
3862
3725
  });
3863
3726
  const i = [];
3864
- return r.bookmarks.forEach((o, u) => {
3727
+ return r.bookmarks.forEach((o, a) => {
3865
3728
  const c = ((e == null ? void 0 : e.apps) || []).find(
3866
3729
  (l) => l.name === o
3867
3730
  );
@@ -3877,11 +3740,11 @@ class SessionService {
3877
3740
  }
3878
3741
  async getPerson(e = {}) {
3879
3742
  var c;
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(
3743
+ 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(
3881
3744
  i,
3882
3745
  t
3883
3746
  );
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;
3747
+ return o.status < 200 || o.status >= 300 || typeof a == "string" ? null : ((c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) || null;
3885
3748
  }
3886
3749
  async isAdml() {
3887
3750
  const e = await this.getUser();
@@ -3939,38 +3802,38 @@ class ShareService {
3939
3802
  t,
3940
3803
  s,
3941
3804
  r
3942
- ), u = await this.cache.httpGetJson(o), c = u.users.visibles.filter(({ username: h, firstName: y, lastName: E, login: g }) => {
3805
+ ), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
3943
3806
  const A = StringUtils.removeAccents(
3944
- E || ""
3807
+ d || ""
3945
3808
  ).toLowerCase(), f = StringUtils.removeAccents(
3946
3809
  y || ""
3947
3810
  ).toLowerCase(), w = StringUtils.removeAccents(
3948
- h || ""
3811
+ p || ""
3949
3812
  ).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
3950
3813
  return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
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,
3814
+ }).map((p) => ({
3815
+ avatarUrl: this.directory.getAvatarUrl(p.id, "user"),
3816
+ directoryUrl: this.directory.getDirectoryUrl(p.id, "user"),
3817
+ displayName: p.username,
3818
+ id: p.id,
3819
+ profile: p.profile,
3957
3820
  type: "user"
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,
3821
+ })), l = a.groups.visibles.filter(({ name: p }) => StringUtils.removeAccents(p || "").toLowerCase().includes(i)).map((p) => ({
3822
+ avatarUrl: this.directory.getAvatarUrl(p.id, "group"),
3823
+ directoryUrl: this.directory.getDirectoryUrl(p.id, "group"),
3824
+ displayName: p.name,
3825
+ id: p.id,
3963
3826
  type: "group",
3964
- structureName: h.structureName
3827
+ structureName: p.structureName
3965
3828
  }));
3966
- return [...(await this.directory.getBookMarks()).filter(({ displayName: h }) => StringUtils.removeAccents(
3967
- h || ""
3968
- ).toLowerCase().includes(i)).map((h) => ({
3829
+ return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
3830
+ p || ""
3831
+ ).toLowerCase().includes(i)).map((p) => ({
3969
3832
  avatarUrl: "",
3970
3833
  directoryUrl: "",
3971
3834
  profile: "",
3972
- displayName: h.displayName,
3973
- id: h.id,
3835
+ displayName: p.displayName,
3836
+ id: p.id,
3974
3837
  type: "sharebookmark"
3975
3838
  })), ...c, ...l];
3976
3839
  }
@@ -3986,10 +3849,10 @@ class ShareService {
3986
3849
  return s;
3987
3850
  }
3988
3851
  getActionsAvailableFor({ id: e, type: t }, s, r) {
3989
- const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], u = Object.keys(r), c = [];
3990
- for (const l of u)
3852
+ const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
3853
+ for (const l of a)
3991
3854
  r[l].filter(
3992
- (h) => o.includes(h)
3855
+ (p) => o.includes(p)
3993
3856
  ).length > 0 && c.push(l);
3994
3857
  return c;
3995
3858
  }
@@ -4001,26 +3864,26 @@ class ShareService {
4001
3864
  s == null ? void 0 : s.getResourceRights
4002
3865
  ), o = await this.cache.httpGetJson(
4003
3866
  i
4004
- ), u = await this.getShareMapping(
3867
+ ), a = await this.getShareMapping(
4005
3868
  e,
4006
3869
  s == null ? void 0 : s.getShareMapping
4007
3870
  ), c = await this.cache.httpGetJson(
4008
3871
  "/infra/public/json/sharing-rights.json"
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) => {
3872
+ ), l = Object.keys(o.users.checked).map((d) => o.users.visibles.find(
3873
+ (A) => A.id === d
3874
+ )).filter((d) => d !== void 0).map((d) => {
4012
3875
  const g = this.getActionsAvailableFor(
4013
- { id: E.id, type: "user" },
3876
+ { id: d.id, type: "user" },
4014
3877
  o,
4015
- u
3878
+ a
4016
3879
  );
4017
3880
  return {
4018
- id: E.id,
3881
+ id: d.id,
4019
3882
  type: "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"),
3883
+ displayName: d.username,
3884
+ profile: d.profile,
3885
+ avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
3886
+ directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
4024
3887
  actions: g.map((f) => {
4025
3888
  const w = c[f];
4026
3889
  return {
@@ -4030,21 +3893,21 @@ class ShareService {
4030
3893
  };
4031
3894
  })
4032
3895
  };
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) => {
3896
+ }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((d) => o.groups.visibles.find(
3897
+ (A) => A.id === d
3898
+ )).filter((d) => d !== void 0).map((d) => {
4036
3899
  const g = this.getActionsAvailableFor(
4037
- { id: E.id, type: "group" },
3900
+ { id: d.id, type: "group" },
4038
3901
  o,
4039
- u
3902
+ a
4040
3903
  );
4041
3904
  return {
4042
- id: E.id,
3905
+ id: d.id,
4043
3906
  type: "group",
4044
- displayName: E.name,
3907
+ displayName: d.name,
4045
3908
  profile: void 0,
4046
- avatarUrl: this.directory.getAvatarUrl(E.id, "group"),
4047
- directoryUrl: this.directory.getDirectoryUrl(E.id, "group"),
3909
+ avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
3910
+ directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
4048
3911
  actions: g.map((f) => {
4049
3912
  const w = c[f];
4050
3913
  return {
@@ -4054,26 +3917,26 @@ class ShareService {
4054
3917
  };
4055
3918
  })
4056
3919
  };
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 }) => ({
3920
+ }).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), E = [...l, ...h], p = o.groups.visibles.map(
3921
+ ({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
4059
3922
  labels: f,
4060
- displayName: E || A,
3923
+ displayName: d || A,
4061
3924
  id: g
4062
3925
  })
4063
3926
  ), y = o.users.visibles.map(
4064
- ({ id: E, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
3927
+ ({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
4065
3928
  displayName: A,
4066
3929
  firstName: f,
4067
3930
  lastName: w,
4068
3931
  login: F,
4069
3932
  profile: g,
4070
- id: E
3933
+ id: d
4071
3934
  })
4072
3935
  );
4073
3936
  return {
4074
- rights: d,
3937
+ rights: E,
4075
3938
  visibleBookmarks: r,
4076
- visibleGroups: h,
3939
+ visibleGroups: p,
4077
3940
  visibleUsers: y
4078
3941
  };
4079
3942
  }
@@ -4084,7 +3947,7 @@ class ShareService {
4084
3947
  bookmarks: {}
4085
3948
  }, i = await this.getShareMapping(e, s);
4086
3949
  for (const o of t) {
4087
- const u = o.actions.map((l) => i[l.id]).reduce((l, p) => Array.isArray(p) ? [...l, ...p] : l, []), c = [...new Set(u)];
3950
+ const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
4088
3951
  c.length > 0 && (o.type === "user" ? r.users[o.id] = c : o.type === "group" ? r.groups[o.id] = c : r.bookmarks[o.id] = c);
4089
3952
  }
4090
3953
  return r;
@@ -4094,40 +3957,40 @@ class ShareService {
4094
3957
  e,
4095
3958
  s,
4096
3959
  r == null ? void 0 : r.getShareMapping
4097
- ), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, u = this.getSearchUrl(
3960
+ ), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, a = this.getSearchUrl(
4098
3961
  e,
4099
3962
  t,
4100
3963
  "",
4101
3964
  r == null ? void 0 : r.getResourceRights
4102
3965
  );
4103
- return this.cache.clearCache(u), await this.http.putJson(o, i);
3966
+ return this.cache.clearCache(a), await this.http.putJson(o, i);
4104
3967
  }
4105
3968
  async getActionsForApp(e, t) {
4106
3969
  const s = await this.cache.httpGetJson(
4107
3970
  "/infra/public/json/sharing-rights.json"
4108
3971
  ), r = await this.getShareMapping(e, t);
4109
3972
  return Object.keys(s).map((o) => {
4110
- const u = s[o];
3973
+ const a = s[o];
4111
3974
  return {
4112
3975
  displayName: o,
4113
3976
  id: o,
4114
- priority: u.priority,
4115
- requires: u.requires
3977
+ priority: a.priority,
3978
+ requires: a.requires
4116
3979
  };
4117
3980
  }).filter((o) => {
4118
- var u;
4119
- return ((u = r[o.id]) == null ? void 0 : u.length) > 0;
4120
- }).sort((o, u) => o.priority - u.priority);
3981
+ var a;
3982
+ return ((a = r[o.id]) == null ? void 0 : a.length) > 0;
3983
+ }).sort((o, a) => o.priority - a.priority);
4121
3984
  }
4122
3985
  }
4123
3986
  const loadedScripts = {};
4124
3987
  class HttpService {
4125
3988
  constructor(e, t) {
4126
3989
  // Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
4127
- a(this, "axios");
4128
- a(this, "baseUrl");
4129
- a(this, "headers", {});
4130
- a(this, "_latestResponse");
3990
+ u(this, "axios");
3991
+ u(this, "baseUrl");
3992
+ u(this, "headers", {});
3993
+ u(this, "_latestResponse");
4131
3994
  this.context = e, this.axios = axios.create(t);
4132
3995
  }
4133
3996
  fixBaseUrl(e) {
@@ -4342,8 +4205,8 @@ class HttpService {
4342
4205
  const r = s ?? "exports", i = this.toAxiosConfig(t);
4343
4206
  return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
4344
4207
  try {
4345
- const u = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
4346
- return Function(u)();
4208
+ const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
4209
+ return Function(a)();
4347
4210
  } catch {
4348
4211
  return o;
4349
4212
  }
@@ -4357,7 +4220,7 @@ class HttpService {
4357
4220
  });
4358
4221
  }
4359
4222
  }
4360
- const b = class b {
4223
+ const C = class C {
4361
4224
  // in minutes. Applies to recorded videos.
4362
4225
  constructor(e) {
4363
4226
  this.context = e;
@@ -4378,8 +4241,8 @@ const b = class b {
4378
4241
  APP$4.VIDEO
4379
4242
  );
4380
4243
  return {
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,
4244
+ maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? C.MAX_WEIGHT,
4245
+ maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? C.MAX_DURATION,
4383
4246
  acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
4384
4247
  (s) => s.toUpperCase()
4385
4248
  )) ?? []
@@ -4402,43 +4265,43 @@ const b = class b {
4402
4265
  throw new Error("Invalid video filename");
4403
4266
  const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
4404
4267
  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);
4405
- let u = `/video/encode?captation=${s}`;
4406
- r && (u += `&duration=${r}`);
4268
+ let a = `/video/encode?captation=${s}`;
4269
+ r && (a += `&duration=${r}`);
4407
4270
  const c = await this.http.post(
4408
- u,
4271
+ a,
4409
4272
  o,
4410
4273
  { headers: { "Content-Type": "multipart/form-data" } }
4411
4274
  );
4412
4275
  if (c.state == "running") {
4413
- let l = 0, p = 1;
4276
+ let l = 0, h = 1;
4414
4277
  do {
4415
- const d = p + l;
4278
+ const E = h + l;
4416
4279
  await new Promise(
4417
- (y) => setTimeout(y, d * 1e3)
4418
- ), l = p, p = Math.min(8, d);
4419
- const h = await this.http.get(
4280
+ (y) => setTimeout(y, E * 1e3)
4281
+ ), l = h, h = Math.min(8, E);
4282
+ const p = await this.http.get(
4420
4283
  `/video/status/${c.processid}`
4421
4284
  );
4422
- if (h.state == "succeed")
4423
- return h.videoworkspaceid && h.videosize && this.context.data().trackVideoSave(
4424
- h.videoworkspaceid,
4285
+ if (p.state == "succeed")
4286
+ return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
4287
+ p.videoworkspaceid,
4425
4288
  Math.round(r),
4426
- h.videosize,
4289
+ p.videosize,
4427
4290
  s,
4428
4291
  e.url,
4429
4292
  i,
4430
4293
  e.device
4431
- ), h;
4432
- if (h.state == "error")
4294
+ ), p;
4295
+ if (p.state == "error")
4433
4296
  break;
4434
4297
  } while (!0);
4435
4298
  }
4436
4299
  throw new Error("Video cannot be uploaded.");
4437
4300
  }
4438
4301
  };
4439
- a(b, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
4440
- a(b, "MAX_DURATION", 3);
4441
- let VideoService = b;
4302
+ u(C, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
4303
+ u(C, "MAX_DURATION", 3);
4304
+ let VideoService = C;
4442
4305
  class WidgetService {
4443
4306
  constructor(e) {
4444
4307
  this.context = e;
@@ -4519,7 +4382,7 @@ const defaultMappers = {
4519
4382
  }
4520
4383
  };
4521
4384
  // FIXME add edumedia support
4522
- a(v, "roleMappers", [
4385
+ u(v, "roleMappers", [
4523
4386
  (e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
4524
4387
  ]);
4525
4388
  let DocumentHelper = v;
@@ -4537,29 +4400,29 @@ class WorkspaceService {
4537
4400
  size: e.size,
4538
4401
  extension: i,
4539
4402
  role: DocumentHelper.role(r, !1, i)
4540
- }, u = t.replace("." + o.extension, ""), c = o.extension ? u + "." + o.extension : u;
4541
- return { basename: u, fullname: c, metadata: o };
4403
+ }, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
4404
+ return { basename: a, fullname: c, metadata: o };
4542
4405
  }
4543
4406
  async saveFile(e, t) {
4544
4407
  const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
4545
4408
  i.append("file", e, s);
4546
4409
  const o = [];
4547
4410
  ((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}`);
4548
- const u = await this.http.postFile(
4411
+ const a = await this.http.postFile(
4549
4412
  `/workspace/document?${o.join("&")}`,
4550
4413
  i
4551
4414
  );
4552
4415
  if (this.http.isResponseError())
4553
4416
  throw this.http.latestResponse.statusText;
4554
- return u;
4417
+ return a;
4555
4418
  }
4556
4419
  async updateFile(e, t, s) {
4557
4420
  const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
4558
4421
  o.append("file", t, r);
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}`);
4422
+ const a = [];
4423
+ 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}`);
4561
4424
  const c = await this.http.putFile(
4562
- `/workspace/document/${e}?${u.join("&")}`,
4425
+ `/workspace/document/${e}?${a.join("&")}`,
4563
4426
  o
4564
4427
  );
4565
4428
  if (this.http.isResponseError())
@@ -4610,11 +4473,11 @@ class WorkspaceService {
4610
4473
  );
4611
4474
  if (this.http.isResponseError())
4612
4475
  throw this.http.latestResponse.statusText;
4613
- return r.forEach((o, u) => {
4476
+ return r.forEach((o, a) => {
4614
4477
  const c = e.findIndex(
4615
4478
  (l) => l._id === o._id
4616
4479
  );
4617
- 0 <= c && c < e.length && (e[c] = i[u]);
4480
+ 0 <= c && c < e.length && (e[c] = i[a]);
4618
4481
  }), e.filter((o) => !!o);
4619
4482
  }
4620
4483
  return e;
@@ -4629,12 +4492,12 @@ class WorkspaceService {
4629
4492
  if (typeof e == "string")
4630
4493
  return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
4631
4494
  {
4632
- const u = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
4495
+ const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
4633
4496
  if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
4634
4497
  const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
4635
- return l ? u + l : null;
4498
+ return l ? a + l : null;
4636
4499
  } else
4637
- return u + r;
4500
+ return a + r;
4638
4501
  }
4639
4502
  }
4640
4503
  /**
@@ -4688,24 +4551,23 @@ class WorkspaceService {
4688
4551
  }
4689
4552
  class OdeServices {
4690
4553
  constructor() {
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);
4554
+ u(this, "_analytics");
4555
+ u(this, "_cache");
4556
+ u(this, "_conf");
4557
+ u(this, "_data");
4558
+ u(this, "_directory");
4559
+ u(this, "_http");
4560
+ u(this, "_idiom");
4561
+ u(this, "_nextcloud");
4562
+ u(this, "_notify");
4563
+ u(this, "_rights");
4564
+ u(this, "_session");
4565
+ u(this, "_share");
4566
+ u(this, "_video");
4567
+ u(this, "_widget");
4568
+ u(this, "_workspace");
4569
+ u(this, "_embedder");
4570
+ 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);
4709
4571
  }
4710
4572
  initialize() {
4711
4573
  return this._data.initialize(), this;
@@ -4728,9 +4590,6 @@ class OdeServices {
4728
4590
  directory() {
4729
4591
  return this._directory;
4730
4592
  }
4731
- googledrive() {
4732
- return this._googledrive;
4733
- }
4734
4593
  http() {
4735
4594
  return this._http;
4736
4595
  }
@@ -4915,10 +4774,10 @@ const isActionAvailable = (n, e) => {
4915
4774
  class WidgetFramework {
4916
4775
  constructor() {
4917
4776
  //-------------------------------------
4918
- a(this, "_initialized");
4919
- a(this, "_widgets", []);
4777
+ u(this, "_initialized");
4778
+ u(this, "_widgets", []);
4920
4779
  ////////////////////////////////////// USER PREFERENCES
4921
- a(this, "_userPrefs", {});
4780
+ u(this, "_userPrefs", {});
4922
4781
  }
4923
4782
  initialize(e, t) {
4924
4783
  return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
@@ -4961,20 +4820,20 @@ class WidgetFramework {
4961
4820
  this._userPrefs = e ?? this._userPrefs;
4962
4821
  const t = configure.Platform.theme, s = [];
4963
4822
  t.listSkins().then((r) => {
4964
- var u;
4965
- const i = ((u = r.find((c) => c.child === t.skin)) == null ? void 0 : u.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4823
+ var a;
4824
+ const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
4966
4825
  this._widgets = this._widgets.filter((c, l) => {
4967
- const p = c.platformConf.name;
4968
- return i.indexOf(p) !== -1 ? !1 : (this._userPrefs[p] || (this._userPrefs[p] = {
4969
- index: defaultWidgetOrder[p] ?? 999,
4826
+ const h = c.platformConf.name;
4827
+ return i.indexOf(h) !== -1 ? !1 : (this._userPrefs[h] || (this._userPrefs[h] = {
4828
+ index: defaultWidgetOrder[h] ?? 999,
4970
4829
  show: !0,
4971
4830
  position: c.platformConf.position
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);
4831
+ }), 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);
4973
4832
  });
4974
4833
  const o = new Idiom();
4975
4834
  this._widgets = this._widgets.sort((c, l) => {
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;
4835
+ const h = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
4836
+ return h < E ? -1 : h > E ? 1 : 0;
4978
4837
  });
4979
4838
  });
4980
4839
  }
@@ -4982,8 +4841,8 @@ class WidgetFramework {
4982
4841
  class Widget {
4983
4842
  //-------------------------------------
4984
4843
  constructor(e) {
4985
- a(this, "_schoolConf", {});
4986
- a(this, "_userPref");
4844
+ u(this, "_schoolConf", {});
4845
+ u(this, "_userPref");
4987
4846
  this._platformConf = e, this._userPref = null;
4988
4847
  }
4989
4848
  get platformConf() {
@@ -5034,8 +4893,6 @@ export {
5034
4893
  ERROR_CODE,
5035
4894
  EVENT_NAME,
5036
4895
  FOLDER,
5037
- GOOGLE_DRIVE_FOLDER_MIME_TYPE,
5038
- GoogleDriveCopyError,
5039
4896
  ITimelineFactory,
5040
4897
  LAYER_NAME,
5041
4898
  NotifyFrameworkFactory,