@beam3_dev/api_module 0.0.80 → 0.0.81

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/wb3Api.js CHANGED
@@ -34,10 +34,10 @@ const L = {
34
34
  b3Edit8: "#616161",
35
35
  b3Edit9: "#795548"
36
36
  };
37
- async function ie(e, t = void 0, s = void 0) {
38
- const n = parseInt(e);
37
+ async function ie(e, t = void 0, n = void 0) {
38
+ const s = parseInt(e);
39
39
  await fetch(
40
- "https://apicarto.ign.fr/api/codes-postaux/communes/" + n,
40
+ "https://apicarto.ign.fr/api/codes-postaux/communes/" + s,
41
41
  {
42
42
  method: "GET",
43
43
  headers: {
@@ -47,10 +47,10 @@ async function ie(e, t = void 0, s = void 0) {
47
47
  ).then((o) => o.json()).then((o) => {
48
48
  t && t(o);
49
49
  }).catch((o) => {
50
- s && s(o), console.error("Erreur : " + o);
50
+ n && n(o), console.error("Erreur : " + o);
51
51
  });
52
52
  }
53
- async function re(e, t = void 0, s = void 0) {
53
+ async function re(e, t = void 0, n = void 0) {
54
54
  e = encodeURIComponent(e), await fetch(
55
55
  "https://api-adresse.data.gouv.fr/search/?q=" + e + "&limit=15",
56
56
  {
@@ -59,19 +59,19 @@ async function re(e, t = void 0, s = void 0) {
59
59
  Accept: "application/json"
60
60
  }
61
61
  }
62
- ).then((n) => n.json()).then((n) => {
63
- t && t(n);
64
- }).catch((n) => {
65
- s && s(n), console.error("Erreur : " + n);
62
+ ).then((s) => s.json()).then((s) => {
63
+ t && t(s);
64
+ }).catch((s) => {
65
+ n && n(s), console.error("Erreur : " + s);
66
66
  });
67
67
  }
68
68
  async function ce(e, t = L) {
69
- let s = N.now().year;
70
- const n = e, o = [], c = (a) => {
71
- for (let i in a)
72
- o.push({ date: i, comment: a[i] });
69
+ let n = N.now().year;
70
+ const s = e, o = [], c = (a) => {
71
+ for (let r in a)
72
+ o.push({ date: r, comment: a[r] });
73
73
  };
74
- for (let a = s; a <= s + 1; a++)
74
+ for (let a = n; a <= n + 1; a++)
75
75
  await fetch(
76
76
  "https://calendrier.api.gouv.fr/jours-feries/metropole/" + a + ".json",
77
77
  {
@@ -80,63 +80,63 @@ async function ce(e, t = L) {
80
80
  Accept: "application/json"
81
81
  }
82
82
  }
83
- ).then((i) => i.json()).then((i) => {
84
- c(i);
85
- }).catch((i) => console.error("Erreur : " + i));
83
+ ).then((r) => r.json()).then((r) => {
84
+ c(r);
85
+ }).catch((r) => console.error("Erreur : " + r));
86
86
  return (() => {
87
- const a = n.length === 0 ? {
87
+ const a = s.length === 0 ? {
88
88
  events: []
89
- } : n;
90
- for (let i of o)
89
+ } : s;
90
+ for (let r of o)
91
91
  a.events.findIndex(
92
- (l) => l.start === N.fromISO(i.date).toISODate() && l.name === "Férié : " + i.comment
92
+ (l) => l.start === N.fromISO(r.date).toISODate() && l.name === "Férié : " + r.comment
93
93
  ) === -1 && a.events.push({
94
- name: "Férié : " + i.comment,
95
- start: N.fromISO(i.date).toISODate(),
96
- end: N.fromISO(i.date).toISODate(),
94
+ name: "Férié : " + r.comment,
95
+ start: N.fromISO(r.date).toISODate(),
96
+ end: N.fromISO(r.date).toISODate(),
97
97
  color: t.b3BusinnessDays,
98
98
  timed: !1
99
99
  });
100
100
  return a;
101
101
  })();
102
102
  }
103
- async function de(e, t, s = !0) {
104
- const n = e.events.findIndex((o) => o.uuid === t.uuid);
105
- return n === -1 ? e.events.push(t) : s ? e.events[n] = t : e.events.splice(n, 1), e.length > 0 && e.sort((o, c) => o.start - c.start), e;
103
+ async function de(e, t, n = !0) {
104
+ const s = e.events.findIndex((o) => o.uuid === t.uuid);
105
+ return s === -1 ? e.events.push(t) : n ? e.events[s] = t : e.events.splice(s, 1), e.length > 0 && e.sort((o, c) => o.start - c.start), e;
106
106
  }
107
107
  function m(e, t) {
108
- O(["DS/WAFData/WAFData"], (s) => {
109
- s.authenticatedRequest(e, t);
108
+ O(["DS/WAFData/WAFData"], (n) => {
109
+ n.authenticatedRequest(e, t);
110
110
  });
111
111
  }
112
- function le(e, t, s) {
113
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
114
- n.draggable(e, { data: t, start: s });
112
+ function le(e, t, n) {
113
+ O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
114
+ s.draggable(e, { data: t, start: n });
115
115
  });
116
116
  }
117
117
  function pe(e, t = void 0) {
118
- O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (s) => {
119
- let n;
120
- n === void 0 && (n = s.createProxy({
118
+ O(["DS/TagNavigatorProxy/TagNavigatorProxy"], (n) => {
119
+ let s;
120
+ s === void 0 && (s = n.createProxy({
121
121
  widgetId: A.id,
122
122
  filteringMode: "WithFilteringServices"
123
- }), t !== void 0 && n.addEvent("onFilterSubjectsChange", t)), n.setSubjectsTags(e);
123
+ }), t !== void 0 && s.addEvent("onFilterSubjectsChange", t)), s.setSubjectsTags(e);
124
124
  });
125
125
  }
126
126
  function ue(e, t) {
127
- O(["DS/DataDragAndDrop/DataDragAndDrop"], (s) => {
128
- s.droppable(e, { drop: t });
127
+ O(["DS/DataDragAndDrop/DataDragAndDrop"], (n) => {
128
+ n.droppable(e, { drop: t });
129
129
  });
130
130
  }
131
- async function fe(e, t = void 0, s = void 0) {
131
+ async function fe(e, t = void 0, n = void 0) {
132
132
  await O(
133
133
  ["DS/i3DXCompassServices/i3DXCompassServices"],
134
- (n) => {
134
+ (s) => {
135
135
  (!e || e === "") && (e = A.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), t && t(
136
- n.getPlatformServices({
136
+ s.getPlatformServices({
137
137
  platformId: e,
138
138
  onComplete: t,
139
- onFailure: s
139
+ onFailure: n
140
140
  })
141
141
  );
142
142
  }
@@ -145,66 +145,66 @@ async function fe(e, t = void 0, s = void 0) {
145
145
  function me() {
146
146
  let e = {};
147
147
  return O(["DS/PlatformAPI/PlatformAPI"], (t) => {
148
- const s = t.getTenant(), n = t.getUser(), o = t.getAllApplicationConfigurations(), c = t.getApplicationConfiguration(
148
+ const n = t.getTenant(), s = t.getUser(), o = t.getAllApplicationConfigurations(), c = t.getApplicationConfiguration(
149
149
  "com.3ds.wp.passport.cors"
150
150
  );
151
151
  e = {
152
- tenant: s,
153
- user: n,
152
+ tenant: n,
153
+ user: s,
154
154
  appsConfiguration: o,
155
155
  appConf: c
156
156
  };
157
157
  }), console.log("%cRETOUR API :", "color:blue", e), e;
158
158
  }
159
- function ge(e, t, s) {
160
- const n = {
159
+ function ge(e, t, n) {
160
+ const s = {
161
161
  base: `${e.space}`,
162
162
  uri: "/resources/AppsMngt/api/custom/applications",
163
163
  option: `?filter=${e.tenant}`
164
164
  // facultatif
165
- }, o = `${n.base}${n.uri}${n.option}`;
165
+ }, o = `${s.base}${s.uri}${s.option}`;
166
166
  m(o, {
167
167
  method: "GET",
168
168
  headers: {
169
169
  "Content-Type": "application/json",
170
170
  Accept: "application/json"
171
171
  },
172
- onComplete(c, r, a) {
173
- const i = JSON.parse(c), d = i.data.map((l) => {
172
+ onComplete(c, i, a) {
173
+ const r = JSON.parse(c), d = r.data.map((l) => {
174
174
  const p = l.attributes.name, u = l.id;
175
175
  return { name: p, id: u };
176
176
  });
177
- t && t(d, i);
177
+ t && t(d, r);
178
178
  },
179
- onFailure(c, r) {
179
+ onFailure(c, i) {
180
180
  const a = c;
181
- a.msg = r.errormsg, a.errCode = r.errorcode, s && s(a);
181
+ a.msg = i.errormsg, a.errCode = i.errorcode, n && n(a);
182
182
  }
183
183
  });
184
184
  }
185
- function he(e, t = void 0, s = void 0) {
186
- let n = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;
187
- m(n, {
188
- onComplete(o, c, r) {
185
+ function he(e, t = void 0, n = void 0) {
186
+ let s = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&limit=-1`;
187
+ m(s, {
188
+ onComplete(o, c, i) {
189
189
  const a = JSON.parse(o);
190
190
  console.log("_AppMngt_get_users => ", a), t && t(a);
191
191
  },
192
192
  onFailure(o, c) {
193
- const r = o;
194
- r.msg = c.errormsg, r.errCode = c.errorcode, s && s(r);
193
+ const i = o;
194
+ i.msg = c.errormsg, i.errCode = c.errorcode, n && n(i);
195
195
  }
196
196
  });
197
197
  }
198
- function Se(e, t, s = void 0, n = void 0) {
198
+ function Se(e, t, n = void 0, s = void 0) {
199
199
  let o = `${e.space}/resources/AppsMngt/user?platform=${e.tenant}&id=${t}`;
200
200
  m(o, {
201
- onComplete(c, r, a) {
202
- const i = JSON.parse(c);
203
- s && s(i);
201
+ onComplete(c, i, a) {
202
+ const r = JSON.parse(c);
203
+ n && n(r);
204
204
  },
205
- onFailure(c, r) {
205
+ onFailure(c, i) {
206
206
  const a = c;
207
- a.msg = r.errormsg, a.errCode = r.errorcode, n && n(a);
207
+ a.msg = i.errormsg, a.errCode = i.errorcode, s && s(a);
208
208
  }
209
209
  });
210
210
  }
@@ -212,10 +212,10 @@ const F = {
212
212
  "Content-Type": "application/json",
213
213
  Accept: "application/json,text/javascript,*/*"
214
214
  };
215
- function _e(e, t, s = void 0, n = void 0) {
215
+ function _e(e, t, n = void 0, s = void 0) {
216
216
  const { space: o, currentUser: c } = e, a = `${o}${{
217
217
  URIUGr: "/3drdfpersist/resources/v1/usersgroup"
218
- }.URIUGr}`, i = {
218
+ }.URIUGr}`, r = {
219
219
  groups: [
220
220
  {
221
221
  title: t.title,
@@ -230,19 +230,19 @@ function _e(e, t, s = void 0, n = void 0) {
230
230
  m(a, {
231
231
  method: "POST",
232
232
  headers: F,
233
- data: JSON.stringify(i),
233
+ data: JSON.stringify(r),
234
234
  onComplete(d) {
235
- s && s(JSON.parse(d));
235
+ n && n(JSON.parse(d));
236
236
  },
237
237
  onFailure(d, l) {
238
238
  console.log(d);
239
239
  const p = d;
240
- p.msg = l.errormsg, p.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", p), n && n(p);
240
+ p.msg = l.errormsg, p.errCode = l.errorcode, console.log("❌ sendDirectMessage => ", p), s && s(p);
241
241
  }
242
242
  });
243
243
  }
244
- function ye(e, t, s = void 0, n = void 0) {
245
- const { space: o, tenant: c } = e, r = o, a = `/3drdfpersist/v1/resources/${t}`, i = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`, d = `${r}${a}${i}`;
244
+ function ye(e, t, n = void 0, s = void 0) {
245
+ const { space: o, tenant: c } = e, i = o, a = `/3drdfpersist/v1/resources/${t}`, r = `?$mask=dsaccess:Mask.GroupUI.Properties&tenant=dstenant:${c}`, d = `${i}${a}${r}`;
246
246
  m(d, {
247
247
  opts: {
248
248
  method: "GET",
@@ -252,32 +252,32 @@ function ye(e, t, s = void 0, n = void 0) {
252
252
  }
253
253
  },
254
254
  onComplete(u) {
255
- s && s(JSON.parse(u));
255
+ n && n(JSON.parse(u));
256
256
  },
257
257
  onFailure(u, f) {
258
258
  const g = u;
259
- g.msg = f.errormsg, g.errCode = f.errorcode, n && n(g);
259
+ g.msg = f.errormsg, g.errCode = f.errorcode, s && s(g);
260
260
  }
261
261
  });
262
262
  }
263
- function E(e, t = void 0, s = void 0) {
264
- const { space: n, tenant: o } = e, c = n, r = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", a = `?tenant=dstenant:${o}`, i = {
263
+ function E(e, t = void 0, n = void 0) {
264
+ const { space: s, tenant: o } = e, c = s, i = "/3drdfpersist/resources/v1/option-sets/dsusergroup:ListOfGroupResponsibilities/options", a = `?tenant=dstenant:${o}`, r = {
265
265
  method: "GET",
266
266
  Accept: "application/json,*/*,test/javascript"
267
- }, d = `${c}${r}${a}`;
267
+ }, d = `${c}${i}${a}`;
268
268
  m(d, {
269
- OPTsH: i,
269
+ OPTsH: r,
270
270
  onComplete(l) {
271
271
  t && t(JSON.parse(l));
272
272
  },
273
273
  onFailure(l, p) {
274
274
  const u = l;
275
- u.msg = p.errormsg, u.errCode = p.errorcode, s && s(u);
275
+ u.msg = p.errormsg, u.errCode = p.errorcode, n && n(u);
276
276
  }
277
277
  });
278
278
  }
279
- function we(e, t = void 0, s = void 0) {
280
- const { space: n, currentUser: o } = e, a = `${n}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
279
+ function we(e, t = void 0, n = void 0) {
280
+ const { space: s, currentUser: o } = e, a = `${s}/3drdfpersist/resources/v1/usersgroup?select=uri,title,description,owner,members,pending_members,creation_date,modification_date,visibility`, d = { method: "GET", headers: {
281
281
  "Content-Type": "application/json",
282
282
  Accept: "application/json,text/javascript,*/*"
283
283
  } };
@@ -294,13 +294,13 @@ function we(e, t = void 0, s = void 0) {
294
294
  u.rules = _, t && t(u);
295
295
  },
296
296
  (_) => {
297
- s && s(_);
297
+ n && n(_);
298
298
  }
299
299
  );
300
300
  }
301
301
  },
302
302
  onFailure(l) {
303
- s && s(l);
303
+ n && n(l);
304
304
  }
305
305
  });
306
306
  } catch (l) {
@@ -308,52 +308,52 @@ function we(e, t = void 0, s = void 0) {
308
308
  }
309
309
  }
310
310
  function Te(e, t) {
311
- const { space: s } = e, o = `${s}/3drdfpersist/resources/v1/usersgroup/${t}`;
311
+ const { space: n } = e, o = `${n}/3drdfpersist/resources/v1/usersgroup/${t}`;
312
312
  m(o, {
313
313
  method: "DELETE"
314
314
  });
315
315
  }
316
- function Ce(e, t, s, n = void 0, o = void 0) {
317
- const { space: c, tenant: r } = e, a = {
316
+ function Ce(e, t, n, s = void 0, o = void 0) {
317
+ const { space: c, tenant: i } = e, a = {
318
318
  URITI: "/3drdfpersist/resources/v1/template-instances",
319
319
  URIUGr: "/3drdfpersist/resources/v1/usersgroup",
320
320
  nextURICh: "/characteristics",
321
321
  nextURIGr: "/group",
322
322
  nexURImem: "/members",
323
323
  OPTsTI: "?$mask=dsaccess:Mask.GroupUI.Properties",
324
- OPTsTenant: `tenant=dstenant:${r}`
325
- }, i = s, d = `${c}${a.URIUGr}/${t}`, l = JSON.stringify(i);
324
+ OPTsTenant: `tenant=dstenant:${i}`
325
+ }, r = n, d = `${c}${a.URIUGr}/${t}`, l = JSON.stringify(r);
326
326
  m(d, {
327
327
  headers: F,
328
328
  method: "PATCH",
329
329
  data: l,
330
330
  type: "json",
331
331
  onComplete(p) {
332
- n && n(p);
332
+ s && s(p);
333
333
  },
334
334
  onFailure(p) {
335
335
  o && o(p);
336
336
  }
337
337
  });
338
338
  }
339
- function Oe(e, t, s, n = void 0, o = void 0) {
339
+ function Oe(e, t, n, s = void 0, o = void 0) {
340
340
  const { space: c } = e, a = `${c}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
341
341
  m(a, {
342
342
  method: "PATCH",
343
343
  headers: F,
344
- data: JSON.stringify(s),
344
+ data: JSON.stringify(n),
345
345
  type: "json",
346
346
  onComplete(d) {
347
- n && n(d);
347
+ s && s(d);
348
348
  },
349
349
  onFailure(d) {
350
350
  o && o(d);
351
351
  }
352
352
  });
353
353
  }
354
- function be(e, t, s = void 0, n = void 0) {
355
- const { space: o } = e, r = `${o}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
356
- m(r, {
354
+ function be(e, t, n = void 0, s = void 0) {
355
+ const { space: o } = e, i = `${o}/3drdfpersist/resources/v1/usersgroup/${t}/sharing`;
356
+ m(i, {
357
357
  opts: {
358
358
  method: "GET",
359
359
  headers: {
@@ -362,27 +362,27 @@ function be(e, t, s = void 0, n = void 0) {
362
362
  }
363
363
  },
364
364
  onComplete(d) {
365
- s && s(JSON.parse(d));
365
+ n && n(JSON.parse(d));
366
366
  },
367
367
  onFailure(d) {
368
- n && n(d);
368
+ s && s(d);
369
369
  }
370
370
  });
371
371
  }
372
- async function J(e, t, s) {
372
+ async function J(e, t, n) {
373
373
  if (e.space) {
374
- const n = `${e.space}/resources/v1/application/CSRF`;
375
- m(n, {
374
+ const s = `${e.space}/resources/v1/application/CSRF`;
375
+ m(s, {
376
376
  onComplete(o) {
377
- o = JSON.parse(o), t && t(o.csrf);
377
+ o = JSON.parse(o), console.log("getCSRFToken() / response => ", o), t && t(o.csrf);
378
378
  },
379
- onFailure(o, c, r) {
380
- s && s({ error: o, headers: c, xhr: r });
379
+ onFailure(o, c, i) {
380
+ n && n({ error: o, headers: c, xhr: i });
381
381
  }
382
382
  });
383
383
  }
384
384
  }
385
- async function G(e, t = void 0, s = void 0, n = void 0) {
385
+ async function G(e, t = void 0, n = void 0, s = void 0) {
386
386
  const o = e.space;
387
387
  if (t === void 0) {
388
388
  console.log("Le paramètre docid est obligatoire");
@@ -390,63 +390,63 @@ async function G(e, t = void 0, s = void 0, n = void 0) {
390
390
  }
391
391
  const c = o + `/resources/v1/modeler/documents/${t}`;
392
392
  m(c, {
393
- onComplete(r, a, i) {
394
- const d = JSON.parse(r);
395
- s && s(d);
393
+ onComplete(i, a, r) {
394
+ const d = JSON.parse(i);
395
+ n && n(d);
396
396
  },
397
- onFailure(r) {
398
- n && n(r);
397
+ onFailure(i) {
398
+ s && s(i);
399
399
  }
400
400
  });
401
401
  }
402
- function k(e, t = void 0, s = void 0) {
402
+ function k(e, t = void 0, n = void 0) {
403
403
  if (e.objID && e.objID !== "") {
404
- let n = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
405
- m(n, {
406
- onComplete(o, c, r) {
404
+ let s = `${e.space}/resources/v1/modeler/documents/${e.objID}`;
405
+ m(s, {
406
+ onComplete(o, c, i) {
407
407
  const a = JSON.parse(o);
408
408
  e.token = a?.csrf?.value, e.datas = a?.data[0], t && t(e);
409
409
  },
410
410
  onFailure(o) {
411
- s && s(o);
411
+ n && n(o);
412
412
  }
413
413
  });
414
414
  } else
415
415
  C(
416
416
  e,
417
- (n) => {
418
- console.log("_3DSpace_get_csrf / _3DSpace_csrf", n), t && t(n);
417
+ (s) => {
418
+ console.log("_3DSpace_get_csrf / _3DSpace_csrf", s), t && t(s);
419
419
  },
420
- (n) => {
421
- s && s(n);
420
+ (s) => {
421
+ n && n(s);
422
422
  }
423
423
  );
424
424
  }
425
- function C(e, t = void 0, s = void 0) {
425
+ function C(e, t = void 0, n = void 0) {
426
426
  if (e.space) {
427
- const n = e.space + "/resources/v1/application/CSRF";
428
- m(n, {
429
- onComplete(o, c, r) {
427
+ const s = e.space + "/resources/v1/application/CSRF";
428
+ m(s, {
429
+ onComplete(o, c, i) {
430
430
  const a = JSON.parse(o);
431
431
  t && t(a.csrf.value);
432
432
  },
433
- onFailure(o, c, r) {
434
- s && s({
433
+ onFailure(o, c, i) {
434
+ n && n({
435
435
  response: o,
436
436
  headers: c,
437
- xhr: r
437
+ xhr: i
438
438
  });
439
439
  }
440
440
  });
441
441
  } else
442
- s && s("ERROR : url du 3DSpace non défini.");
442
+ n && n("ERROR : url du 3DSpace non défini.");
443
443
  }
444
- function U(e, t = void 0, s = void 0) {
445
- let n = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
444
+ function U(e, t = void 0, n = void 0) {
445
+ let s = e.space + `/resources/v1/modeler/documents/${e.objID}/files/DownloadTicket`;
446
446
  k(
447
447
  e,
448
448
  (o) => {
449
- m(n, {
449
+ m(s, {
450
450
  method: "PUT",
451
451
  headers: {
452
452
  ENO_CSRF_TOKEN: e.token
@@ -455,39 +455,39 @@ function U(e, t = void 0, s = void 0) {
455
455
  const a = JSON.parse(c).data[0].dataelements.ticketURL;
456
456
  t && t(a);
457
457
  },
458
- onFailure(c, r) {
459
- console.warn("☠️ error => ", c, r), s && s(c, r);
458
+ onFailure(c, i) {
459
+ console.warn("☠️ error => ", c, i), n && n(c, i);
460
460
  }
461
461
  });
462
462
  },
463
463
  (o) => {
464
- console.warn("_3DSpace_get_ticket / error => ", o), s && s(o);
464
+ console.warn("_3DSpace_get_ticket / error => ", o), n && n(o);
465
465
  }
466
466
  );
467
467
  }
468
- function Ne(e, t, s, n = void 0, o = void 0) {
468
+ function Ne(e, t, n, s = void 0, o = void 0) {
469
469
  const c = `${e.space}/resources/v1/modeler/documents/${t}/files/DownloadTicket`;
470
- s || (s = e.token), m(c, {
470
+ n || (n = e.token), m(c, {
471
471
  method: "PUT",
472
472
  headers: {
473
- ENO_CSRF_TOKEN: s
473
+ ENO_CSRF_TOKEN: n
474
474
  },
475
- onComplete(r) {
476
- let a = JSON.parse(r);
475
+ onComplete(i) {
476
+ let a = JSON.parse(i);
477
477
  if (console.log("☠️ info => ", a), a.success === !0)
478
478
  try {
479
- const i = a.data[0].dataelements.ticketURL;
480
- n && n(i);
481
- } catch (i) {
482
- o && o(i);
479
+ const r = a.data[0].dataelements.ticketURL;
480
+ s && s(r);
481
+ } catch (r) {
482
+ o && o(r);
483
483
  }
484
484
  },
485
- onFailure(r) {
486
- o && o(r);
485
+ onFailure(i) {
486
+ o && o(i);
487
487
  }
488
488
  });
489
489
  }
490
- function K(e, t, s, n, o, c = void 0, r = void 0) {
490
+ function K(e, t, n, s, o, c = void 0, i = void 0) {
491
491
  k(
492
492
  e,
493
493
  t,
@@ -495,26 +495,26 @@ function K(e, t, s, n, o, c = void 0, r = void 0) {
495
495
  W(
496
496
  e,
497
497
  t,
498
- s,
499
498
  n,
499
+ s,
500
500
  o,
501
501
  a.csrf.value,
502
502
  c,
503
- r
503
+ i
504
504
  );
505
505
  }
506
506
  );
507
507
  }
508
- function W(e, t, s, n, o, c, r = void 0, a = void 0) {
509
- const i = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
510
- m(i, {
508
+ function W(e, t, n, s, o, c, i = void 0, a = void 0) {
509
+ const r = e.space + `/resources/v1/modeler/documents/${t}/files/CheckinTicket`;
510
+ m(r, {
511
511
  method: "PUT",
512
512
  headers: {
513
513
  ENO_CSRF_TOKEN: c
514
514
  },
515
515
  onComplete(d, l, p) {
516
516
  const u = JSON.parse(d).data[0].dataelements, f = new FormData();
517
- f.append("__fcs__jobTicket", u.ticket), f.append("file_0", n, o);
517
+ f.append("__fcs__jobTicket", u.ticket), f.append("file_0", s, o);
518
518
  const g = {};
519
519
  g.method = "POST", g.data = f, g.onComplete = function(h) {
520
520
  let S = "temp_" + Date.now(), _ = {
@@ -523,28 +523,24 @@ function W(e, t, s, n, o, c, r = void 0, a = void 0) {
523
523
  ENO_CSRF_TOKEN: c
524
524
  },
525
525
  data: JSON.stringify({
526
- data: [
527
- {
528
- id: t,
529
- relateddata: {
530
- files: [
531
- {
532
- id: s,
533
- dataelements: {
534
- title: o,
535
- receipt: h
536
- },
537
- updateAction: "REVISE"
538
- }
539
- ]
540
- },
541
- tempId: S
542
- }
543
- ]
526
+ data: [{
527
+ id: t,
528
+ relateddata: {
529
+ files: [{
530
+ id: n,
531
+ dataelements: {
532
+ title: o,
533
+ receipt: h
534
+ },
535
+ updateAction: "REVISE"
536
+ }]
537
+ },
538
+ tempId: S
539
+ }]
544
540
  }),
545
541
  type: "json",
546
542
  onComplete(y) {
547
- r && r(y);
543
+ i && i(y);
548
544
  },
549
545
  onFailure(y) {
550
546
  a && a(y);
@@ -560,14 +556,14 @@ function W(e, t, s, n, o, c, r = void 0, a = void 0) {
560
556
  }
561
557
  });
562
558
  }
563
- async function ke(e, t, s, n, o = void 0, c = void 0) {
564
- const r = e.space, a = e.token, i = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
559
+ async function ke(e, t, n, s, o = void 0, c = void 0) {
560
+ const i = e.space, a = e.token, r = e.ctx, d = new FormData(), l = new Blob([JSON.stringify(t)], {
565
561
  type: "text/plain"
566
562
  }), p = {
567
- url_Ticket: `${r}/resources/v1/modeler/documents/files/CheckinTicket`,
568
- url_Post: `${r}/resources/v1/modeler/documents/?SecurityContext=ctx::${i}`
563
+ url_Ticket: `${i}/resources/v1/modeler/documents/files/CheckinTicket`,
564
+ url_Post: `${i}/resources/v1/modeler/documents/?SecurityContext=ctx::${r}`
569
565
  };
570
- if (!r && r !== "") {
566
+ if (!i && i !== "") {
571
567
  console.log("le store._3DSpace est vide");
572
568
  return;
573
569
  }
@@ -578,12 +574,12 @@ async function ke(e, t, s, n, o = void 0, c = void 0) {
578
574
  },
579
575
  onComplete(u, f, g) {
580
576
  const h = JSON.parse(u).data[0].dataelements;
581
- d.append("__fcs__jobTicket", h.ticket), d.append("filename", l, s);
577
+ d.append("__fcs__jobTicket", h.ticket), d.append("filename", l, n);
582
578
  const S = {
583
579
  method: "POST",
584
580
  data: d,
585
581
  onComplete(T) {
586
- if (i !== "" && a !== "") {
582
+ if (r !== "" && a !== "") {
587
583
  const D = {
588
584
  method: "POST",
589
585
  headers: {
@@ -592,34 +588,30 @@ async function ke(e, t, s, n, o = void 0, c = void 0) {
592
588
  "Content-Type": "application/json"
593
589
  },
594
590
  data: JSON.stringify({
595
- data: [
596
- {
597
- type: "Document",
598
- dataelements: {
599
- title: `Title_${s.toLowerCase().split(" ").join("_")}`,
600
- policy: "Document Release",
601
- description: n
602
- },
603
- relateddata: {
604
- files: [
605
- {
606
- dataelements: {
607
- title: `${s}.json`,
608
- receipt: T
609
- }
610
- }
611
- ]
612
- },
613
- tempId: I()
614
- }
615
- ]
591
+ data: [{
592
+ type: "Document",
593
+ dataelements: {
594
+ title: `Title_${n.toLowerCase().split(" ").join("_")}`,
595
+ policy: "Document Release",
596
+ description: s
597
+ },
598
+ relateddata: {
599
+ files: [{
600
+ dataelements: {
601
+ title: `${n}.json`,
602
+ receipt: T
603
+ }
604
+ }]
605
+ },
606
+ tempId: I()
607
+ }]
616
608
  }),
617
609
  type: "json",
618
610
  timeout: 0,
619
611
  onComplete: _,
620
612
  onFailure: y
621
613
  };
622
- i !== "" && m(p.url_Post, D);
614
+ r !== "" && m(p.url_Post, D);
623
615
  } else
624
616
  console.warn("le store est vide");
625
617
  },
@@ -636,12 +628,12 @@ async function ke(e, t, s, n, o = void 0, c = void 0) {
636
628
  }
637
629
  });
638
630
  }
639
- function b(e, t = void 0, s = void 0, n = void 0, o = void 0, c = void 0, r = !1) {
631
+ function b(e, t = void 0, n = void 0, s = void 0, o = void 0, c = void 0, i = !1) {
640
632
  const a = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces`;
641
633
  m(a, {
642
634
  method: "GET",
643
- onComplete(i) {
644
- const d = JSON.parse(i);
635
+ onComplete(r) {
636
+ const d = JSON.parse(r);
645
637
  let l = "", p, u, f;
646
638
  if (t) {
647
639
  let g = d.collabspaces.find((h) => h.title === t);
@@ -652,10 +644,10 @@ function b(e, t = void 0, s = void 0, n = void 0, o = void 0, c = void 0, r = !1
652
644
  (S, _, y) => _ === y.findIndex(
653
645
  (T) => T.organization.pid === S.organization.pid && T.role.pid === S.role.pid
654
646
  )
655
- ), s && (Array.isArray(s) ? s.forEach((S) => {
647
+ ), n && (Array.isArray(n) ? n.forEach((S) => {
656
648
  f || h.forEach((_) => {
657
- if (S === _.role.name && n === _.organization.title)
658
- f = S, u = n;
649
+ if (S === _.role.name && s === _.organization.title)
650
+ f = S, u = s;
659
651
  else if (S === _.role.name) {
660
652
  let y = h.filter(
661
653
  (T) => T.role.name === S
@@ -664,107 +656,104 @@ function b(e, t = void 0, s = void 0, n = void 0, o = void 0, c = void 0, r = !1
664
656
  }
665
657
  });
666
658
  }) : h.forEach((S) => {
667
- if (s === S.role.name && n === S.organization.title)
668
- f = s, u = n;
669
- else if (s === S.role.name) {
659
+ if (n === S.role.name && s === S.organization.title)
660
+ f = n, u = s;
661
+ else if (n === S.role.name) {
670
662
  let _ = h.filter(
671
- (y) => y.role.name === s
663
+ (y) => y.role.name === n
672
664
  );
673
665
  _.length === 1 ? (f = _[0].role.name, u = _[0].organization.title) : c(_);
674
666
  }
675
667
  }));
676
668
  }
677
669
  }
678
- p && u && f ? (l = f + "." + u + "." + p, o(l)) : d.preferredcredentials && r ? (l = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, o(l)) : c && (l = f + "." + u + "." + p, c(l));
670
+ p && u && f ? (l = f + "." + u + "." + p, o(l)) : d.preferredcredentials && i ? (l = d.preferredcredentials.role.name + "." + d.preferredcredentials.organization.title + "." + d.preferredcredentials.collabspace.title, o(l)) : c && (l = f + "." + u + "." + p, c(l));
679
671
  },
680
- onFailure(i, d) {
681
- console.log("Erreur de récupération du contexte de sécurité. => ", {
682
- err: i,
683
- headers: d
684
- });
672
+ onFailure(r) {
673
+ console.log("Erreur de récupération du contexte de sécurité. => ", r);
685
674
  }
686
675
  });
687
676
  }
688
- async function R(e, t = void 0, s = void 0) {
677
+ async function R(e, t = void 0, n = void 0) {
689
678
  return (!e.objID || e.objID === "") && console.warn(
690
679
  "_3DSpace_download_doc() / Le paramètre objectId est obligatoire"
691
680
  ), (e.space === "" || !e.space) && console.warn(
692
681
  "_3DSpace_download_doc() / Le paramètre space est obligatoire"
693
682
  ), (e.token === "" || !e.token) && (J(
694
683
  e,
695
- (n) => {
696
- e.token = n;
684
+ (o) => {
685
+ e.token = o;
697
686
  },
698
- (n) => {
699
- console.log("☠️ error => ", n);
687
+ (o) => {
688
+ console.log("☠️ error => ", o);
700
689
  }
701
690
  ), console.warn(
702
691
  "_3DSpace_download_doc() / Le paramètre token est obligatoire"
703
- )), new Promise((n, o) => {
692
+ )), new Promise((o, c) => {
704
693
  U(
705
694
  e,
706
- (c) => {
707
- m(c, {
695
+ (i) => {
696
+ m(i, {
708
697
  headers: {
709
698
  "Content-Type": "application/json",
710
699
  Accept: "application/json"
711
700
  },
712
- onComplete(a) {
713
- let i;
701
+ onComplete(r) {
702
+ let d;
714
703
  try {
715
- i = JSON.parse(a);
704
+ d = JSON.parse(r);
716
705
  } catch {
717
- i = a;
706
+ d = r;
718
707
  }
719
- t && t(i), n(i);
708
+ return result = d, t && t(d), result;
720
709
  },
721
- onFailure(a, i, d) {
722
- s && (console.log("error http", a), s({
723
- msg: JSON.parse(a),
724
- headers: i,
725
- xhr: d
726
- }), o({
727
- msg: JSON.parse(a),
728
- headers: i,
729
- xhr: d
710
+ onFailure(r, d, l) {
711
+ n && (console.log("error http", r), n({
712
+ msg: JSON.parse(r),
713
+ headers: d,
714
+ xhr: l
715
+ }), c({
716
+ msg: JSON.parse(r),
717
+ headers: d,
718
+ xhr: l
730
719
  }));
731
720
  }
732
721
  });
733
722
  },
734
- (c) => {
735
- s && s(c), console.log("*_3dspace_download_doc / error file URL *", c), o(c);
723
+ (i) => {
724
+ n && n(i), console.log("*_3dspace_download_doc / error file URL *", i), c(i);
736
725
  }
737
726
  );
738
727
  });
739
728
  }
740
- async function X(e, t, s = void 0, n = void 0) {
729
+ async function X(e, t, n = void 0, s = void 0) {
741
730
  let o = [];
742
731
  for (let a = 0; a < t.length; a += 80) {
743
- const i = t.slice(a, a + 80);
744
- o.push(i);
732
+ const r = t.slice(a, a + 80);
733
+ o.push(r);
745
734
  }
746
- const r = (a) => {
735
+ const i = (a) => {
747
736
  V(
748
737
  e,
749
738
  o[a],
750
739
  () => {
751
- a++, a < o.length && r(a);
740
+ a++, a < o.length && i(a);
752
741
  },
753
- (i) => {
754
- s && s(i);
742
+ (r) => {
743
+ n && n(r);
755
744
  }
756
745
  );
757
746
  };
758
- r(0);
747
+ i(0);
759
748
  }
760
- function V(e, t, s = void 0, n = void 0, o = void 0) {
749
+ function V(e, t, n = void 0, s = void 0, o = void 0) {
761
750
  const c = [];
762
- t.forEach((i) => {
751
+ t.forEach((r) => {
763
752
  c.push({
764
- id: i
753
+ id: r
765
754
  });
766
755
  });
767
- let r = JSON.stringify({
756
+ let i = JSON.stringify({
768
757
  csrf: {
769
758
  name: "ENO_CSRF_TOKEN",
770
759
  value: e.token
@@ -774,16 +763,16 @@ function V(e, t, s = void 0, n = void 0, o = void 0) {
774
763
  const a = `${e.space}/resources/v1/modeler/documents/DownloadTicket?tenant=${e.tenant}&e6w-lang=fr&e6w-timezone=-120`;
775
764
  m(a, {
776
765
  method: "PUT",
777
- data: r,
766
+ data: i,
778
767
  type: "json",
779
- onComplete(i) {
780
- const d = i.data;
781
- i.success === !0 && (s && s(), d.forEach((l) => {
768
+ onComplete(r) {
769
+ const d = r.data;
770
+ r.success === !0 && (n && n(), d.forEach((l) => {
782
771
  try {
783
772
  const p = l.dataelements.fileName, u = l.dataelements.ticketURL;
784
773
  m(u, {
785
774
  onComplete: (f) => {
786
- n && n({
775
+ s && s({
787
776
  objectId: l.id,
788
777
  fileName: p,
789
778
  data: JSON.parse(f)
@@ -798,12 +787,12 @@ function V(e, t, s = void 0, n = void 0, o = void 0) {
798
787
  }
799
788
  }));
800
789
  },
801
- onFailure(i) {
802
- console.log(i), o && o(i);
790
+ onFailure(r) {
791
+ console.log(r), o && o(r);
803
792
  }
804
793
  });
805
794
  }
806
- function De(e, t, s = void 0, n = void 0) {
795
+ function De(e, t, n = void 0, s = void 0) {
807
796
  return new Promise((o) => {
808
797
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
809
798
  const c = `${e.space}/resources/v1/modeler/dslc/maturity/getNextStates`;
@@ -817,7 +806,7 @@ function De(e, t, s = void 0, n = void 0) {
817
806
  console.log("onError =>", a);
818
807
  }
819
808
  );
820
- let r = {
809
+ let i = {
821
810
  method: "POST",
822
811
  headers: {
823
812
  SecurityContext: "ctx::" + e.ctx,
@@ -826,36 +815,34 @@ function De(e, t, s = void 0, n = void 0) {
826
815
  "Content-Type": "application/json"
827
816
  },
828
817
  data: JSON.stringify({
829
- data: [
830
- {
831
- id: t
832
- }
833
- ]
818
+ data: [{
819
+ id: t
820
+ }]
834
821
  }),
835
822
  type: "json",
836
823
  onComplete(a) {
837
- s && s(a);
824
+ n && n(a);
838
825
  },
839
826
  onFailure(a) {
840
- n && n(a);
827
+ s && s(a);
841
828
  }
842
829
  };
843
- m(c, r);
830
+ m(c, i);
844
831
  }
845
832
  });
846
833
  }
847
- function Fe(e, t, s, n = void 0, o = void 0) {
834
+ function Fe(e, t, n, s = void 0, o = void 0) {
848
835
  return new Promise((c) => {
849
836
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
850
- const r = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
837
+ const i = `${e.space}/resources/v1/modeler/dslc/maturity/changeState`;
851
838
  b(
852
839
  e.space,
853
840
  "ESPACE COMMUN",
854
841
  ["VPLMProjectLeader", "VPLMCreator"],
855
842
  void 0,
856
- (i) => e.ctx = i,
857
- (i) => {
858
- console.log("onError =>", i);
843
+ (r) => e.ctx = r,
844
+ (r) => {
845
+ console.log("onError =>", r);
859
846
  }
860
847
  );
861
848
  let a = {
@@ -867,26 +854,24 @@ function Fe(e, t, s, n = void 0, o = void 0) {
867
854
  "Content-Type": "application/json"
868
855
  },
869
856
  data: JSON.stringify({
870
- data: [
871
- {
872
- id: t,
873
- nextState: s
874
- }
875
- ]
857
+ data: [{
858
+ id: t,
859
+ nextState: n
860
+ }]
876
861
  }),
877
862
  type: "json",
878
- onComplete(i) {
879
- n && n(i);
863
+ onComplete(r) {
864
+ s && s(r);
880
865
  },
881
- onFailure(i) {
882
- o && o(i);
866
+ onFailure(r) {
867
+ o && o(r);
883
868
  }
884
869
  };
885
- m(r, a);
870
+ m(i, a);
886
871
  }
887
872
  });
888
873
  }
889
- function Ue(e, t, s = void 0, n = void 0) {
874
+ function Ue(e, t, n = void 0, s = void 0) {
890
875
  return new Promise((o) => {
891
876
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
892
877
  const c = `${e.space}/resources/v1/dslc/versiongraph?withThumbnail=0&withIsLastVersion=0&withAttributes=0&withCopyFrom=0&tenant=${e.tenant}`;
@@ -900,7 +885,7 @@ function Ue(e, t, s = void 0, n = void 0) {
900
885
  console.log("onError =>", a);
901
886
  }
902
887
  );
903
- let r = {
888
+ let i = {
904
889
  method: "POST",
905
890
  headers: {
906
891
  securitycontext: "ctx::" + e.ctx,
@@ -909,25 +894,23 @@ function Ue(e, t, s = void 0, n = void 0) {
909
894
  "Content-Type": "application/json"
910
895
  },
911
896
  data: JSON.stringify({
912
- graphRequests: [
913
- {
914
- id: t
915
- }
916
- ]
897
+ graphRequests: [{
898
+ id: t
899
+ }]
917
900
  }),
918
901
  type: "json",
919
902
  onComplete(a) {
920
- s && s(a);
903
+ n && n(a);
921
904
  },
922
905
  onFailure(a) {
923
- n && n(a);
906
+ s && s(a);
924
907
  }
925
908
  };
926
- m(c, r);
909
+ m(c, i);
927
910
  }
928
911
  });
929
912
  }
930
- function je(e, t, s = void 0, n = void 0) {
913
+ function je(e, t, n = void 0, s = void 0) {
931
914
  return new Promise((o) => {
932
915
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
933
916
  const c = `${e.space}/resources/lifecycle/revise/prepare_revise_maskattributes?tenant=${e.tenant}`;
@@ -941,7 +924,7 @@ function je(e, t, s = void 0, n = void 0) {
941
924
  console.log("onError =>", a);
942
925
  }
943
926
  );
944
- let r = {
927
+ let i = {
945
928
  method: "POST",
946
929
  headers: {
947
930
  SecurityContext: "ctx::" + e.ctx,
@@ -950,42 +933,40 @@ function je(e, t, s = void 0, n = void 0) {
950
933
  "Content-Type": "application/json"
951
934
  },
952
935
  data: JSON.stringify({
953
- data: [
954
- {
955
- "attribute[PLMReference.V_versionComment]": null,
956
- physicalid: t,
957
- type: "Document",
958
- tenant: e.tenant,
959
- objectId: t,
960
- policy: "Document Release",
961
- availableSemantic: ["E", "LAST", "NEW", "DUP"]
962
- }
963
- ]
936
+ data: [{
937
+ "attribute[PLMReference.V_versionComment]": null,
938
+ physicalid: t,
939
+ type: "Document",
940
+ tenant: e.tenant,
941
+ objectId: t,
942
+ policy: "Document Release",
943
+ availableSemantic: ["E", "LAST", "NEW", "DUP"]
944
+ }]
964
945
  }),
965
946
  type: "json",
966
947
  onComplete(a) {
967
- s && s(a);
948
+ n && n(a);
968
949
  },
969
950
  onFailure(a) {
970
- n && n(a);
951
+ s && s(a);
971
952
  }
972
953
  };
973
- m(c, r);
954
+ m(c, i);
974
955
  }
975
956
  });
976
957
  }
977
- function $e(e, t, s, n = void 0, o = void 0) {
958
+ function $e(e, t, n, s = void 0, o = void 0) {
978
959
  return new Promise((c) => {
979
960
  if (e.token === "" && C(e), t !== void 0 && t !== "" && t !== null) {
980
- const r = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
961
+ const i = `${e.space}/resources/lifecycle/revise/major?tenant=${e.tenant}`;
981
962
  b(
982
963
  e.space,
983
964
  "ESPACE COMMUN",
984
965
  ["VPLMProjectLeader", "VPLMCreator"],
985
966
  void 0,
986
- (i) => e.ctx = i,
987
- (i) => {
988
- console.log("onError =>", i);
967
+ (r) => e.ctx = r,
968
+ (r) => {
969
+ console.log("onError =>", r);
989
970
  }
990
971
  );
991
972
  let a = {
@@ -997,53 +978,51 @@ function $e(e, t, s, n = void 0, o = void 0) {
997
978
  "Content-Type": "application/json"
998
979
  },
999
980
  data: JSON.stringify({
1000
- data: [
1001
- {
1002
- physicalid: t,
1003
- proposedRevision: s,
1004
- modifiedAttributes: {
1005
- revision: s
1006
- }
981
+ data: [{
982
+ physicalid: t,
983
+ proposedRevision: n,
984
+ modifiedAttributes: {
985
+ revision: n
1007
986
  }
1008
- ],
987
+ }],
1009
988
  folderid: null,
1010
989
  notificationTimeout: 600
1011
990
  }),
1012
991
  type: "json",
1013
- onComplete(i) {
1014
- n && n(i);
992
+ onComplete(r) {
993
+ s && s(r);
1015
994
  },
1016
- onFailure(i) {
1017
- o && o(i);
995
+ onFailure(r) {
996
+ o && o(r);
1018
997
  }
1019
998
  };
1020
- m(r, a);
999
+ m(i, a);
1021
1000
  }
1022
1001
  });
1023
1002
  }
1024
1003
  //!SECTION
1025
- function Ae(e, t = void 0, s = void 0) {
1026
- const n = {
1004
+ function Ae(e, t = void 0, n = void 0) {
1005
+ const s = {
1027
1006
  base: `${e.space}`,
1028
1007
  uri: "/resources/bps/cspaces",
1029
1008
  optTenant: `tenant=${e.tenant}`
1030
- }, o = `${n.base}${n.uri}?${n.optTenant}`;
1009
+ }, o = `${s.base}${s.uri}?${s.optTenant}`;
1031
1010
  m(o, {
1032
1011
  method: "GET",
1033
1012
  headers: {
1034
1013
  Accept: "application/json,text/javascript,*/*",
1035
1014
  "Content-Type": "application/ds-json"
1036
1015
  },
1037
- onComplete(c, r) {
1016
+ onComplete(c, i) {
1038
1017
  const a = JSON.parse(c);
1039
- t && t(a, r);
1018
+ t && t(a, i);
1040
1019
  },
1041
- onFailure(c, r, a) {
1042
- s && s({ response: c, headers: r, xhr: a });
1020
+ onFailure(c, i, a) {
1021
+ n && n({ response: c, headers: i, xhr: a });
1043
1022
  }
1044
1023
  });
1045
1024
  }
1046
- function Ie(e, t, s, n) {
1025
+ function Ie(e, t, n, s) {
1047
1026
  U(
1048
1027
  e.space,
1049
1028
  t,
@@ -1051,42 +1030,42 @@ function Ie(e, t, s, n) {
1051
1030
  m(o, {
1052
1031
  header: { ENO_CSRF_TOKEN: e.token },
1053
1032
  onComplete: (c) => {
1054
- s && s(c);
1033
+ n && n(c);
1055
1034
  },
1056
1035
  onFailure: (c) => {
1057
- console.log("error http", c), n && n(c);
1036
+ console.log("error http", c), s && s(c);
1058
1037
  }
1059
1038
  });
1060
1039
  }
1061
1040
  );
1062
1041
  }
1063
- async function Re(e, t, s = void 0, n = void 0) {
1042
+ async function Re(e, t, n = void 0, s = void 0) {
1064
1043
  return new Promise((o) => {
1065
1044
  U(e, t, (c) => {
1066
1045
  m(c, {
1067
- onComplete: (r, a, i) => (o(JSON.parse(r)), s && s(JSON.parse(r), a, i), o),
1068
- onFailure: (r, a, i) => {
1069
- n && n(r, a, i), console.log(r, a?.errormsg);
1046
+ onComplete: (i, a, r) => (o(JSON.parse(i)), n && n(JSON.parse(i), a, r), o),
1047
+ onFailure: (i, a, r) => {
1048
+ s && s(i, a, r), console.log(i, a?.errormsg);
1070
1049
  }
1071
1050
  });
1072
1051
  });
1073
1052
  });
1074
1053
  }
1075
- function ve(e, t, s, n = void 0, o = void 0) {
1054
+ function ve(e, t, n, s = void 0, o = void 0) {
1076
1055
  const c = new Blob([JSON.stringify(t)], { type: "text/plain" });
1077
1056
  k(
1078
1057
  e,
1079
- s,
1080
- (r) => {
1081
- const a = r.data[0].relateddata.files[0].id, i = r.data[0].dataelements.secondaryTitle !== "" ? r.data[0].dataelements.secondaryTitle : r.data[0].dataelements.title;
1058
+ n,
1059
+ (i) => {
1060
+ const a = i.data[0].relateddata.files[0].id, r = i.data[0].dataelements.secondaryTitle !== "" ? i.data[0].dataelements.secondaryTitle : i.data[0].dataelements.title;
1082
1061
  K(
1083
1062
  e,
1084
- s,
1063
+ n,
1085
1064
  a,
1086
1065
  c,
1087
- i,
1066
+ r,
1088
1067
  (d) => {
1089
- n && n(d);
1068
+ s && s(d);
1090
1069
  },
1091
1070
  (d) => {
1092
1071
  o && o(d);
@@ -1097,39 +1076,39 @@ function ve(e, t, s, n = void 0, o = void 0) {
1097
1076
  }
1098
1077
  let v, P;
1099
1078
  const j = [];
1100
- async function Pe(e, t = void 0, s = void 0) {
1079
+ async function Pe(e, t = void 0, n = void 0) {
1101
1080
  e.objID && e.objID !== "" ? k(
1102
1081
  e,
1103
- (n) => {
1104
- t && t(n);
1082
+ (s) => {
1083
+ t && t(s);
1105
1084
  },
1106
- (n) => {
1107
- s && s(n);
1085
+ (s) => {
1086
+ n && n(s);
1108
1087
  }
1109
1088
  ) : (e.objID === null || e.objID === "") && C(
1110
1089
  e,
1111
- (n) => {
1112
- t && t({ rep: n, msg: "Pas d'objID, ou invalide" });
1090
+ (s) => {
1091
+ t && t({ rep: s, msg: "Pas d'objID, ou invalide" });
1113
1092
  },
1114
- (n) => {
1115
- s && s({ msg: "Pas d'objID et erreur sur le Space", err: n });
1093
+ (s) => {
1094
+ n && n({ msg: "Pas d'objID et erreur sur le Space", err: s });
1116
1095
  }
1117
1096
  );
1118
1097
  }
1119
- async function xe(e, t = void 0, s = void 0) {
1098
+ async function xe(e, t = void 0, n = void 0) {
1120
1099
  console.log("getDatasByTenant (getDocuments)", e), await R(
1121
1100
  e,
1122
- (n) => {
1101
+ (s) => {
1123
1102
  const o = {};
1124
- o.obj = n, console.log("getDatasByTenant (getDocuments) _datas", o), t && t?.(o);
1103
+ o.obj = s, console.log("getDatasByTenant (getDocuments) _datas", o), t && t?.(o);
1125
1104
  },
1126
- (n) => {
1127
- s && s?.(n);
1105
+ (s) => {
1106
+ n && n?.(s);
1128
1107
  }
1129
1108
  );
1130
1109
  }
1131
- function Me(e, t = void 0, s = void 0) {
1132
- const n = [];
1110
+ function Me(e, t = void 0, n = void 0) {
1111
+ const s = [];
1133
1112
  if (!e.objIds && !Array.isArray(e.objIds) && e.objIds.length === 0) {
1134
1113
  console.warn("la liste est vide ou n'est pas un tableau");
1135
1114
  return;
@@ -1138,22 +1117,22 @@ function Me(e, t = void 0, s = void 0) {
1138
1117
  R(
1139
1118
  e,
1140
1119
  o.objID,
1141
- (r) => {
1142
- n.push({ [o.name]: r }), o.name === "dbProjets" && (v = r.affaires.map((a) => a.objectID), B(e, P)), c === e.objIds.length - 1 && (t && t(n), delete e.objIds, delete e.datas);
1120
+ (i) => {
1121
+ s.push({ [o.name]: i }), o.name === "dbProjets" && (v = i.affaires.map((a) => a.objectID), B(e, P)), c === e.objIds.length - 1 && (t && t(s), delete e.objIds, delete e.datas);
1143
1122
  }
1144
1123
  );
1145
1124
  });
1146
1125
  }
1147
- function B(e, t, s = void 0, n = void 0) {
1126
+ function B(e, t, n = void 0, s = void 0) {
1148
1127
  X(
1149
1128
  e,
1150
1129
  v,
1151
1130
  (o) => {
1152
1131
  const c = [...t];
1153
- c.find((r) => r.objectID === o.objectId).data = o.data, P = c, j.push(o.data), s && s(j);
1132
+ c.find((i) => i.objectID === o.objectId).data = o.data, P = c, j.push(o.data), n && n(j);
1154
1133
  },
1155
1134
  (o) => {
1156
- n && (n(o), console.log(o));
1135
+ s && (s(o), console.log(o));
1157
1136
  }
1158
1137
  );
1159
1138
  }
@@ -1177,8 +1156,8 @@ const Y = "FA35FB9B177A280065800EA0000F599C", H = [
1177
1156
  order_by: "desc",
1178
1157
  tag: "testTag"
1179
1158
  };
1180
- function Le(e, t, s = void 0, n = void 0) {
1181
- const { space: o, tenant: c } = e, { objId: r, pred: a, tag: i } = t, d = {
1159
+ function Le(e, t, n = void 0, s = void 0) {
1160
+ const { space: o, tenant: c } = e, { objId: i, pred: a, tag: r } = t, d = {
1182
1161
  uri: "/resources/6w/tags",
1183
1162
  otpCTX: "SecurityContext=preferred",
1184
1163
  optTenant: `tenant=${c}`
@@ -1187,12 +1166,12 @@ function Le(e, t, s = void 0, n = void 0) {
1187
1166
  {
1188
1167
  subject: [
1189
1168
  {
1190
- uri: `pid://${r}`
1169
+ uri: `pid://${i}`
1191
1170
  }
1192
1171
  ],
1193
1172
  predicate: x[a],
1194
1173
  object: {
1195
- literal: i
1174
+ literal: r
1196
1175
  }
1197
1176
  }
1198
1177
  ]
@@ -1210,46 +1189,46 @@ function Le(e, t, s = void 0, n = void 0) {
1210
1189
  setTimeout(() => {
1211
1190
  G(
1212
1191
  e,
1213
- r,
1192
+ i,
1214
1193
  (g) => {
1215
1194
  const h = g.data[0].dataelements.title, S = g.data[0].dataelements.fileExtension !== void 0 ? g.data[0].dataelements.fileExtension : "", _ = g.data[0].relateddata.ownerInfo[0].dataelements.name;
1216
1195
  f.name = h, f.ext = S, f.createBy = _, t.info = { ...f }, q(
1217
1196
  e,
1218
1197
  t,
1219
1198
  (y) => {
1220
- s && s(y);
1199
+ n && n(y);
1221
1200
  },
1222
1201
  (y) => {
1223
- n && n(y);
1202
+ s && s(y);
1224
1203
  }
1225
1204
  );
1226
1205
  },
1227
1206
  (g, h) => {
1228
1207
  const S = g;
1229
- S.msg = h.errormsg, S.errCode = h.errorcode, console.log("❌ sendDirectMessage => ", S), n && n(S);
1208
+ S.msg = h.errormsg, S.errCode = h.errorcode, console.log("❌ sendDirectMessage => ", S), s && s(S);
1230
1209
  }
1231
1210
  );
1232
1211
  }, 2e3);
1233
1212
  },
1234
1213
  onFailure(u, f) {
1235
1214
  const g = u;
1236
- g.msg = f.errormsg, g.errCode = f.errorcode, console.log("❌ sendDirectMessage => ", g), n && n(g);
1215
+ g.msg = f.errormsg, g.errCode = f.errorcode, console.log("❌ sendDirectMessage => ", g), s && s(g);
1237
1216
  }
1238
1217
  });
1239
1218
  }
1240
- function q(e, t, s = void 0, n = void 0) {
1219
+ function q(e, t, n = void 0, s = void 0) {
1241
1220
  console.log("obj ", t);
1242
1221
  const o = t.info.name, c = {
1243
1222
  baseUrl: `https://${e.tenant.toLowerCase()}-eu1-fedsearch.3dexperience.3ds.com`,
1244
1223
  uri: "/federated/search"
1245
- }, r = `${c.baseUrl}${c.uri}`, a = {
1224
+ }, i = `${c.baseUrl}${c.uri}`, a = {
1246
1225
  "Content-Type": "application/json",
1247
1226
  Accept: "application/json,text/javascript,*/*"
1248
- }, i = I(), d = {
1227
+ }, r = I(), d = {
1249
1228
  with_indexing_date: !0,
1250
1229
  with_synthesis: !0,
1251
1230
  with_nls: !1,
1252
- label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${i}`,
1231
+ label: `3DSearch-${e.currentUser.username}-AjoutDeTagBeam-${r}`,
1253
1232
  locale: "fr",
1254
1233
  select_predicate: [
1255
1234
  "ds6w:label",
@@ -1306,26 +1285,26 @@ function q(e, t, s = void 0, n = void 0) {
1306
1285
  }
1307
1286
  }
1308
1287
  };
1309
- console.log("dataPattern => ", d), m(r, {
1288
+ console.log("dataPattern => ", d), m(i, {
1310
1289
  method: "POST",
1311
1290
  headers: a,
1312
1291
  data: JSON.stringify(d),
1313
1292
  onComplete(l) {
1314
1293
  const p = JSON.parse(l);
1315
- s(p);
1294
+ n(p);
1316
1295
  },
1317
1296
  onFailure(l, p) {
1318
1297
  const u = l;
1319
- u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), n && n(u), console.log("Erreur de recuperation d'id du doc et des tags", l);
1298
+ u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u), console.log("Erreur de recuperation d'id du doc et des tags", l);
1320
1299
  }
1321
1300
  });
1322
1301
  }
1323
- function Ee(e, t, s = void 0, n = void 0) {
1324
- const { objId: o, pred: c, tag: r } = t, a = {
1302
+ function Ee(e, t, n = void 0, s = void 0) {
1303
+ const { objId: o, pred: c, tag: i } = t, a = {
1325
1304
  uri: "/resources/6w/tags",
1326
1305
  otpCTX: "SecurityContext=preferred",
1327
1306
  optTenant: `tenant=${e.tenant}`
1328
- }, i = `${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`, d = {
1307
+ }, r = `${e.space}${a.uri}?${a.otpCTX}&${a.optTenant}`, d = {
1329
1308
  tag: [
1330
1309
  {
1331
1310
  subject: [
@@ -1335,12 +1314,12 @@ function Ee(e, t, s = void 0, n = void 0) {
1335
1314
  ],
1336
1315
  predicate: x[c],
1337
1316
  object: {
1338
- literal: r
1317
+ literal: i
1339
1318
  }
1340
1319
  }
1341
1320
  ]
1342
1321
  };
1343
- m(i, {
1322
+ m(r, {
1344
1323
  method: "DELETE",
1345
1324
  data: JSON.stringify(d),
1346
1325
  headers: {
@@ -1348,52 +1327,52 @@ function Ee(e, t, s = void 0, n = void 0) {
1348
1327
  Accept: "application/json,text/javascript,*/*"
1349
1328
  },
1350
1329
  onComplete(l) {
1351
- s && s(l);
1330
+ n && n(l);
1352
1331
  },
1353
1332
  onFailure(l, p) {
1354
1333
  const u = l;
1355
- u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), n && n(u);
1334
+ u.msg = p.errormsg, u.errCode = p.errorcode, console.log("❌ sendDirectMessage => ", u), s && s(u);
1356
1335
  }
1357
1336
  });
1358
1337
  }
1359
- function Je(e, t = "", s = void 0, n = void 0) {
1338
+ function Je(e, t = "", n = void 0, s = void 0) {
1360
1339
  const { space: o } = e;
1361
1340
  if (t === "")
1362
1341
  return;
1363
1342
  const c = {
1364
1343
  uri: "/resources/v1/modeler/documents"
1365
- }, r = {
1344
+ }, i = {
1366
1345
  "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
1367
1346
  Accept: "application/json,text/javascript,*/*"
1368
- }, a = `${o}${c.uri}`, i = `$include=none,lockerInfo,ownerInfo,originatorInfo,files,ownerInfo,originatorInfo&$fields=none,title,name,typeNLS,collabSpaceTitle,revision,isLatestRevision,files,lockStatus,lockerInfo.name,lockerInfo.firstname,lockerInfo.lastname,owner,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,stateNLS,modified,policy,state,organizationTitle,originator,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname,hasModifyAccess,fileExtension,files.name,files.title,files.revision,files.locker,ownerInfo,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,originatorInfo,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname&$ids=${t}`;
1347
+ }, a = `${o}${c.uri}`, r = `$include=none,lockerInfo,ownerInfo,originatorInfo,files,ownerInfo,originatorInfo&$fields=none,title,name,typeNLS,collabSpaceTitle,revision,isLatestRevision,files,lockStatus,lockerInfo.name,lockerInfo.firstname,lockerInfo.lastname,owner,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,stateNLS,modified,policy,state,organizationTitle,originator,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname,hasModifyAccess,fileExtension,files.name,files.title,files.revision,files.locker,ownerInfo,ownerInfo.name,ownerInfo.firstname,ownerInfo.lastname,originatorInfo,originatorInfo.name,originatorInfo.firstname,originatorInfo.lastname&$ids=${t}`;
1369
1348
  m(a, {
1370
1349
  method: "POST",
1371
- headers: r,
1372
- data: i,
1350
+ headers: i,
1351
+ data: r,
1373
1352
  onComplete(d) {
1374
- s && s(JSON.parse(d));
1353
+ n && n(JSON.parse(d));
1375
1354
  },
1376
1355
  onFailure(d, l) {
1377
1356
  const p = d;
1378
- p.msg = l.error, n && n(p);
1357
+ p.msg = l.error, s && s(p);
1379
1358
  }
1380
1359
  });
1381
1360
  }
1382
- async function w(e, t = void 0, s = void 0) {
1383
- const n = e.space + "/api/index/tk";
1384
- return m(n, {
1385
- onComplete(o, c, r) {
1361
+ async function w(e, t = void 0, n = void 0) {
1362
+ const s = e.space + "/api/index/tk";
1363
+ return m(s, {
1364
+ onComplete(o, c, i) {
1386
1365
  const a = JSON.parse(o);
1387
1366
  if (t)
1388
1367
  return t(a), e.token = a?.result?.ServerToken;
1389
1368
  },
1390
1369
  onFailure(o) {
1391
- s && s(o);
1370
+ n && n(o);
1392
1371
  }
1393
1372
  });
1394
1373
  }
1395
- function Ge(e, t = void 0, s = void 0) {
1396
- const n = `${e.space}/api/exalead/whatsnew`, o = {
1374
+ function Ge(e, t = void 0, n = void 0) {
1375
+ const s = `${e.space}/api/exalead/whatsnew`, o = {
1397
1376
  params: {
1398
1377
  community_id: null,
1399
1378
  hash_key: null,
@@ -1404,7 +1383,7 @@ function Ge(e, t = void 0, s = void 0) {
1404
1383
  }
1405
1384
  };
1406
1385
  w(e, (c) => {
1407
- m(n, {
1386
+ m(s, {
1408
1387
  method: "POST",
1409
1388
  headers: {
1410
1389
  "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
@@ -1413,17 +1392,17 @@ function Ge(e, t = void 0, s = void 0) {
1413
1392
  },
1414
1393
  data: JSON.stringify(o),
1415
1394
  type: "json",
1416
- onComplete(r, a) {
1417
- t && t(r, a);
1395
+ onComplete(i, a) {
1396
+ t && t(i, a);
1418
1397
  },
1419
- onFailure(r, a) {
1420
- s && s(r, a);
1398
+ onFailure(i, a) {
1399
+ n && n(i, a);
1421
1400
  }
1422
1401
  });
1423
1402
  });
1424
1403
  }
1425
- function Ke(e, t = void 0, s = void 0) {
1426
- const n = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, o = {
1404
+ function Ke(e, t = void 0, n = void 0) {
1405
+ const s = `${e.space}/api/Recommendation/getpeoplefamiliartocurrentuser`, o = {
1427
1406
  params: {
1428
1407
  idsToFilterArr: [],
1429
1408
  mode: "offline",
@@ -1433,7 +1412,7 @@ function Ke(e, t = void 0, s = void 0) {
1433
1412
  }
1434
1413
  };
1435
1414
  w(e, (c) => {
1436
- m(n, {
1415
+ m(s, {
1437
1416
  method: "POST",
1438
1417
  headers: {
1439
1418
  "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken,
@@ -1442,30 +1421,30 @@ function Ke(e, t = void 0, s = void 0) {
1442
1421
  },
1443
1422
  data: JSON.stringify(o),
1444
1423
  type: "json",
1445
- onComplete(r, a) {
1446
- const i = r.result.hits.map((d) => ({ login: d.login, fullName: d.name }));
1447
- t && t(i, r);
1424
+ onComplete(i, a) {
1425
+ const r = i.result.hits.map((d) => ({ login: d.login, fullName: d.name }));
1426
+ t && t(r, i);
1448
1427
  },
1449
- onFailure(r, a) {
1450
- s && s(r, a);
1428
+ onFailure(i, a) {
1429
+ n && n(i, a);
1451
1430
  }
1452
1431
  });
1453
1432
  });
1454
1433
  }
1455
- function We(e, t = void 0, s = void 0) {
1456
- const n = {
1434
+ function We(e, t = void 0, n = void 0) {
1435
+ const s = {
1457
1436
  base: e.space,
1458
1437
  uri: "/api/community/listmycommunities",
1459
1438
  limit: `/limit/${e.limit ? e.limit : 128}`,
1460
1439
  page: `/page/${e.page ? e.page : "1"}`
1461
- }, o = `${n.base}${n.uri}${n.limit}${n.page}`, c = [];
1462
- w(e, (r) => {
1440
+ }, o = `${s.base}${s.uri}${s.limit}${s.page}`, c = [];
1441
+ w(e, (i) => {
1463
1442
  m(o, {
1464
1443
  method: "GET",
1465
1444
  headers: {
1466
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1445
+ "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1467
1446
  },
1468
- onComplete(a, i, d) {
1447
+ onComplete(a, r, d) {
1469
1448
  const p = JSON.parse(a).result;
1470
1449
  let u = 0;
1471
1450
  p.forEach((f) => {
@@ -1483,18 +1462,18 @@ function We(e, t = void 0, s = void 0) {
1483
1462
  (h) => {
1484
1463
  u++, g.members = h, c.push(g), u === p.length && t && t(c);
1485
1464
  },
1486
- (h) => s(h)
1465
+ (h) => n(h)
1487
1466
  );
1488
1467
  });
1489
1468
  },
1490
- onFailure(a, i) {
1469
+ onFailure(a, r) {
1491
1470
  const d = a;
1492
- d.status = i.status, d.response = i.errormsg, s && s(d);
1471
+ d.status = r.status, d.response = r.errormsg, n && n(d);
1493
1472
  }
1494
1473
  });
1495
1474
  });
1496
1475
  }
1497
- function Q(e, t, s, n) {
1476
+ function Q(e, t, n, s) {
1498
1477
  const o = `${e.space}/api/community/listmembers`, c = {
1499
1478
  params: {
1500
1479
  page: e.page ? e.page : 1,
@@ -1502,29 +1481,29 @@ function Q(e, t, s, n) {
1502
1481
  community_id: t
1503
1482
  }
1504
1483
  };
1505
- w(e, (r) => {
1484
+ w(e, (i) => {
1506
1485
  m(o, {
1507
1486
  method: "POST",
1508
1487
  headers: {
1509
1488
  "Content-type": "application/json;charset=UTF-8",
1510
1489
  Accept: "application/json",
1511
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1490
+ "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1512
1491
  },
1513
1492
  data: JSON.stringify(c),
1514
1493
  type: "json",
1515
- onComplete(a, i, d) {
1516
- s && s(a);
1494
+ onComplete(a, r, d) {
1495
+ n && n(a);
1517
1496
  },
1518
- onFailure(a, i) {
1497
+ onFailure(a, r) {
1519
1498
  const d = a;
1520
- d.status = i.status, d.response = i.errormsg, n && n(d);
1499
+ d.status = r.status, d.response = r.errormsg, s && s(d);
1521
1500
  }
1522
1501
  });
1523
1502
  });
1524
1503
  }
1525
- function Xe(e, t = void 0, s = void 0) {
1526
- const n = "YXdA5x4DSUKtlAi2wmnyTA";
1527
- e.commu_id || (e.commu_id = n);
1504
+ function Xe(e, t = void 0, n = void 0) {
1505
+ const s = "YXdA5x4DSUKtlAi2wmnyTA";
1506
+ e.commu_id || (e.commu_id = s);
1528
1507
  const o = `${e.space}/api/v2/communities/${e.commu_id}/ideas/statuses`;
1529
1508
  w(e, (c) => {
1530
1509
  m(o, {
@@ -1534,23 +1513,23 @@ function Xe(e, t = void 0, s = void 0) {
1534
1513
  Accept: "application/json",
1535
1514
  "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1536
1515
  },
1537
- onComplete(r) {
1538
- const a = JSON.parse(r);
1516
+ onComplete(i) {
1517
+ const a = JSON.parse(i);
1539
1518
  t && t(a);
1540
1519
  },
1541
- onFailure(r, a) {
1542
- const i = r;
1543
- i.status = a.status, i.response = a.errormsg, s && s(i);
1520
+ onFailure(i, a) {
1521
+ const r = i;
1522
+ r.status = a.status, r.response = a.errormsg, n && n(r);
1544
1523
  }
1545
1524
  });
1546
1525
  });
1547
1526
  }
1548
- function Ve(e, t, s = void 0, n = void 0) {
1527
+ function Ve(e, t, n = void 0, s = void 0) {
1549
1528
  const { listAllContacts: o, currentUser: c } = e;
1550
1529
  console.log("__listAllContacts", o.hits);
1551
- const r = `${e.space}/api/directmessages`, a = {
1530
+ const i = `${e.space}/api/directmessages`, a = {
1552
1531
  users: [c.login].concat(t.receipt)
1553
- }, i = {
1532
+ }, r = {
1554
1533
  id_msg: "",
1555
1534
  senderId: e.currentUser.login,
1556
1535
  senderName: `${e.currentUser.first_name} ${e.currentUser.last_name}`,
@@ -1560,14 +1539,14 @@ function Ve(e, t, s = void 0, n = void 0) {
1560
1539
  Z(
1561
1540
  a.users,
1562
1541
  (l) => {
1563
- l !== void 0 && (i.id_msg = l.id, d = !0, $(e, i));
1542
+ l !== void 0 && (r.id_msg = l.id, d = !0, $(e, r));
1564
1543
  },
1565
1544
  (l) => {
1566
- d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), n && n(l), i.id_msg = "";
1545
+ d = !1, console.log("_3dSwym_findCommunityToInstantMSG callback", l), s && s(l), r.id_msg = "";
1567
1546
  }
1568
1547
  ), d === !1 && setTimeout(() => {
1569
1548
  d === !1 && w(e, (l) => {
1570
- m(r, {
1549
+ m(i, {
1571
1550
  method: "POST",
1572
1551
  headers: {
1573
1552
  "Content-Type": "application/json",
@@ -1578,17 +1557,17 @@ function Ve(e, t, s = void 0, n = void 0) {
1578
1557
  type: "json",
1579
1558
  onComplete(p, u, f) {
1580
1559
  const g = p;
1581
- g.reponse = JSON.parse(f.response), g.status = f.status, s && s(g), i.id_msg = g.result.id, $(e, i);
1560
+ g.reponse = JSON.parse(f.response), g.status = f.status, n && n(g), r.id_msg = g.result.id, $(e, r);
1582
1561
  },
1583
1562
  onFailure(p, u, f) {
1584
1563
  const g = p;
1585
- g.msg = u.errormsg, g.status = u.status, n && n(g);
1564
+ g.msg = u.errormsg, g.status = u.status, s && s(g);
1586
1565
  }
1587
1566
  });
1588
1567
  });
1589
1568
  }, 500);
1590
1569
  }
1591
- function Z(e, t, s, n) {
1570
+ function Z(e, t, n, s) {
1592
1571
  const o = `${e.space}/api/directmessages/lite?with_favorites=false`;
1593
1572
  w(e, (c) => {
1594
1573
  m(o, {
@@ -1597,33 +1576,33 @@ function Z(e, t, s, n) {
1597
1576
  Accept: "application/json,text/javascript,*/*",
1598
1577
  "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken
1599
1578
  },
1600
- onComplete(r) {
1601
- const a = JSON.parse(r), i = [];
1579
+ onComplete(i) {
1580
+ const a = JSON.parse(i), r = [];
1602
1581
  a.result.forEach((p) => {
1603
- p.users = p.users.sort((u, f) => u.login.localeCompare(f.login)), p.users.length === t.length && i.push(p);
1582
+ p.users = p.users.sort((u, f) => u.login.localeCompare(f.login)), p.users.length === t.length && r.push(p);
1604
1583
  });
1605
- const d = t.sort(), l = i.find((p) => {
1584
+ const d = t.sort(), l = r.find((p) => {
1606
1585
  const u = [];
1607
1586
  return p.users.forEach((f) => {
1608
1587
  u.push(f.login);
1609
1588
  }), JSON.stringify(u) === JSON.stringify(d);
1610
1589
  });
1611
- s && l !== void 0 ? s(l) : (n || l === void 0) && n(l);
1590
+ n && l !== void 0 ? n(l) : (s || l === void 0) && s(l);
1612
1591
  },
1613
- onFailure(r) {
1614
- const a = r;
1615
- a.msg = headers.errormsg, a.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", a), n && n(a);
1592
+ onFailure(i) {
1593
+ const a = i;
1594
+ a.msg = headers.errormsg, a.errCode = headers.errorcode, console.log("❌ sendDirectMessageLite => ", a), s && s(a);
1616
1595
  }
1617
1596
  });
1618
1597
  });
1619
1598
  }
1620
- function $(e, t, s = void 0, n = void 0) {
1599
+ function $(e, t, n = void 0, s = void 0) {
1621
1600
  const o = {
1622
1601
  base: e.space,
1623
1602
  uri: "/api/community",
1624
1603
  id_msg: `${t.id_msg}`,
1625
1604
  endUri: "/instantmessages"
1626
- }, c = `${o.base}${o.uri}/${o.id_msg}${o.endUri}`, r = {
1605
+ }, c = `${o.base}${o.uri}/${o.id_msg}${o.endUri}`, i = {
1627
1606
  author: { login: t.senderId, displayName: t.senderName },
1628
1607
  accessState: null,
1629
1608
  commentUri: null,
@@ -1641,25 +1620,25 @@ function $(e, t, s = void 0, n = void 0) {
1641
1620
  Accept: "application/json",
1642
1621
  "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
1643
1622
  },
1644
- data: JSON.stringify(r),
1623
+ data: JSON.stringify(i),
1645
1624
  type: "json",
1646
- onComplete(i, d, l) {
1647
- const p = i;
1648
- p.status = l.status, p.response = JSON.parse(l.response), console.log("✅ _3dSwym_sendDirectMessageData => ", p), s && s(p);
1625
+ onComplete(r, d, l) {
1626
+ const p = r;
1627
+ p.status = l.status, p.response = JSON.parse(l.response), console.log("✅ _3dSwym_sendDirectMessageData => ", p), n && n(p);
1649
1628
  },
1650
- onFailure(i, d) {
1651
- const l = i;
1652
- l.msg = d.errormsg, l.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", l), n && n(l);
1629
+ onFailure(r, d) {
1630
+ const l = r;
1631
+ l.msg = d.errormsg, l.errCode = d.errorcode, console.log("❌ sendDirectMessage => ", l), s && s(l);
1653
1632
  }
1654
1633
  });
1655
1634
  });
1656
1635
  }
1657
1636
  function ee(e) {
1658
- const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), s = (/* @__PURE__ */ new Date()).toLocaleTimeString();
1637
+ const t = (/* @__PURE__ */ new Date()).toLocaleDateString(), n = (/* @__PURE__ */ new Date()).toLocaleTimeString();
1659
1638
  return `<p>${e} </p>
1660
1639
  <br/>
1661
1640
  <hr/>
1662
- <p><u>envoyer :</u>Le <b>${t} à ${s}</b></p>`;
1641
+ <p><u>envoyer :</u>Le <b>${t} à ${n}</b></p>`;
1663
1642
  }
1664
1643
  const te = {
1665
1644
  title: "TEST DEV COMMUNITY IDEA",
@@ -1671,16 +1650,16 @@ const te = {
1671
1650
  idee_id: "THhRI8rlQNWKRxpv3Xqqug"
1672
1651
  // id de l'idee qui est créer au post (_3dSwym_postIdea)
1673
1652
  };
1674
- function Be(e, t, s = void 0, n = void 0) {
1653
+ function Be(e, t, n = void 0, s = void 0) {
1675
1654
  const o = `${e.space}/api/idea/add`, c = e.swymCommunities.find(
1676
- (i) => i.id === t.community_id
1677
- ), r = e.swymCommunities.find(
1678
- (i) => i.title.toLowerCase() === t.community_title.toLowerCase()
1655
+ (r) => r.id === t.community_id
1656
+ ), i = e.swymCommunities.find(
1657
+ (r) => r.title.toLowerCase() === t.community_title.toLowerCase()
1679
1658
  ), a = {
1680
1659
  params: {
1681
1660
  title: t.title,
1682
1661
  // String, le nom de l'affaire
1683
- community_id: c?.id !== void 0 ? c.id : r.id,
1662
+ community_id: c?.id !== void 0 ? c.id : i.id,
1684
1663
  // String, l'id de la communauté
1685
1664
  message: ne(t.text_html),
1686
1665
  // STRING => le contenue du message doit être au format HTML
@@ -1688,11 +1667,11 @@ function Be(e, t, s = void 0, n = void 0) {
1688
1667
  // 1 publier, 0 non publier
1689
1668
  }
1690
1669
  };
1691
- w(e, (i) => {
1670
+ w(e, (r) => {
1692
1671
  const d = {
1693
1672
  "Content-type": "application/json;charset=UTF-8",
1694
1673
  Accept: "application/json",
1695
- "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1674
+ "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1696
1675
  };
1697
1676
  m(o, {
1698
1677
  method: "POST",
@@ -1701,46 +1680,46 @@ function Be(e, t, s = void 0, n = void 0) {
1701
1680
  type: "json",
1702
1681
  onComplete(l, p, u) {
1703
1682
  const f = JSON.parse(l);
1704
- f.status = u.status, f.response = u.response, s && s(f);
1683
+ f.status = u.status, f.response = u.response, n && n(f);
1705
1684
  },
1706
1685
  onFailure(l, p, u) {
1707
1686
  const f = l;
1708
- f.status = p.status, f.response = p.errormsg, n && n(f);
1687
+ f.status = p.status, f.response = p.errormsg, s && s(f);
1709
1688
  }
1710
1689
  });
1711
1690
  });
1712
1691
  }
1713
- function Ye(e, t, s = void 0, n = void 0) {
1692
+ function Ye(e, t, n = void 0, s = void 0) {
1714
1693
  const o = `${e.space}/api/idea/delete`, c = {
1715
1694
  params: {
1716
1695
  community_id: t.community_id,
1717
1696
  ideationIds: [t.idee_id]
1718
1697
  }
1719
1698
  };
1720
- w(e, (r) => {
1699
+ w(e, (i) => {
1721
1700
  m(o, {
1722
1701
  method: "POST",
1723
1702
  headers: {
1724
1703
  "Content-type": "application/json;charset=UTF-8",
1725
1704
  Accept: "application/json",
1726
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1705
+ "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1727
1706
  },
1728
1707
  data: JSON.stringify(c),
1729
1708
  type: "json",
1730
- onComplete(a, i, d) {
1731
- s && s(a);
1709
+ onComplete(a, r, d) {
1710
+ n && n(a);
1732
1711
  },
1733
- onFailure(a, i, d) {
1712
+ onFailure(a, r, d) {
1734
1713
  const l = a;
1735
- l.status = i.status, l.response = i.errormsg, n && n(l);
1714
+ l.status = r.status, l.response = r.errormsg, s && s(l);
1736
1715
  }
1737
1716
  });
1738
1717
  });
1739
1718
  }
1740
- function He(e, t = "", s = void 0, n = void 0) {
1719
+ function He(e, t = "", n = void 0, s = void 0) {
1741
1720
  const o = e.tenant.toLowerCase() === "r1132101716373" ? "tFtz0G4MR6qNtKgJjNfTog" : e.tenant.toLowerCase() === "r1132101286859" ? "Qpv3HN-tTDOsU-7_c5DnDg" : "Template_d'idée_à_créer";
1742
1721
  t === "" && (t = o);
1743
- const c = `${e.space}/api/idea/get`, r = {
1722
+ const c = `${e.space}/api/idea/get`, i = {
1744
1723
  params: {
1745
1724
  id: t
1746
1725
  }
@@ -1753,38 +1732,38 @@ function He(e, t = "", s = void 0, n = void 0) {
1753
1732
  Accept: "application/json",
1754
1733
  "X-DS-SWYM-CSRFTOKEN": a.result.ServerToken
1755
1734
  },
1756
- data: JSON.stringify(r),
1735
+ data: JSON.stringify(i),
1757
1736
  type: "json",
1758
- onComplete(i) {
1759
- const d = i;
1760
- d.msg = d.result.message, s && s(d);
1737
+ onComplete(r) {
1738
+ const d = r;
1739
+ d.msg = d.result.message, n && n(d);
1761
1740
  },
1762
- onFailure(i) {
1763
- const d = i;
1764
- d.status = headers.status, d.response = headers.errormsg, n && n(d);
1741
+ onFailure(r) {
1742
+ const d = r;
1743
+ d.status = headers.status, d.response = headers.errormsg, s && s(d);
1765
1744
  }
1766
1745
  });
1767
1746
  });
1768
1747
  }
1769
- function ze(e, t = te, s = void 0, n = void 0) {
1748
+ function ze(e, t = te, n = void 0, s = void 0) {
1770
1749
  const o = {
1771
1750
  uri: "/api/idea/list",
1772
1751
  comId: `/community_id/${e.tenant.toLowerCase() === "r1132101716373" ? t.community_id : "bgnIsG74SUWswyGzS6NC6g"}`,
1773
1752
  limit: `/limit/${t.limit ? t.limit : 10}`
1774
1753
  }, c = `${e.space}${o.uri}${o.comId}${o.limit}`;
1775
- w(e, (r) => {
1754
+ w(e, (i) => {
1776
1755
  m(c, {
1777
1756
  method: "GET",
1778
1757
  headers: {
1779
- "X-DS-SWYM-CSRFTOKEN": r.result.ServerToken
1758
+ "X-DS-SWYM-CSRFTOKEN": i.result.ServerToken
1780
1759
  },
1781
1760
  onComplete(a) {
1782
- const i = JSON.parse(a);
1783
- s && s(i);
1761
+ const r = JSON.parse(a);
1762
+ n && n(r);
1784
1763
  },
1785
- onFailure(a, i) {
1764
+ onFailure(a, r) {
1786
1765
  const d = a;
1787
- d.status = i.status, d.response = i.errormsg, n && n(d);
1766
+ d.status = r.status, d.response = r.errormsg, s && s(d);
1788
1767
  }
1789
1768
  });
1790
1769
  });
@@ -1864,26 +1843,26 @@ function ne(e) {
1864
1843
  <p>
1865
1844
  </p>` : e;
1866
1845
  }
1867
- function qe(e, t = void 0, s = void 0) {
1868
- const n = e.space + "/api/user/getcurrent/";
1846
+ function qe(e, t = void 0, n = void 0) {
1847
+ const s = e.space + "/api/user/getcurrent/";
1869
1848
  w(e, (o) => {
1870
- m(n, {
1849
+ m(s, {
1871
1850
  method: "GET",
1872
1851
  headers: {
1873
1852
  "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken
1874
1853
  },
1875
- onComplete(c, r, a) {
1876
- const i = JSON.parse(c);
1877
- t && t(i.result);
1854
+ onComplete(c, i, a) {
1855
+ const r = JSON.parse(c);
1856
+ t && t(r.result);
1878
1857
  },
1879
- onFailure(c, r, a) {
1880
- const i = { erreur: JSON.parse(c), headers: r, xhr: a };
1881
- s && s(i);
1858
+ onFailure(c, i, a) {
1859
+ const r = { erreur: JSON.parse(c), headers: i, xhr: a };
1860
+ n && n(r);
1882
1861
  }
1883
1862
  });
1884
1863
  });
1885
1864
  }
1886
- function Qe(e, t, s = void 0, n = void 0) {
1865
+ function Qe(e, t, n = void 0, s = void 0) {
1887
1866
  const o = e.space + "/api/user/find/login/" + t;
1888
1867
  w(
1889
1868
  e,
@@ -1891,16 +1870,16 @@ function Qe(e, t, s = void 0, n = void 0) {
1891
1870
  m(o, {
1892
1871
  method: "GET",
1893
1872
  headers: { "X-DS-SWYM-CSRFTOKEN": c.result.ServerToken },
1894
- onComplete(r, a, i) {
1895
- const d = JSON.parse(r);
1896
- s && s(d);
1873
+ onComplete(i, a, r) {
1874
+ const d = JSON.parse(i);
1875
+ n && n(d);
1897
1876
  },
1898
- onFailure(r) {
1899
- n && n(r);
1877
+ onFailure(i) {
1878
+ s && s(i);
1900
1879
  }
1901
1880
  });
1902
1881
  },
1903
- n
1882
+ s
1904
1883
  );
1905
1884
  }
1906
1885
  function Ze(e) {