@inappstory/slide-api 0.1.15 → 0.1.16

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.cjs CHANGED
@@ -1168,6 +1168,9 @@ class EsModuleSdkApi {
1168
1168
  isSdkSupportTimelineOnBeforeStart() {
1169
1169
  return true;
1170
1170
  }
1171
+ isSdkSupportCorrectPauseResumeLifecycle() {
1172
+ return true;
1173
+ }
1171
1174
  static get [Symbol.for("___CTOR_ARGS___")]() { return [`SDKInterface`]; }
1172
1175
  }
1173
1176
 
@@ -1178,17 +1181,17 @@ class DataInput {
1178
1181
  _layer;
1179
1182
  _widgetApi;
1180
1183
  _widgetCallbacks;
1181
- sdkApi;
1184
+ _widgetDeps;
1182
1185
  static _className = "narrative-element-data-input";
1183
1186
  static className() {
1184
1187
  return DataInput._className;
1185
1188
  }
1186
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1189
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1187
1190
  this._elementNodeRef = _elementNodeRef;
1188
1191
  this._layer = _layer;
1189
1192
  this._widgetApi = _widgetApi;
1190
1193
  this._widgetCallbacks = _widgetCallbacks;
1191
- this.sdkApi = sdkApi;
1194
+ this._widgetDeps = _widgetDeps;
1192
1195
  }
1193
1196
  static isTypeOf(element) {
1194
1197
  return element instanceof DataInput;
@@ -1196,7 +1199,7 @@ class DataInput {
1196
1199
  mediaElementsLoadingPromises = [];
1197
1200
  init(localData) {
1198
1201
  try {
1199
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1202
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1200
1203
  }
1201
1204
  catch (e) {
1202
1205
  console.error(e);
@@ -1218,12 +1221,12 @@ class DataInput {
1218
1221
  return false;
1219
1222
  }
1220
1223
  setUserData(id, text) {
1221
- this._widgetApi.setUserData(id, text);
1224
+ this._widgetApi.setUserData(this._widgetDeps.slideRoot, id, text);
1222
1225
  }
1223
1226
  get isLayerForcePaused() {
1224
1227
  return false;
1225
1228
  }
1226
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetDataInput.api`, `WidgetCallbacks`, `SDKApi`]; }
1229
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetDataInput.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1227
1230
  }
1228
1231
 
1229
1232
  class Barcode {
@@ -1231,22 +1234,22 @@ class Barcode {
1231
1234
  _layer;
1232
1235
  _widgetApi;
1233
1236
  _widgetCallbacks;
1234
- sdkApi;
1237
+ _widgetDeps;
1235
1238
  static _className = "narrative-element-barcode";
1236
1239
  static className() {
1237
1240
  return Barcode._className;
1238
1241
  }
1239
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1242
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1240
1243
  this._elementNodeRef = _elementNodeRef;
1241
1244
  this._layer = _layer;
1242
1245
  this._widgetApi = _widgetApi;
1243
1246
  this._widgetCallbacks = _widgetCallbacks;
1244
- this.sdkApi = sdkApi;
1247
+ this._widgetDeps = _widgetDeps;
1245
1248
  }
1246
1249
  mediaElementsLoadingPromises = [];
1247
1250
  init(localData) {
1248
1251
  try {
1249
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1252
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1250
1253
  }
1251
1254
  catch (e) {
1252
1255
  console.error(e);
@@ -1270,7 +1273,7 @@ class Barcode {
1270
1273
  get isLayerForcePaused() {
1271
1274
  return false;
1272
1275
  }
1273
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetBarcode.api`, `WidgetCallbacks`, `SDKApi`]; }
1276
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetBarcode.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1274
1277
  }
1275
1278
 
1276
1279
  class ClickableBase {
@@ -1318,22 +1321,22 @@ class Copy {
1318
1321
  _layer;
1319
1322
  _widgetApi;
1320
1323
  _widgetCallbacks;
1321
- sdkApi;
1324
+ _widgetDeps;
1322
1325
  static _className = "narrative-element-copy";
1323
1326
  static className() {
1324
1327
  return Copy._className;
1325
1328
  }
1326
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1329
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1327
1330
  this._elementNodeRef = _elementNodeRef;
1328
1331
  this._layer = _layer;
1329
1332
  this._widgetApi = _widgetApi;
1330
1333
  this._widgetCallbacks = _widgetCallbacks;
1331
- this.sdkApi = sdkApi;
1334
+ this._widgetDeps = _widgetDeps;
1332
1335
  }
1333
1336
  mediaElementsLoadingPromises = [];
1334
1337
  init(localData) {
1335
1338
  try {
1336
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1339
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1337
1340
  }
1338
1341
  catch (e) {
1339
1342
  console.error(e);
@@ -1357,7 +1360,7 @@ class Copy {
1357
1360
  get isLayerForcePaused() {
1358
1361
  return false;
1359
1362
  }
1360
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetCopy.api`, `WidgetCallbacks`, `SDKApi`]; }
1363
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetCopy.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1361
1364
  }
1362
1365
 
1363
1366
  class DateCountdown {
@@ -1366,23 +1369,23 @@ class DateCountdown {
1366
1369
  _layersNodesRefs;
1367
1370
  _widgetApi;
1368
1371
  _widgetCallbacks;
1369
- sdkApi;
1372
+ _widgetDeps;
1370
1373
  static _className = "narrative-element-date-countdown";
1371
1374
  static className() {
1372
1375
  return DateCountdown._className;
1373
1376
  }
1374
- constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
1377
+ constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, _widgetDeps) {
1375
1378
  this._elementNodeRef = _elementNodeRef;
1376
1379
  this._layer = _layer;
1377
1380
  this._layersNodesRefs = _layersNodesRefs;
1378
1381
  this._widgetApi = _widgetApi;
1379
1382
  this._widgetCallbacks = _widgetCallbacks;
1380
- this.sdkApi = sdkApi;
1383
+ this._widgetDeps = _widgetDeps;
1381
1384
  }
1382
1385
  mediaElementsLoadingPromises = [];
1383
1386
  init(localData) {
1384
1387
  try {
1385
- this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
1388
+ this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this._widgetDeps);
1386
1389
  }
1387
1390
  catch (e) {
1388
1391
  console.error(e);
@@ -1410,7 +1413,7 @@ class DateCountdown {
1410
1413
  get isLayerForcePaused() {
1411
1414
  return false;
1412
1415
  }
1413
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetDateCountdown.api`, `WidgetCallbacks`, `SDKApi`]; }
1416
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetDateCountdown.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1414
1417
  }
1415
1418
 
1416
1419
  class Poll {
@@ -1418,17 +1421,17 @@ class Poll {
1418
1421
  _layer;
1419
1422
  _widgetApi;
1420
1423
  _widgetCallbacks;
1421
- sdkApi;
1424
+ _widgetDeps;
1422
1425
  static _className = "narrative-element-poll";
1423
1426
  static className() {
1424
1427
  return Poll._className;
1425
1428
  }
1426
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1429
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1427
1430
  this._elementNodeRef = _elementNodeRef;
1428
1431
  this._layer = _layer;
1429
1432
  this._widgetApi = _widgetApi;
1430
1433
  this._widgetCallbacks = _widgetCallbacks;
1431
- this.sdkApi = sdkApi;
1434
+ this._widgetDeps = _widgetDeps;
1432
1435
  }
1433
1436
  static isTypeOf(element) {
1434
1437
  return element instanceof Poll;
@@ -1436,7 +1439,7 @@ class Poll {
1436
1439
  mediaElementsLoadingPromises = [];
1437
1440
  init(localData) {
1438
1441
  try {
1439
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1442
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1440
1443
  }
1441
1444
  catch (e) {
1442
1445
  console.error(e);
@@ -1458,12 +1461,12 @@ class Poll {
1458
1461
  return false;
1459
1462
  }
1460
1463
  setUserData(id, text) {
1461
- this._widgetApi.setUserData(id, text);
1464
+ this._widgetApi.setUserData(this._widgetDeps.slideRoot, id, text);
1462
1465
  }
1463
1466
  get isLayerForcePaused() {
1464
1467
  return false;
1465
1468
  }
1466
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetPoll.api`, `WidgetCallbacks`, `SDKApi`]; }
1469
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetPoll.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1467
1470
  }
1468
1471
 
1469
1472
  class PollLayers {
@@ -1472,18 +1475,18 @@ class PollLayers {
1472
1475
  _layersNodesRefs;
1473
1476
  _widgetApi;
1474
1477
  _widgetCallbacks;
1475
- sdkApi;
1478
+ _widgetDeps;
1476
1479
  static _className = "narrative-element-poll-layers";
1477
1480
  static className() {
1478
1481
  return PollLayers._className;
1479
1482
  }
1480
- constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
1483
+ constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, _widgetDeps) {
1481
1484
  this._elementNodeRef = _elementNodeRef;
1482
1485
  this._layer = _layer;
1483
1486
  this._layersNodesRefs = _layersNodesRefs;
1484
1487
  this._widgetApi = _widgetApi;
1485
1488
  this._widgetCallbacks = _widgetCallbacks;
1486
- this.sdkApi = sdkApi;
1489
+ this._widgetDeps = _widgetDeps;
1487
1490
  }
1488
1491
  static isTypeOf(element) {
1489
1492
  return element instanceof PollLayers;
@@ -1491,7 +1494,7 @@ class PollLayers {
1491
1494
  mediaElementsLoadingPromises = [];
1492
1495
  init(localData) {
1493
1496
  try {
1494
- this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
1497
+ this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this._widgetDeps);
1495
1498
  }
1496
1499
  catch (e) {
1497
1500
  console.error(e);
@@ -1515,7 +1518,7 @@ class PollLayers {
1515
1518
  get isLayerForcePaused() {
1516
1519
  return false;
1517
1520
  }
1518
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetPollLayers.api`, `WidgetCallbacks`, `SDKApi`]; }
1521
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetPollLayers.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1519
1522
  }
1520
1523
 
1521
1524
  class Products {
@@ -1523,17 +1526,17 @@ class Products {
1523
1526
  _layer;
1524
1527
  _widgetApi;
1525
1528
  _widgetCallbacks;
1526
- sdkApi;
1529
+ _widgetDeps;
1527
1530
  static _className = "narrative-element-products";
1528
1531
  static className() {
1529
1532
  return Products._className;
1530
1533
  }
1531
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1534
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1532
1535
  this._elementNodeRef = _elementNodeRef;
1533
1536
  this._layer = _layer;
1534
1537
  this._widgetApi = _widgetApi;
1535
1538
  this._widgetCallbacks = _widgetCallbacks;
1536
- this.sdkApi = sdkApi;
1539
+ this._widgetDeps = _widgetDeps;
1537
1540
  }
1538
1541
  static isTypeOf(element) {
1539
1542
  return element instanceof Products;
@@ -1541,7 +1544,7 @@ class Products {
1541
1544
  mediaElementsLoadingPromises = [];
1542
1545
  init(localData) {
1543
1546
  try {
1544
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1547
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1545
1548
  }
1546
1549
  catch (e) {
1547
1550
  console.error(e);
@@ -1574,7 +1577,7 @@ class Products {
1574
1577
  get isLayerForcePaused() {
1575
1578
  return this._widgetApi.isForcePaused(this._elementNodeRef);
1576
1579
  }
1577
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetProducts.api`, `WidgetCallbacks`, `SDKApi`]; }
1580
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetProducts.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1578
1581
  }
1579
1582
 
1580
1583
  class Quest {
@@ -1582,24 +1585,24 @@ class Quest {
1582
1585
  _layer;
1583
1586
  _widgetApi;
1584
1587
  _widgetCallbacks;
1585
- sdkApi;
1588
+ _widgetDeps;
1586
1589
  static _className = "narrative-element-quest";
1587
1590
  static className() {
1588
1591
  return Quest._className;
1589
1592
  }
1590
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1593
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1591
1594
  this._elementNodeRef = _elementNodeRef;
1592
1595
  this._layer = _layer;
1593
1596
  this._widgetApi = _widgetApi;
1594
1597
  this._widgetCallbacks = _widgetCallbacks;
1595
- this.sdkApi = sdkApi;
1598
+ this._widgetDeps = _widgetDeps;
1596
1599
  }
1597
1600
  static isTypeOf(element) {
1598
1601
  return element instanceof Quest;
1599
1602
  }
1600
1603
  mediaElementsLoadingPromises = [];
1601
1604
  init(localData) {
1602
- return this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1605
+ return this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1603
1606
  }
1604
1607
  onPause() { }
1605
1608
  onResume() { }
@@ -1621,7 +1624,7 @@ class Quest {
1621
1624
  get isLayerForcePaused() {
1622
1625
  return false;
1623
1626
  }
1624
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuest.api`, `WidgetCallbacks`, `SDKApi`]; }
1627
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuest.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1625
1628
  }
1626
1629
 
1627
1630
  class Quiz {
@@ -1629,18 +1632,18 @@ class Quiz {
1629
1632
  _layer;
1630
1633
  _widgetApi;
1631
1634
  _widgetCallbacks;
1632
- sdkApi;
1635
+ _widgetDeps;
1633
1636
  static _className = "narrative-element-quiz";
1634
1637
  static className() {
1635
1638
  return Quiz._className;
1636
1639
  }
1637
1640
  // widgetApi in ctor
1638
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1641
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1639
1642
  this._elementNodeRef = _elementNodeRef;
1640
1643
  this._layer = _layer;
1641
1644
  this._widgetApi = _widgetApi;
1642
1645
  this._widgetCallbacks = _widgetCallbacks;
1643
- this.sdkApi = sdkApi;
1646
+ this._widgetDeps = _widgetDeps;
1644
1647
  }
1645
1648
  static isTypeOf(element) {
1646
1649
  return element instanceof Quiz;
@@ -1648,7 +1651,7 @@ class Quiz {
1648
1651
  mediaElementsLoadingPromises = [];
1649
1652
  init(localData) {
1650
1653
  try {
1651
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1654
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1652
1655
  }
1653
1656
  catch (e) {
1654
1657
  console.error(e);
@@ -1675,7 +1678,7 @@ class Quiz {
1675
1678
  get isLayerForcePaused() {
1676
1679
  return false;
1677
1680
  }
1678
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuiz.api`, `WidgetCallbacks`, `SDKApi`]; }
1681
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuiz.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1679
1682
  }
1680
1683
 
1681
1684
  class QuizGrouped {
@@ -1683,17 +1686,17 @@ class QuizGrouped {
1683
1686
  _layer;
1684
1687
  _widgetApi;
1685
1688
  _widgetCallbacks;
1686
- sdkApi;
1689
+ _widgetDeps;
1687
1690
  static _className = "narrative-element-quiz-grouped";
1688
1691
  static className() {
1689
1692
  return QuizGrouped._className;
1690
1693
  }
1691
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1694
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1692
1695
  this._elementNodeRef = _elementNodeRef;
1693
1696
  this._layer = _layer;
1694
1697
  this._widgetApi = _widgetApi;
1695
1698
  this._widgetCallbacks = _widgetCallbacks;
1696
- this.sdkApi = sdkApi;
1699
+ this._widgetDeps = _widgetDeps;
1697
1700
  }
1698
1701
  static isTypeOf(element) {
1699
1702
  return element instanceof QuizGrouped;
@@ -1701,7 +1704,7 @@ class QuizGrouped {
1701
1704
  mediaElementsLoadingPromises = [];
1702
1705
  init(localData) {
1703
1706
  try {
1704
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1707
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1705
1708
  }
1706
1709
  catch (e) {
1707
1710
  console.error(e);
@@ -1728,7 +1731,7 @@ class QuizGrouped {
1728
1731
  get isLayerForcePaused() {
1729
1732
  return false;
1730
1733
  }
1731
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuizGrouped.api`, `WidgetCallbacks`, `SDKApi`]; }
1734
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetQuizGrouped.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1732
1735
  }
1733
1736
 
1734
1737
  class RangeSlider {
@@ -1736,17 +1739,17 @@ class RangeSlider {
1736
1739
  _layer;
1737
1740
  _widgetApi;
1738
1741
  _widgetCallbacks;
1739
- sdkApi;
1742
+ _widgetDeps;
1740
1743
  static _className = "narrative-element-range-slider";
1741
1744
  static className() {
1742
1745
  return RangeSlider._className;
1743
1746
  }
1744
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1747
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1745
1748
  this._elementNodeRef = _elementNodeRef;
1746
1749
  this._layer = _layer;
1747
1750
  this._widgetApi = _widgetApi;
1748
1751
  this._widgetCallbacks = _widgetCallbacks;
1749
- this.sdkApi = sdkApi;
1752
+ this._widgetDeps = _widgetDeps;
1750
1753
  }
1751
1754
  static isTypeOf(element) {
1752
1755
  return element instanceof RangeSlider;
@@ -1754,7 +1757,7 @@ class RangeSlider {
1754
1757
  mediaElementsLoadingPromises = [];
1755
1758
  init(localData) {
1756
1759
  try {
1757
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1760
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1758
1761
  }
1759
1762
  catch (e) {
1760
1763
  console.error(e);
@@ -1781,7 +1784,7 @@ class RangeSlider {
1781
1784
  get isLayerForcePaused() {
1782
1785
  return false;
1783
1786
  }
1784
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRangeSlider.api`, `WidgetCallbacks`, `SDKApi`]; }
1787
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRangeSlider.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1785
1788
  }
1786
1789
 
1787
1790
  class Rate {
@@ -1789,17 +1792,17 @@ class Rate {
1789
1792
  _layer;
1790
1793
  _widgetApi;
1791
1794
  _widgetCallbacks;
1792
- sdkApi;
1795
+ _widgetDeps;
1793
1796
  static _className = "narrative-element-rate";
1794
1797
  static className() {
1795
1798
  return Rate._className;
1796
1799
  }
1797
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1800
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1798
1801
  this._elementNodeRef = _elementNodeRef;
1799
1802
  this._layer = _layer;
1800
1803
  this._widgetApi = _widgetApi;
1801
1804
  this._widgetCallbacks = _widgetCallbacks;
1802
- this.sdkApi = sdkApi;
1805
+ this._widgetDeps = _widgetDeps;
1803
1806
  }
1804
1807
  static isTypeOf(element) {
1805
1808
  return element instanceof Rate;
@@ -1807,7 +1810,7 @@ class Rate {
1807
1810
  mediaElementsLoadingPromises = [];
1808
1811
  init(localData) {
1809
1812
  try {
1810
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1813
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1811
1814
  }
1812
1815
  catch (e) {
1813
1816
  console.error(e);
@@ -1829,12 +1832,12 @@ class Rate {
1829
1832
  return false;
1830
1833
  }
1831
1834
  setUserData(id, text) {
1832
- this._widgetApi.setUserData(id, text);
1835
+ this._widgetApi.setUserData(this._widgetDeps.slideRoot, id, text);
1833
1836
  }
1834
1837
  get isLayerForcePaused() {
1835
1838
  return false;
1836
1839
  }
1837
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRate.api`, `WidgetCallbacks`, `SDKApi`]; }
1840
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetRate.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1838
1841
  }
1839
1842
 
1840
1843
  class Share {
@@ -1843,19 +1846,19 @@ class Share {
1843
1846
  _layersNodesRefs;
1844
1847
  _widgetApi;
1845
1848
  _widgetCallbacks;
1846
- sdkApi;
1849
+ _widgetDeps;
1847
1850
  static _className = "narrative-element-share";
1848
1851
  static _widgetApiName = "_narrative_share";
1849
1852
  static className() {
1850
1853
  return Share._className;
1851
1854
  }
1852
- constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, sdkApi) {
1855
+ constructor(_elementNodeRef, _layer, _layersNodesRefs, _widgetApi, _widgetCallbacks, _widgetDeps) {
1853
1856
  this._elementNodeRef = _elementNodeRef;
1854
1857
  this._layer = _layer;
1855
1858
  this._layersNodesRefs = _layersNodesRefs;
1856
1859
  this._widgetApi = _widgetApi;
1857
1860
  this._widgetCallbacks = _widgetCallbacks;
1858
- this.sdkApi = sdkApi;
1861
+ this._widgetDeps = _widgetDeps;
1859
1862
  }
1860
1863
  static isTypeOf(element) {
1861
1864
  return element instanceof Share;
@@ -1863,7 +1866,7 @@ class Share {
1863
1866
  mediaElementsLoadingPromises = [];
1864
1867
  init(localData) {
1865
1868
  try {
1866
- this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this.sdkApi);
1869
+ this._widgetApi.init(this._elementNodeRef, this._layersNodesRefs, localData, this._widgetCallbacks, this._widgetDeps);
1867
1870
  }
1868
1871
  catch (e) {
1869
1872
  console.error(e);
@@ -1885,12 +1888,12 @@ class Share {
1885
1888
  return false;
1886
1889
  }
1887
1890
  complete(id, isSuccess) {
1888
- this._widgetApi.complete(id, isSuccess);
1891
+ this._widgetApi.complete(this._widgetDeps.slideRoot, id, isSuccess);
1889
1892
  }
1890
1893
  get isLayerForcePaused() {
1891
1894
  return false;
1892
1895
  }
1893
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetShare.api`, `WidgetCallbacks`, `SDKApi`]; }
1896
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `Array`, `typeof WidgetShare.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1894
1897
  }
1895
1898
 
1896
1899
  class SwipeUpItems {
@@ -1935,17 +1938,17 @@ class Test {
1935
1938
  _layer;
1936
1939
  _widgetApi;
1937
1940
  _widgetCallbacks;
1938
- sdkApi;
1941
+ _widgetDeps;
1939
1942
  static _className = "narrative-element-test";
1940
1943
  static className() {
1941
1944
  return Test._className;
1942
1945
  }
1943
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
1946
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
1944
1947
  this._elementNodeRef = _elementNodeRef;
1945
1948
  this._layer = _layer;
1946
1949
  this._widgetApi = _widgetApi;
1947
1950
  this._widgetCallbacks = _widgetCallbacks;
1948
- this.sdkApi = sdkApi;
1951
+ this._widgetDeps = _widgetDeps;
1949
1952
  }
1950
1953
  static isTypeOf(element) {
1951
1954
  return element instanceof Test;
@@ -1953,7 +1956,7 @@ class Test {
1953
1956
  mediaElementsLoadingPromises = [];
1954
1957
  init(localData) {
1955
1958
  try {
1956
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
1959
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
1957
1960
  }
1958
1961
  catch (e) {
1959
1962
  console.error(e);
@@ -1983,7 +1986,7 @@ class Test {
1983
1986
  get isLayerForcePaused() {
1984
1987
  return false;
1985
1988
  }
1986
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetTest.api`, `WidgetCallbacks`, `SDKApi`]; }
1989
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetTest.api`, `WidgetCallbacks`, `WidgetDeps`]; }
1987
1990
  }
1988
1991
 
1989
1992
  class Vote {
@@ -1991,22 +1994,22 @@ class Vote {
1991
1994
  _layer;
1992
1995
  _widgetApi;
1993
1996
  _widgetCallbacks;
1994
- sdkApi;
1997
+ _widgetDeps;
1995
1998
  static _className = "narrative-element-vote";
1996
1999
  static className() {
1997
2000
  return Vote._className;
1998
2001
  }
1999
- constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, sdkApi) {
2002
+ constructor(_elementNodeRef, _layer, _widgetApi, _widgetCallbacks, _widgetDeps) {
2000
2003
  this._elementNodeRef = _elementNodeRef;
2001
2004
  this._layer = _layer;
2002
2005
  this._widgetApi = _widgetApi;
2003
2006
  this._widgetCallbacks = _widgetCallbacks;
2004
- this.sdkApi = sdkApi;
2007
+ this._widgetDeps = _widgetDeps;
2005
2008
  }
2006
2009
  mediaElementsLoadingPromises = [];
2007
2010
  init(localData) {
2008
2011
  try {
2009
- this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this.sdkApi);
2012
+ this._widgetApi.init(this._elementNodeRef, localData, this._widgetCallbacks, this._widgetDeps);
2010
2013
  }
2011
2014
  catch (e) {
2012
2015
  console.error(e);
@@ -2030,7 +2033,7 @@ class Vote {
2030
2033
  get isLayerForcePaused() {
2031
2034
  return false;
2032
2035
  }
2033
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetVote.api`, `WidgetCallbacks`, `SDKApi`]; }
2036
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Layer`, `typeof WidgetVote.api`, `WidgetCallbacks`, `WidgetDeps`]; }
2034
2037
  }
2035
2038
 
2036
2039
  class Text {
@@ -2790,7 +2793,7 @@ class VideoStateAdapter {
2790
2793
  // const
2791
2794
  // }
2792
2795
  // args nodeRef, elementClassName
2793
- const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, sdkApi) => {
2796
+ const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, widgetDeps) => {
2794
2797
  const layoutApi = layer.layoutService.layoutApi;
2795
2798
  const layersNodesRefs = layer.slide.layersNodesRefs;
2796
2799
  for (let elementClassName of nodeRef.classList.values()) {
@@ -2811,39 +2814,39 @@ const tryCreateFromHtmlElement = (nodeRef, layer, widgetCallbacks, sdkApi) => {
2811
2814
  return new Video(nodeRef, layer, layoutApi.VideoPlayer, layer.sdkApi);
2812
2815
  //////// widgets ///////
2813
2816
  case Copy.className():
2814
- return layoutApi.widgetCopyApi ? new Copy(nodeRef, layer, layoutApi.widgetCopyApi, widgetCallbacks, sdkApi) : null;
2817
+ return layoutApi.widgetCopyApi ? new Copy(nodeRef, layer, layoutApi.widgetCopyApi, widgetCallbacks, widgetDeps) : null;
2815
2818
  case Barcode.className():
2816
- return layoutApi.widgetBarcodeApi ? new Barcode(nodeRef, layer, layoutApi.widgetBarcodeApi, widgetCallbacks, sdkApi) : null;
2819
+ return layoutApi.widgetBarcodeApi ? new Barcode(nodeRef, layer, layoutApi.widgetBarcodeApi, widgetCallbacks, widgetDeps) : null;
2817
2820
  case DataInput.className():
2818
- return layoutApi.widgetDataInputApi ? new DataInput(nodeRef, layer, layoutApi.widgetDataInputApi, widgetCallbacks, sdkApi) : null;
2821
+ return layoutApi.widgetDataInputApi ? new DataInput(nodeRef, layer, layoutApi.widgetDataInputApi, widgetCallbacks, widgetDeps) : null;
2819
2822
  case DateCountdown.className():
2820
2823
  return layoutApi.widgetDateCountdownApi
2821
- ? new DateCountdown(nodeRef, layer, layersNodesRefs, layoutApi.widgetDateCountdownApi, widgetCallbacks, sdkApi)
2824
+ ? new DateCountdown(nodeRef, layer, layersNodesRefs, layoutApi.widgetDateCountdownApi, widgetCallbacks, widgetDeps)
2822
2825
  : null;
2823
2826
  case Poll.className():
2824
- return layoutApi.widgetPollApi ? new Poll(nodeRef, layer, layoutApi.widgetPollApi, widgetCallbacks, sdkApi) : null;
2827
+ return layoutApi.widgetPollApi ? new Poll(nodeRef, layer, layoutApi.widgetPollApi, widgetCallbacks, widgetDeps) : null;
2825
2828
  case PollLayers.className():
2826
2829
  return layoutApi.widgetPollLayersApi
2827
- ? new PollLayers(nodeRef, layer, layersNodesRefs, layoutApi.widgetPollLayersApi, widgetCallbacks, sdkApi)
2830
+ ? new PollLayers(nodeRef, layer, layersNodesRefs, layoutApi.widgetPollLayersApi, widgetCallbacks, widgetDeps)
2828
2831
  : null;
2829
2832
  case Quest.className():
2830
- return layoutApi.widgetQuestApi ? new Quest(nodeRef, layer, layoutApi.widgetQuestApi, widgetCallbacks, sdkApi) : null;
2833
+ return layoutApi.widgetQuestApi ? new Quest(nodeRef, layer, layoutApi.widgetQuestApi, widgetCallbacks, widgetDeps) : null;
2831
2834
  case Quiz.className():
2832
- return layoutApi.widgetQuizApi ? new Quiz(nodeRef, layer, layoutApi.widgetQuizApi, widgetCallbacks, sdkApi) : null;
2835
+ return layoutApi.widgetQuizApi ? new Quiz(nodeRef, layer, layoutApi.widgetQuizApi, widgetCallbacks, widgetDeps) : null;
2833
2836
  case QuizGrouped.className():
2834
- return layoutApi.widgetQuizGroupedApi ? new QuizGrouped(nodeRef, layer, layoutApi.widgetQuizGroupedApi, widgetCallbacks, sdkApi) : null;
2837
+ return layoutApi.widgetQuizGroupedApi ? new QuizGrouped(nodeRef, layer, layoutApi.widgetQuizGroupedApi, widgetCallbacks, widgetDeps) : null;
2835
2838
  case RangeSlider.className():
2836
- return layoutApi.widgetRangeSliderApi ? new RangeSlider(nodeRef, layer, layoutApi.widgetRangeSliderApi, widgetCallbacks, sdkApi) : null;
2839
+ return layoutApi.widgetRangeSliderApi ? new RangeSlider(nodeRef, layer, layoutApi.widgetRangeSliderApi, widgetCallbacks, widgetDeps) : null;
2837
2840
  case Rate.className():
2838
- return layoutApi.widgetRateApi ? new Rate(nodeRef, layer, layoutApi.widgetRateApi, widgetCallbacks, sdkApi) : null;
2841
+ return layoutApi.widgetRateApi ? new Rate(nodeRef, layer, layoutApi.widgetRateApi, widgetCallbacks, widgetDeps) : null;
2839
2842
  case Share.className():
2840
- return layoutApi.widgetShareApi ? new Share(nodeRef, layer, layersNodesRefs, layoutApi.widgetShareApi, widgetCallbacks, sdkApi) : null;
2843
+ return layoutApi.widgetShareApi ? new Share(nodeRef, layer, layersNodesRefs, layoutApi.widgetShareApi, widgetCallbacks, widgetDeps) : null;
2841
2844
  case Test.className():
2842
- return layoutApi.widgetTestApi ? new Test(nodeRef, layer, layoutApi.widgetTestApi, widgetCallbacks, sdkApi) : null;
2845
+ return layoutApi.widgetTestApi ? new Test(nodeRef, layer, layoutApi.widgetTestApi, widgetCallbacks, widgetDeps) : null;
2843
2846
  case Vote.className():
2844
- return layoutApi.widgetVoteApi ? new Vote(nodeRef, layer, layoutApi.widgetVoteApi, widgetCallbacks, sdkApi) : null;
2847
+ return layoutApi.widgetVoteApi ? new Vote(nodeRef, layer, layoutApi.widgetVoteApi, widgetCallbacks, widgetDeps) : null;
2845
2848
  case Products.className():
2846
- return layoutApi.widgetProductsApi ? new Products(nodeRef, layer, layoutApi.widgetProductsApi, widgetCallbacks, sdkApi) : null;
2849
+ return layoutApi.widgetProductsApi ? new Products(nodeRef, layer, layoutApi.widgetProductsApi, widgetCallbacks, widgetDeps) : null;
2847
2850
  }
2848
2851
  }
2849
2852
  return null;
@@ -3078,6 +3081,7 @@ class Layer {
3078
3081
  _afterStartInitQueuePush;
3079
3082
  _showNextSlide;
3080
3083
  sdkApi;
3084
+ _slideRoot;
3081
3085
  _slidePauseUI;
3082
3086
  _slideResumeUI;
3083
3087
  _slideIndex;
@@ -3089,7 +3093,8 @@ class Layer {
3089
3093
  _disabledNavigation;
3090
3094
  _elements = [];
3091
3095
  _timeline;
3092
- constructor(_nodeRef, _slide, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slidePauseUI, _slideResumeUI) {
3096
+ _widgetDeps;
3097
+ constructor(_nodeRef, _slide, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slideRoot, _slidePauseUI, _slideResumeUI) {
3093
3098
  this._nodeRef = _nodeRef;
3094
3099
  this._slide = _slide;
3095
3100
  this._slideReadyPromise = _slideReadyPromise;
@@ -3097,6 +3102,7 @@ class Layer {
3097
3102
  this._afterStartInitQueuePush = _afterStartInitQueuePush;
3098
3103
  this._showNextSlide = _showNextSlide;
3099
3104
  this.sdkApi = sdkApi;
3105
+ this._slideRoot = _slideRoot;
3100
3106
  this._slidePauseUI = _slidePauseUI;
3101
3107
  this._slideResumeUI = _slideResumeUI;
3102
3108
  this._slideIndex = parseInt(this._nodeRef.getAttribute("data-index") ?? "0");
@@ -3107,6 +3113,7 @@ class Layer {
3107
3113
  this._disabledTimer = this._nodeRef.getAttribute("data-disable-timer") === "1";
3108
3114
  this._disabledNavigation = this._nodeRef.getAttribute("data-disable-navigation") === "1";
3109
3115
  this._timeline = new SlideTimeline(this._slideIndex, this._duration, this._disabledTimer, this._slideReadyPromise, this._afterAppResumeQueuePush, this.sdkApi);
3116
+ this._widgetDeps = { sdkApi: this.sdkApi, slideRoot: this._slideRoot };
3110
3117
  const onWidgetComplete = (cardId, slideIndex) => {
3111
3118
  // todo if nothing more widgets with disabled timers - we can start layer timeline
3112
3119
  const fallback = () => this._showNextSlide(DEFAULT_SLIDE_DURATION);
@@ -3128,7 +3135,7 @@ class Layer {
3128
3135
  onWidgetComplete,
3129
3136
  onWidgetRequirePauseUI,
3130
3137
  onWidgetRequireResumeUI,
3131
- }, this.sdkApi);
3138
+ }, this._widgetDeps);
3132
3139
  if (element) {
3133
3140
  this._elements.push(element);
3134
3141
  if (element instanceof Quest) {
@@ -3147,7 +3154,7 @@ class Layer {
3147
3154
  onWidgetComplete,
3148
3155
  onWidgetRequirePauseUI,
3149
3156
  onWidgetRequireResumeUI,
3150
- }, this.sdkApi));
3157
+ }, this._widgetDeps));
3151
3158
  }
3152
3159
  }
3153
3160
  init(localData) {
@@ -3157,12 +3164,14 @@ class Layer {
3157
3164
  this.sdkApi.isAndroid && this._nodeRef.classList.add("_isAndroid");
3158
3165
  }
3159
3166
  const promises = this._elements.map(element => element.init(localData));
3167
+ return promises;
3168
+ }
3169
+ onAfterAllMediaResourcesLoaded() {
3160
3170
  if (this.sdkApi.isIOS) {
3161
3171
  // only for bug in WKWebWebkit
3162
3172
  this._initTextElementAutoWidthCorrection();
3163
3173
  }
3164
3174
  this._initTextFit();
3165
- return promises;
3166
3175
  }
3167
3176
  get nodeRef() {
3168
3177
  return this._nodeRef;
@@ -3444,7 +3453,7 @@ class Layer {
3444
3453
  get isLayerForcePaused() {
3445
3454
  return this.elements.some(element => element.isLayerForcePaused);
3446
3455
  }
3447
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `() => Promise<void>`, `() => Promise<void>`]; }
3456
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Slide`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `HTMLElement`, `() => Promise<void>`, `() => Promise<void>`]; }
3448
3457
  }
3449
3458
  const TextFit = (function () {
3450
3459
  const defaultSettings = {
@@ -3636,24 +3645,26 @@ class Slide {
3636
3645
  _afterStartInitQueuePush;
3637
3646
  _showNextSlide;
3638
3647
  sdkApi;
3648
+ _slideRoot;
3639
3649
  _slidePauseUI;
3640
3650
  _slideResumeUI;
3641
3651
  _layers;
3642
3652
  _start;
3643
- constructor(_slidesNodesRefs, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slidePauseUI, _slideResumeUI) {
3653
+ constructor(_slidesNodesRefs, _slideReadyPromise, _afterAppResumeQueuePush, _afterStartInitQueuePush, _showNextSlide, sdkApi, _slideRoot, _slidePauseUI, _slideResumeUI) {
3644
3654
  this._slidesNodesRefs = _slidesNodesRefs;
3645
3655
  this._slideReadyPromise = _slideReadyPromise;
3646
3656
  this._afterAppResumeQueuePush = _afterAppResumeQueuePush;
3647
3657
  this._afterStartInitQueuePush = _afterStartInitQueuePush;
3648
3658
  this._showNextSlide = _showNextSlide;
3649
3659
  this.sdkApi = sdkApi;
3660
+ this._slideRoot = _slideRoot;
3650
3661
  this._slidePauseUI = _slidePauseUI;
3651
3662
  this._slideResumeUI = _slideResumeUI;
3652
3663
  this._start = window.performance.now();
3653
3664
  if (!this._slidesNodesRefs.length) {
3654
3665
  throw new Error("No slides found.");
3655
3666
  }
3656
- this._layers = this._slidesNodesRefs.map(item => new Layer(item, this, this._slideReadyPromise, this._afterAppResumeQueuePush, this._afterStartInitQueuePush, this._showNextSlide, this.sdkApi, this._slidePauseUI, this._slideResumeUI));
3667
+ this._layers = this._slidesNodesRefs.map(item => new Layer(item, this, this._slideReadyPromise, this._afterAppResumeQueuePush, this._afterStartInitQueuePush, this._showNextSlide, this.sdkApi, this._slideRoot, this._slidePauseUI, this._slideResumeUI));
3657
3668
  this._activeLayer = this._layers[0];
3658
3669
  }
3659
3670
  _activeLayer;
@@ -3672,7 +3683,7 @@ class Slide {
3672
3683
  const multiSlideApi = this.layoutService.layoutApi.widgetMultiSlideApi;
3673
3684
  if (multiSlideApi != null && this.layers.length > 1) {
3674
3685
  try {
3675
- multiSlideApi.init(this.layersNodesRefs, localData, this.sdkApi);
3686
+ multiSlideApi.init(this.layersNodesRefs, localData, { sdkApi: this.sdkApi, slideRoot: this._slideRoot });
3676
3687
  }
3677
3688
  catch (e) {
3678
3689
  console.error(e);
@@ -3689,6 +3700,9 @@ class Slide {
3689
3700
  // if not all Widgets return finishRender: true - return false
3690
3701
  return !res.some(item => item === false);
3691
3702
  }
3703
+ onAfterAllMediaResourcesLoaded() {
3704
+ this.layers.flatMap(layer => layer.onAfterAllMediaResourcesLoaded());
3705
+ }
3692
3706
  refreshActiveLayer() {
3693
3707
  this.layers.forEach(layer => {
3694
3708
  if (!layer.nodeRef.classList.contains("hidden")) {
@@ -3742,7 +3756,7 @@ class Slide {
3742
3756
  get disabledNavigation() {
3743
3757
  return this._activeLayer.disabledNavigation;
3744
3758
  }
3745
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`Array`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `() => Promise<void>`, `() => Promise<void>`]; }
3759
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`Array`, `Promise`, `(cb: () => void) => void`, `(cb: () => void) => void`, `(duration: number) => void`, `SDKApi`, `HTMLElement`, `() => Promise<void>`, `() => Promise<void>`]; }
3746
3760
  }
3747
3761
 
3748
3762
  let SlideApi$1 = class SlideApi {
@@ -3819,6 +3833,14 @@ let SlideApi$1 = class SlideApi {
3819
3833
  let xOffset = "0px";
3820
3834
  // for elements with bottom anchor (absolute position)
3821
3835
  let yOffset = "0px";
3836
+ // alert(viewportHeight);
3837
+ // todo - mobile only (or isIos or isAndroid)
3838
+ if (this.sdkApi.isAndroid || this.sdkApi.isIOS) {
3839
+ if (viewportRatio > _ratio) {
3840
+ // disable _isFullscreen if viewport small
3841
+ _isFullscreen = false;
3842
+ }
3843
+ }
3822
3844
  if (_isFullscreen) {
3823
3845
  // более квадратное чем надо (desktop)
3824
3846
  if (viewportRatio > _ratio) {
@@ -4021,7 +4043,7 @@ let SlideApi$1 = class SlideApi {
4021
4043
  const slideReadyPromise = new Promise(resolve => {
4022
4044
  slideReadyResolve = resolve;
4023
4045
  });
4024
- const slide = new Slide(slidesNodesRefs, slideReadyPromise, this.afterAppResumeQueuePush.bind(this), this.afterStartInitQueuePush.bind(this), this.sdkApi.showNextSlide.bind(this), this.sdkApi, this.slidePauseUI.bind(this), this.slideResumeUI.bind(this));
4046
+ const slide = new Slide(slidesNodesRefs, slideReadyPromise, this.afterAppResumeQueuePush.bind(this), this.afterStartInitQueuePush.bind(this), this.sdkApi.showNextSlide.bind(this), this.sdkApi, this._slideWrapper, this.slidePauseUI.bind(this), this.slideResumeUI.bind(this));
4025
4047
  this._slideInInit = slide;
4026
4048
  slide.activeLayer.timeline.triggerSlideLoadState();
4027
4049
  if (this.sdkApi.isAndroid) {
@@ -4052,6 +4074,8 @@ let SlideApi$1 = class SlideApi {
4052
4074
  if (finishRender) {
4053
4075
  this._state = 1 /* STATE.INITED */;
4054
4076
  await mediaResourcesWithTimeoutPromise;
4077
+ // init TextFit only after fonts
4078
+ slide.onAfterAllMediaResourcesLoaded();
4055
4079
  result.result = true;
4056
4080
  await slideBoxCb();
4057
4081
  }
@@ -4182,7 +4206,7 @@ let SlideApi$1 = class SlideApi {
4182
4206
  this._state = 9 /* STATE.USER_PAUSED */;
4183
4207
  };
4184
4208
  // todo move to Android adapter
4185
- if (this.sdkApi.isAndroid) {
4209
+ if (this.sdkApi.isAndroid && !this.sdkApi.isSdkSupportCorrectPauseResumeLifecycle()) {
4186
4210
  this._pauseCbTimer = this.layoutService.env.setTimeout(pauseCb, 300);
4187
4211
  }
4188
4212
  else {
@@ -4905,7 +4929,7 @@ let SlideApi$1 = class SlideApi {
4905
4929
  }
4906
4930
  }
4907
4931
  setWidgetGoodsComplete(elementId) {
4908
- const element = document.querySelector('[data-element-id="' + elementId + '"]');
4932
+ const element = this._slideWrapper.querySelector('[data-element-id="' + elementId + '"]');
4909
4933
  if (element != null) {
4910
4934
  try {
4911
4935
  element.style.setProperty("opacity", "1");
@@ -14327,7 +14351,7 @@ function ean13(opts,dwg) { return _ToAny(bwipp_ean13,opts,dwg); }function pdf417
14327
14351
 
14328
14352
  class WidgetBase {
14329
14353
  _widgetCallbacks;
14330
- sdkApi;
14354
+ widgetDeps;
14331
14355
  static DEFAULTS = {
14332
14356
  slide: null,
14333
14357
  activateAfterCreate: false,
@@ -14355,9 +14379,9 @@ class WidgetBase {
14355
14379
  id;
14356
14380
  startReadyPromise = null;
14357
14381
  startReadyResolve = null;
14358
- constructor(element, options, _widgetCallbacks, sdkApi, elementIdGetter, slideGetter) {
14382
+ constructor(element, options, _widgetCallbacks, widgetDeps, elementIdGetter, slideGetter) {
14359
14383
  this._widgetCallbacks = _widgetCallbacks;
14360
- this.sdkApi = sdkApi;
14384
+ this.widgetDeps = widgetDeps;
14361
14385
  this.options = extend({}, this.constructor.DEFAULTS, options);
14362
14386
  this.element = element;
14363
14387
  if (elementIdGetter) {
@@ -14401,7 +14425,7 @@ class WidgetBase {
14401
14425
  this.submitButtonView = this.submitButtonAnimatedView.querySelector(".submit-button-view");
14402
14426
  }
14403
14427
  }
14404
- this.savedData = this.sdkApi.getCardServerData(this.cardId);
14428
+ this.savedData = this.widgetDeps.sdkApi.getCardServerData(this.cardId);
14405
14429
  this.localData = extend({}, this.savedData ?? {}, this.options.localData ?? {});
14406
14430
  this.id = `w_${this.elementId}_${WidgetBase.widgetIndex}`;
14407
14431
  ++WidgetBase.widgetIndex;
@@ -14423,7 +14447,7 @@ class WidgetBase {
14423
14447
  * @param localData
14424
14448
  */
14425
14449
  onRefreshUserData(localData) {
14426
- this.savedData = this.sdkApi.getCardServerData(this.cardId);
14450
+ this.savedData = this.widgetDeps.sdkApi.getCardServerData(this.cardId);
14427
14451
  this.localData = extend({}, this.savedData ?? {}, localData);
14428
14452
  }
14429
14453
  onStart() {
@@ -14442,8 +14466,8 @@ class WidgetBase {
14442
14466
  static getInstance(element) {
14443
14467
  return data(element, this.widgetCacheKey);
14444
14468
  }
14445
- static getInstanceById(id) {
14446
- const widgetsElements = slice.call(this.widgetsService.env.document.querySelectorAll(`.${this.widgetClassName}`));
14469
+ static getInstanceById(slideRoot, id) {
14470
+ const widgetsElements = slice.call(slideRoot.querySelectorAll(`.${this.widgetClassName}`));
14447
14471
  let widget;
14448
14472
  forEach(widgetsElements, (element, index) => {
14449
14473
  const localWidget = data(element, this.widgetCacheKey);
@@ -14480,7 +14504,7 @@ class WidgetBase {
14480
14504
  return sdkApi.getCardLocalData();
14481
14505
  }
14482
14506
  getLocalData() {
14483
- return this.constructor.getLocalData(this.sdkApi);
14507
+ return this.constructor.getLocalData(this.widgetDeps.sdkApi);
14484
14508
  }
14485
14509
  static setLocalData(sdkApi, keyValue, sendToServer, syncWithRuntimeLocalData) {
14486
14510
  // push json object as string
@@ -14510,7 +14534,7 @@ class WidgetBase {
14510
14534
  }
14511
14535
  }
14512
14536
  setLocalData(keyValue, sendToServer, syncWithRuntimeLocalData) {
14513
- return this.constructor.setLocalData(this.sdkApi, keyValue, sendToServer, syncWithRuntimeLocalData);
14537
+ return this.constructor.setLocalData(this.widgetDeps.sdkApi, keyValue, sendToServer, syncWithRuntimeLocalData);
14514
14538
  }
14515
14539
  get statisticEventBaseFieldsShortForm() {
14516
14540
  return WidgetBase.getStatisticEventBaseFieldsShortForm(this.cardId, this.slideIndex);
@@ -14541,7 +14565,7 @@ class WidgetBase {
14541
14565
  sendStatisticEventToApp(sdkApi, name, data, devPayload, options);
14542
14566
  }
14543
14567
  sendStatisticEventToApp(name, data, devPayload, options) {
14544
- this.constructor.sendStatisticEventToApp(this.sdkApi, name, data, devPayload, options);
14568
+ this.constructor.sendStatisticEventToApp(this.widgetDeps.sdkApi, name, data, devPayload, options);
14545
14569
  }
14546
14570
  onWidgetComplete() {
14547
14571
  this._widgetCallbacks.onWidgetComplete(this.cardId, this.slideIndex);
@@ -14553,14 +14577,14 @@ class WidgetBase {
14553
14577
  this._widgetCallbacks.onWidgetRequireResumeUI(this.cardId, this.slideIndex);
14554
14578
  }
14555
14579
  _showLayer(layers, selectIndex, withStatEvent = false) {
14556
- if (this.sdkApi.isExistsShowLayer()) {
14557
- this.sdkApi.showLayer(selectIndex);
14580
+ if (this.widgetDeps.sdkApi.isExistsShowLayer()) {
14581
+ this.widgetDeps.sdkApi.showLayer(selectIndex);
14558
14582
  }
14559
14583
  else {
14560
14584
  forEach(layers, (layer, index) => {
14561
14585
  if (index === selectIndex) {
14562
14586
  layer.classList.remove("hidden");
14563
- this.sdkApi.cardAnimation?.start(layer);
14587
+ this.widgetDeps.sdkApi.cardAnimation?.start(layer);
14564
14588
  }
14565
14589
  else {
14566
14590
  layer.classList.add("hidden");
@@ -14602,7 +14626,7 @@ class WidgetBase {
14602
14626
  return `story/${this.cardId}/widget/${this.elementId}/promo-code/${promotionalCodeId}`;
14603
14627
  }
14604
14628
  }
14605
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`, `(element: HTMLElement) => string`, `(element: HTMLElement) => HTMLElement`]; }
14629
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`, `(element: HTMLElement) => string`, `(element: HTMLElement) => HTMLElement`]; }
14606
14630
  }
14607
14631
 
14608
14632
  class WidgetBarcode extends WidgetBase {
@@ -14626,8 +14650,8 @@ class WidgetBarcode extends WidgetBase {
14626
14650
  msgNoMoreCodes;
14627
14651
  msgTryAgain;
14628
14652
  msgBarcodeRenderError;
14629
- constructor(element, options, widgetCallbacks, sdkApi) {
14630
- super(element, options, widgetCallbacks, sdkApi);
14653
+ constructor(element, options, widgetCallbacks, widgetDeps) {
14654
+ super(element, options, widgetCallbacks, widgetDeps);
14631
14655
  this.captionView = this.element.querySelector(".narrative-element-text-lines");
14632
14656
  this.clipboardTarget = getTagData(element, "clipboardTarget");
14633
14657
  this.isPromotionalCode = getTagData(element, "clipboardType") === "promocode";
@@ -14710,7 +14734,7 @@ class WidgetBarcode extends WidgetBase {
14710
14734
  }
14711
14735
  catch (e) {
14712
14736
  if (this.msgBarcodeRenderError) {
14713
- this.sdkApi.showToast(this.msgBarcodeRenderError);
14737
+ this.widgetDeps.sdkApi.showToast(this.msgBarcodeRenderError);
14714
14738
  }
14715
14739
  console.error(e);
14716
14740
  }
@@ -14773,7 +14797,7 @@ class WidgetBarcode extends WidgetBase {
14773
14797
  };
14774
14798
  const profileKey = "fetch-promo-code";
14775
14799
  Promise.all([
14776
- this.sdkApi.sendApiRequest(path, "POST", null, headers, null, profileKey),
14800
+ this.widgetDeps.sdkApi.sendApiRequest(path, "POST", null, headers, null, profileKey),
14777
14801
  new Promise(function (t, e) {
14778
14802
  return setTimeout(t, 300);
14779
14803
  }),
@@ -14801,14 +14825,14 @@ class WidgetBarcode extends WidgetBase {
14801
14825
  this.setLocalData(this.localData, true);
14802
14826
  }
14803
14827
  else {
14804
- this.msgNoMoreCodes && this.sdkApi.showToast(this.msgNoMoreCodes);
14828
+ this.msgNoMoreCodes && this.widgetDeps.sdkApi.showToast(this.msgNoMoreCodes);
14805
14829
  }
14806
14830
  }
14807
14831
  else if (status === 12163 || status === 12002) {
14808
- this.msgNetworkError && this.sdkApi.showToast(this.msgNetworkError);
14832
+ this.msgNetworkError && this.widgetDeps.sdkApi.showToast(this.msgNetworkError);
14809
14833
  }
14810
14834
  else {
14811
- this.msgServiceError && this.sdkApi.showToast(this.msgServiceError);
14835
+ this.msgServiceError && this.widgetDeps.sdkApi.showToast(this.msgServiceError);
14812
14836
  }
14813
14837
  if (!success) {
14814
14838
  this.state = 3;
@@ -14854,13 +14878,13 @@ class WidgetBarcode extends WidgetBase {
14854
14878
  }
14855
14879
  });
14856
14880
  if (this.copiedText) {
14857
- this.sdkApi.showToast(this.copiedText);
14881
+ this.widgetDeps.sdkApi.showToast(this.copiedText);
14858
14882
  }
14859
14883
  }
14860
14884
  copyToClipboard(element) {
14861
14885
  this._select();
14862
14886
  const textValue = this.clipboardTarget ?? "";
14863
- this.sdkApi.writeToClipboard({ type: "text", textValue });
14887
+ this.widgetDeps.sdkApi.writeToClipboard({ type: "text", textValue });
14864
14888
  this.completeWidget();
14865
14889
  this._statEventCopyClick(textValue);
14866
14890
  }
@@ -14876,8 +14900,8 @@ class WidgetBarcode extends WidgetBase {
14876
14900
  static api = {
14877
14901
  widgetClassName: WidgetBarcode.widgetClassName,
14878
14902
  onRefreshUserData: WidgetBarcode.onRefreshUserData,
14879
- init: function (element, localData, widgetCallbacks, sdkApi) {
14880
- WidgetBarcode.initWidget(element, localData, (element, options) => new WidgetBarcode(element, options, widgetCallbacks, sdkApi));
14903
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
14904
+ WidgetBarcode.initWidget(element, localData, (element, options) => new WidgetBarcode(element, options, widgetCallbacks, widgetDeps));
14881
14905
  },
14882
14906
  onStart: function (element) {
14883
14907
  WidgetBarcode.getInstance(element)?.onStart();
@@ -14904,7 +14928,7 @@ class WidgetBarcode extends WidgetBase {
14904
14928
  return false;
14905
14929
  },
14906
14930
  };
14907
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
14931
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
14908
14932
  }
14909
14933
 
14910
14934
  class WidgetCopy extends WidgetBase {
@@ -14926,8 +14950,8 @@ class WidgetCopy extends WidgetBase {
14926
14950
  geometry;
14927
14951
  resultLayer;
14928
14952
  resultLayerGeometry;
14929
- constructor(element, options, widgetCallbacks, sdkApi) {
14930
- super(element, options, widgetCallbacks, sdkApi);
14953
+ constructor(element, options, widgetCallbacks, widgetDeps) {
14954
+ super(element, options, widgetCallbacks, widgetDeps);
14931
14955
  this.button = this.element.querySelector(".narrative-element-text-lines");
14932
14956
  this.clipboardTarget = getTagData(element, "clipboardTarget");
14933
14957
  this.isPromotionalCode = getTagData(element, "clipboardType") === "promocode";
@@ -15032,7 +15056,7 @@ class WidgetCopy extends WidgetBase {
15032
15056
  };
15033
15057
  const profileKey = "fetch-promo-code";
15034
15058
  Promise.all([
15035
- this.sdkApi.sendApiRequest(path, "POST", null, headers, null, profileKey),
15059
+ this.widgetDeps.sdkApi.sendApiRequest(path, "POST", null, headers, null, profileKey),
15036
15060
  new Promise(function (t, e) {
15037
15061
  return setTimeout(t, 300);
15038
15062
  }),
@@ -15059,14 +15083,14 @@ class WidgetCopy extends WidgetBase {
15059
15083
  this.setLocalData(this.localData, true);
15060
15084
  }
15061
15085
  else {
15062
- this.msgNoMoreCodes && this.sdkApi.showToast(this.msgNoMoreCodes);
15086
+ this.msgNoMoreCodes && this.widgetDeps.sdkApi.showToast(this.msgNoMoreCodes);
15063
15087
  }
15064
15088
  }
15065
15089
  else if (status === 12163 || status === 12002) {
15066
- this.msgNetworkError && this.sdkApi.showToast(this.msgNetworkError);
15090
+ this.msgNetworkError && this.widgetDeps.sdkApi.showToast(this.msgNetworkError);
15067
15091
  }
15068
15092
  else {
15069
- this.msgServiceError && this.sdkApi.showToast(this.msgServiceError);
15093
+ this.msgServiceError && this.widgetDeps.sdkApi.showToast(this.msgServiceError);
15070
15094
  }
15071
15095
  if (!success) {
15072
15096
  this.state = 3;
@@ -15118,7 +15142,7 @@ class WidgetCopy extends WidgetBase {
15118
15142
  copyToClipboard(element) {
15119
15143
  this._select();
15120
15144
  const textValue = this.clipboardTarget ?? "";
15121
- this.sdkApi.writeToClipboard({ type: "text", textValue });
15145
+ this.widgetDeps.sdkApi.writeToClipboard({ type: "text", textValue });
15122
15146
  this.completeWidget();
15123
15147
  this._statEventCopyClick(textValue);
15124
15148
  }
@@ -15134,10 +15158,10 @@ class WidgetCopy extends WidgetBase {
15134
15158
  static api = {
15135
15159
  widgetClassName: WidgetCopy.widgetClassName,
15136
15160
  onRefreshUserData: WidgetCopy.onRefreshUserData,
15137
- init: function (element, localData, widgetCallbacks, sdkApi) {
15161
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
15138
15162
  // prevent initWidget for result layer
15139
15163
  if (!element.classList.contains("narrative-element-copy-result-variant")) {
15140
- WidgetCopy.initWidget(element, localData, (element, options) => new WidgetCopy(element, options, widgetCallbacks, sdkApi));
15164
+ WidgetCopy.initWidget(element, localData, (element, options) => new WidgetCopy(element, options, widgetCallbacks, widgetDeps));
15141
15165
  }
15142
15166
  },
15143
15167
  onStart: function (element) {
@@ -15165,7 +15189,7 @@ class WidgetCopy extends WidgetBase {
15165
15189
  return false;
15166
15190
  },
15167
15191
  };
15168
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
15192
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
15169
15193
  }
15170
15194
 
15171
15195
  class WidgetDataInput extends WidgetBase {
@@ -15185,11 +15209,11 @@ class WidgetDataInput extends WidgetBase {
15185
15209
  * @throws Error
15186
15210
  * @param element
15187
15211
  * @param options
15188
- * @param onWidgetComplete
15189
- * @param sdkApi
15212
+ * @param widgetCallbacks
15213
+ * @param widgetDeps
15190
15214
  */
15191
- constructor(element, options, widgetCallbacks, sdkApi) {
15192
- super(element, options, widgetCallbacks, sdkApi);
15215
+ constructor(element, options, widgetCallbacks, widgetDeps) {
15216
+ super(element, options, widgetCallbacks, widgetDeps);
15193
15217
  this.label = this.element.querySelector(".label-view .label");
15194
15218
  this.elementRect = this.element.getBoundingClientRect();
15195
15219
  this.inputElement = getValueOrException(this.element.querySelector(".input-view .input"), "Empty .input-view .input");
@@ -15260,12 +15284,12 @@ class WidgetDataInput extends WidgetBase {
15260
15284
  return true;
15261
15285
  }
15262
15286
  this.elementRect = this.element.getBoundingClientRect();
15263
- if (this.sdkApi.isAndroid || this.sdkApi.isWeb) {
15287
+ if (this.widgetDeps.sdkApi.isAndroid || this.widgetDeps.sdkApi.isWeb) {
15264
15288
  this.slide.classList.add("blured");
15265
15289
  }
15266
15290
  this.slide.classList.add("data-input-editing");
15267
15291
  const dataString = this.element.dataset["clientdialogwidgetconfig"];
15268
- if (this.sdkApi.isExistsShowCardTextInput && dataString) {
15292
+ if (this.widgetDeps.sdkApi.isExistsShowCardTextInput && dataString) {
15269
15293
  const data = JSON.parse(dataString);
15270
15294
  data.size = getElementBounding(this.env, this.elementRect);
15271
15295
  if (!this.disableTimer) {
@@ -15286,7 +15310,7 @@ class WidgetDataInput extends WidgetBase {
15286
15310
  catch (e) {
15287
15311
  console.error(e);
15288
15312
  }
15289
- this.sdkApi.showCardTextInput(this.id, data);
15313
+ this.widgetDeps.sdkApi.showCardTextInput(this.id, data);
15290
15314
  this._statEventFocusIn();
15291
15315
  }
15292
15316
  return false;
@@ -15336,8 +15360,8 @@ class WidgetDataInput extends WidgetBase {
15336
15360
  static api = {
15337
15361
  widgetClassName: WidgetDataInput.widgetClassName,
15338
15362
  onRefreshUserData: WidgetDataInput.onRefreshUserData,
15339
- init: function (element, localData, widgetCallbacks, sdkApi) {
15340
- WidgetDataInput.initWidget(element, localData, (element, options) => new WidgetDataInput(element, options, widgetCallbacks, sdkApi));
15363
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
15364
+ WidgetDataInput.initWidget(element, localData, (element, options) => new WidgetDataInput(element, options, widgetCallbacks, widgetDeps));
15341
15365
  },
15342
15366
  onStart: function (element) {
15343
15367
  WidgetDataInput.getInstance(element)?.onStart();
@@ -15355,11 +15379,11 @@ class WidgetDataInput extends WidgetBase {
15355
15379
  }
15356
15380
  return true;
15357
15381
  },
15358
- setUserData: function (id, text) {
15359
- WidgetDataInput.getInstanceById(id)?.setUserText(text);
15382
+ setUserData: function (slideRoot, id, text) {
15383
+ WidgetDataInput.getInstanceById(slideRoot, id)?.setUserText(text);
15360
15384
  },
15361
15385
  };
15362
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
15386
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
15363
15387
  }
15364
15388
 
15365
15389
  class WidgetDateCountdown extends WidgetBase {
@@ -15387,8 +15411,8 @@ class WidgetDateCountdown extends WidgetBase {
15387
15411
  thirdGroup1;
15388
15412
  thirdGroup2;
15389
15413
  thirdGroupCaption;
15390
- constructor(element, options, widgetCallbacks, sdkApi) {
15391
- super(element, options, widgetCallbacks, sdkApi);
15414
+ constructor(element, options, widgetCallbacks, widgetDeps) {
15415
+ super(element, options, widgetCallbacks, widgetDeps);
15392
15416
  this.label = this.element.querySelector(".label-view .label");
15393
15417
  this.messages = {
15394
15418
  days: getTagData(this.element, "tDays") ?? "",
@@ -15566,8 +15590,8 @@ class WidgetDateCountdown extends WidgetBase {
15566
15590
  static api = {
15567
15591
  widgetClassName: WidgetDateCountdown.widgetClassName,
15568
15592
  onRefreshUserData: WidgetDateCountdown.onRefreshUserData,
15569
- init: function (element, layers, localData, widgetCallbacks, sdkApi) {
15570
- WidgetDateCountdown.initWidget(element, localData, (element, options) => new WidgetDateCountdown(element, { ...options, layers }, widgetCallbacks, sdkApi));
15593
+ init: function (element, layers, localData, widgetCallbacks, widgetDeps) {
15594
+ WidgetDateCountdown.initWidget(element, localData, (element, options) => new WidgetDateCountdown(element, { ...options, layers }, widgetCallbacks, widgetDeps));
15571
15595
  },
15572
15596
  onStart: function (element) {
15573
15597
  WidgetDateCountdown.getInstance(element)?.onStart();
@@ -15582,7 +15606,7 @@ class WidgetDateCountdown extends WidgetBase {
15582
15606
  WidgetDateCountdown.getInstance(element)?.onResume();
15583
15607
  },
15584
15608
  };
15585
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
15609
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
15586
15610
  }
15587
15611
 
15588
15612
  const displaySlide = function (slides, localData, sdkApi) {
@@ -15705,8 +15729,8 @@ const _sendStatEvent = function (sdkApi, cardId, cardType, slideIndex, layerInde
15705
15729
  };
15706
15730
  class WidgetMultiSlide {
15707
15731
  static api = {
15708
- init: function (slides, localData, sdkApi) {
15709
- displaySlide(slides, localData, sdkApi);
15732
+ init: function (slides, localData, widgetDeps) {
15733
+ displaySlide(slides, localData, widgetDeps.sdkApi);
15710
15734
  },
15711
15735
  };
15712
15736
  }
@@ -15737,10 +15761,11 @@ class WidgetPoll extends WidgetBase {
15737
15761
  * @throws Error
15738
15762
  * @param element
15739
15763
  * @param options
15740
- * @param onWidgetComplete
15764
+ * @param widgetCallbacks
15765
+ * @param widgetDeps
15741
15766
  */
15742
- constructor(element, options, widgetCallbacks, sdkApi) {
15743
- super(element, options, widgetCallbacks, sdkApi);
15767
+ constructor(element, options, widgetCallbacks, widgetDeps) {
15768
+ super(element, options, widgetCallbacks, widgetDeps);
15744
15769
  this.label = this.element.querySelector(".label-view .label");
15745
15770
  this.percentFillMask = this.element.querySelector(".percent-filled-variants-view-group-mask");
15746
15771
  this.maskedVariants = slice.call(this.element.querySelectorAll(".variants-box .variants-view-group.percent-filled-variants-view-group .variant-view"));
@@ -15873,13 +15898,13 @@ class WidgetPoll extends WidgetBase {
15873
15898
  if (index !== -1) {
15874
15899
  this.elementRect = this.element.getBoundingClientRect();
15875
15900
  if (this.getUseResponseOnFirstButton && index === 0) {
15876
- if (this.sdkApi.isAndroid) {
15901
+ if (this.widgetDeps.sdkApi.isAndroid) {
15877
15902
  this.slide.classList.add("blured");
15878
15903
  }
15879
15904
  this.slide.classList.add("data-input-editing");
15880
15905
  const dataString = this.element.dataset["clientdialogwidgetconfig"];
15881
15906
  this.selectedVariant = index;
15882
- if (this.sdkApi.isExistsShowCardTextInput && dataString) {
15907
+ if (this.widgetDeps.sdkApi.isExistsShowCardTextInput && dataString) {
15883
15908
  const data = JSON.parse(dataString);
15884
15909
  data.size = getElementBounding(this.env, this.elementRect);
15885
15910
  if (!this.disableTimer) {
@@ -15901,19 +15926,19 @@ class WidgetPoll extends WidgetBase {
15901
15926
  catch (e) {
15902
15927
  console.error(e);
15903
15928
  }
15904
- this.sdkApi.showCardTextInput(`${this.id}_first`, data);
15929
+ this.widgetDeps.sdkApi.showCardTextInput(`${this.id}_first`, data);
15905
15930
  }
15906
15931
  this._statEventPollAnswer();
15907
15932
  return false;
15908
15933
  }
15909
15934
  else if (this.getUseResponseOnSecondButton && index === 1) {
15910
- if (this.sdkApi.isAndroid) {
15935
+ if (this.widgetDeps.sdkApi.isAndroid) {
15911
15936
  this.slide.classList.add("blured");
15912
15937
  }
15913
15938
  this.slide.classList.add("data-input-editing");
15914
15939
  const dataString = this.element.dataset["clientdialogwidgetconfig"];
15915
15940
  this.selectedVariant = index;
15916
- if (this.sdkApi.isExistsShowCardTextInput && dataString) {
15941
+ if (this.widgetDeps.sdkApi.isExistsShowCardTextInput && dataString) {
15917
15942
  const data = JSON.parse(dataString);
15918
15943
  data.size = getElementBounding(this.env, this.elementRect);
15919
15944
  if (!this.disableTimer) {
@@ -15934,7 +15959,7 @@ class WidgetPoll extends WidgetBase {
15934
15959
  catch (e) {
15935
15960
  console.error(e);
15936
15961
  }
15937
- this.sdkApi.showCardTextInput(`${this.id}_second`, data);
15962
+ this.widgetDeps.sdkApi.showCardTextInput(`${this.id}_second`, data);
15938
15963
  }
15939
15964
  this._statEventPollAnswer();
15940
15965
  return false;
@@ -15977,7 +16002,7 @@ class WidgetPoll extends WidgetBase {
15977
16002
  displayPercents(selectedVariantIndex, filled = false) {
15978
16003
  let pollAllocation = [0, 0];
15979
16004
  let pollAllocationTs = undefined;
15980
- const sharedData = this.sdkApi.getWidgetsSharedData(this.cardId, "poll" /* Widgets.Poll */);
16005
+ const sharedData = this.widgetDeps.sdkApi.getWidgetsSharedData(this.cardId, "poll" /* Widgets.Poll */);
15981
16006
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
15982
16007
  pollAllocation = sharedData[this.elementId];
15983
16008
  if (isObject$1(sharedData[this.elementId])) {
@@ -16190,8 +16215,8 @@ class WidgetPoll extends WidgetBase {
16190
16215
  static api = {
16191
16216
  widgetClassName: WidgetPoll.widgetClassName,
16192
16217
  onRefreshUserData: WidgetPoll.onRefreshUserData,
16193
- init: function (element, localData, widgetCallbacks, sdkApi) {
16194
- WidgetPoll.initWidget(element, localData, (element, options) => new WidgetPoll(element, options, widgetCallbacks, sdkApi));
16218
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
16219
+ WidgetPoll.initWidget(element, localData, (element, options) => new WidgetPoll(element, options, widgetCallbacks, widgetDeps));
16195
16220
  },
16196
16221
  onStart: function (element) {
16197
16222
  WidgetPoll.getInstance(element)?.onStart();
@@ -16219,7 +16244,7 @@ class WidgetPoll extends WidgetBase {
16219
16244
  }
16220
16245
  return true;
16221
16246
  },
16222
- setUserData: function (id, text) {
16247
+ setUserData: function (slideRoot, id, text) {
16223
16248
  // id = widgetId_first || widgetId_second
16224
16249
  let correctWidgetId = id;
16225
16250
  let buttonPosition;
@@ -16231,13 +16256,13 @@ class WidgetPoll extends WidgetBase {
16231
16256
  buttonPosition = "second_button";
16232
16257
  correctWidgetId = id.replace(/_second$/, "");
16233
16258
  }
16234
- const widget = WidgetPoll.getInstanceById(correctWidgetId);
16259
+ const widget = WidgetPoll.getInstanceById(slideRoot, correctWidgetId);
16235
16260
  if (widget && buttonPosition) {
16236
16261
  widget.setUserText(text, buttonPosition);
16237
16262
  }
16238
16263
  },
16239
16264
  };
16240
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
16265
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
16241
16266
  }
16242
16267
 
16243
16268
  class WidgetPollLayers extends WidgetBase {
@@ -16254,8 +16279,8 @@ class WidgetPollLayers extends WidgetBase {
16254
16279
  variantsTexts;
16255
16280
  selectedVariant;
16256
16281
  layers;
16257
- constructor(element, options, widgetCallbacks, sdkApi) {
16258
- super(element, options, widgetCallbacks, sdkApi);
16282
+ constructor(element, options, widgetCallbacks, widgetDeps) {
16283
+ super(element, options, widgetCallbacks, widgetDeps);
16259
16284
  this.layers = this.options.layers;
16260
16285
  this.label = this.element.querySelector(".label-view .label");
16261
16286
  this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view"));
@@ -16367,8 +16392,8 @@ class WidgetPollLayers extends WidgetBase {
16367
16392
  static api = {
16368
16393
  widgetClassName: WidgetPollLayers.widgetClassName,
16369
16394
  onRefreshUserData: WidgetPollLayers.onRefreshUserData,
16370
- init: function (element, layers, localData, widgetCallbacks, sdkApi) {
16371
- WidgetPollLayers.initWidget(element, localData, (element, options) => new WidgetPollLayers(element, { ...options, layers }, widgetCallbacks, sdkApi));
16395
+ init: function (element, layers, localData, widgetCallbacks, widgetDeps) {
16396
+ WidgetPollLayers.initWidget(element, localData, (element, options) => new WidgetPollLayers(element, { ...options, layers }, widgetCallbacks, widgetDeps));
16372
16397
  },
16373
16398
  onStart: function (element) {
16374
16399
  WidgetPollLayers.getInstance(element)?.onStart();
@@ -16392,7 +16417,7 @@ class WidgetPollLayers extends WidgetBase {
16392
16417
  return false;
16393
16418
  },
16394
16419
  };
16395
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
16420
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
16396
16421
  }
16397
16422
 
16398
16423
  class Formatter {
@@ -17019,8 +17044,8 @@ class WidgetProducts extends WidgetBase {
17019
17044
  swipeGestureDetector = null;
17020
17045
  isClickCapturedByWidget = false;
17021
17046
  isScreenSupportsTouch = false;
17022
- constructor(element, options, widgetCallbacks, sdkApi) {
17023
- super(element, options, widgetCallbacks, sdkApi);
17047
+ constructor(element, options, widgetCallbacks, widgetDeps) {
17048
+ super(element, options, widgetCallbacks, widgetDeps);
17024
17049
  this.captionView = this.element.querySelector(".narrative-element-text-lines");
17025
17050
  const linkTarget = decodeURIComponent(getTagData(element, "linkTarget") ?? "[]");
17026
17051
  try {
@@ -17150,7 +17175,7 @@ class WidgetProducts extends WidgetBase {
17150
17175
  };
17151
17176
  const profileKey = "fetch-products";
17152
17177
  try {
17153
- const response = await this.sdkApi.sendApiRequest(path, "GET", null, headers, null, profileKey);
17178
+ const response = await this.widgetDeps.sdkApi.sendApiRequest(path, "GET", null, headers, null, profileKey);
17154
17179
  // console.log({response});
17155
17180
  const status = response.status;
17156
17181
  if (status === 200 || status === 201) {
@@ -17276,15 +17301,15 @@ class WidgetProducts extends WidgetBase {
17276
17301
  this.isOpen = true;
17277
17302
  // prevent next slide navigation gesture
17278
17303
  this.isClickCapturedByWidget = true;
17279
- this.sdkApi.disableHorizontalSwipeGesture();
17280
- this.sdkApi.disableVerticalSwipeGesture();
17281
- this.sdkApi.disableBackpress();
17304
+ this.widgetDeps.sdkApi.disableHorizontalSwipeGesture();
17305
+ this.widgetDeps.sdkApi.disableVerticalSwipeGesture();
17306
+ this.widgetDeps.sdkApi.disableBackpress();
17282
17307
  this._statEventWidgetOpen(this.currentModels);
17283
17308
  this.initSwipeGestureDetector();
17284
17309
  }
17285
17310
  else {
17286
17311
  if (result.message) {
17287
- this.sdkApi.showToast(result.message);
17312
+ this.widgetDeps.sdkApi.showToast(result.message);
17288
17313
  }
17289
17314
  }
17290
17315
  this.element.classList.remove("loader");
@@ -17296,13 +17321,13 @@ class WidgetProducts extends WidgetBase {
17296
17321
  this.productsView?.classList.add("ias-products-container-view--hidden");
17297
17322
  this.element.classList.remove("hidden");
17298
17323
  this.isClickCapturedByWidget = false;
17299
- this.sdkApi.enableHorizontalSwipeGesture();
17324
+ this.widgetDeps.sdkApi.enableHorizontalSwipeGesture();
17300
17325
  if (this.swipeGestureDetector != null) {
17301
17326
  this.swipeGestureDetector.destroy();
17302
17327
  this.swipeGestureDetector = null;
17303
17328
  }
17304
- this.sdkApi.enableVerticalSwipeGesture();
17305
- this.sdkApi.enableBackpress();
17329
+ this.widgetDeps.sdkApi.enableVerticalSwipeGesture();
17330
+ this.widgetDeps.sdkApi.enableBackpress();
17306
17331
  const onClosed = () => {
17307
17332
  this.productsView?.removeEventListener("animationend", onClosed);
17308
17333
  this.productsView?.parentElement?.removeChild(this.productsView);
@@ -17362,7 +17387,7 @@ class WidgetProducts extends WidgetBase {
17362
17387
  e.preventDefault();
17363
17388
  this._statEventWidgetCardClick(offer);
17364
17389
  if (offer.url) {
17365
- this.sdkApi.openUrl({ type: "link", link: { type: "url", target: offer.url } });
17390
+ this.widgetDeps.sdkApi.openUrl({ type: "link", link: { type: "url", target: offer.url } });
17366
17391
  }
17367
17392
  };
17368
17393
  card.appendChild(figure);
@@ -17497,8 +17522,8 @@ class WidgetProducts extends WidgetBase {
17497
17522
  static api = {
17498
17523
  widgetClassName: WidgetProducts.widgetClassName,
17499
17524
  onRefreshUserData: WidgetProducts.onRefreshUserData,
17500
- init: function (element, localData, widgetCallbacks, sdkApi) {
17501
- WidgetProducts.initWidget(element, localData, (element, options) => new WidgetProducts(element, options, widgetCallbacks, sdkApi));
17525
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
17526
+ WidgetProducts.initWidget(element, localData, (element, options) => new WidgetProducts(element, options, widgetCallbacks, widgetDeps));
17502
17527
  },
17503
17528
  onStart: function (element) {
17504
17529
  WidgetProducts.getInstance(element)?.onStart();
@@ -17547,7 +17572,7 @@ class WidgetProducts extends WidgetBase {
17547
17572
  return false;
17548
17573
  },
17549
17574
  };
17550
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
17575
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
17551
17576
  }
17552
17577
 
17553
17578
  class WidgetQuest extends WidgetBase {
@@ -17567,11 +17592,11 @@ class WidgetQuest extends WidgetBase {
17567
17592
  navigationNextSlide;
17568
17593
  slideDisabledNavigation;
17569
17594
  finalSlide;
17570
- constructor(element, options, widgetCallbacks, sdkApi) {
17595
+ constructor(element, options, widgetCallbacks, widgetDeps) {
17571
17596
  const isWidget = !hasClass(element, "narrative-slide");
17572
17597
  const elementIdGetter = (element) => getValueOrDefault(getTagData(element, "elementId"), "");
17573
17598
  const slideGetter = (element) => isWidget ? getValueOrException(element.closest(".narrative-slide"), "Empty slide") : element;
17574
- super(element, options, widgetCallbacks, sdkApi, elementIdGetter, slideGetter);
17599
+ super(element, options, widgetCallbacks, widgetDeps, elementIdGetter, slideGetter);
17575
17600
  this.isWidget = isWidget;
17576
17601
  this.slideCount = getTagDataAsNumber(this.slide, "slideCount") ?? 0;
17577
17602
  const nonFinalSlide = getTagDataAsNumber(this.slide, "nonFinalSlide");
@@ -17593,10 +17618,10 @@ class WidgetQuest extends WidgetBase {
17593
17618
  super.onRefreshUserData(localData);
17594
17619
  }
17595
17620
  setCardSessionValue(name, value) {
17596
- this.sdkApi.setCardSessionValue(this.element, name, value);
17621
+ this.widgetDeps.sdkApi.setCardSessionValue(this.element, name, value);
17597
17622
  }
17598
17623
  getCardSessionValue(name) {
17599
- return this.sdkApi.getCardSessionValue(this.element, name);
17624
+ return this.widgetDeps.sdkApi.getCardSessionValue(this.element, name);
17600
17625
  }
17601
17626
  init() {
17602
17627
  if (this.localData) {
@@ -17615,8 +17640,8 @@ class WidgetQuest extends WidgetBase {
17615
17640
  // global flag - был сделан переход на нужный слайд, больше не нужно повторять за эту сессию
17616
17641
  // perform showStorySlide with lastSlideIdx only on story open first time (not on second slide, etc)
17617
17642
  this.setCardSessionValue("__storyQuestSlideChanged", "1");
17618
- if (this.sdkApi.isExistsShowCardSlide) {
17619
- this.sdkApi.showCardSlide(lastSlideIdx);
17643
+ if (this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17644
+ this.widgetDeps.sdkApi.showCardSlide(lastSlideIdx);
17620
17645
  return false;
17621
17646
  }
17622
17647
  }
@@ -17627,8 +17652,8 @@ class WidgetQuest extends WidgetBase {
17627
17652
  // если этого слайда нет в роутинге (сработал переход по таймеру в app)
17628
17653
  const routes = this._getRoutes();
17629
17654
  if (routes[0].indexOf(this.slideIndex) === -1 && this.finalSlide) {
17630
- if (this.sdkApi.isExistsShowNextCard) {
17631
- this.sdkApi.cardShowNext();
17655
+ if (this.widgetDeps.sdkApi.isExistsShowNextCard) {
17656
+ this.widgetDeps.sdkApi.cardShowNext();
17632
17657
  return false;
17633
17658
  }
17634
17659
  }
@@ -17674,10 +17699,10 @@ class WidgetQuest extends WidgetBase {
17674
17699
  this._selectAnswer(index, slideIndex);
17675
17700
  this.setLocalData(this.localData, true);
17676
17701
  this.env.setTimeout(() => {
17677
- if (slideIndex >= 0 && slideIndex < this.slideCount && this.sdkApi.isExistsShowCardSlide) {
17702
+ if (slideIndex >= 0 && slideIndex < this.slideCount && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17678
17703
  // global flag - был сделан переход на нужный слайд, больше не нужно повторять за эту сессию
17679
17704
  this.setCardSessionValue("__storyQuestSlideChanged", "1");
17680
- this.sdkApi.showCardSlide(slideIndex);
17705
+ this.widgetDeps.sdkApi.showCardSlide(slideIndex);
17681
17706
  }
17682
17707
  }, 100);
17683
17708
  }
@@ -17749,12 +17774,12 @@ class WidgetQuest extends WidgetBase {
17749
17774
  else {
17750
17775
  // by routing - move back
17751
17776
  moveTo = this._routeMvPtrBack();
17752
- if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.sdkApi.isExistsShowCardSlide) {
17753
- this.sdkApi.showCardSlide(moveTo);
17777
+ if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17778
+ this.widgetDeps.sdkApi.showCardSlide(moveTo);
17754
17779
  }
17755
- if (moveTo === false && this.sdkApi.isExistsShowCardSlide) {
17780
+ if (moveTo === false && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17756
17781
  // allow move to start - for broken route history
17757
- this.sdkApi.showCardSlide(0);
17782
+ this.widgetDeps.sdkApi.showCardSlide(0);
17758
17783
  }
17759
17784
  }
17760
17785
  return result;
@@ -17770,8 +17795,8 @@ class WidgetQuest extends WidgetBase {
17770
17795
  if (directionForward) {
17771
17796
  if (this.navigationNextSlide === -1) {
17772
17797
  // this is the final slide - exit from this quest
17773
- if (this.sdkApi.isExistsShowNextCard) {
17774
- this.sdkApi.cardShowNext();
17798
+ if (this.widgetDeps.sdkApi.isExistsShowNextCard) {
17799
+ this.widgetDeps.sdkApi.cardShowNext();
17775
17800
  }
17776
17801
  result.continueDefaultNavigation = false;
17777
17802
  return result;
@@ -17780,11 +17805,11 @@ class WidgetQuest extends WidgetBase {
17780
17805
  if (nextSlideIndex < this.slideCount) {
17781
17806
  this._addNewRouteHistory(nextSlideIndex);
17782
17807
  this.setLocalData(this.localData, true);
17783
- this.sdkApi.showCardSlide(nextSlideIndex);
17808
+ this.widgetDeps.sdkApi.showCardSlide(nextSlideIndex);
17784
17809
  }
17785
17810
  else {
17786
- if (this.sdkApi.isExistsShowNextCard) {
17787
- this.sdkApi.cardShowNext();
17811
+ if (this.widgetDeps.sdkApi.isExistsShowNextCard) {
17812
+ this.widgetDeps.sdkApi.cardShowNext();
17788
17813
  }
17789
17814
  }
17790
17815
  }
@@ -17797,12 +17822,12 @@ class WidgetQuest extends WidgetBase {
17797
17822
  else {
17798
17823
  // by routing - move back
17799
17824
  moveTo = this._routeMvPtrBack();
17800
- if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.sdkApi.isExistsShowCardSlide) {
17801
- this.sdkApi.showCardSlide(moveTo);
17825
+ if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17826
+ this.widgetDeps.sdkApi.showCardSlide(moveTo);
17802
17827
  }
17803
- if (moveTo === false && this.sdkApi.isExistsShowCardSlide) {
17828
+ if (moveTo === false && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17804
17829
  // allow move to start - for broken route history
17805
- this.sdkApi.showCardSlide(0);
17830
+ this.widgetDeps.sdkApi.showCardSlide(0);
17806
17831
  }
17807
17832
  }
17808
17833
  }
@@ -17817,11 +17842,11 @@ class WidgetQuest extends WidgetBase {
17817
17842
  if (nextSlideIndex < this.slideCount) {
17818
17843
  this._addNewRouteHistory(nextSlideIndex);
17819
17844
  this.setLocalData(this.localData, true);
17820
- this.sdkApi.showCardSlide(nextSlideIndex);
17845
+ this.widgetDeps.sdkApi.showCardSlide(nextSlideIndex);
17821
17846
  }
17822
17847
  else {
17823
- if (this.sdkApi.isExistsShowNextCard) {
17824
- this.sdkApi.cardShowNext();
17848
+ if (this.widgetDeps.sdkApi.isExistsShowNextCard) {
17849
+ this.widgetDeps.sdkApi.cardShowNext();
17825
17850
  }
17826
17851
  }
17827
17852
  }
@@ -17834,12 +17859,12 @@ class WidgetQuest extends WidgetBase {
17834
17859
  else {
17835
17860
  // by routing - move back
17836
17861
  moveTo = this._routeMvPtrBack();
17837
- if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.sdkApi.isExistsShowCardSlide) {
17838
- this.sdkApi.showCardSlide(moveTo);
17862
+ if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17863
+ this.widgetDeps.sdkApi.showCardSlide(moveTo);
17839
17864
  }
17840
- if (moveTo === false && this.sdkApi.isExistsShowCardSlide) {
17865
+ if (moveTo === false && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17841
17866
  // allow move to start - for broken route history
17842
- this.sdkApi.showCardSlide(0);
17867
+ this.widgetDeps.sdkApi.showCardSlide(0);
17843
17868
  }
17844
17869
  }
17845
17870
  }
@@ -17854,20 +17879,20 @@ class WidgetQuest extends WidgetBase {
17854
17879
  // setLocalData(this.localData, true);
17855
17880
  // window._showNarrativeSlide(nextSlideIndex);
17856
17881
  // } else {
17857
- if (this.sdkApi.isExistsShowNextCard) {
17858
- this.sdkApi.cardShowNext();
17882
+ if (this.widgetDeps.sdkApi.isExistsShowNextCard) {
17883
+ this.widgetDeps.sdkApi.cardShowNext();
17859
17884
  }
17860
17885
  // }
17861
17886
  }
17862
17887
  else {
17863
17888
  // by routing - move back
17864
17889
  moveTo = this._routeMvPtrBack();
17865
- if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.sdkApi.isExistsShowCardSlide) {
17866
- this.sdkApi.showCardSlide(moveTo);
17890
+ if (moveTo !== false && moveTo >= 0 && moveTo < event.slideCount && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17891
+ this.widgetDeps.sdkApi.showCardSlide(moveTo);
17867
17892
  }
17868
- if (moveTo === false && this.sdkApi.isExistsShowCardSlide) {
17893
+ if (moveTo === false && this.widgetDeps.sdkApi.isExistsShowCardSlide) {
17869
17894
  // allow move to start - for broken route history
17870
- this.sdkApi.showCardSlide(0);
17895
+ this.widgetDeps.sdkApi.showCardSlide(0);
17871
17896
  }
17872
17897
  }
17873
17898
  }
@@ -17878,9 +17903,9 @@ class WidgetQuest extends WidgetBase {
17878
17903
  static api = {
17879
17904
  widgetClassName: WidgetQuest.widgetClassName,
17880
17905
  onRefreshUserData: WidgetQuest.onRefreshUserData,
17881
- init: function (element, localData, widgetCallbacks, sdkApi) {
17906
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
17882
17907
  return new Promise(function (resolve, reject) {
17883
- WidgetQuest.initWidget(element, localData, (element, options) => new WidgetQuest(element, options, widgetCallbacks, sdkApi)).then(localData => {
17908
+ WidgetQuest.initWidget(element, localData, (element, options) => new WidgetQuest(element, options, widgetCallbacks, widgetDeps)).then(localData => {
17884
17909
  const widget = WidgetQuest.getInstance(element);
17885
17910
  if (widget) {
17886
17911
  resolve(widget.init());
@@ -17922,7 +17947,7 @@ class WidgetQuest extends WidgetBase {
17922
17947
  return { continueDefaultNavigation: true };
17923
17948
  },
17924
17949
  };
17925
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
17950
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
17926
17951
  }
17927
17952
 
17928
17953
  class WidgetQuiz extends WidgetBase {
@@ -17937,8 +17962,8 @@ class WidgetQuiz extends WidgetBase {
17937
17962
  answers;
17938
17963
  questionCount;
17939
17964
  selectedAnswer;
17940
- constructor(element, options, widgetCallbacks, sdkApi) {
17941
- super(element, options, widgetCallbacks, sdkApi);
17965
+ constructor(element, options, widgetCallbacks, widgetDeps) {
17966
+ super(element, options, widgetCallbacks, widgetDeps);
17942
17967
  this.question = this.element.querySelector(".label-view .label");
17943
17968
  this.answers = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
17944
17969
  this.questionCount = getValueOrException(getTagDataAsNumber(this.slide, "quizCount"), "Empty quizCount");
@@ -18086,8 +18111,8 @@ class WidgetQuiz extends WidgetBase {
18086
18111
  static api = {
18087
18112
  widgetClassName: WidgetQuiz.widgetClassName,
18088
18113
  onRefreshUserData: WidgetQuiz.onRefreshUserData,
18089
- init: function (element, localData, widgetCallbacks, sdkApi) {
18090
- WidgetQuiz.initWidget(element, localData, (element, options) => new WidgetQuiz(element, options, widgetCallbacks, sdkApi));
18114
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
18115
+ WidgetQuiz.initWidget(element, localData, (element, options) => new WidgetQuiz(element, options, widgetCallbacks, widgetDeps));
18091
18116
  },
18092
18117
  onStart: function (element) {
18093
18118
  WidgetQuiz.getInstance(element)?.onStart();
@@ -18116,7 +18141,7 @@ class WidgetQuiz extends WidgetBase {
18116
18141
  return true;
18117
18142
  },
18118
18143
  };
18119
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
18144
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
18120
18145
  }
18121
18146
 
18122
18147
  class WidgetQuizGrouped extends WidgetBase {
@@ -18135,11 +18160,11 @@ class WidgetQuizGrouped extends WidgetBase {
18135
18160
  * @throws Error
18136
18161
  * @param element
18137
18162
  * @param options
18138
- * @param onWidgetComplete
18139
- * @param sdkApi
18163
+ * @param widgetCallbacks
18164
+ * @param widgetDeps
18140
18165
  */
18141
- constructor(element, options, widgetCallbacks, sdkApi) {
18142
- super(element, options, widgetCallbacks, sdkApi);
18166
+ constructor(element, options, widgetCallbacks, widgetDeps) {
18167
+ super(element, options, widgetCallbacks, widgetDeps);
18143
18168
  this.question = this.element.querySelector(".label-view .label");
18144
18169
  this.answers = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
18145
18170
  this.questionCount = getValueOrException(getTagDataAsNumber(this.slide, "quizCount"), "Empty quizCount");
@@ -18291,8 +18316,8 @@ class WidgetQuizGrouped extends WidgetBase {
18291
18316
  static api = {
18292
18317
  widgetClassName: WidgetQuizGrouped.widgetClassName,
18293
18318
  onRefreshUserData: WidgetQuizGrouped.onRefreshUserData,
18294
- init: function (element, localData, widgetCallbacks, sdkApi) {
18295
- WidgetQuizGrouped.initWidget(element, localData, (element, options) => new WidgetQuizGrouped(element, options, widgetCallbacks, sdkApi));
18319
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
18320
+ WidgetQuizGrouped.initWidget(element, localData, (element, options) => new WidgetQuizGrouped(element, options, widgetCallbacks, widgetDeps));
18296
18321
  },
18297
18322
  onStart: function (element) {
18298
18323
  WidgetQuizGrouped.getInstance(element)?.onStart();
@@ -18321,7 +18346,7 @@ class WidgetQuizGrouped extends WidgetBase {
18321
18346
  return true;
18322
18347
  },
18323
18348
  };
18324
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
18349
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
18325
18350
  }
18326
18351
 
18327
18352
  // Polyfill Number.isNaN(value)
@@ -18491,10 +18516,11 @@ class WidgetRangeSlider extends WidgetBase {
18491
18516
  * @throws Error
18492
18517
  * @param element
18493
18518
  * @param options
18494
- * @param onWidgetComplete
18519
+ * @param widgetCallbacks
18520
+ * @param widgetDeps
18495
18521
  */
18496
- constructor(element, options, widgetCallbacks, sdkApi) {
18497
- super(element, options, widgetCallbacks, sdkApi);
18522
+ constructor(element, options, widgetCallbacks, widgetDeps) {
18523
+ super(element, options, widgetCallbacks, widgetDeps);
18498
18524
  this.hasSubmitButton = Boolean(this.element.querySelector(".submit-button-view"));
18499
18525
  this.topScale = this.element.querySelector(".top-scale-bar-view-group");
18500
18526
  this.snapPosition = false;
@@ -18656,7 +18682,7 @@ class WidgetRangeSlider extends WidgetBase {
18656
18682
  total_user: 0,
18657
18683
  };
18658
18684
  let answerAllocationTs = undefined;
18659
- const sharedData = this.sdkApi.getWidgetsSharedData(this.cardId, "rangeSlider" /* Widgets.RangeSlider */);
18685
+ const sharedData = this.widgetDeps.sdkApi.getWidgetsSharedData(this.cardId, "rangeSlider" /* Widgets.RangeSlider */);
18660
18686
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
18661
18687
  answerAllocation = sharedData[this.elementId];
18662
18688
  answerAllocationTs = sharedData.ts;
@@ -18756,7 +18782,7 @@ class WidgetRangeSlider extends WidgetBase {
18756
18782
  }
18757
18783
  e.preventDefault();
18758
18784
  this.isClickCapturedBySlider = true;
18759
- this.sdkApi.disableHorizontalSwipeGesture();
18785
+ this.widgetDeps.sdkApi.disableHorizontalSwipeGesture();
18760
18786
  if (!this.maxHandlePos) {
18761
18787
  this.update(true, false);
18762
18788
  }
@@ -18786,7 +18812,7 @@ class WidgetRangeSlider extends WidgetBase {
18786
18812
  handleEnd(e) {
18787
18813
  this.env.requestAnimationFrame(() => {
18788
18814
  this.isClickCapturedBySlider = false;
18789
- this.sdkApi.enableHorizontalSwipeGesture();
18815
+ this.widgetDeps.sdkApi.enableHorizontalSwipeGesture();
18790
18816
  });
18791
18817
  // e.preventDefault();
18792
18818
  this.env.document.removeEventListener("touchmove", this.handleMove);
@@ -18851,7 +18877,7 @@ class WidgetRangeSlider extends WidgetBase {
18851
18877
  if (this.value !== this.prevSnapValue) {
18852
18878
  this.prevSnapValue = this.value;
18853
18879
  try {
18854
- this.sdkApi.vibrate(20);
18880
+ this.widgetDeps.sdkApi.vibrate(20);
18855
18881
  }
18856
18882
  catch (e) {
18857
18883
  console.error(e);
@@ -18939,8 +18965,8 @@ class WidgetRangeSlider extends WidgetBase {
18939
18965
  static api = {
18940
18966
  widgetClassName: WidgetRangeSlider.widgetClassName,
18941
18967
  onRefreshUserData: WidgetRangeSlider.onRefreshUserData,
18942
- init: function (element, localData, widgetCallbacks, sdkApi) {
18943
- WidgetRangeSlider.initWidget(element, localData, (element, options) => new WidgetRangeSlider(element, options, widgetCallbacks, sdkApi));
18968
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
18969
+ WidgetRangeSlider.initWidget(element, localData, (element, options) => new WidgetRangeSlider(element, options, widgetCallbacks, widgetDeps));
18944
18970
  },
18945
18971
  onStart: function (element) {
18946
18972
  WidgetRangeSlider.getInstance(element)?.onStart();
@@ -18969,7 +18995,7 @@ class WidgetRangeSlider extends WidgetBase {
18969
18995
  return false;
18970
18996
  },
18971
18997
  };
18972
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
18998
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
18973
18999
  }
18974
19000
 
18975
19001
  class WidgetRate extends WidgetBase {
@@ -18992,8 +19018,8 @@ class WidgetRate extends WidgetBase {
18992
19018
  selectedStar;
18993
19019
  answerSelectDuration;
18994
19020
  elementRect;
18995
- constructor(element, options, widgetCallbacks, sdkApi) {
18996
- super(element, options, widgetCallbacks, sdkApi);
19021
+ constructor(element, options, widgetCallbacks, widgetDeps) {
19022
+ super(element, options, widgetCallbacks, widgetDeps);
18997
19023
  this.label = this.element.querySelector(".label-view .label");
18998
19024
  this.stars = slice.call(this.element.querySelectorAll(".input-view"));
18999
19025
  this.submitToStores = Boolean(getValueOrDefault(getTagDataAsNumber(this.element, "submitToStores"), 0));
@@ -19098,12 +19124,12 @@ class WidgetRate extends WidgetBase {
19098
19124
  if (this.showDialogOnLowRate) {
19099
19125
  this.elementRect = this.element.getBoundingClientRect();
19100
19126
  this._selectStar(this.selectedStar, false);
19101
- if (this.sdkApi.isAndroid) {
19127
+ if (this.widgetDeps.sdkApi.isAndroid) {
19102
19128
  this.slide.classList.add("blured");
19103
19129
  }
19104
19130
  this.slide.classList.add("data-input-editing");
19105
19131
  const dataString = this.element.dataset["clientdialogwidgetconfig"];
19106
- if (this.sdkApi.isExistsShowCardTextInput && dataString) {
19132
+ if (this.widgetDeps.sdkApi.isExistsShowCardTextInput && dataString) {
19107
19133
  const data = JSON.parse(dataString);
19108
19134
  data.size = getElementBounding(this.env, this.elementRect);
19109
19135
  if (!this.disableTimer) {
@@ -19125,7 +19151,7 @@ class WidgetRate extends WidgetBase {
19125
19151
  catch (e) {
19126
19152
  console.error(e);
19127
19153
  }
19128
- this.sdkApi.showCardTextInput(this.id, data);
19154
+ this.widgetDeps.sdkApi.showCardTextInput(this.id, data);
19129
19155
  }
19130
19156
  }
19131
19157
  else {
@@ -19137,17 +19163,17 @@ class WidgetRate extends WidgetBase {
19137
19163
  }
19138
19164
  else if (value + 1 >= this.submitToStoresMin && value + 1 <= this.submitToStoresMax) {
19139
19165
  let target = null;
19140
- if (this.sdkApi.isAndroid) {
19166
+ if (this.widgetDeps.sdkApi.isAndroid) {
19141
19167
  target = getTagData(this.element, "androidLink");
19142
19168
  }
19143
- else if (this.sdkApi.isIOS) {
19169
+ else if (this.widgetDeps.sdkApi.isIOS) {
19144
19170
  target = getTagData(this.element, "appleLink");
19145
19171
  }
19146
19172
  this._selectStar(value, true);
19147
19173
  this.completeWidget();
19148
19174
  this._statEventRateUsAnswer("");
19149
19175
  if (this.submitToStores && target) {
19150
- this.sdkApi.openUrl({ type: "link", link: { type: "url", target } });
19176
+ this.widgetDeps.sdkApi.openUrl({ type: "link", link: { type: "url", target } });
19151
19177
  }
19152
19178
  }
19153
19179
  else {
@@ -19196,8 +19222,8 @@ class WidgetRate extends WidgetBase {
19196
19222
  static api = {
19197
19223
  widgetClassName: WidgetRate.widgetClassName,
19198
19224
  onRefreshUserData: WidgetRate.onRefreshUserData,
19199
- init: function (element, localData, widgetCallbacks, sdkApi) {
19200
- WidgetRate.initWidget(element, localData, (element, options) => new WidgetRate(element, options, widgetCallbacks, sdkApi));
19225
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
19226
+ WidgetRate.initWidget(element, localData, (element, options) => new WidgetRate(element, options, widgetCallbacks, widgetDeps));
19201
19227
  },
19202
19228
  onStart: function (element) {
19203
19229
  WidgetRate.getInstance(element)?.onStart();
@@ -19222,11 +19248,11 @@ class WidgetRate extends WidgetBase {
19222
19248
  }
19223
19249
  return true;
19224
19250
  },
19225
- setUserData: function (id, text) {
19226
- WidgetRate.getInstanceById(id)?.setUserText(text);
19251
+ setUserData: function (slideRoot, id, text) {
19252
+ WidgetRate.getInstanceById(slideRoot, id)?.setUserText(text);
19227
19253
  },
19228
19254
  };
19229
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
19255
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
19230
19256
  }
19231
19257
 
19232
19258
  class WidgetShare extends WidgetBase {
@@ -19243,8 +19269,8 @@ class WidgetShare extends WidgetBase {
19243
19269
  shareTarget;
19244
19270
  withLayer;
19245
19271
  btnDisabled;
19246
- constructor(element, options, widgetCallbacks, sdkApi) {
19247
- super(element, options, widgetCallbacks, sdkApi);
19272
+ constructor(element, options, widgetCallbacks, widgetDeps) {
19273
+ super(element, options, widgetCallbacks, widgetDeps);
19248
19274
  this.shareType = getTagData(this.element, "shareType");
19249
19275
  this.shareTarget = getTagData(this.element, "shareTarget");
19250
19276
  this.layers = this.options.layers;
@@ -19296,12 +19322,12 @@ class WidgetShare extends WidgetBase {
19296
19322
  }
19297
19323
  share() {
19298
19324
  if (!this.btnDisabled) {
19299
- if (this.sdkApi.isExistsShare) {
19300
- if (this.sdkApi.sdkCanSendShareComplete) {
19325
+ if (this.widgetDeps.sdkApi.isExistsShare) {
19326
+ if (this.widgetDeps.sdkApi.sdkCanSendShareComplete) {
19301
19327
  this.btnDisabled = true;
19302
19328
  }
19303
19329
  if (this.shareType === "url" || this.shareType === "story") {
19304
- this.sdkApi.share(this.id, {
19330
+ this.widgetDeps.sdkApi.share(this.id, {
19305
19331
  url: this.shareTarget, // sdk old versions
19306
19332
  text: this.shareTarget,
19307
19333
  title: null,
@@ -19309,7 +19335,7 @@ class WidgetShare extends WidgetBase {
19309
19335
  });
19310
19336
  }
19311
19337
  else if (this.shareType === "slide") {
19312
- this.sdkApi.shareSlideScreenshot(this.id, "[data-element-id='" + this.elementId + "']", this.shareTarget ? this.shareTarget : undefined);
19338
+ this.widgetDeps.sdkApi.shareSlideScreenshot(this.id, "[data-element-id='" + this.elementId + "']", this.shareTarget ? this.shareTarget : undefined);
19313
19339
  }
19314
19340
  }
19315
19341
  }
@@ -19336,11 +19362,11 @@ class WidgetShare extends WidgetBase {
19336
19362
  static api = {
19337
19363
  widgetClassName: WidgetShare.widgetClassName,
19338
19364
  onRefreshUserData: WidgetShare.onRefreshUserData,
19339
- init: function (element, layers, localData, widgetCallbacks, sdkApi) {
19365
+ init: function (element, layers, localData, widgetCallbacks, widgetDeps) {
19340
19366
  WidgetShare.initWidget(element, localData, (element, options) => new WidgetShare(element, {
19341
19367
  ...options,
19342
19368
  layers,
19343
- }, widgetCallbacks, sdkApi));
19369
+ }, widgetCallbacks, widgetDeps));
19344
19370
  },
19345
19371
  onStart: function (element) {
19346
19372
  WidgetShare.getInstance(element)?.onStart();
@@ -19357,11 +19383,11 @@ class WidgetShare extends WidgetBase {
19357
19383
  }
19358
19384
  }
19359
19385
  },
19360
- complete: function (id, isSuccess) {
19361
- WidgetShare.getInstanceById(id)?._complete(isSuccess);
19386
+ complete: function (slideRoot, id, isSuccess) {
19387
+ WidgetShare.getInstanceById(slideRoot, id)?._complete(isSuccess);
19362
19388
  },
19363
19389
  };
19364
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
19390
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
19365
19391
  }
19366
19392
 
19367
19393
  class WidgetTest extends WidgetBase {
@@ -19386,8 +19412,8 @@ class WidgetTest extends WidgetBase {
19386
19412
  timeLeftDefault;
19387
19413
  timeline;
19388
19414
  isWidgetTimerInit = false;
19389
- constructor(element, options, widgetCallbacks, sdkApi) {
19390
- super(element, options, widgetCallbacks, sdkApi);
19415
+ constructor(element, options, widgetCallbacks, widgetDeps) {
19416
+ super(element, options, widgetCallbacks, widgetDeps);
19391
19417
  this.label = this.element.querySelector(".label-view .label");
19392
19418
  this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view"));
19393
19419
  this.testCount = getValueOrException(getTagDataAsNumber(this.slide, "testCount"), "Empty testCount");
@@ -19615,8 +19641,8 @@ class WidgetTest extends WidgetBase {
19615
19641
  static api = {
19616
19642
  widgetClassName: WidgetTest.widgetClassName,
19617
19643
  onRefreshUserData: WidgetTest.onRefreshUserData,
19618
- init: function (element, localData, widgetCallbacks, sdkApi) {
19619
- WidgetTest.initWidget(element, localData, (element, options) => new WidgetTest(element, options, widgetCallbacks, sdkApi));
19644
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
19645
+ WidgetTest.initWidget(element, localData, (element, options) => new WidgetTest(element, options, widgetCallbacks, widgetDeps));
19620
19646
  },
19621
19647
  onStart: function (element) {
19622
19648
  WidgetTest.getInstance(element)?.onStart();
@@ -19652,7 +19678,7 @@ class WidgetTest extends WidgetBase {
19652
19678
  return true;
19653
19679
  },
19654
19680
  };
19655
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
19681
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
19656
19682
  }
19657
19683
 
19658
19684
  class WidgetVote extends WidgetBase {
@@ -19678,11 +19704,11 @@ class WidgetVote extends WidgetBase {
19678
19704
  * @throws Error
19679
19705
  * @param element
19680
19706
  * @param options
19681
- * @param onWidgetComplete
19682
- * @param sdkApi
19707
+ * @param widgetCallbacks
19708
+ * @param widgetDeps
19683
19709
  */
19684
- constructor(element, options, widgetCallbacks, sdkApi) {
19685
- super(element, options, widgetCallbacks, sdkApi);
19710
+ constructor(element, options, widgetCallbacks, widgetDeps) {
19711
+ super(element, options, widgetCallbacks, widgetDeps);
19686
19712
  this.voteAllocation = getTagData(this.slide, "voteAllocation");
19687
19713
  this.label = this.element.querySelector(".label-view .label");
19688
19714
  this.variants = slice.call(this.element.querySelectorAll(".variants-box .variant-view-group"));
@@ -19986,7 +20012,7 @@ class WidgetVote extends WidgetBase {
19986
20012
  // voteAllocation[7]
19987
20013
  let voteAllocation = [];
19988
20014
  let voteAllocationTs = undefined;
19989
- const sharedData = this.sdkApi.getWidgetsSharedData(this.cardId, "vote" /* Widgets.Vote */);
20015
+ const sharedData = this.widgetDeps.sdkApi.getWidgetsSharedData(this.cardId, "vote" /* Widgets.Vote */);
19990
20016
  if (sharedData && sharedData[this.elementId] != null && (isObject$1(sharedData[this.elementId]) || isArray(sharedData[this.elementId]))) {
19991
20017
  voteAllocation = sharedData[this.elementId];
19992
20018
  if (isObject$1(sharedData[this.elementId])) {
@@ -20065,8 +20091,8 @@ class WidgetVote extends WidgetBase {
20065
20091
  static api = {
20066
20092
  widgetClassName: WidgetVote.widgetClassName,
20067
20093
  onRefreshUserData: WidgetVote.onRefreshUserData,
20068
- init: function (element, localData, widgetCallbacks, sdkApi) {
20069
- WidgetVote.initWidget(element, localData, (element, options) => new WidgetVote(element, options, widgetCallbacks, sdkApi));
20094
+ init: function (element, localData, widgetCallbacks, widgetDeps) {
20095
+ WidgetVote.initWidget(element, localData, (element, options) => new WidgetVote(element, options, widgetCallbacks, widgetDeps));
20070
20096
  },
20071
20097
  onStart: function (element) {
20072
20098
  WidgetVote.getInstance(element)?.onStart();
@@ -20102,7 +20128,7 @@ class WidgetVote extends WidgetBase {
20102
20128
  return true;
20103
20129
  },
20104
20130
  };
20105
- static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `SDKApi`]; }
20131
+ static get [Symbol.for("___CTOR_ARGS___")]() { return [`HTMLElement`, `Partial`, `WidgetCallbacks`, `WidgetDeps`]; }
20106
20132
  }
20107
20133
 
20108
20134
  class EsModuleLayoutApi {