@kontur.candy/tools 2.217.0 → 2.219.0

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.
@@ -302,36 +302,106 @@
302
302
  }), a.send(void 0 === o._bodyInit ? null : o._bodyInit);
303
303
  });
304
304
  }
305
- function _(e, t) {
305
+ function _(e, t, r, n, o, i, a) {
306
+ try {
307
+ var u = e[i](a),
308
+ s = u.value;
309
+ } catch (e) {
310
+ return void r(e);
311
+ }
312
+ u.done ? t(s) : Promise.resolve(s).then(n, o);
313
+ }
314
+ function B(e) {
315
+ return function () {
316
+ var t = this,
317
+ r = arguments;
318
+ return new Promise(function (n, o) {
319
+ var i = e.apply(t, r);
320
+ function a(e) {
321
+ _(i, n, o, a, u, "next", e);
322
+ }
323
+ function u(e) {
324
+ _(i, n, o, a, u, "throw", e);
325
+ }
326
+ a(void 0);
327
+ });
328
+ };
329
+ }
330
+ function U(e, t) {
306
331
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
307
332
  }
308
- function B(e, t) {
333
+ function C(e, t) {
309
334
  for (var n = 0; n < t.length; n++) {
310
335
  var o = t[n];
311
336
  o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, r(o.key), o);
312
337
  }
313
338
  }
314
- function U(e, t, r) {
315
- return t && B(e.prototype, t), r && B(e, r), Object.defineProperty(e, "prototype", {
339
+ function R(e, t, r) {
340
+ return t && C(e.prototype, t), r && C(e, r), Object.defineProperty(e, "prototype", {
316
341
  writable: !1
317
342
  }), e;
318
343
  }
319
344
  T.polyfill = !0, i.fetch || (i.fetch = T, i.Headers = m, i.Request = O, i.Response = j);
320
- var C = function () {
321
- return U(function e() {
322
- _(this, e);
323
- }, null, [{
345
+ var I = function () {
346
+ function e() {
347
+ U(this, e);
348
+ }
349
+ return R(e, null, [{
350
+ key: "diagnoseNetworkError",
351
+ value: (t = B(regeneratorRuntime.mark(function e(t) {
352
+ var r, n;
353
+ return regeneratorRuntime.wrap(function (e) {
354
+ for (;;) switch (e.prev = e.next) {
355
+ case 0:
356
+ return e.prev = 0, e.next = 3, fetch(t, {
357
+ method: "GET",
358
+ mode: "cors",
359
+ credentials: "include"
360
+ });
361
+ case 3:
362
+ return r = e.sent, e.abrupt("return", {
363
+ status: r.status,
364
+ statusText: r.statusText,
365
+ ok: r.ok,
366
+ headers: Object.fromEntries(r.headers.entries())
367
+ });
368
+ case 7:
369
+ return e.prev = 7, e.t0 = e.catch(0), n = e.t0, e.abrupt("return", {
370
+ error: n.message,
371
+ type: n.name,
372
+ stack: n.stack
373
+ });
374
+ case 11:
375
+ case "end":
376
+ return e.stop();
377
+ }
378
+ }, e, null, [[0, 7]]);
379
+ })), function (e) {
380
+ return t.apply(this, arguments);
381
+ })
382
+ }, {
324
383
  key: "script",
325
- value: function (e, t) {
326
- var r = !1,
327
- n = document.getElementsByTagName("head")[0] || document.documentElement,
328
- o = document.createElement("script");
329
- function i() {
330
- r || o.readyState && "loaded" !== o.readyState && "complete" !== o.readyState || (r = !0, t());
384
+ value: function (t, r) {
385
+ var n = !1,
386
+ o = document.getElementsByTagName("head")[0] || document.documentElement,
387
+ i = document.createElement("script");
388
+ function a() {
389
+ n || i.readyState && "loaded" !== i.readyState && "complete" !== i.readyState || (n = !0, r());
331
390
  }
332
- o.onload = i, o.onreadystatechange = i, o.onerror = function () {
333
- o.parentNode && o.parentNode.removeChild(o), t(new Error("Error while loading script."));
334
- }, o.src = e, o.setAttribute("crossorigin", "use-credentials"), n.appendChild(o);
391
+ i.onload = a, i.onreadystatechange = a, i.onerror = B(regeneratorRuntime.mark(function n() {
392
+ var o;
393
+ return regeneratorRuntime.wrap(function (n) {
394
+ for (;;) switch (n.prev = n.next) {
395
+ case 0:
396
+ return i.parentNode && i.parentNode.removeChild(i), n.next = 3, e.diagnoseNetworkError(t);
397
+ case 3:
398
+ o = n.sent, r(new Error("Error while loading script \n ".concat(JSON.stringify(o))));
399
+ case 5:
400
+ case "end":
401
+ return n.stop();
402
+ }
403
+ }, n);
404
+ })), i.src = t, i.setAttribute("crossorigin", "use-credentials"), o.appendChild(i);
335
405
  }
336
406
  }, {
337
407
  key: "styleSheet",
@@ -346,55 +416,31 @@
346
416
  }), o.appendChild(i), i.setAttribute("href", e);
347
417
  }
348
418
  }]);
419
+ var t;
349
420
  }();
350
- function I(e) {
421
+ function x(e) {
351
422
  return "string" == typeof e ? "false" !== e && "true" === e : Boolean(e);
352
423
  }
353
- var R = {
354
- authorized: I("{authorized}"),
424
+ var D = {
425
+ authorized: x("{authorized}"),
355
426
  cauldronApiUrl: "{cauldronApiUrl}",
356
- isTestServer: I("{isTestServer}"),
357
- renderCachingForIE8: I("{renderCachingForIE8}"),
358
- normalizationOnServer: I("{normalizationOnServer}"),
427
+ isTestServer: x("{isTestServer}"),
428
+ renderCachingForIE8: x("{renderCachingForIE8}"),
429
+ normalizationOnServer: x("{normalizationOnServer}"),
359
430
  normativeUrl: "{normativeUrl}",
360
431
  konturDomains: "{konturDomains}"
361
432
  };
362
- function D(e, t, r, n, o, i, a) {
363
- try {
364
- var u = e[i](a),
365
- s = u.value;
366
- } catch (e) {
367
- return void r(e);
368
- }
369
- u.done ? t(s) : Promise.resolve(s).then(n, o);
370
- }
371
433
  function F(e) {
372
- return function () {
373
- var t = this,
374
- r = arguments;
375
- return new Promise(function (n, o) {
376
- var i = e.apply(t, r);
377
- function a(e) {
378
- D(i, n, o, a, u, "next", e);
379
- }
380
- function u(e) {
381
- D(i, n, o, a, u, "throw", e);
382
- }
383
- a(void 0);
384
- });
385
- };
386
- }
387
- function x(e) {
388
- return x = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
434
+ return F = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
389
435
  return e.__proto__ || Object.getPrototypeOf(e);
390
- }, x(e);
436
+ }, F(e);
391
437
  }
392
438
  function M(e, t) {
393
439
  return M = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
394
440
  return e.__proto__ = t, e;
395
441
  }, M(e, t);
396
442
  }
397
- function L(e, t) {
443
+ function N(e, t) {
398
444
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
399
445
  e.prototype = Object.create(t && t.prototype, {
400
446
  constructor: {
@@ -406,11 +452,11 @@
406
452
  writable: !1
407
453
  }), t && M(e, t);
408
454
  }
409
- function N() {
455
+ function L() {
410
456
  try {
411
457
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
412
458
  } catch (e) {}
413
- return (N = function () {
459
+ return (L = function () {
414
460
  return !!e;
415
461
  })();
416
462
  }
@@ -431,12 +477,12 @@
431
477
  }
432
478
  function r() {
433
479
  return function (e, t, r) {
434
- if (N()) return Reflect.construct.apply(null, arguments);
480
+ if (L()) return Reflect.construct.apply(null, arguments);
435
481
  var n = [null];
436
482
  n.push.apply(n, t);
437
483
  var o = new (e.bind.apply(e, n))();
438
484
  return r && M(o, r.prototype), o;
439
- }(e, arguments, x(this).constructor);
485
+ }(e, arguments, F(this).constructor);
440
486
  }
441
487
  return r.prototype = Object.create(e.prototype, {
442
488
  constructor: {
@@ -449,14 +495,14 @@
449
495
  }, z(e);
450
496
  }
451
497
  function q(e, r, n) {
452
- return r = x(r), function (e, r) {
498
+ return r = F(r), function (e, r) {
453
499
  if (r && ("object" == t(r) || "function" == typeof r)) return r;
454
500
  if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
455
501
  return function (e) {
456
502
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
457
503
  return e;
458
504
  }(e);
459
- }(e, H() ? Reflect.construct(r, n || [], x(e).constructor) : r.apply(e, n));
505
+ }(e, H() ? Reflect.construct(r, n || [], F(e).constructor) : r.apply(e, n));
460
506
  }
461
507
  function H() {
462
508
  try {
@@ -466,19 +512,19 @@
466
512
  return !!e;
467
513
  })();
468
514
  }
469
- var V = function (e) {
515
+ var G = function (e) {
470
516
  function t() {
471
- return _(this, t), q(this, t, ["Operation not implemented"]);
517
+ return U(this, t), q(this, t, ["Operation not implemented"]);
472
518
  }
473
- return L(t, e), U(t);
519
+ return N(t, e), R(t);
474
520
  }(function (e) {
475
521
  function t(e) {
476
522
  var r;
477
- return _(this, t), (r = q(this, t, [e])).name = r.constructor.name, r;
523
+ return U(this, t), (r = q(this, t, [e])).name = r.constructor.name, r;
478
524
  }
479
- return L(t, e), U(t);
525
+ return N(t, e), R(t);
480
526
  }(z(Error)));
481
- function G(e, t) {
527
+ function V(e, t) {
482
528
  var r = Object.keys(e);
483
529
  if (Object.getOwnPropertySymbols) {
484
530
  var n = Object.getOwnPropertySymbols(e);
@@ -491,9 +537,9 @@
491
537
  function Z(e) {
492
538
  for (var t = 1; t < arguments.length; t++) {
493
539
  var r = null != arguments[t] ? arguments[t] : {};
494
- t % 2 ? G(Object(r), !0).forEach(function (t) {
540
+ t % 2 ? V(Object(r), !0).forEach(function (t) {
495
541
  n(e, t, r[t]);
496
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : G(Object(r)).forEach(function (t) {
542
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : V(Object(r)).forEach(function (t) {
497
543
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
498
544
  });
499
545
  }
@@ -506,7 +552,7 @@
506
552
  }
507
553
  return null != e ? ["model", "change", e] : ["model", "change"];
508
554
  }
509
- function X(e) {
555
+ function J(e) {
510
556
  return Object.keys(e).filter(function (t) {
511
557
  return e[t] && Object.prototype.hasOwnProperty.call(e[t], "value");
512
558
  }).map(function (t) {
@@ -514,14 +560,14 @@
514
560
  return null == r ? {} : n({}, t, r.value);
515
561
  });
516
562
  }
517
- function J(e) {
563
+ function X(e) {
518
564
  return e.reduce(function (e, t) {
519
565
  return Z(Z({}, e), t);
520
566
  }, {});
521
567
  }
522
568
  var W = function () {
523
- return U(function e(t) {
524
- _(this, e), this.form = void 0, this.form = t;
569
+ return R(function e(t) {
570
+ U(this, e), this.form = void 0, this.form = t;
525
571
  }, [{
526
572
  key: "navigateByHighlanderPaths",
527
573
  value: function (e) {
@@ -554,7 +600,7 @@
554
600
  }
555
601
  }, {
556
602
  key: "validateChildrenByPath",
557
- value: (o = F(regeneratorRuntime.mark(function e(t) {
603
+ value: (o = B(regeneratorRuntime.mark(function e(t) {
558
604
  return regeneratorRuntime.wrap(function (e) {
559
605
  for (;;) switch (e.prev = e.next) {
560
606
  case 0:
@@ -574,7 +620,7 @@
574
620
  }
575
621
  }, {
576
622
  key: "__INTERNAL__getSelectFunctionForDisableEmployeeInSS",
577
- value: (r = F(regeneratorRuntime.mark(function e(t) {
623
+ value: (r = B(regeneratorRuntime.mark(function e(t) {
578
624
  return regeneratorRuntime.wrap(function (e) {
579
625
  for (;;) switch (e.prev = e.next) {
580
626
  case 0:
@@ -693,7 +739,7 @@
693
739
  }
694
740
  }, {
695
741
  key: "reloadInner",
696
- value: (e = F(regeneratorRuntime.mark(function e() {
742
+ value: (e = B(regeneratorRuntime.mark(function e() {
697
743
  return regeneratorRuntime.wrap(function (e) {
698
744
  for (;;) switch (e.prev = e.next) {
699
745
  case 0:
@@ -746,13 +792,13 @@
746
792
  key: "get",
747
793
  value: function (e) {
748
794
  var t = this;
749
- if (Array.isArray(e)) return J(e.map(function (e) {
750
- return X(t.form.model.getChunk(e));
795
+ if (Array.isArray(e)) return X(e.map(function (e) {
796
+ return J(t.form.model.getChunk(e));
751
797
  }).reduce(function (e, t) {
752
798
  return e.concat(t);
753
799
  }, []));
754
- if ("string" == typeof e) return J(X(this.form.model.getChunk(e)));
755
- if (void 0 === e) return J(X(this.form.model.getChunk(this.form.settings.formRoot)));
800
+ if ("string" == typeof e) return X(J(this.form.model.getChunk(e)));
801
+ if (void 0 === e) return X(J(this.form.model.getChunk(this.form.settings.formRoot)));
756
802
  throw new Error("form.get() parameter should be string path or array of paths");
757
803
  }
758
804
  }, {
@@ -763,67 +809,67 @@
763
809
  }, {
764
810
  key: "copySubtree",
765
811
  value: function (e, t, r) {
766
- throw new V();
812
+ throw new G();
767
813
  }
768
814
  }, {
769
815
  key: "addInstance",
770
816
  value: function (e) {
771
- throw new V();
817
+ throw new G();
772
818
  }
773
819
  }, {
774
820
  key: "getChildren",
775
821
  value: function (e) {
776
- throw new V();
822
+ throw new G();
777
823
  }
778
824
  }, {
779
825
  key: "uuidGenerate",
780
826
  value: function () {
781
- throw new V();
827
+ throw new G();
782
828
  }
783
829
  }, {
784
830
  key: "showModal",
785
831
  value: function (e) {
786
- throw new V();
832
+ throw new G();
787
833
  }
788
834
  }, {
789
835
  key: "addSection",
790
836
  value: function (e) {
791
- throw new V();
837
+ throw new G();
792
838
  }
793
839
  }, {
794
840
  key: "callInitSection",
795
841
  value: function (e) {
796
- throw new V();
842
+ throw new G();
797
843
  }
798
844
  }, {
799
845
  key: "preferredInterdocumentTransfer",
800
846
  value: function (e) {
801
- throw new V();
847
+ throw new G();
802
848
  }
803
849
  }, {
804
850
  key: "createFiasApiClient",
805
851
  value: function (e) {
806
- throw new V();
852
+ throw new G();
807
853
  }
808
854
  }, {
809
855
  key: "openEmployeeEditor",
810
856
  value: function (e) {
811
- throw new V();
857
+ throw new G();
812
858
  }
813
859
  }, {
814
860
  key: "removeInstance",
815
861
  value: function (e, t) {
816
- throw new V();
862
+ throw new G();
817
863
  }
818
864
  }, {
819
865
  key: "removeInstances",
820
866
  value: function (e, t) {
821
- throw new V();
867
+ throw new G();
822
868
  }
823
869
  }, {
824
870
  key: "focusOnControlIfExist",
825
871
  value: function (e) {
826
- throw new V();
872
+ throw new G();
827
873
  }
828
874
  }, {
829
875
  key: "setAutoFieldsToAutoValue",
@@ -833,17 +879,17 @@
833
879
  }, {
834
880
  key: "getInnerForm",
835
881
  value: function () {
836
- throw new V();
882
+ throw new G();
837
883
  }
838
884
  }, {
839
885
  key: "getAttachmentPublicFormByPath",
840
886
  value: function (e) {
841
- throw new V();
887
+ throw new G();
842
888
  }
843
889
  }, {
844
890
  key: "getGfv",
845
891
  value: function () {
846
- throw new V();
892
+ throw new G();
847
893
  }
848
894
  }, {
849
895
  key: "ensureInstanceFullyLoaded",
@@ -853,17 +899,17 @@
853
899
  }, {
854
900
  key: "customNormalize",
855
901
  value: function (e, t) {
856
- throw new V();
902
+ throw new G();
857
903
  }
858
904
  }, {
859
905
  key: "removeInstancesByRules",
860
906
  value: function (e) {
861
- throw new V();
907
+ throw new G();
862
908
  }
863
909
  }, {
864
910
  key: "createDnp",
865
911
  value: function () {
866
- throw new V();
912
+ throw new G();
867
913
  }
868
914
  }, {
869
915
  key: "getSelectedInstances",
@@ -961,7 +1007,7 @@
961
1007
  a = null,
962
1008
  u = r.ns,
963
1009
  s = r.draftId;
964
- if (new RegExp("^(?:".concat(R.konturDomains.replace(/\./g, "\\.").replace(/\*/g, "[a-z0-9-._]+"), ")$")).test(e.g.location.host) ? R.authorized ? s ? u || (a = new Error("options.ns is required")) : a = new Error("options.draftId is required") : a = new Error("user.unauthenticated") : a = new Error("domain.untrusted"), a) i(a);else {
1010
+ if (new RegExp("^(?:".concat(D.konturDomains.replace(/\./g, "\\.").replace(/\*/g, "[a-z0-9-._]+"), ")$")).test(e.g.location.host) ? D.authorized ? s ? u || (a = new Error("options.ns is required")) : a = new Error("options.draftId is required") : a = new Error("user.unauthenticated") : a = new Error("domain.untrusted"), a) i(a);else {
965
1011
  var c = null !== (n = r.resourceZone) && void 0 !== n ? n : re("resourceZone"),
966
1012
  l = te(ee(function (e) {
967
1013
  return "v1/ns/".concat(e.ns, "/drafts/").concat(e.draftId, "/client-draft-info");
@@ -989,13 +1035,13 @@
989
1035
  f = n.gfv,
990
1036
  h = n.engineVersion,
991
1037
  d = Q(Q(Q({
992
- authorized: R.authorized,
993
- cauldronApiUrl: R.cauldronApiUrl,
994
- isTestServer: R.isTestServer,
995
- renderCachingForIE8: R.renderCachingForIE8,
996
- normalizationOnServer: R.normalizationOnServer,
997
- normativeUrl: R.normativeUrl,
998
- konturDomains: R.konturDomains,
1038
+ authorized: D.authorized,
1039
+ cauldronApiUrl: D.cauldronApiUrl,
1040
+ isTestServer: D.isTestServer,
1041
+ renderCachingForIE8: D.renderCachingForIE8,
1042
+ normalizationOnServer: D.normalizationOnServer,
1043
+ normativeUrl: D.normativeUrl,
1044
+ konturDomains: D.konturDomains,
999
1045
  showNavigationSidebar: null === (o = r.showNavigationSidebar) || void 0 === o || o,
1000
1046
  onRemoveAttachment: r.onRemoveAttachment
1001
1047
  }, r), n), {}, {
@@ -1018,13 +1064,13 @@
1018
1064
  resourceZone: t.resourceZone
1019
1065
  };
1020
1066
  u.push(function (e) {
1021
- return C.styleSheet(ee(te("static/public/styles/".concat(n).concat(a, ".css"), s)), !0, e);
1067
+ return I.styleSheet(ee(te("static/public/styles/".concat(n).concat(a, ".css"), s)), !0, e);
1022
1068
  }), u.push(function (e) {
1023
- return C.script(ee(te("static/public/scripts/".concat(n).concat(a, ".js"), s)), e);
1069
+ return I.script(ee(te("static/public/scripts/".concat(n).concat(a, ".js"), s)), e);
1024
1070
  }), i && u.push(function (e) {
1025
- return C.styleSheet(ee(te("static/public/styles/candy_".concat(o).concat(a, ".css"), s)), !1, e);
1071
+ return I.styleSheet(ee(te("static/public/styles/candy_".concat(o).concat(a, ".css"), s)), !1, e);
1026
1072
  }, function (e) {
1027
- return C.script(ee(te("static/public/scripts/candy_".concat(o).concat(a, ".js"), s)), e);
1073
+ return I.script(ee(te("static/public/scripts/candy_".concat(o).concat(a, ".js"), s)), e);
1028
1074
  }), function (e, t) {
1029
1075
  var r = 0;
1030
1076
  e.forEach(function (n) {
@@ -1061,7 +1107,7 @@
1061
1107
  templatesApi: r.templatesApi,
1062
1108
  renderForm: o
1063
1109
  }), i);
1064
- } else i(new Error("dynamic loading is not supported for gfv ".concat(f)));
1110
+ } else i(new Error("dynamic loading is not supported for gfv ".concat(f, "\n").concat(n)));
1065
1111
  });
1066
1112
  }).catch(i);
1067
1113
  }