@plattar/plattar-ar-adapter 2.7.1 → 2.7.2

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.
@@ -1025,7 +1025,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1025
1025
  exports.SceneAR = void 0;
1026
1026
  var plattar_analytics_1 = require("@plattar/plattar-analytics");
1027
1027
  var plattar_api_1 = require("@plattar/plattar-api");
1028
- var plattar_services_1 = require("@plattar/plattar-services");
1029
1028
  var util_1 = require("../util/util");
1030
1029
  var quicklook_viewer_1 = __importDefault(require("../viewers/quicklook-viewer"));
1031
1030
  var scene_viewer_1 = __importDefault(require("../viewers/scene-viewer"));
@@ -1093,58 +1092,114 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1093
1092
  */
1094
1093
  }, {
1095
1094
  key: "_ComposeScene",
1096
- value: function _ComposeScene(scene, output) {
1097
- var _this0 = this;
1098
- return new Promise(function (accept, reject) {
1099
- var sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
1100
- var sceneModels = scene.relationships.filter(plattar_api_1.SceneModel);
1101
- // nothing to do if no AR components can be found
1102
- if (sceneProducts.length + sceneModels.length <= 0) {
1103
- return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain AR components"));
1104
- }
1105
- // define our configurator
1106
- var configurator = new plattar_services_1.Configurator();
1107
- configurator.server = plattar_api_1.Server.location().type;
1108
- configurator.output = output;
1109
- var totalARObjectCount = 0;
1110
- // add our scene products
1111
- sceneProducts.forEach(function (sceneProduct) {
1112
- var product = sceneProduct.relationships.find(plattar_api_1.Product);
1113
- var selection = _this0._options.variationSelection;
1114
- // we have a specific product selection
1115
- if (sceneProduct.attributes.include_in_augment) {
1116
- // check if this product is the one we want (from selection optionally)
1117
- if (product && product.id === selection.productID && selection.variationID) {
1118
- configurator.addSceneProduct(sceneProduct.id, selection.variationID);
1119
- totalARObjectCount++;
1120
- } else if (product) {
1121
- // check if this scene-product is the one we want (from selection)
1122
- if (sceneProduct.id === selection.sceneProductID && selection.variationID) {
1123
- configurator.addSceneProduct(sceneProduct.id, selection.variationID);
1124
- totalARObjectCount++;
1125
- } else if (product.attributes.product_variation_id) {
1126
- configurator.addSceneProduct(sceneProduct.id, product.attributes.product_variation_id);
1127
- totalARObjectCount++;
1095
+ value: (function () {
1096
+ var _ComposeScene2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(scene, output) {
1097
+ var _this0 = this;
1098
+ var sceneProducts, sceneModels, url, payload, totalARObjectCount, response, data, _t2;
1099
+ return _regenerator().w(function (_context4) {
1100
+ while (1) switch (_context4.p = _context4.n) {
1101
+ case 0:
1102
+ sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
1103
+ sceneModels = scene.relationships.filter(plattar_api_1.SceneModel); // nothing to do if no AR components can be found
1104
+ if (!(sceneProducts.length + sceneModels.length <= 0)) {
1105
+ _context4.n = 1;
1106
+ break;
1128
1107
  }
1129
- }
1130
- }
1131
- });
1132
- // add our scene models
1133
- sceneModels.forEach(function (sceneModel) {
1134
- if (sceneModel.attributes.include_in_augment) {
1135
- configurator.addModel(sceneModel.id);
1136
- totalARObjectCount++;
1108
+ throw new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain AR components");
1109
+ case 1:
1110
+ url = "".concat(plattar_api_1.Server.location().type === 'staging' ? 'https://converter.plattar.space' : 'https://converter.plattar.com', "/v3/converter/config-to-model");
1111
+ payload = {
1112
+ data: {
1113
+ attributes: {
1114
+ quality: 100,
1115
+ output: output,
1116
+ maps: new Array()
1117
+ }
1118
+ }
1119
+ };
1120
+ totalARObjectCount = 0; // add our scene products
1121
+ sceneProducts.forEach(function (sceneProduct) {
1122
+ var product = sceneProduct.relationships.find(plattar_api_1.Product);
1123
+ var selection = _this0._options.variationSelection;
1124
+ // we have a specific product selection
1125
+ if (sceneProduct.attributes.include_in_augment) {
1126
+ // check if this product is the one we want (from selection optionally)
1127
+ if (product && product.id === selection.productID && selection.variationID) {
1128
+ payload.data.attributes.maps.push({
1129
+ sceneproduct: sceneProduct.id,
1130
+ productvariation: selection.variationID
1131
+ });
1132
+ totalARObjectCount++;
1133
+ } else if (product) {
1134
+ // check if this scene-product is the one we want (from selection)
1135
+ if (sceneProduct.id === selection.sceneProductID && selection.variationID) {
1136
+ payload.data.attributes.maps.push({
1137
+ sceneproduct: sceneProduct.id,
1138
+ productvariation: selection.variationID
1139
+ });
1140
+ totalARObjectCount++;
1141
+ } else if (product.attributes.product_variation_id) {
1142
+ payload.data.attributes.maps.push({
1143
+ sceneproduct: sceneProduct.id,
1144
+ productvariation: product.attributes.product_variation_id
1145
+ });
1146
+ totalARObjectCount++;
1147
+ }
1148
+ }
1149
+ }
1150
+ });
1151
+ // add our scene models
1152
+ sceneModels.forEach(function (sceneModel) {
1153
+ if (sceneModel.attributes.include_in_augment) {
1154
+ payload.data.attributes.maps.push({
1155
+ scenemodel: sceneModel.id
1156
+ });
1157
+ totalARObjectCount++;
1158
+ }
1159
+ });
1160
+ // ensure we have actually added AR objects
1161
+ if (!(totalARObjectCount <= 0)) {
1162
+ _context4.n = 2;
1163
+ break;
1164
+ }
1165
+ throw new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain any enabled AR components");
1166
+ case 2:
1167
+ _context4.p = 2;
1168
+ _context4.n = 3;
1169
+ return fetch(url, {
1170
+ method: "POST",
1171
+ headers: {
1172
+ "Content-Type": "application/json"
1173
+ },
1174
+ body: JSON.stringify(payload)
1175
+ });
1176
+ case 3:
1177
+ response = _context4.v;
1178
+ if (response.ok) {
1179
+ _context4.n = 4;
1180
+ break;
1181
+ }
1182
+ throw new Error("SceneAR.ComposeScene() - network response was not ok ".concat(response.status));
1183
+ case 4:
1184
+ _context4.n = 5;
1185
+ return response.json();
1186
+ case 5:
1187
+ data = _context4.v;
1188
+ return _context4.a(2, data.data.attributes.filename);
1189
+ case 6:
1190
+ _context4.p = 6;
1191
+ _t2 = _context4.v;
1192
+ throw new Error("SceneAR.ComposeScene() - there was a request error to ".concat(url, ", error was ").concat(_t2.message));
1193
+ case 7:
1194
+ return _context4.a(2);
1137
1195
  }
1138
- });
1139
- // ensure we have actually added AR objects
1140
- if (totalARObjectCount <= 0) {
1141
- return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain any enabled AR components"));
1142
- }
1143
- return configurator.get().then(function (result) {
1144
- accept(result.filename);
1145
- })["catch"](reject);
1146
- });
1147
- }
1196
+ }, _callee4, null, [[2, 6]]);
1197
+ }));
1198
+ function _ComposeScene(_x2, _x3) {
1199
+ return _ComposeScene2.apply(this, arguments);
1200
+ }
1201
+ return _ComposeScene;
1202
+ }()
1148
1203
  /**
1149
1204
  * Initialise the SceneAR instance. This returns a Promise that resolves
1150
1205
  * successfully if initialisation is successful, otherwise it will fail.
@@ -1152,6 +1207,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1152
1207
  * filure can occur for a number of reasons but it generally means that AR
1153
1208
  * cannot be performed.
1154
1209
  */
1210
+ )
1155
1211
  }, {
1156
1212
  key: "init",
1157
1213
  value: function init() {
@@ -1258,8 +1314,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1258
1314
  "../viewers/scene-viewer": 24,
1259
1315
  "./launcher-ar": 2,
1260
1316
  "@plattar/plattar-analytics": 44,
1261
- "@plattar/plattar-api": 48,
1262
- "@plattar/plattar-services": 122
1317
+ "@plattar/plattar-api": 48
1263
1318
  }],
1264
1319
  7: [function (require, module, exports) {
1265
1320
  "use strict";
@@ -1302,17 +1357,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1302
1357
  return _createClass(SceneGraphAR, [{
1303
1358
  key: "_SetupAnalytics",
1304
1359
  value: function () {
1305
- var _SetupAnalytics2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1360
+ var _SetupAnalytics2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
1306
1361
  var scene, fetchedScene, analytics, application;
1307
- return _regenerator().w(function (_context4) {
1308
- while (1) switch (_context4.n) {
1362
+ return _regenerator().w(function (_context5) {
1363
+ while (1) switch (_context5.n) {
1309
1364
  case 0:
1310
1365
  scene = new plattar_api_1.Scene(this._options.sceneID);
1311
1366
  scene.include(plattar_api_1.Project);
1312
- _context4.n = 1;
1367
+ _context5.n = 1;
1313
1368
  return scene.get();
1314
1369
  case 1:
1315
- fetchedScene = _context4.v;
1370
+ fetchedScene = _context5.v;
1316
1371
  analytics = null;
1317
1372
  analytics = new plattar_analytics_1.Analytics(fetchedScene.attributes.application_id);
1318
1373
  analytics.origin = plattar_api_1.Server.location().type;
@@ -1333,9 +1388,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1333
1388
  };
1334
1389
  }
1335
1390
  }
1336
- return _context4.a(2, fetchedScene);
1391
+ return _context5.a(2, fetchedScene);
1337
1392
  }
1338
- }, _callee4, this);
1393
+ }, _callee5, this);
1339
1394
  }));
1340
1395
  function _SetupAnalytics() {
1341
1396
  return _SetupAnalytics2.apply(this, arguments);
@@ -1349,16 +1404,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1349
1404
  }, {
1350
1405
  key: "_Compose",
1351
1406
  value: (function () {
1352
- var _Compose3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(output) {
1353
- var type, serverLocation, url, response, data, _t2;
1354
- return _regenerator().w(function (_context5) {
1355
- while (1) switch (_context5.p = _context5.n) {
1407
+ var _Compose3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(output) {
1408
+ var type, serverLocation, url, response, data, _t3;
1409
+ return _regenerator().w(function (_context6) {
1410
+ while (1) switch (_context6.p = _context6.n) {
1356
1411
  case 0:
1357
1412
  type = output === 'glb' ? "viewer" : "reality";
1358
1413
  serverLocation = plattar_api_1.Server.location().type === 'staging' ? 'https://xrutils.plattar.space/v3/scene' : 'https://xrutils.plattar.com/v3/scene';
1359
1414
  url = "".concat(serverLocation, "/").concat(this._options.sceneID, "/").concat(type, "/").concat(this._options.id); // grab our existing scene-graph from the saved API
1360
- _context5.p = 1;
1361
- _context5.n = 2;
1415
+ _context6.p = 1;
1416
+ _context6.n = 2;
1362
1417
  return fetch(url, {
1363
1418
  method: "GET",
1364
1419
  headers: {
@@ -1366,28 +1421,28 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1366
1421
  }
1367
1422
  });
1368
1423
  case 2:
1369
- response = _context5.v;
1424
+ response = _context6.v;
1370
1425
  if (response.ok) {
1371
- _context5.n = 3;
1426
+ _context6.n = 3;
1372
1427
  break;
1373
1428
  }
1374
1429
  throw new Error("ARAdapter - Fetching Existing Graph Error - network response was not ok ".concat(response.status));
1375
1430
  case 3:
1376
- _context5.n = 4;
1431
+ _context6.n = 4;
1377
1432
  return response.json();
1378
1433
  case 4:
1379
- data = _context5.v;
1380
- return _context5.a(2, data.data.attributes.url);
1434
+ data = _context6.v;
1435
+ return _context6.a(2, data.data.attributes.url);
1381
1436
  case 5:
1382
- _context5.p = 5;
1383
- _t2 = _context5.v;
1384
- throw new Error("ARAdapter - Fetching Existing Graph Error - there was a request error to ".concat(url, ", error was ").concat(_t2.message));
1437
+ _context6.p = 5;
1438
+ _t3 = _context6.v;
1439
+ throw new Error("ARAdapter - Fetching Existing Graph Error - there was a request error to ".concat(url, ", error was ").concat(_t3.message));
1385
1440
  case 6:
1386
- return _context5.a(2);
1441
+ return _context6.a(2);
1387
1442
  }
1388
- }, _callee5, this, [[1, 5]]);
1443
+ }, _callee6, this, [[1, 5]]);
1389
1444
  }));
1390
- function _Compose(_x2) {
1445
+ function _Compose(_x4) {
1391
1446
  return _Compose3.apply(this, arguments);
1392
1447
  }
1393
1448
  return _Compose;
@@ -1403,69 +1458,69 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1403
1458
  }, {
1404
1459
  key: "init",
1405
1460
  value: (function () {
1406
- var _init2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
1461
+ var _init2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1407
1462
  var scene, sceneOpt, modelUrl, _modelUrl3, _modelUrl4, arviewer;
1408
- return _regenerator().w(function (_context6) {
1409
- while (1) switch (_context6.n) {
1463
+ return _regenerator().w(function (_context7) {
1464
+ while (1) switch (_context7.n) {
1410
1465
  case 0:
1411
1466
  if (util_1.Util.canAugment()) {
1412
- _context6.n = 1;
1467
+ _context7.n = 1;
1413
1468
  break;
1414
1469
  }
1415
1470
  throw new Error("SceneGraphAR.init() - cannot proceed as AR not available in context");
1416
1471
  case 1:
1417
- _context6.n = 2;
1472
+ _context7.n = 2;
1418
1473
  return this._SetupAnalytics();
1419
1474
  case 2:
1420
- scene = _context6.v;
1475
+ scene = _context7.v;
1421
1476
  sceneOpt = scene.attributes.custom_json || {}; // we need to define our AR module here
1422
1477
  // we are in Safari/Quicklook mode here
1423
1478
  if (!(util_1.Util.isSafari() || util_1.Util.isChromeOnIOS())) {
1424
- _context6.n = 8;
1479
+ _context7.n = 8;
1425
1480
  break;
1426
1481
  }
1427
1482
  if (!(sceneOpt.anchor === "face")) {
1428
- _context6.n = 5;
1483
+ _context7.n = 5;
1429
1484
  break;
1430
1485
  }
1431
1486
  if (!util_1.Util.canRealityViewer()) {
1432
- _context6.n = 4;
1487
+ _context7.n = 4;
1433
1488
  break;
1434
1489
  }
1435
- _context6.n = 3;
1490
+ _context7.n = 3;
1436
1491
  return this._Compose("vto");
1437
1492
  case 3:
1438
- modelUrl = _context6.v;
1493
+ modelUrl = _context7.v;
1439
1494
  this._ar = new quicklook_viewer_1["default"]();
1440
1495
  this._ar.modelUrl = modelUrl;
1441
1496
  this._ar.banner = this.options.banner;
1442
- return _context6.a(2, this);
1497
+ return _context7.a(2, this);
1443
1498
  case 4:
1444
1499
  throw new Error("SceneGraphAR.init() - cannot proceed as VTO AR requires Reality Viewer support");
1445
1500
  case 5:
1446
1501
  if (!util_1.Util.canQuicklook()) {
1447
- _context6.n = 7;
1502
+ _context7.n = 7;
1448
1503
  break;
1449
1504
  }
1450
- _context6.n = 6;
1505
+ _context7.n = 6;
1451
1506
  return this._Compose("usdz");
1452
1507
  case 6:
1453
- _modelUrl3 = _context6.v;
1508
+ _modelUrl3 = _context7.v;
1454
1509
  this._ar = new quicklook_viewer_1["default"]();
1455
1510
  this._ar.modelUrl = _modelUrl3;
1456
1511
  this._ar.banner = this.options.banner;
1457
- return _context6.a(2, this);
1512
+ return _context7.a(2, this);
1458
1513
  case 7:
1459
1514
  throw new Error("SceneGraphAR.init() - cannot proceed as IOS device does not support AR Mode");
1460
1515
  case 8:
1461
1516
  if (!util_1.Util.canSceneViewer()) {
1462
- _context6.n = 10;
1517
+ _context7.n = 10;
1463
1518
  break;
1464
1519
  }
1465
- _context6.n = 9;
1520
+ _context7.n = 9;
1466
1521
  return this._Compose("glb");
1467
1522
  case 9:
1468
- _modelUrl4 = _context6.v;
1523
+ _modelUrl4 = _context7.v;
1469
1524
  arviewer = new scene_viewer_1["default"]();
1470
1525
  arviewer.modelUrl = _modelUrl4;
1471
1526
  arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
@@ -1474,13 +1529,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1474
1529
  arviewer.isVertical = true;
1475
1530
  }
1476
1531
  this._ar = arviewer;
1477
- return _context6.a(2, this);
1532
+ return _context7.a(2, this);
1478
1533
  case 10:
1479
1534
  throw new Error("SceneGraphAR.init() - could not initialise AR correctly, check values");
1480
1535
  case 11:
1481
- return _context6.a(2);
1536
+ return _context7.a(2);
1482
1537
  }
1483
- }, _callee6, this);
1538
+ }, _callee7, this);
1484
1539
  }));
1485
1540
  function init() {
1486
1541
  return _init2.apply(this, arguments);
@@ -1632,20 +1687,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1632
1687
  return _createClass(ConfiguratorController, [{
1633
1688
  key: "getConfiguratorState",
1634
1689
  value: function () {
1635
- var _getConfiguratorState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
1636
- return _regenerator().w(function (_context7) {
1637
- while (1) switch (_context7.n) {
1690
+ var _getConfiguratorState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
1691
+ return _regenerator().w(function (_context8) {
1692
+ while (1) switch (_context8.n) {
1638
1693
  case 0:
1639
1694
  if (!this._cachedConfigState) {
1640
- _context7.n = 1;
1695
+ _context8.n = 1;
1641
1696
  break;
1642
1697
  }
1643
- return _context7.a(2, this._cachedConfigState);
1698
+ return _context8.a(2, this._cachedConfigState);
1644
1699
  case 1:
1645
1700
  this._cachedConfigState = this.createConfiguratorState();
1646
- return _context7.a(2, this._cachedConfigState);
1701
+ return _context8.a(2, this._cachedConfigState);
1647
1702
  }
1648
- }, _callee7, this);
1703
+ }, _callee8, this);
1649
1704
  }));
1650
1705
  function getConfiguratorState() {
1651
1706
  return _getConfiguratorState.apply(this, arguments);
@@ -1655,61 +1710,61 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1655
1710
  }, {
1656
1711
  key: "onAttributesUpdated",
1657
1712
  value: function () {
1658
- var _onAttributesUpdated = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(attributeName) {
1713
+ var _onAttributesUpdated = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(attributeName) {
1659
1714
  var state, viewer, variationIDs, variationIDsList, variationSKUs, variationSKUList, configState, _variationIDs, _variationIDsList, _configState, _variationSKUs, _variationSKUList;
1660
- return _regenerator().w(function (_context8) {
1661
- while (1) switch (_context8.n) {
1715
+ return _regenerator().w(function (_context9) {
1716
+ while (1) switch (_context9.n) {
1662
1717
  case 0:
1663
1718
  state = this._state;
1664
1719
  if (!(state === plattar_controller_1.ControllerState.Renderer)) {
1665
- _context8.n = 3;
1720
+ _context9.n = 3;
1666
1721
  break;
1667
1722
  }
1668
1723
  viewer = this.element;
1669
1724
  if (!viewer) {
1670
- _context8.n = 2;
1725
+ _context9.n = 2;
1671
1726
  break;
1672
1727
  }
1673
1728
  if (!(attributeName === "variation-id")) {
1674
- _context8.n = 1;
1729
+ _context9.n = 1;
1675
1730
  break;
1676
1731
  }
1677
1732
  variationIDs = this.getAttribute("variation-id");
1678
1733
  variationIDsList = variationIDs ? variationIDs.split(",") : [];
1679
1734
  if (!(variationIDsList.length > 0)) {
1680
- _context8.n = 1;
1735
+ _context9.n = 1;
1681
1736
  break;
1682
1737
  }
1683
- _context8.n = 1;
1738
+ _context9.n = 1;
1684
1739
  return viewer.messenger.selectVariationID(variationIDsList);
1685
1740
  case 1:
1686
1741
  if (!(attributeName === "variation-sku")) {
1687
- _context8.n = 2;
1742
+ _context9.n = 2;
1688
1743
  break;
1689
1744
  }
1690
1745
  variationSKUs = this.getAttribute("variation-sku");
1691
1746
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
1692
1747
  if (!(variationSKUList.length > 0)) {
1693
- _context8.n = 2;
1748
+ _context9.n = 2;
1694
1749
  break;
1695
1750
  }
1696
- _context8.n = 2;
1751
+ _context9.n = 2;
1697
1752
  return viewer.messenger.selectVariationSKU(variationSKUList);
1698
1753
  case 2:
1699
- return _context8.a(2);
1754
+ return _context9.a(2);
1700
1755
  case 3:
1701
1756
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
1702
- _context8.n = 8;
1757
+ _context9.n = 8;
1703
1758
  break;
1704
1759
  }
1705
1760
  if (!(attributeName === "variation-id")) {
1706
- _context8.n = 5;
1761
+ _context9.n = 5;
1707
1762
  break;
1708
1763
  }
1709
- _context8.n = 4;
1764
+ _context9.n = 4;
1710
1765
  return this.getConfiguratorState();
1711
1766
  case 4:
1712
- configState = _context8.v;
1767
+ configState = _context9.v;
1713
1768
  _variationIDs = this.getAttribute("variation-id");
1714
1769
  _variationIDsList = _variationIDs ? _variationIDs.split(",") : [];
1715
1770
  _variationIDsList.forEach(function (variationID) {
@@ -1717,13 +1772,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1717
1772
  });
1718
1773
  case 5:
1719
1774
  if (!(attributeName === "variation-sku")) {
1720
- _context8.n = 7;
1775
+ _context9.n = 7;
1721
1776
  break;
1722
1777
  }
1723
- _context8.n = 6;
1778
+ _context9.n = 6;
1724
1779
  return this.getConfiguratorState();
1725
1780
  case 6:
1726
- _configState = _context8.v;
1781
+ _configState = _context9.v;
1727
1782
  _variationSKUs = this.getAttribute("variation-sku");
1728
1783
  _variationSKUList = _variationSKUs ? _variationSKUs.split(",") : [];
1729
1784
  _variationSKUList.forEach(function (variationSKU) {
@@ -1731,13 +1786,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1731
1786
  });
1732
1787
  case 7:
1733
1788
  this.startQRCode(this._prevQROpt);
1734
- return _context8.a(2);
1789
+ return _context9.a(2);
1735
1790
  case 8:
1736
- return _context8.a(2);
1791
+ return _context9.a(2);
1737
1792
  }
1738
- }, _callee8, this);
1793
+ }, _callee9, this);
1739
1794
  }));
1740
- function onAttributesUpdated(_x3) {
1795
+ function onAttributesUpdated(_x5) {
1741
1796
  return _onAttributesUpdated.apply(this, arguments);
1742
1797
  }
1743
1798
  return onAttributesUpdated;
@@ -1745,21 +1800,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1745
1800
  }, {
1746
1801
  key: "startARQRCode",
1747
1802
  value: function () {
1748
- var _startARQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(options) {
1749
- var dState, product, controller, _t3;
1750
- return _regenerator().w(function (_context9) {
1751
- while (1) switch (_context9.p = _context9.n) {
1803
+ var _startARQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(options) {
1804
+ var dState, product, controller, _t4;
1805
+ return _regenerator().w(function (_context0) {
1806
+ while (1) switch (_context0.p = _context0.n) {
1752
1807
  case 0:
1753
- _context9.p = 0;
1754
- _context9.n = 1;
1808
+ _context0.p = 0;
1809
+ _context0.n = 1;
1755
1810
  return this.getConfiguratorState();
1756
1811
  case 1:
1757
- dState = _context9.v;
1812
+ dState = _context0.v;
1758
1813
  // if this is declared, we have a furniture scene that we need to re-create the embed
1759
1814
  // with new attributes
1760
1815
  product = dState.state.firstOfType("product");
1761
1816
  if (!product) {
1762
- _context9.n = 3;
1817
+ _context0.n = 3;
1763
1818
  break;
1764
1819
  }
1765
1820
  this.parent.lockObserver();
@@ -1769,24 +1824,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1769
1824
  this.parent.unlockObserver();
1770
1825
  controller = this.parent.create();
1771
1826
  if (!controller) {
1772
- _context9.n = 2;
1827
+ _context0.n = 2;
1773
1828
  break;
1774
1829
  }
1775
- return _context9.a(2, controller.startARQRCode(options));
1830
+ return _context0.a(2, controller.startARQRCode(options));
1776
1831
  case 2:
1777
- return _context9.a(2, Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1832
+ return _context0.a(2, Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1778
1833
  case 3:
1779
- _context9.n = 5;
1834
+ _context0.n = 5;
1780
1835
  break;
1781
1836
  case 4:
1782
- _context9.p = 4;
1783
- _t3 = _context9.v;
1837
+ _context0.p = 4;
1838
+ _t4 = _context0.v;
1784
1839
  case 5:
1785
- return _context9.a(2, _superPropGet(ConfiguratorController, "startARQRCode", this, 3)([options]));
1840
+ return _context0.a(2, _superPropGet(ConfiguratorController, "startARQRCode", this, 3)([options]));
1786
1841
  }
1787
- }, _callee9, this, [[0, 4]]);
1842
+ }, _callee0, this, [[0, 4]]);
1788
1843
  }));
1789
- function startARQRCode(_x4) {
1844
+ function startARQRCode(_x6) {
1790
1845
  return _startARQRCode.apply(this, arguments);
1791
1846
  }
1792
1847
  return startARQRCode;
@@ -1794,11 +1849,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1794
1849
  }, {
1795
1850
  key: "startViewerQRCode",
1796
1851
  value: function () {
1797
- var _startViewerQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(options) {
1852
+ var _startViewerQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(options) {
1798
1853
  var _this14 = this;
1799
- var opt, sceneID, configState, dState, product, controller, viewer, width, height, dst, showAR, showUI, showBanner, sceneGraphID, _t4, _t5, _t6;
1800
- return _regenerator().w(function (_context0) {
1801
- while (1) switch (_context0.p = _context0.n) {
1854
+ var opt, sceneID, configState, dState, product, controller, viewer, width, height, dst, showAR, showUI, showBanner, sceneGraphID, _t5, _t6, _t7;
1855
+ return _regenerator().w(function (_context1) {
1856
+ while (1) switch (_context1.p = _context1.n) {
1802
1857
  case 0:
1803
1858
  opt = this._GetDefaultQROptions(options); // remove the old renderer instance if any
1804
1859
  if (!opt.detached) {
@@ -1806,23 +1861,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1806
1861
  }
1807
1862
  sceneID = this.getAttribute("scene-id");
1808
1863
  if (sceneID) {
1809
- _context0.n = 1;
1864
+ _context1.n = 1;
1810
1865
  break;
1811
1866
  }
1812
1867
  throw new Error("ConfiguratorController.startViewerQRCode() - minimum required attributes not set, use scene-id as a minimum");
1813
1868
  case 1:
1814
1869
  // optional attributes
1815
1870
  configState = null;
1816
- _context0.p = 2;
1817
- _context0.n = 3;
1871
+ _context1.p = 2;
1872
+ _context1.n = 3;
1818
1873
  return this.getConfiguratorState();
1819
1874
  case 3:
1820
- dState = _context0.v;
1875
+ dState = _context1.v;
1821
1876
  // if this is declared, we have a furniture scene that we need to re-create the embed
1822
1877
  // with new attributes
1823
1878
  product = dState.state.firstOfType("product");
1824
1879
  if (!product) {
1825
- _context0.n = 5;
1880
+ _context1.n = 5;
1826
1881
  break;
1827
1882
  }
1828
1883
  this.parent.lockObserver();
@@ -1832,19 +1887,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1832
1887
  this.parent.unlockObserver();
1833
1888
  controller = this.parent.create();
1834
1889
  if (!controller) {
1835
- _context0.n = 4;
1890
+ _context1.n = 4;
1836
1891
  break;
1837
1892
  }
1838
- return _context0.a(2, controller.startViewerQRCode(options));
1893
+ return _context1.a(2, controller.startViewerQRCode(options));
1839
1894
  case 4:
1840
- return _context0.a(2, Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1895
+ return _context1.a(2, Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1841
1896
  case 5:
1842
1897
  configState = dState.state.encode();
1843
- _context0.n = 7;
1898
+ _context1.n = 7;
1844
1899
  break;
1845
1900
  case 6:
1846
- _context0.p = 6;
1847
- _t4 = _context0.v;
1901
+ _context1.p = 6;
1902
+ _t5 = _context1.v;
1848
1903
  // config state is not available
1849
1904
  configState = null;
1850
1905
  case 7:
@@ -1869,34 +1924,34 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1869
1924
  }
1870
1925
  viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
1871
1926
  dst = "https://renderer.plattar.com/configurator.html?scene_id=".concat(sceneID);
1872
- _t5 = plattar_api_1.Server.location().type;
1873
- _context0.n = _t5 === 'review' ? 8 : _t5 === 'staging' ? 9 : 10;
1927
+ _t6 = plattar_api_1.Server.location().type;
1928
+ _context1.n = _t6 === 'review' ? 8 : _t6 === 'staging' ? 9 : 10;
1874
1929
  break;
1875
1930
  case 8:
1876
1931
  dst = "https://renderer-review.plattar.com/configurator.html?scene_id=".concat(sceneID);
1877
- return _context0.a(3, 10);
1932
+ return _context1.a(3, 10);
1878
1933
  case 9:
1879
1934
  dst = "https://renderer.plattar.space/configurator.html?scene_id=".concat(sceneID);
1880
- return _context0.a(3, 10);
1935
+ return _context1.a(3, 10);
1881
1936
  case 10:
1882
1937
  showAR = this.getAttribute("show-ar");
1883
1938
  showUI = this.getAttribute("show-ui");
1884
1939
  showBanner = this.getAttribute("show-ar-banner");
1885
1940
  sceneGraphID = this.getAttribute("scene-graph-id");
1886
1941
  if (!(showUI && showUI === "true")) {
1887
- _context0.n = 13;
1942
+ _context1.n = 13;
1888
1943
  break;
1889
1944
  }
1890
1945
  dst = "https://configurator.plattar.com/index.html?scene_id=".concat(sceneID);
1891
- _t6 = plattar_api_1.Server.location().type;
1892
- _context0.n = _t6 === 'review' ? 11 : _t6 === 'staging' ? 12 : 13;
1946
+ _t7 = plattar_api_1.Server.location().type;
1947
+ _context1.n = _t7 === 'review' ? 11 : _t7 === 'staging' ? 12 : 13;
1893
1948
  break;
1894
1949
  case 11:
1895
1950
  dst = "https://configurator-review.plattar.com/configurator.html?scene_id=".concat(sceneID);
1896
- return _context0.a(3, 13);
1951
+ return _context1.a(3, 13);
1897
1952
  case 12:
1898
1953
  dst = "https://configurator.plattar.space/configurator.html?scene_id=".concat(sceneID);
1899
- return _context0.a(3, 13);
1954
+ return _context1.a(3, 13);
1900
1955
  case 13:
1901
1956
  if (configState) {
1902
1957
  dst += "&config_state=" + configState;
@@ -1913,24 +1968,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1913
1968
  viewer.setAttribute("url", opt.url || dst);
1914
1969
  this._prevQROpt = opt;
1915
1970
  if (opt.detached) {
1916
- _context0.n = 14;
1971
+ _context1.n = 14;
1917
1972
  break;
1918
1973
  }
1919
1974
  this._state = plattar_controller_1.ControllerState.QRCode;
1920
- return _context0.a(2, new Promise(function (accept, reject) {
1975
+ return _context1.a(2, new Promise(function (accept, reject) {
1921
1976
  viewer.onload = function () {
1922
1977
  return accept(viewer);
1923
1978
  };
1924
1979
  _this14.append(viewer);
1925
1980
  }));
1926
1981
  case 14:
1927
- return _context0.a(2, new Promise(function (accept, reject) {
1982
+ return _context1.a(2, new Promise(function (accept, reject) {
1928
1983
  return accept(viewer);
1929
1984
  }));
1930
1985
  }
1931
- }, _callee0, this, [[2, 6]]);
1986
+ }, _callee1, this, [[2, 6]]);
1932
1987
  }));
1933
- function startViewerQRCode(_x5) {
1988
+ function startViewerQRCode(_x7) {
1934
1989
  return _startViewerQRCode.apply(this, arguments);
1935
1990
  }
1936
1991
  return startViewerQRCode;
@@ -1938,17 +1993,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1938
1993
  }, {
1939
1994
  key: "startRenderer",
1940
1995
  value: function () {
1941
- var _startRenderer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
1996
+ var _startRenderer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
1942
1997
  var _this15 = this;
1943
- var sceneID, configState, dState, product, controller, width, height, server, viewer, showAR, showUI, encodedState, _t7;
1944
- return _regenerator().w(function (_context1) {
1945
- while (1) switch (_context1.p = _context1.n) {
1998
+ var sceneID, configState, dState, product, controller, width, height, server, viewer, showAR, showUI, encodedState, _t8;
1999
+ return _regenerator().w(function (_context10) {
2000
+ while (1) switch (_context10.p = _context10.n) {
1946
2001
  case 0:
1947
2002
  // remove the old renderer instance if any
1948
2003
  this.removeRenderer();
1949
2004
  sceneID = this.getAttribute("scene-id");
1950
2005
  if (sceneID) {
1951
- _context1.n = 1;
2006
+ _context10.n = 1;
1952
2007
  break;
1953
2008
  }
1954
2009
  throw new Error("ConfiguratorController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
@@ -1956,16 +2011,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1956
2011
  // optional attributes
1957
2012
  configState = null;
1958
2013
  this._state = plattar_controller_1.ControllerState.Renderer;
1959
- _context1.p = 2;
1960
- _context1.n = 3;
2014
+ _context10.p = 2;
2015
+ _context10.n = 3;
1961
2016
  return this.getConfiguratorState();
1962
2017
  case 3:
1963
- dState = _context1.v;
2018
+ dState = _context10.v;
1964
2019
  // if this is declared, we have a furniture scene that we need to re-create the embed
1965
2020
  // with new attributes
1966
2021
  product = dState.state.firstOfType("product");
1967
2022
  if (!product) {
1968
- _context1.n = 5;
2023
+ _context10.n = 5;
1969
2024
  break;
1970
2025
  }
1971
2026
  this.parent.lockObserver();
@@ -1975,19 +2030,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1975
2030
  this.parent.unlockObserver();
1976
2031
  controller = this.parent.create();
1977
2032
  if (!controller) {
1978
- _context1.n = 4;
2033
+ _context10.n = 4;
1979
2034
  break;
1980
2035
  }
1981
- return _context1.a(2, controller.startRenderer());
2036
+ return _context10.a(2, controller.startRenderer());
1982
2037
  case 4:
1983
- return _context1.a(2, Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
2038
+ return _context10.a(2, Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
1984
2039
  case 5:
1985
2040
  configState = dState;
1986
- _context1.n = 7;
2041
+ _context10.n = 7;
1987
2042
  break;
1988
2043
  case 6:
1989
- _context1.p = 6;
1990
- _t7 = _context1.v;
2044
+ _context10.p = 6;
2045
+ _t8 = _context10.v;
1991
2046
  // config state is not available
1992
2047
  configState = null;
1993
2048
  case 7:
@@ -2015,7 +2070,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2015
2070
  if (showUI) {
2016
2071
  viewer.setAttribute("show-ui", showUI);
2017
2072
  }
2018
- return _context1.a(2, new Promise(function (accept, reject) {
2073
+ return _context10.a(2, new Promise(function (accept, reject) {
2019
2074
  _this15.append(viewer);
2020
2075
  if (configState) {
2021
2076
  _this15.setupMessengerObservers(viewer, configState);
@@ -2023,7 +2078,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2023
2078
  return accept(viewer);
2024
2079
  }));
2025
2080
  }
2026
- }, _callee1, this, [[2, 6]]);
2081
+ }, _callee10, this, [[2, 6]]);
2027
2082
  }));
2028
2083
  function startRenderer() {
2029
2084
  return _startRenderer.apply(this, arguments);
@@ -2033,27 +2088,27 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2033
2088
  }, {
2034
2089
  key: "initAR",
2035
2090
  value: function () {
2036
- var _initAR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
2037
- var dState, product, controller, arMode, _t8, _t9;
2038
- return _regenerator().w(function (_context10) {
2039
- while (1) switch (_context10.p = _context10.n) {
2091
+ var _initAR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
2092
+ var dState, product, controller, arMode, _t9, _t0;
2093
+ return _regenerator().w(function (_context11) {
2094
+ while (1) switch (_context11.p = _context11.n) {
2040
2095
  case 0:
2041
2096
  if (util_1.Util.canAugment()) {
2042
- _context10.n = 1;
2097
+ _context11.n = 1;
2043
2098
  break;
2044
2099
  }
2045
2100
  throw new Error("ConfiguratorController.initAR() - cannot proceed as AR not available in context");
2046
2101
  case 1:
2047
- _context10.p = 1;
2048
- _context10.n = 2;
2102
+ _context11.p = 1;
2103
+ _context11.n = 2;
2049
2104
  return this.getConfiguratorState();
2050
2105
  case 2:
2051
- dState = _context10.v;
2106
+ dState = _context11.v;
2052
2107
  // if this is declared, we have a furniture scene that we need to re-create the embed
2053
2108
  // with new attributes
2054
2109
  product = dState.state.firstOfType("product");
2055
2110
  if (!product) {
2056
- _context10.n = 4;
2111
+ _context11.n = 4;
2057
2112
  break;
2058
2113
  }
2059
2114
  this.parent.lockObserver();
@@ -2063,31 +2118,31 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2063
2118
  this.parent.unlockObserver();
2064
2119
  controller = this.parent.create();
2065
2120
  if (!controller) {
2066
- _context10.n = 3;
2121
+ _context11.n = 3;
2067
2122
  break;
2068
2123
  }
2069
- return _context10.a(2, controller.initAR());
2124
+ return _context11.a(2, controller.initAR());
2070
2125
  case 3:
2071
- return _context10.a(2, Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
2126
+ return _context11.a(2, Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
2072
2127
  case 4:
2073
- _context10.n = 6;
2128
+ _context11.n = 6;
2074
2129
  break;
2075
2130
  case 5:
2076
- _context10.p = 5;
2077
- _t8 = _context10.v;
2131
+ _context11.p = 5;
2132
+ _t9 = _context11.v;
2078
2133
  case 6:
2079
2134
  arMode = this.getAttribute("ar-mode") || "generated";
2080
- _t9 = arMode.toLowerCase();
2081
- _context10.n = _t9 === "inherited" ? 7 : _t9 === "generated" ? 8 : 8;
2135
+ _t0 = arMode.toLowerCase();
2136
+ _context11.n = _t0 === "inherited" ? 7 : _t0 === "generated" ? 8 : 8;
2082
2137
  break;
2083
2138
  case 7:
2084
- return _context10.a(2, this._InitARInherited());
2139
+ return _context11.a(2, this._InitARInherited());
2085
2140
  case 8:
2086
- return _context10.a(2, this._InitARGenerated());
2141
+ return _context11.a(2, this._InitARGenerated());
2087
2142
  case 9:
2088
- return _context10.a(2);
2143
+ return _context11.a(2);
2089
2144
  }
2090
- }, _callee10, this, [[1, 5]]);
2145
+ }, _callee11, this, [[1, 5]]);
2091
2146
  }));
2092
2147
  function initAR() {
2093
2148
  return _initAR.apply(this, arguments);
@@ -2100,25 +2155,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2100
2155
  }, {
2101
2156
  key: "_InitARInherited",
2102
2157
  value: (function () {
2103
- var _InitARInherited2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
2158
+ var _InitARInherited2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
2104
2159
  var sceneID, state, first, sceneProductAR;
2105
- return _regenerator().w(function (_context11) {
2106
- while (1) switch (_context11.n) {
2160
+ return _regenerator().w(function (_context12) {
2161
+ while (1) switch (_context12.n) {
2107
2162
  case 0:
2108
2163
  sceneID = this.getAttribute("scene-id");
2109
2164
  if (sceneID) {
2110
- _context11.n = 1;
2165
+ _context12.n = 1;
2111
2166
  break;
2112
2167
  }
2113
2168
  throw new Error("ConfiguratorController.initAR() - inherited AR minimum required attributes not set, use scene-id as a minimum");
2114
2169
  case 1:
2115
- _context11.n = 2;
2170
+ _context12.n = 2;
2116
2171
  return this.getConfiguratorState();
2117
2172
  case 2:
2118
- state = _context11.v.state;
2173
+ state = _context12.v.state;
2119
2174
  first = state.firstActiveOfType("sceneproduct");
2120
2175
  if (!first) {
2121
- _context11.n = 3;
2176
+ _context12.n = 3;
2122
2177
  break;
2123
2178
  }
2124
2179
  //const sceneProductAR: SceneProductAR = new SceneProductAR(first.scene_product_id, first.product_variation_id);
@@ -2128,13 +2183,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2128
2183
  variationSKU: null,
2129
2184
  useARBanner: this.getBooleanAttribute("show-ar-banner")
2130
2185
  });
2131
- return _context11.a(2, sceneProductAR.init());
2186
+ return _context12.a(2, sceneProductAR.init());
2132
2187
  case 3:
2133
2188
  throw new Error("ConfiguratorController.initAR() - invalid decoded config-state does not have any product states");
2134
2189
  case 4:
2135
- return _context11.a(2);
2190
+ return _context12.a(2);
2136
2191
  }
2137
- }, _callee11, this);
2192
+ }, _callee12, this);
2138
2193
  }));
2139
2194
  function _InitARInherited() {
2140
2195
  return _InitARInherited2.apply(this, arguments);
@@ -2148,21 +2203,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2148
2203
  }, {
2149
2204
  key: "_InitARGenerated",
2150
2205
  value: (function () {
2151
- var _InitARGenerated2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
2152
- var sceneID, graphID, _configAR, configAR, _t0, _t1, _t10, _t11;
2153
- return _regenerator().w(function (_context12) {
2154
- while (1) switch (_context12.n) {
2206
+ var _InitARGenerated2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
2207
+ var sceneID, graphID, _configAR, configAR, _t1, _t10, _t11, _t12;
2208
+ return _regenerator().w(function (_context13) {
2209
+ while (1) switch (_context13.n) {
2155
2210
  case 0:
2156
2211
  sceneID = this.getAttribute("scene-id");
2157
2212
  if (sceneID) {
2158
- _context12.n = 1;
2213
+ _context13.n = 1;
2159
2214
  break;
2160
2215
  }
2161
2216
  throw new Error("VTOController.initAR() - generated AR minimum required attributes not set, use scene-id as a minimum");
2162
2217
  case 1:
2163
2218
  graphID = this.getAttribute("scene-graph-id"); // use the scene-graph route if available
2164
2219
  if (!graphID) {
2165
- _context12.n = 2;
2220
+ _context13.n = 2;
2166
2221
  break;
2167
2222
  }
2168
2223
  _configAR = new scene_graph_ar_1.SceneGraphAR({
@@ -2170,22 +2225,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2170
2225
  id: graphID,
2171
2226
  sceneID: sceneID
2172
2227
  });
2173
- return _context12.a(2, _configAR.init());
2228
+ return _context13.a(2, _configAR.init());
2174
2229
  case 2:
2175
- _t0 = configurator_ar_1.ConfiguratorAR;
2176
- _context12.n = 3;
2230
+ _t1 = configurator_ar_1.ConfiguratorAR;
2231
+ _context13.n = 3;
2177
2232
  return this.getConfiguratorState();
2178
2233
  case 3:
2179
- _t1 = _context12.v;
2180
- _t10 = this.getBooleanAttribute("show-ar-banner");
2181
- _t11 = {
2182
- state: _t1,
2183
- useARBanner: _t10
2234
+ _t10 = _context13.v;
2235
+ _t11 = this.getBooleanAttribute("show-ar-banner");
2236
+ _t12 = {
2237
+ state: _t10,
2238
+ useARBanner: _t11
2184
2239
  };
2185
- configAR = new _t0(_t11);
2186
- return _context12.a(2, configAR.init());
2240
+ configAR = new _t1(_t12);
2241
+ return _context13.a(2, configAR.init());
2187
2242
  }
2188
- }, _callee12, this);
2243
+ }, _callee13, this);
2189
2244
  }));
2190
2245
  function _InitARGenerated() {
2191
2246
  return _InitARGenerated2.apply(this, arguments);
@@ -2235,20 +2290,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2235
2290
  return _createClass(GalleryController, [{
2236
2291
  key: "getConfiguratorState",
2237
2292
  value: function () {
2238
- var _getConfiguratorState2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
2239
- return _regenerator().w(function (_context13) {
2240
- while (1) switch (_context13.n) {
2293
+ var _getConfiguratorState2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
2294
+ return _regenerator().w(function (_context14) {
2295
+ while (1) switch (_context14.n) {
2241
2296
  case 0:
2242
2297
  if (!this._cachedConfigState) {
2243
- _context13.n = 1;
2298
+ _context14.n = 1;
2244
2299
  break;
2245
2300
  }
2246
- return _context13.a(2, this._cachedConfigState);
2301
+ return _context14.a(2, this._cachedConfigState);
2247
2302
  case 1:
2248
2303
  this._cachedConfigState = this.createConfiguratorState();
2249
- return _context13.a(2, this._cachedConfigState);
2304
+ return _context14.a(2, this._cachedConfigState);
2250
2305
  }
2251
- }, _callee13, this);
2306
+ }, _callee14, this);
2252
2307
  }));
2253
2308
  function getConfiguratorState() {
2254
2309
  return _getConfiguratorState2.apply(this, arguments);
@@ -2258,24 +2313,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2258
2313
  }, {
2259
2314
  key: "onAttributesUpdated",
2260
2315
  value: function () {
2261
- var _onAttributesUpdated2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(attributeName) {
2316
+ var _onAttributesUpdated2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(attributeName) {
2262
2317
  var state, configState, variationIDs, variationIDsList, _configState2, variationSKUs, variationSKUList;
2263
- return _regenerator().w(function (_context14) {
2264
- while (1) switch (_context14.n) {
2318
+ return _regenerator().w(function (_context15) {
2319
+ while (1) switch (_context15.n) {
2265
2320
  case 0:
2266
2321
  state = this._state; // re-render the QR Code when attributes have changed
2267
2322
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
2268
- _context14.n = 5;
2323
+ _context15.n = 5;
2269
2324
  break;
2270
2325
  }
2271
2326
  if (!(attributeName === "variation-id")) {
2272
- _context14.n = 2;
2327
+ _context15.n = 2;
2273
2328
  break;
2274
2329
  }
2275
- _context14.n = 1;
2330
+ _context15.n = 1;
2276
2331
  return this.getConfiguratorState();
2277
2332
  case 1:
2278
- configState = _context14.v;
2333
+ configState = _context15.v;
2279
2334
  variationIDs = this.getAttribute("variation-id");
2280
2335
  variationIDsList = variationIDs ? variationIDs.split(",") : [];
2281
2336
  variationIDsList.forEach(function (variationID) {
@@ -2283,13 +2338,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2283
2338
  });
2284
2339
  case 2:
2285
2340
  if (!(attributeName === "variation-sku")) {
2286
- _context14.n = 4;
2341
+ _context15.n = 4;
2287
2342
  break;
2288
2343
  }
2289
- _context14.n = 3;
2344
+ _context15.n = 3;
2290
2345
  return this.getConfiguratorState();
2291
2346
  case 3:
2292
- _configState2 = _context14.v;
2347
+ _configState2 = _context15.v;
2293
2348
  variationSKUs = this.getAttribute("variation-sku");
2294
2349
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
2295
2350
  variationSKUList.forEach(function (variationSKU) {
@@ -2297,13 +2352,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2297
2352
  });
2298
2353
  case 4:
2299
2354
  this.startQRCode(this._prevQROpt);
2300
- return _context14.a(2);
2355
+ return _context15.a(2);
2301
2356
  case 5:
2302
- return _context14.a(2);
2357
+ return _context15.a(2);
2303
2358
  }
2304
- }, _callee14, this);
2359
+ }, _callee15, this);
2305
2360
  }));
2306
- function onAttributesUpdated(_x6) {
2361
+ function onAttributesUpdated(_x8) {
2307
2362
  return _onAttributesUpdated2.apply(this, arguments);
2308
2363
  }
2309
2364
  return onAttributesUpdated;
@@ -2311,11 +2366,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2311
2366
  }, {
2312
2367
  key: "startViewerQRCode",
2313
2368
  value: function () {
2314
- var _startViewerQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee15(options) {
2369
+ var _startViewerQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16(options) {
2315
2370
  var _this17 = this;
2316
- var opt, sceneID, viewer, width, height, dst, _t12;
2317
- return _regenerator().w(function (_context15) {
2318
- while (1) switch (_context15.n) {
2371
+ var opt, sceneID, viewer, width, height, dst, _t13;
2372
+ return _regenerator().w(function (_context16) {
2373
+ while (1) switch (_context16.n) {
2319
2374
  case 0:
2320
2375
  opt = this._GetDefaultQROptions(options); // remove the old renderer instance if any
2321
2376
  if (!opt.detached) {
@@ -2323,7 +2378,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2323
2378
  }
2324
2379
  sceneID = this.getAttribute("scene-id");
2325
2380
  if (sceneID) {
2326
- _context15.n = 1;
2381
+ _context16.n = 1;
2327
2382
  break;
2328
2383
  }
2329
2384
  throw new Error("GalleryController.startViewerQRCode() - minimum required attributes not set, use scene-id as a minimum");
@@ -2349,37 +2404,37 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2349
2404
  }
2350
2405
  viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
2351
2406
  dst = "https://renderer.plattar.com/gallery.html?scene_id=".concat(sceneID);
2352
- _t12 = plattar_api_1.Server.location().type;
2353
- _context15.n = _t12 === 'review' ? 2 : _t12 === 'staging' ? 3 : 4;
2407
+ _t13 = plattar_api_1.Server.location().type;
2408
+ _context16.n = _t13 === 'review' ? 2 : _t13 === 'staging' ? 3 : 4;
2354
2409
  break;
2355
2410
  case 2:
2356
2411
  dst = "https://renderer-review.plattar.com/gallery.html?scene_id=".concat(sceneID);
2357
- return _context15.a(3, 4);
2412
+ return _context16.a(3, 4);
2358
2413
  case 3:
2359
2414
  dst = "https://renderer.plattar.space/gallery.html?scene_id=".concat(sceneID);
2360
- return _context15.a(3, 4);
2415
+ return _context16.a(3, 4);
2361
2416
  case 4:
2362
2417
  viewer.setAttribute("url", opt.url || dst);
2363
2418
  this._prevQROpt = opt;
2364
2419
  if (opt.detached) {
2365
- _context15.n = 5;
2420
+ _context16.n = 5;
2366
2421
  break;
2367
2422
  }
2368
2423
  this._state = plattar_controller_1.ControllerState.QRCode;
2369
- return _context15.a(2, new Promise(function (accept, reject) {
2424
+ return _context16.a(2, new Promise(function (accept, reject) {
2370
2425
  viewer.onload = function () {
2371
2426
  return accept(viewer);
2372
2427
  };
2373
2428
  _this17.append(viewer);
2374
2429
  }));
2375
2430
  case 5:
2376
- return _context15.a(2, new Promise(function (accept, reject) {
2431
+ return _context16.a(2, new Promise(function (accept, reject) {
2377
2432
  return accept(viewer);
2378
2433
  }));
2379
2434
  }
2380
- }, _callee15, this);
2435
+ }, _callee16, this);
2381
2436
  }));
2382
- function startViewerQRCode(_x7) {
2437
+ function startViewerQRCode(_x9) {
2383
2438
  return _startViewerQRCode2.apply(this, arguments);
2384
2439
  }
2385
2440
  return startViewerQRCode;
@@ -2387,17 +2442,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2387
2442
  }, {
2388
2443
  key: "startRenderer",
2389
2444
  value: function () {
2390
- var _startRenderer2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee16() {
2445
+ var _startRenderer2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
2391
2446
  var _this18 = this;
2392
2447
  var sceneID, width, height, server, viewer;
2393
- return _regenerator().w(function (_context16) {
2394
- while (1) switch (_context16.n) {
2448
+ return _regenerator().w(function (_context17) {
2449
+ while (1) switch (_context17.n) {
2395
2450
  case 0:
2396
2451
  // remove the old renderer instance if any
2397
2452
  this.removeRenderer();
2398
2453
  sceneID = this.getAttribute("scene-id");
2399
2454
  if (sceneID) {
2400
- _context16.n = 1;
2455
+ _context17.n = 1;
2401
2456
  break;
2402
2457
  }
2403
2458
  throw new Error("GalleryController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
@@ -2413,12 +2468,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2413
2468
  viewer.setAttribute("height", height);
2414
2469
  viewer.setAttribute("server", server);
2415
2470
  viewer.setAttribute("scene-id", sceneID);
2416
- return _context16.a(2, new Promise(function (accept, reject) {
2471
+ return _context17.a(2, new Promise(function (accept, reject) {
2417
2472
  _this18.append(viewer);
2418
2473
  return accept(viewer);
2419
2474
  }));
2420
2475
  }
2421
- }, _callee16, this);
2476
+ }, _callee17, this);
2422
2477
  }));
2423
2478
  function startRenderer() {
2424
2479
  return _startRenderer2.apply(this, arguments);
@@ -2428,15 +2483,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2428
2483
  }, {
2429
2484
  key: "initAR",
2430
2485
  value: function () {
2431
- var _initAR2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
2432
- return _regenerator().w(function (_context17) {
2433
- while (1) switch (_context17.n) {
2486
+ var _initAR2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
2487
+ return _regenerator().w(function (_context18) {
2488
+ while (1) switch (_context18.n) {
2434
2489
  case 0:
2435
2490
  throw new Error("GalleryController.initAR() - cannot proceed as AR not available in gallery context");
2436
2491
  case 1:
2437
- return _context17.a(2);
2492
+ return _context18.a(2);
2438
2493
  }
2439
- }, _callee17);
2494
+ }, _callee18);
2440
2495
  }));
2441
2496
  function initAR() {
2442
2497
  return _initAR2.apply(this, arguments);
@@ -2485,20 +2540,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2485
2540
  return _createClass(LauncherController, [{
2486
2541
  key: "getConfiguratorState",
2487
2542
  value: function () {
2488
- var _getConfiguratorState3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee18() {
2489
- return _regenerator().w(function (_context18) {
2490
- while (1) switch (_context18.n) {
2543
+ var _getConfiguratorState3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19() {
2544
+ return _regenerator().w(function (_context19) {
2545
+ while (1) switch (_context19.n) {
2491
2546
  case 0:
2492
2547
  if (!this._cachedConfigState) {
2493
- _context18.n = 1;
2548
+ _context19.n = 1;
2494
2549
  break;
2495
2550
  }
2496
- return _context18.a(2, this._cachedConfigState);
2551
+ return _context19.a(2, this._cachedConfigState);
2497
2552
  case 1:
2498
2553
  this._cachedConfigState = this.createConfiguratorState();
2499
- return _context18.a(2, this._cachedConfigState);
2554
+ return _context19.a(2, this._cachedConfigState);
2500
2555
  }
2501
- }, _callee18, this);
2556
+ }, _callee19, this);
2502
2557
  }));
2503
2558
  function getConfiguratorState() {
2504
2559
  return _getConfiguratorState3.apply(this, arguments);
@@ -2508,20 +2563,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2508
2563
  }, {
2509
2564
  key: "onAttributesUpdated",
2510
2565
  value: function () {
2511
- var _onAttributesUpdated3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(attributeName) {
2566
+ var _onAttributesUpdated3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(attributeName) {
2512
2567
  var state, configState, variationIDs, variationIDsList, _configState3, variationSKUs, variationSKUList;
2513
- return _regenerator().w(function (_context19) {
2514
- while (1) switch (_context19.n) {
2568
+ return _regenerator().w(function (_context20) {
2569
+ while (1) switch (_context20.n) {
2515
2570
  case 0:
2516
2571
  state = this._state;
2517
2572
  if (!(attributeName === "variation-id")) {
2518
- _context19.n = 2;
2573
+ _context20.n = 2;
2519
2574
  break;
2520
2575
  }
2521
- _context19.n = 1;
2576
+ _context20.n = 1;
2522
2577
  return this.getConfiguratorState();
2523
2578
  case 1:
2524
- configState = _context19.v;
2579
+ configState = _context20.v;
2525
2580
  variationIDs = this.getAttribute("variation-id");
2526
2581
  variationIDsList = variationIDs ? variationIDs.split(",") : [];
2527
2582
  variationIDsList.forEach(function (variationID) {
@@ -2529,13 +2584,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2529
2584
  });
2530
2585
  case 2:
2531
2586
  if (!(attributeName === "variation-sku")) {
2532
- _context19.n = 4;
2587
+ _context20.n = 4;
2533
2588
  break;
2534
2589
  }
2535
- _context19.n = 3;
2590
+ _context20.n = 3;
2536
2591
  return this.getConfiguratorState();
2537
2592
  case 3:
2538
- _configState3 = _context19.v;
2593
+ _configState3 = _context20.v;
2539
2594
  variationSKUs = this.getAttribute("variation-sku");
2540
2595
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
2541
2596
  variationSKUList.forEach(function (variationSKU) {
@@ -2543,17 +2598,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2543
2598
  });
2544
2599
  case 4:
2545
2600
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
2546
- _context19.n = 5;
2601
+ _context20.n = 5;
2547
2602
  break;
2548
2603
  }
2549
2604
  this.startQRCode(this._prevQROpt);
2550
- return _context19.a(2);
2605
+ return _context20.a(2);
2551
2606
  case 5:
2552
- return _context19.a(2);
2607
+ return _context20.a(2);
2553
2608
  }
2554
- }, _callee19, this);
2609
+ }, _callee20, this);
2555
2610
  }));
2556
- function onAttributesUpdated(_x8) {
2611
+ function onAttributesUpdated(_x0) {
2557
2612
  return _onAttributesUpdated3.apply(this, arguments);
2558
2613
  }
2559
2614
  return onAttributesUpdated;
@@ -2561,21 +2616,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2561
2616
  }, {
2562
2617
  key: "startARQRCode",
2563
2618
  value: function () {
2564
- var _startARQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(options) {
2565
- var dState, product, controller, _t13;
2566
- return _regenerator().w(function (_context20) {
2567
- while (1) switch (_context20.p = _context20.n) {
2619
+ var _startARQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(options) {
2620
+ var dState, product, controller, _t14;
2621
+ return _regenerator().w(function (_context21) {
2622
+ while (1) switch (_context21.p = _context21.n) {
2568
2623
  case 0:
2569
- _context20.p = 0;
2570
- _context20.n = 1;
2624
+ _context21.p = 0;
2625
+ _context21.n = 1;
2571
2626
  return this.getConfiguratorState();
2572
2627
  case 1:
2573
- dState = _context20.v;
2628
+ dState = _context21.v;
2574
2629
  // if this is declared, we have a furniture scene that we need to re-create the embed
2575
2630
  // with new attributes
2576
2631
  product = dState.state.firstOfType("product");
2577
2632
  if (!product) {
2578
- _context20.n = 3;
2633
+ _context21.n = 3;
2579
2634
  break;
2580
2635
  }
2581
2636
  this.parent.lockObserver();
@@ -2585,24 +2640,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2585
2640
  this.parent.unlockObserver();
2586
2641
  controller = this.parent.create();
2587
2642
  if (!controller) {
2588
- _context20.n = 2;
2643
+ _context21.n = 2;
2589
2644
  break;
2590
2645
  }
2591
- return _context20.a(2, controller.startARQRCode(options));
2646
+ return _context21.a(2, controller.startARQRCode(options));
2592
2647
  case 2:
2593
- return _context20.a(2, Promise.reject(new Error("LauncherController.startARQRCode() - legacy product transition failed")));
2648
+ return _context21.a(2, Promise.reject(new Error("LauncherController.startARQRCode() - legacy product transition failed")));
2594
2649
  case 3:
2595
- _context20.n = 5;
2650
+ _context21.n = 5;
2596
2651
  break;
2597
2652
  case 4:
2598
- _context20.p = 4;
2599
- _t13 = _context20.v;
2653
+ _context21.p = 4;
2654
+ _t14 = _context21.v;
2600
2655
  case 5:
2601
- return _context20.a(2, _superPropGet(LauncherController, "startARQRCode", this, 3)([options]));
2656
+ return _context21.a(2, _superPropGet(LauncherController, "startARQRCode", this, 3)([options]));
2602
2657
  }
2603
- }, _callee20, this, [[0, 4]]);
2658
+ }, _callee21, this, [[0, 4]]);
2604
2659
  }));
2605
- function startARQRCode(_x9) {
2660
+ function startARQRCode(_x1) {
2606
2661
  return _startARQRCode2.apply(this, arguments);
2607
2662
  }
2608
2663
  return startARQRCode;
@@ -2610,15 +2665,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2610
2665
  }, {
2611
2666
  key: "startViewerQRCode",
2612
2667
  value: function () {
2613
- var _startViewerQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(options) {
2614
- return _regenerator().w(function (_context21) {
2615
- while (1) switch (_context21.n) {
2668
+ var _startViewerQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(options) {
2669
+ return _regenerator().w(function (_context22) {
2670
+ while (1) switch (_context22.n) {
2616
2671
  case 0:
2617
- return _context21.a(2, this.startARQRCode(options));
2672
+ return _context22.a(2, this.startARQRCode(options));
2618
2673
  }
2619
- }, _callee21, this);
2674
+ }, _callee22, this);
2620
2675
  }));
2621
- function startViewerQRCode(_x0) {
2676
+ function startViewerQRCode(_x10) {
2622
2677
  return _startViewerQRCode3.apply(this, arguments);
2623
2678
  }
2624
2679
  return startViewerQRCode;
@@ -2626,25 +2681,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2626
2681
  }, {
2627
2682
  key: "startRenderer",
2628
2683
  value: function () {
2629
- var _startRenderer3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
2684
+ var _startRenderer3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
2630
2685
  var _this20 = this;
2631
- var sceneID, configState, qrOptions, embedType, productID, sceneProductID, variationID, variationSKU, arMode, showBanner, sceneGraphID, width, height, server, viewer, _sceneGraphID, _t14;
2632
- return _regenerator().w(function (_context22) {
2633
- while (1) switch (_context22.p = _context22.n) {
2686
+ var sceneID, configState, qrOptions, embedType, productID, sceneProductID, variationID, variationSKU, arMode, showBanner, sceneGraphID, width, height, server, viewer, _sceneGraphID, _t15;
2687
+ return _regenerator().w(function (_context23) {
2688
+ while (1) switch (_context23.p = _context23.n) {
2634
2689
  case 0:
2635
2690
  // remove the old renderer instance if any
2636
2691
  this.removeRenderer();
2637
2692
  sceneID = this.getAttribute("scene-id");
2638
2693
  if (sceneID) {
2639
- _context22.n = 1;
2694
+ _context23.n = 1;
2640
2695
  break;
2641
2696
  }
2642
2697
  throw new Error("LauncherController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
2643
2698
  case 1:
2644
- _context22.n = 2;
2699
+ _context23.n = 2;
2645
2700
  return this.getConfiguratorState();
2646
2701
  case 2:
2647
- configState = _context22.v;
2702
+ configState = _context23.v;
2648
2703
  this._state = plattar_controller_1.ControllerState.Renderer;
2649
2704
  qrOptions = btoa(JSON.stringify(this._GetDefaultQROptions()));
2650
2705
  embedType = this.getAttribute("embed-type");
@@ -2687,32 +2742,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2687
2742
  viewer.setAttribute("show-ar-banner", showBanner);
2688
2743
  }
2689
2744
  if (!sceneGraphID) {
2690
- _context22.n = 3;
2745
+ _context23.n = 3;
2691
2746
  break;
2692
2747
  }
2693
2748
  viewer.setAttribute("scene-graph-id", sceneGraphID);
2694
- _context22.n = 7;
2749
+ _context23.n = 7;
2695
2750
  break;
2696
2751
  case 3:
2697
- _context22.p = 3;
2698
- _context22.n = 4;
2752
+ _context23.p = 3;
2753
+ _context23.n = 4;
2699
2754
  return this.getConfiguratorState();
2700
2755
  case 4:
2701
- _context22.n = 5;
2702
- return _context22.v.state.encodeSceneGraphID();
2756
+ _context23.n = 5;
2757
+ return _context23.v.state.encodeSceneGraphID();
2703
2758
  case 5:
2704
- _sceneGraphID = _context22.v;
2759
+ _sceneGraphID = _context23.v;
2705
2760
  viewer.setAttribute("scene-graph-id", _sceneGraphID);
2706
- _context22.n = 7;
2761
+ _context23.n = 7;
2707
2762
  break;
2708
2763
  case 6:
2709
- _context22.p = 6;
2710
- _t14 = _context22.v;
2764
+ _context23.p = 6;
2765
+ _t15 = _context23.v;
2711
2766
  // scene graph ID not available for some reason
2712
2767
  // we will generate a new one
2713
- console.error(_t14);
2768
+ console.error(_t15);
2714
2769
  case 7:
2715
- return _context22.a(2, new Promise(function (accept, reject) {
2770
+ return _context23.a(2, new Promise(function (accept, reject) {
2716
2771
  _this20.append(viewer);
2717
2772
  if (configState) {
2718
2773
  _this20.setupMessengerObservers(viewer, configState);
@@ -2720,7 +2775,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2720
2775
  return accept(viewer);
2721
2776
  }));
2722
2777
  }
2723
- }, _callee22, this, [[3, 6]]);
2778
+ }, _callee23, this, [[3, 6]]);
2724
2779
  }));
2725
2780
  function startRenderer() {
2726
2781
  return _startRenderer3.apply(this, arguments);
@@ -2730,27 +2785,27 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2730
2785
  }, {
2731
2786
  key: "initAR",
2732
2787
  value: function () {
2733
- var _initAR3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
2734
- var dState, product, controller, arMode, _t15, _t16;
2735
- return _regenerator().w(function (_context23) {
2736
- while (1) switch (_context23.p = _context23.n) {
2788
+ var _initAR3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
2789
+ var dState, product, controller, arMode, _t16, _t17;
2790
+ return _regenerator().w(function (_context24) {
2791
+ while (1) switch (_context24.p = _context24.n) {
2737
2792
  case 0:
2738
2793
  if (util_1.Util.canAugment()) {
2739
- _context23.n = 1;
2794
+ _context24.n = 1;
2740
2795
  break;
2741
2796
  }
2742
2797
  throw new Error("LauncherController.initAR() - cannot proceed as AR not available in context");
2743
2798
  case 1:
2744
- _context23.p = 1;
2745
- _context23.n = 2;
2799
+ _context24.p = 1;
2800
+ _context24.n = 2;
2746
2801
  return this.getConfiguratorState();
2747
2802
  case 2:
2748
- dState = _context23.v;
2803
+ dState = _context24.v;
2749
2804
  // if this is declared, we have a furniture scene that we need to re-create the embed
2750
2805
  // with new attributes
2751
2806
  product = dState.state.firstOfType("product");
2752
2807
  if (!product) {
2753
- _context23.n = 4;
2808
+ _context24.n = 4;
2754
2809
  break;
2755
2810
  }
2756
2811
  this.parent.lockObserver();
@@ -2760,31 +2815,31 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2760
2815
  this.parent.unlockObserver();
2761
2816
  controller = this.parent.create();
2762
2817
  if (!controller) {
2763
- _context23.n = 3;
2818
+ _context24.n = 3;
2764
2819
  break;
2765
2820
  }
2766
- return _context23.a(2, controller.initAR());
2821
+ return _context24.a(2, controller.initAR());
2767
2822
  case 3:
2768
- return _context23.a(2, Promise.reject(new Error("LauncherController.initAR() - legacy product transition failed")));
2823
+ return _context24.a(2, Promise.reject(new Error("LauncherController.initAR() - legacy product transition failed")));
2769
2824
  case 4:
2770
- _context23.n = 6;
2825
+ _context24.n = 6;
2771
2826
  break;
2772
2827
  case 5:
2773
- _context23.p = 5;
2774
- _t15 = _context23.v;
2828
+ _context24.p = 5;
2829
+ _t16 = _context24.v;
2775
2830
  case 6:
2776
2831
  arMode = this.getAttribute("ar-mode") || "generated";
2777
- _t16 = arMode.toLowerCase();
2778
- _context23.n = _t16 === "inherited" ? 7 : _t16 === "generated" ? 8 : 8;
2832
+ _t17 = arMode.toLowerCase();
2833
+ _context24.n = _t17 === "inherited" ? 7 : _t17 === "generated" ? 8 : 8;
2779
2834
  break;
2780
2835
  case 7:
2781
- return _context23.a(2, this._InitARInherited());
2836
+ return _context24.a(2, this._InitARInherited());
2782
2837
  case 8:
2783
- return _context23.a(2, this._InitARGenerated());
2838
+ return _context24.a(2, this._InitARGenerated());
2784
2839
  case 9:
2785
- return _context23.a(2);
2840
+ return _context24.a(2);
2786
2841
  }
2787
- }, _callee23, this, [[1, 5]]);
2842
+ }, _callee24, this, [[1, 5]]);
2788
2843
  }));
2789
2844
  function initAR() {
2790
2845
  return _initAR3.apply(this, arguments);
@@ -2797,25 +2852,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2797
2852
  }, {
2798
2853
  key: "_InitARInherited",
2799
2854
  value: (function () {
2800
- var _InitARInherited3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
2855
+ var _InitARInherited3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
2801
2856
  var sceneID, state, first, sceneProductAR;
2802
- return _regenerator().w(function (_context24) {
2803
- while (1) switch (_context24.n) {
2857
+ return _regenerator().w(function (_context25) {
2858
+ while (1) switch (_context25.n) {
2804
2859
  case 0:
2805
2860
  sceneID = this.getAttribute("scene-id");
2806
2861
  if (sceneID) {
2807
- _context24.n = 1;
2862
+ _context25.n = 1;
2808
2863
  break;
2809
2864
  }
2810
2865
  throw new Error("LauncherController.initAR() - inherited AR minimum required attributes not set, use scene-id as a minimum");
2811
2866
  case 1:
2812
- _context24.n = 2;
2867
+ _context25.n = 2;
2813
2868
  return this.getConfiguratorState();
2814
2869
  case 2:
2815
- state = _context24.v.state;
2870
+ state = _context25.v.state;
2816
2871
  first = state.firstActiveOfType("sceneproduct");
2817
2872
  if (!first) {
2818
- _context24.n = 3;
2873
+ _context25.n = 3;
2819
2874
  break;
2820
2875
  }
2821
2876
  //const sceneProductAR: SceneProductAR = new SceneProductAR(first.scene_product_id, first.product_variation_id);
@@ -2825,13 +2880,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2825
2880
  variationSKU: null,
2826
2881
  useARBanner: this.getBooleanAttribute("show-ar-banner")
2827
2882
  });
2828
- return _context24.a(2, sceneProductAR.init());
2883
+ return _context25.a(2, sceneProductAR.init());
2829
2884
  case 3:
2830
2885
  throw new Error("LauncherController.initAR() - invalid decoded config-state does not have any product states");
2831
2886
  case 4:
2832
- return _context24.a(2);
2887
+ return _context25.a(2);
2833
2888
  }
2834
- }, _callee24, this);
2889
+ }, _callee25, this);
2835
2890
  }));
2836
2891
  function _InitARInherited() {
2837
2892
  return _InitARInherited3.apply(this, arguments);
@@ -2845,21 +2900,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2845
2900
  }, {
2846
2901
  key: "_InitARGenerated",
2847
2902
  value: (function () {
2848
- var _InitARGenerated3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
2849
- var sceneID, graphID, _configAR2, configAR, _t17, _t18, _t19, _t20;
2850
- return _regenerator().w(function (_context25) {
2851
- while (1) switch (_context25.n) {
2903
+ var _InitARGenerated3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
2904
+ var sceneID, graphID, _configAR2, configAR, _t18, _t19, _t20, _t21;
2905
+ return _regenerator().w(function (_context26) {
2906
+ while (1) switch (_context26.n) {
2852
2907
  case 0:
2853
2908
  sceneID = this.getAttribute("scene-id");
2854
2909
  if (sceneID) {
2855
- _context25.n = 1;
2910
+ _context26.n = 1;
2856
2911
  break;
2857
2912
  }
2858
2913
  throw new Error("LauncherController.initAR() - generated AR minimum required attributes not set, use scene-id as a minimum");
2859
2914
  case 1:
2860
2915
  graphID = this.getAttribute("scene-graph-id"); // use the scene-graph route if available
2861
2916
  if (!graphID) {
2862
- _context25.n = 2;
2917
+ _context26.n = 2;
2863
2918
  break;
2864
2919
  }
2865
2920
  _configAR2 = new scene_graph_ar_1.SceneGraphAR({
@@ -2867,22 +2922,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2867
2922
  id: graphID,
2868
2923
  sceneID: sceneID
2869
2924
  });
2870
- return _context25.a(2, _configAR2.init());
2925
+ return _context26.a(2, _configAR2.init());
2871
2926
  case 2:
2872
- _t17 = configurator_ar_1.ConfiguratorAR;
2873
- _context25.n = 3;
2927
+ _t18 = configurator_ar_1.ConfiguratorAR;
2928
+ _context26.n = 3;
2874
2929
  return this.getConfiguratorState();
2875
2930
  case 3:
2876
- _t18 = _context25.v;
2877
- _t19 = this.getBooleanAttribute("show-ar-banner");
2878
- _t20 = {
2879
- state: _t18,
2880
- useARBanner: _t19
2931
+ _t19 = _context26.v;
2932
+ _t20 = this.getBooleanAttribute("show-ar-banner");
2933
+ _t21 = {
2934
+ state: _t19,
2935
+ useARBanner: _t20
2881
2936
  };
2882
- configAR = new _t17(_t20);
2883
- return _context25.a(2, configAR.init());
2937
+ configAR = new _t18(_t21);
2938
+ return _context26.a(2, configAR.init());
2884
2939
  }
2885
- }, _callee25, this);
2940
+ }, _callee26, this);
2886
2941
  }));
2887
2942
  function _InitARGenerated() {
2888
2943
  return _InitARGenerated3.apply(this, arguments);
@@ -2959,15 +3014,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2959
3014
  }, {
2960
3015
  key: "createConfiguratorState",
2961
3016
  value: (function () {
2962
- var _createConfiguratorState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
2963
- var sceneID, configState, variationIDs, variationSKUs, decodedState, variationIDList, variationSKUList, _t21;
2964
- return _regenerator().w(function (_context26) {
2965
- while (1) switch (_context26.n) {
3017
+ var _createConfiguratorState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
3018
+ var sceneID, configState, variationIDs, variationSKUs, decodedState, variationIDList, variationSKUList, _t22;
3019
+ return _regenerator().w(function (_context27) {
3020
+ while (1) switch (_context27.n) {
2966
3021
  case 0:
2967
3022
  // get our Scene ID
2968
3023
  sceneID = this.getAttribute("scene-id");
2969
3024
  if (sceneID) {
2970
- _context26.n = 1;
3025
+ _context27.n = 1;
2971
3026
  break;
2972
3027
  }
2973
3028
  throw new Error("PlattarController.createConfiguratorState() - cannot create as required attribute scene-id is not defined");
@@ -2976,22 +3031,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2976
3031
  variationIDs = this.getAttribute("variation-id"); // get a list of variation SKU's to use for initialising
2977
3032
  variationSKUs = this.getAttribute("variation-sku"); // generate the decoded configurator state
2978
3033
  if (!configState) {
2979
- _context26.n = 3;
3034
+ _context27.n = 3;
2980
3035
  break;
2981
3036
  }
2982
- _context26.n = 2;
3037
+ _context27.n = 2;
2983
3038
  return configurator_state_1.ConfiguratorState.decodeState(sceneID, configState);
2984
3039
  case 2:
2985
- _t21 = _context26.v;
2986
- _context26.n = 5;
3040
+ _t22 = _context27.v;
3041
+ _context27.n = 5;
2987
3042
  break;
2988
3043
  case 3:
2989
- _context26.n = 4;
3044
+ _context27.n = 4;
2990
3045
  return configurator_state_1.ConfiguratorState.decodeScene(sceneID);
2991
3046
  case 4:
2992
- _t21 = _context26.v;
3047
+ _t22 = _context27.v;
2993
3048
  case 5:
2994
- decodedState = _t21;
3049
+ decodedState = _t22;
2995
3050
  // change the ID's and SKU's (if any) of the default configuration state
2996
3051
  variationIDList = variationIDs ? variationIDs.split(",") : [];
2997
3052
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
@@ -3002,9 +3057,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3002
3057
  decodedState.state.setVariationSKU(variationSKU);
3003
3058
  });
3004
3059
  // return fully modified configuration state
3005
- return _context26.a(2, decodedState);
3060
+ return _context27.a(2, decodedState);
3006
3061
  }
3007
- }, _callee26, this);
3062
+ }, _callee27, this);
3008
3063
  }));
3009
3064
  function createConfiguratorState() {
3010
3065
  return _createConfiguratorState.apply(this, arguments);
@@ -3072,18 +3127,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3072
3127
  }, {
3073
3128
  key: "startAR",
3074
3129
  value: (function () {
3075
- var _startAR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
3130
+ var _startAR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28() {
3076
3131
  var launcher;
3077
- return _regenerator().w(function (_context27) {
3078
- while (1) switch (_context27.n) {
3132
+ return _regenerator().w(function (_context28) {
3133
+ while (1) switch (_context28.n) {
3079
3134
  case 0:
3080
- _context27.n = 1;
3135
+ _context28.n = 1;
3081
3136
  return this.initAR();
3082
3137
  case 1:
3083
- launcher = _context27.v;
3084
- return _context27.a(2, launcher.start());
3138
+ launcher = _context28.v;
3139
+ return _context28.a(2, launcher.start());
3085
3140
  }
3086
- }, _callee27, this);
3141
+ }, _callee28, this);
3087
3142
  }));
3088
3143
  function startAR() {
3089
3144
  return _startAR.apply(this, arguments);
@@ -3099,25 +3154,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3099
3154
  }, {
3100
3155
  key: "startQRCode",
3101
3156
  value: (function () {
3102
- var _startQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(options) {
3103
- var qrType, _t22;
3104
- return _regenerator().w(function (_context28) {
3105
- while (1) switch (_context28.n) {
3157
+ var _startQRCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(options) {
3158
+ var qrType, _t23;
3159
+ return _regenerator().w(function (_context29) {
3160
+ while (1) switch (_context29.n) {
3106
3161
  case 0:
3107
3162
  qrType = this.getAttribute("qr-type") || "viewer";
3108
- _t22 = qrType.toLowerCase();
3109
- _context28.n = _t22 === "ar" ? 1 : _t22 === "viewer" ? 2 : 2;
3163
+ _t23 = qrType.toLowerCase();
3164
+ _context29.n = _t23 === "ar" ? 1 : _t23 === "viewer" ? 2 : 2;
3110
3165
  break;
3111
3166
  case 1:
3112
- return _context28.a(2, this.startARQRCode(options));
3167
+ return _context29.a(2, this.startARQRCode(options));
3113
3168
  case 2:
3114
- return _context28.a(2, this.startViewerQRCode(options));
3169
+ return _context29.a(2, this.startViewerQRCode(options));
3115
3170
  case 3:
3116
- return _context28.a(2);
3171
+ return _context29.a(2);
3117
3172
  }
3118
- }, _callee28, this);
3173
+ }, _callee29, this);
3119
3174
  }));
3120
- function startQRCode(_x1) {
3175
+ function startQRCode(_x11) {
3121
3176
  return _startQRCode.apply(this, arguments);
3122
3177
  }
3123
3178
  return startQRCode;
@@ -3131,11 +3186,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3131
3186
  }, {
3132
3187
  key: "startARQRCode",
3133
3188
  value: (function () {
3134
- var _startARQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(options) {
3189
+ var _startARQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(options) {
3135
3190
  var _this21 = this;
3136
- var opt, viewer, width, height, qrOptions, dst, sceneID, embedType, productID, sceneProductID, variationID, variationSKU, arMode, showBanner, sceneGraphID, _sceneGraphID2, _t23, _t24;
3137
- return _regenerator().w(function (_context29) {
3138
- while (1) switch (_context29.p = _context29.n) {
3191
+ var opt, viewer, width, height, qrOptions, dst, sceneID, embedType, productID, sceneProductID, variationID, variationSKU, arMode, showBanner, sceneGraphID, _sceneGraphID2, _t24, _t25;
3192
+ return _regenerator().w(function (_context30) {
3193
+ while (1) switch (_context30.p = _context30.n) {
3139
3194
  case 0:
3140
3195
  opt = this._GetDefaultQROptions(options);
3141
3196
  viewer = document.createElement("plattar-qrcode"); // remove the old renderer instance if any
@@ -3161,15 +3216,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3161
3216
  viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
3162
3217
  qrOptions = btoa(JSON.stringify(opt));
3163
3218
  dst = "https://renderer.plattar.com/launcher.html?qr_options=".concat(qrOptions);
3164
- _t23 = plattar_api_1.Server.location().type;
3165
- _context29.n = _t23 === 'review' ? 1 : _t23 === 'staging' ? 2 : 3;
3219
+ _t24 = plattar_api_1.Server.location().type;
3220
+ _context30.n = _t24 === 'review' ? 1 : _t24 === 'staging' ? 2 : 3;
3166
3221
  break;
3167
3222
  case 1:
3168
3223
  dst = "https://renderer-review.plattar.com/launcher.html?qr_options=".concat(qrOptions);
3169
- return _context29.a(3, 3);
3224
+ return _context30.a(3, 3);
3170
3225
  case 2:
3171
3226
  dst = "https://renderer.plattar.space/launcher.html?qr_options=".concat(qrOptions);
3172
- return _context29.a(3, 3);
3227
+ return _context30.a(3, 3);
3173
3228
  case 3:
3174
3229
  //let configState: string | null = null;
3175
3230
  sceneID = this.getAttribute("scene-id");
@@ -3206,52 +3261,52 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3206
3261
  dst += "&show_ar_banner=" + showBanner;
3207
3262
  }
3208
3263
  if (!sceneGraphID) {
3209
- _context29.n = 4;
3264
+ _context30.n = 4;
3210
3265
  break;
3211
3266
  }
3212
3267
  dst += "&scene_graph_id=" + sceneGraphID;
3213
- _context29.n = 8;
3268
+ _context30.n = 8;
3214
3269
  break;
3215
3270
  case 4:
3216
- _context29.p = 4;
3217
- _context29.n = 5;
3271
+ _context30.p = 4;
3272
+ _context30.n = 5;
3218
3273
  return this.getConfiguratorState();
3219
3274
  case 5:
3220
- _context29.n = 6;
3221
- return _context29.v.state.encodeSceneGraphID();
3275
+ _context30.n = 6;
3276
+ return _context30.v.state.encodeSceneGraphID();
3222
3277
  case 6:
3223
- _sceneGraphID2 = _context29.v;
3278
+ _sceneGraphID2 = _context30.v;
3224
3279
  dst += "&scene_graph_id=" + _sceneGraphID2;
3225
- _context29.n = 8;
3280
+ _context30.n = 8;
3226
3281
  break;
3227
3282
  case 7:
3228
- _context29.p = 7;
3229
- _t24 = _context29.v;
3283
+ _context30.p = 7;
3284
+ _t25 = _context30.v;
3230
3285
  // scene graph ID not available for some reason
3231
3286
  // we will generate a new one
3232
- console.error(_t24);
3287
+ console.error(_t25);
3233
3288
  case 8:
3234
3289
  viewer.setAttribute("url", opt.url || dst);
3235
3290
  this._prevQROpt = opt;
3236
3291
  if (opt.detached) {
3237
- _context29.n = 9;
3292
+ _context30.n = 9;
3238
3293
  break;
3239
3294
  }
3240
3295
  this._state = ControllerState.QRCode;
3241
- return _context29.a(2, new Promise(function (accept, reject) {
3296
+ return _context30.a(2, new Promise(function (accept, reject) {
3242
3297
  _this21.append(viewer);
3243
3298
  viewer.onload = function () {
3244
3299
  return accept(viewer);
3245
3300
  };
3246
3301
  }));
3247
3302
  case 9:
3248
- return _context29.a(2, new Promise(function (accept, reject) {
3303
+ return _context30.a(2, new Promise(function (accept, reject) {
3249
3304
  return accept(viewer);
3250
3305
  }));
3251
3306
  }
3252
- }, _callee29, this, [[4, 7]]);
3307
+ }, _callee30, this, [[4, 7]]);
3253
3308
  }));
3254
- function startARQRCode(_x10) {
3309
+ function startARQRCode(_x12) {
3255
3310
  return _startARQRCode3.apply(this, arguments);
3256
3311
  }
3257
3312
  return startARQRCode;
@@ -3398,15 +3453,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3398
3453
  return _createClass(ProductController, [{
3399
3454
  key: "getConfiguratorState",
3400
3455
  value: function () {
3401
- var _getConfiguratorState4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30() {
3402
- return _regenerator().w(function (_context30) {
3403
- while (1) switch (_context30.n) {
3456
+ var _getConfiguratorState4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31() {
3457
+ return _regenerator().w(function (_context31) {
3458
+ while (1) switch (_context31.n) {
3404
3459
  case 0:
3405
3460
  throw new Error("ProductController.getConfiguratorState() - legacy embeds do not support configurator states");
3406
3461
  case 1:
3407
- return _context30.a(2);
3462
+ return _context31.a(2);
3408
3463
  }
3409
- }, _callee30);
3464
+ }, _callee31);
3410
3465
  }));
3411
3466
  function getConfiguratorState() {
3412
3467
  return _getConfiguratorState4.apply(this, arguments);
@@ -3416,18 +3471,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3416
3471
  }, {
3417
3472
  key: "onAttributesUpdated",
3418
3473
  value: function () {
3419
- var _onAttributesUpdated4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(attributeName) {
3474
+ var _onAttributesUpdated4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(attributeName) {
3420
3475
  var state, viewer, variationID;
3421
- return _regenerator().w(function (_context31) {
3422
- while (1) switch (_context31.n) {
3476
+ return _regenerator().w(function (_context32) {
3477
+ while (1) switch (_context32.n) {
3423
3478
  case 0:
3424
3479
  state = this._state; // re-render the QR Code when attributes have changed
3425
3480
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
3426
- _context31.n = 1;
3481
+ _context32.n = 1;
3427
3482
  break;
3428
3483
  }
3429
3484
  this.startQRCode(this._prevQROpt);
3430
- return _context31.a(2);
3485
+ return _context32.a(2);
3431
3486
  case 1:
3432
3487
  // use the messenger function to change variation when attributes have changed
3433
3488
  if (state === plattar_controller_1.ControllerState.Renderer) {
@@ -3440,11 +3495,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3440
3495
  }
3441
3496
  }
3442
3497
  case 2:
3443
- return _context31.a(2);
3498
+ return _context32.a(2);
3444
3499
  }
3445
- }, _callee31, this);
3500
+ }, _callee32, this);
3446
3501
  }));
3447
- function onAttributesUpdated(_x11) {
3502
+ function onAttributesUpdated(_x13) {
3448
3503
  return _onAttributesUpdated4.apply(this, arguments);
3449
3504
  }
3450
3505
  return onAttributesUpdated;
@@ -3711,20 +3766,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3711
3766
  return _createClass(VTOController, [{
3712
3767
  key: "getConfiguratorState",
3713
3768
  value: function () {
3714
- var _getConfiguratorState5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32() {
3715
- return _regenerator().w(function (_context32) {
3716
- while (1) switch (_context32.n) {
3769
+ var _getConfiguratorState5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33() {
3770
+ return _regenerator().w(function (_context33) {
3771
+ while (1) switch (_context33.n) {
3717
3772
  case 0:
3718
3773
  if (!this._cachedConfigState) {
3719
- _context32.n = 1;
3774
+ _context33.n = 1;
3720
3775
  break;
3721
3776
  }
3722
- return _context32.a(2, this._cachedConfigState);
3777
+ return _context33.a(2, this._cachedConfigState);
3723
3778
  case 1:
3724
3779
  this._cachedConfigState = this.createConfiguratorState();
3725
- return _context32.a(2, this._cachedConfigState);
3780
+ return _context33.a(2, this._cachedConfigState);
3726
3781
  }
3727
- }, _callee32, this);
3782
+ }, _callee33, this);
3728
3783
  }));
3729
3784
  function getConfiguratorState() {
3730
3785
  return _getConfiguratorState5.apply(this, arguments);
@@ -3734,61 +3789,61 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3734
3789
  }, {
3735
3790
  key: "onAttributesUpdated",
3736
3791
  value: function () {
3737
- var _onAttributesUpdated5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee33(attributeName) {
3792
+ var _onAttributesUpdated5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(attributeName) {
3738
3793
  var state, viewer, variationIDs, variationIDsList, variationSKUs, variationSKUList, configState, _variationIDs2, _variationIDsList2, _configState4, _variationSKUs2, _variationSKUList2;
3739
- return _regenerator().w(function (_context33) {
3740
- while (1) switch (_context33.n) {
3794
+ return _regenerator().w(function (_context34) {
3795
+ while (1) switch (_context34.n) {
3741
3796
  case 0:
3742
3797
  state = this._state;
3743
3798
  if (!(state === plattar_controller_1.ControllerState.Renderer)) {
3744
- _context33.n = 3;
3799
+ _context34.n = 3;
3745
3800
  break;
3746
3801
  }
3747
3802
  viewer = this.element;
3748
3803
  if (!viewer) {
3749
- _context33.n = 2;
3804
+ _context34.n = 2;
3750
3805
  break;
3751
3806
  }
3752
3807
  if (!(attributeName === "variation-id")) {
3753
- _context33.n = 1;
3808
+ _context34.n = 1;
3754
3809
  break;
3755
3810
  }
3756
3811
  variationIDs = this.getAttribute("variation-id");
3757
3812
  variationIDsList = variationIDs ? variationIDs.split(",") : [];
3758
3813
  if (!(variationIDsList.length > 0)) {
3759
- _context33.n = 1;
3814
+ _context34.n = 1;
3760
3815
  break;
3761
3816
  }
3762
- _context33.n = 1;
3817
+ _context34.n = 1;
3763
3818
  return viewer.messenger.selectVariationID(variationIDsList);
3764
3819
  case 1:
3765
3820
  if (!(attributeName === "variation-sku")) {
3766
- _context33.n = 2;
3821
+ _context34.n = 2;
3767
3822
  break;
3768
3823
  }
3769
3824
  variationSKUs = this.getAttribute("variation-sku");
3770
3825
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
3771
3826
  if (!(variationSKUList.length > 0)) {
3772
- _context33.n = 2;
3827
+ _context34.n = 2;
3773
3828
  break;
3774
3829
  }
3775
- _context33.n = 2;
3830
+ _context34.n = 2;
3776
3831
  return viewer.messenger.selectVariationSKU(variationSKUList);
3777
3832
  case 2:
3778
- return _context33.a(2);
3833
+ return _context34.a(2);
3779
3834
  case 3:
3780
3835
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
3781
- _context33.n = 8;
3836
+ _context34.n = 8;
3782
3837
  break;
3783
3838
  }
3784
3839
  if (!(attributeName === "variation-id")) {
3785
- _context33.n = 5;
3840
+ _context34.n = 5;
3786
3841
  break;
3787
3842
  }
3788
- _context33.n = 4;
3843
+ _context34.n = 4;
3789
3844
  return this.getConfiguratorState();
3790
3845
  case 4:
3791
- configState = _context33.v;
3846
+ configState = _context34.v;
3792
3847
  _variationIDs2 = this.getAttribute("variation-id");
3793
3848
  _variationIDsList2 = _variationIDs2 ? _variationIDs2.split(",") : [];
3794
3849
  _variationIDsList2.forEach(function (variationID) {
@@ -3796,13 +3851,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3796
3851
  });
3797
3852
  case 5:
3798
3853
  if (!(attributeName === "variation-sku")) {
3799
- _context33.n = 7;
3854
+ _context34.n = 7;
3800
3855
  break;
3801
3856
  }
3802
- _context33.n = 6;
3857
+ _context34.n = 6;
3803
3858
  return this.getConfiguratorState();
3804
3859
  case 6:
3805
- _configState4 = _context33.v;
3860
+ _configState4 = _context34.v;
3806
3861
  _variationSKUs2 = this.getAttribute("variation-sku");
3807
3862
  _variationSKUList2 = _variationSKUs2 ? _variationSKUs2.split(",") : [];
3808
3863
  _variationSKUList2.forEach(function (variationSKU) {
@@ -3810,13 +3865,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3810
3865
  });
3811
3866
  case 7:
3812
3867
  this.startQRCode(this._prevQROpt);
3813
- return _context33.a(2);
3868
+ return _context34.a(2);
3814
3869
  case 8:
3815
- return _context33.a(2);
3870
+ return _context34.a(2);
3816
3871
  }
3817
- }, _callee33, this);
3872
+ }, _callee34, this);
3818
3873
  }));
3819
- function onAttributesUpdated(_x12) {
3874
+ function onAttributesUpdated(_x14) {
3820
3875
  return _onAttributesUpdated5.apply(this, arguments);
3821
3876
  }
3822
3877
  return onAttributesUpdated;
@@ -3824,11 +3879,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3824
3879
  }, {
3825
3880
  key: "startViewerQRCode",
3826
3881
  value: function () {
3827
- var _startViewerQRCode4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee34(options) {
3882
+ var _startViewerQRCode4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35(options) {
3828
3883
  var _this27 = this;
3829
- var opt, sceneID, viewer, width, height, dst, configState, showAR, productID, sceneProductID, variationID, _t25, _t26;
3830
- return _regenerator().w(function (_context34) {
3831
- while (1) switch (_context34.p = _context34.n) {
3884
+ var opt, sceneID, viewer, width, height, dst, configState, showAR, productID, sceneProductID, variationID, _t26, _t27;
3885
+ return _regenerator().w(function (_context35) {
3886
+ while (1) switch (_context35.p = _context35.n) {
3832
3887
  case 0:
3833
3888
  opt = this._GetDefaultQROptions(options); // remove the old renderer instance if any
3834
3889
  if (!opt.detached) {
@@ -3836,7 +3891,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3836
3891
  }
3837
3892
  sceneID = this.getAttribute("scene-id");
3838
3893
  if (sceneID) {
3839
- _context34.n = 1;
3894
+ _context35.n = 1;
3840
3895
  break;
3841
3896
  }
3842
3897
  throw new Error("VTOController.startQRCode() - minimum required attributes not set, use scene-id as a minimum");
@@ -3862,28 +3917,28 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3862
3917
  }
3863
3918
  viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
3864
3919
  dst = "https://renderer.plattar.com/facear.html?scene_id=".concat(sceneID);
3865
- _t25 = plattar_api_1.Server.location().type;
3866
- _context34.n = _t25 === 'review' ? 2 : _t25 === 'staging' ? 3 : 4;
3920
+ _t26 = plattar_api_1.Server.location().type;
3921
+ _context35.n = _t26 === 'review' ? 2 : _t26 === 'staging' ? 3 : 4;
3867
3922
  break;
3868
3923
  case 2:
3869
3924
  dst = "https://renderer-review.plattar.com/facear.html?scene_id=".concat(sceneID);
3870
- return _context34.a(3, 4);
3925
+ return _context35.a(3, 4);
3871
3926
  case 3:
3872
3927
  dst = "https://renderer.plattar.space/facear.html?scene_id=".concat(sceneID);
3873
- return _context34.a(3, 4);
3928
+ return _context35.a(3, 4);
3874
3929
  case 4:
3875
3930
  // optional attributes
3876
3931
  configState = null;
3877
- _context34.p = 5;
3878
- _context34.n = 6;
3932
+ _context35.p = 5;
3933
+ _context35.n = 6;
3879
3934
  return this.getConfiguratorState();
3880
3935
  case 6:
3881
- configState = _context34.v;
3882
- _context34.n = 8;
3936
+ configState = _context35.v;
3937
+ _context35.n = 8;
3883
3938
  break;
3884
3939
  case 7:
3885
- _context34.p = 7;
3886
- _t26 = _context34.v;
3940
+ _context35.p = 7;
3941
+ _t27 = _context35.v;
3887
3942
  // config state is not available
3888
3943
  configState = null;
3889
3944
  case 8:
@@ -3909,24 +3964,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3909
3964
  viewer.setAttribute("url", opt.url || dst);
3910
3965
  this._prevQROpt = opt;
3911
3966
  if (opt.detached) {
3912
- _context34.n = 9;
3967
+ _context35.n = 9;
3913
3968
  break;
3914
3969
  }
3915
3970
  this._state = plattar_controller_1.ControllerState.QRCode;
3916
- return _context34.a(2, new Promise(function (accept, reject) {
3971
+ return _context35.a(2, new Promise(function (accept, reject) {
3917
3972
  viewer.onload = function () {
3918
3973
  return accept(viewer);
3919
3974
  };
3920
3975
  _this27.append(viewer);
3921
3976
  }));
3922
3977
  case 9:
3923
- return _context34.a(2, new Promise(function (accept, reject) {
3978
+ return _context35.a(2, new Promise(function (accept, reject) {
3924
3979
  return accept(viewer);
3925
3980
  }));
3926
3981
  }
3927
- }, _callee34, this, [[5, 7]]);
3982
+ }, _callee35, this, [[5, 7]]);
3928
3983
  }));
3929
- function startViewerQRCode(_x13) {
3984
+ function startViewerQRCode(_x15) {
3930
3985
  return _startViewerQRCode4.apply(this, arguments);
3931
3986
  }
3932
3987
  return startViewerQRCode;
@@ -3934,17 +3989,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3934
3989
  }, {
3935
3990
  key: "startRenderer",
3936
3991
  value: function () {
3937
- var _startRenderer4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee35() {
3992
+ var _startRenderer4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36() {
3938
3993
  var _this28 = this;
3939
- var sceneID, width, height, server, viewer, configState, showAR, productID, sceneProductID, variationID, _t27;
3940
- return _regenerator().w(function (_context35) {
3941
- while (1) switch (_context35.p = _context35.n) {
3994
+ var sceneID, width, height, server, viewer, configState, showAR, productID, sceneProductID, variationID, _t28;
3995
+ return _regenerator().w(function (_context36) {
3996
+ while (1) switch (_context36.p = _context36.n) {
3942
3997
  case 0:
3943
3998
  // remove the old renderer instance if any
3944
3999
  this.removeRenderer();
3945
4000
  sceneID = this.getAttribute("scene-id");
3946
4001
  if (sceneID) {
3947
- _context35.n = 1;
4002
+ _context36.n = 1;
3948
4003
  break;
3949
4004
  }
3950
4005
  throw new Error("VTOController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
@@ -3962,16 +4017,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3962
4017
  viewer.setAttribute("scene-id", sceneID);
3963
4018
  // optional attributes
3964
4019
  configState = null;
3965
- _context35.p = 2;
3966
- _context35.n = 3;
4020
+ _context36.p = 2;
4021
+ _context36.n = 3;
3967
4022
  return this.getConfiguratorState();
3968
4023
  case 3:
3969
- configState = _context35.v;
3970
- _context35.n = 5;
4024
+ configState = _context36.v;
4025
+ _context36.n = 5;
3971
4026
  break;
3972
4027
  case 4:
3973
- _context35.p = 4;
3974
- _t27 = _context35.v;
4028
+ _context36.p = 4;
4029
+ _t28 = _context36.v;
3975
4030
  // config state not available
3976
4031
  configState = null;
3977
4032
  case 5:
@@ -3994,7 +4049,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3994
4049
  if (variationID) {
3995
4050
  viewer.setAttribute("variation-id", variationID);
3996
4051
  }
3997
- return _context35.a(2, new Promise(function (accept, reject) {
4052
+ return _context36.a(2, new Promise(function (accept, reject) {
3998
4053
  _this28.append(viewer);
3999
4054
  if (configState) {
4000
4055
  _this28.setupMessengerObservers(viewer, configState);
@@ -4002,7 +4057,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4002
4057
  return accept(viewer);
4003
4058
  }));
4004
4059
  }
4005
- }, _callee35, this, [[2, 4]]);
4060
+ }, _callee36, this, [[2, 4]]);
4006
4061
  }));
4007
4062
  function startRenderer() {
4008
4063
  return _startRenderer4.apply(this, arguments);
@@ -4012,35 +4067,35 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4012
4067
  }, {
4013
4068
  key: "initAR",
4014
4069
  value: function () {
4015
- var _initAR4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee36() {
4016
- var arMode, _t28;
4017
- return _regenerator().w(function (_context36) {
4018
- while (1) switch (_context36.n) {
4070
+ var _initAR4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37() {
4071
+ var arMode, _t29;
4072
+ return _regenerator().w(function (_context37) {
4073
+ while (1) switch (_context37.n) {
4019
4074
  case 0:
4020
4075
  if (util_1.Util.canAugment()) {
4021
- _context36.n = 1;
4076
+ _context37.n = 1;
4022
4077
  break;
4023
4078
  }
4024
4079
  throw new Error("VTOController.initAR() - cannot proceed as VTO AR not available in context");
4025
4080
  case 1:
4026
4081
  if (util_1.Util.isSafari() || util_1.Util.isChromeOnIOS()) {
4027
- _context36.n = 2;
4082
+ _context37.n = 2;
4028
4083
  break;
4029
4084
  }
4030
4085
  throw new Error("VTOController.initAR() - cannot proceed as VTO AR only available on IOS Mobile devices");
4031
4086
  case 2:
4032
4087
  arMode = this.getAttribute("ar-mode") || "generated";
4033
- _t28 = arMode.toLowerCase();
4034
- _context36.n = _t28 === "inherited" ? 3 : _t28 === "generated" ? 4 : 4;
4088
+ _t29 = arMode.toLowerCase();
4089
+ _context37.n = _t29 === "inherited" ? 3 : _t29 === "generated" ? 4 : 4;
4035
4090
  break;
4036
4091
  case 3:
4037
- return _context36.a(2, this._InitARInherited());
4092
+ return _context37.a(2, this._InitARInherited());
4038
4093
  case 4:
4039
- return _context36.a(2, this._InitARGenerated());
4094
+ return _context37.a(2, this._InitARGenerated());
4040
4095
  case 5:
4041
- return _context36.a(2);
4096
+ return _context37.a(2);
4042
4097
  }
4043
- }, _callee36, this);
4098
+ }, _callee37, this);
4044
4099
  }));
4045
4100
  function initAR() {
4046
4101
  return _initAR4.apply(this, arguments);
@@ -4053,25 +4108,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4053
4108
  }, {
4054
4109
  key: "_InitARInherited",
4055
4110
  value: (function () {
4056
- var _InitARInherited4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee37() {
4111
+ var _InitARInherited4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38() {
4057
4112
  var sceneID, state, first, sceneProductAR;
4058
- return _regenerator().w(function (_context37) {
4059
- while (1) switch (_context37.n) {
4113
+ return _regenerator().w(function (_context38) {
4114
+ while (1) switch (_context38.n) {
4060
4115
  case 0:
4061
4116
  sceneID = this.getAttribute("scene-id");
4062
4117
  if (sceneID) {
4063
- _context37.n = 1;
4118
+ _context38.n = 1;
4064
4119
  break;
4065
4120
  }
4066
4121
  throw new Error("VTOController.initAR() - inherited AR minimum required attributes not set, use scene-id as a minimum");
4067
4122
  case 1:
4068
- _context37.n = 2;
4123
+ _context38.n = 2;
4069
4124
  return this.getConfiguratorState();
4070
4125
  case 2:
4071
- state = _context37.v.state;
4126
+ state = _context38.v.state;
4072
4127
  first = state.firstActiveOfType("sceneproduct");
4073
4128
  if (!first) {
4074
- _context37.n = 3;
4129
+ _context38.n = 3;
4075
4130
  break;
4076
4131
  }
4077
4132
  sceneProductAR = new __1.SceneProductAR({
@@ -4080,13 +4135,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4080
4135
  variationSKU: null,
4081
4136
  useARBanner: this.getBooleanAttribute("show-ar-banner")
4082
4137
  });
4083
- return _context37.a(2, sceneProductAR.init());
4138
+ return _context38.a(2, sceneProductAR.init());
4084
4139
  case 3:
4085
4140
  throw new Error("VTOController.initAR() - invalid decoded config-state does not have any product states");
4086
4141
  case 4:
4087
- return _context37.a(2);
4142
+ return _context38.a(2);
4088
4143
  }
4089
- }, _callee37, this);
4144
+ }, _callee38, this);
4090
4145
  }));
4091
4146
  function _InitARInherited() {
4092
4147
  return _InitARInherited4.apply(this, arguments);
@@ -4100,32 +4155,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4100
4155
  }, {
4101
4156
  key: "_InitARGenerated",
4102
4157
  value: (function () {
4103
- var _InitARGenerated4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee38() {
4104
- var sceneID, configAR, _t29, _t30, _t31, _t32;
4105
- return _regenerator().w(function (_context38) {
4106
- while (1) switch (_context38.n) {
4158
+ var _InitARGenerated4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39() {
4159
+ var sceneID, configAR, _t30, _t31, _t32, _t33;
4160
+ return _regenerator().w(function (_context39) {
4161
+ while (1) switch (_context39.n) {
4107
4162
  case 0:
4108
4163
  sceneID = this.getAttribute("scene-id");
4109
4164
  if (sceneID) {
4110
- _context38.n = 1;
4165
+ _context39.n = 1;
4111
4166
  break;
4112
4167
  }
4113
4168
  throw new Error("VTOController.initAR() - generated AR minimum required attributes not set, use scene-id as a minimum");
4114
4169
  case 1:
4115
- _t29 = configurator_ar_1.ConfiguratorAR;
4116
- _context38.n = 2;
4170
+ _t30 = configurator_ar_1.ConfiguratorAR;
4171
+ _context39.n = 2;
4117
4172
  return this.getConfiguratorState();
4118
4173
  case 2:
4119
- _t30 = _context38.v;
4120
- _t31 = this.getBooleanAttribute("show-ar-banner");
4121
- _t32 = {
4122
- state: _t30,
4123
- useARBanner: _t31
4174
+ _t31 = _context39.v;
4175
+ _t32 = this.getBooleanAttribute("show-ar-banner");
4176
+ _t33 = {
4177
+ state: _t31,
4178
+ useARBanner: _t32
4124
4179
  };
4125
- configAR = new _t29(_t32);
4126
- return _context38.a(2, configAR.init());
4180
+ configAR = new _t30(_t33);
4181
+ return _context39.a(2, configAR.init());
4127
4182
  }
4128
- }, _callee38, this);
4183
+ }, _callee39, this);
4129
4184
  }));
4130
4185
  function _InitARGenerated() {
4131
4186
  return _InitARGenerated4.apply(this, arguments);
@@ -4175,20 +4230,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4175
4230
  return _createClass(WebXRController, [{
4176
4231
  key: "getConfiguratorState",
4177
4232
  value: function () {
4178
- var _getConfiguratorState6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee39() {
4179
- return _regenerator().w(function (_context39) {
4180
- while (1) switch (_context39.n) {
4233
+ var _getConfiguratorState6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40() {
4234
+ return _regenerator().w(function (_context40) {
4235
+ while (1) switch (_context40.n) {
4181
4236
  case 0:
4182
4237
  if (!this._cachedConfigState) {
4183
- _context39.n = 1;
4238
+ _context40.n = 1;
4184
4239
  break;
4185
4240
  }
4186
- return _context39.a(2, this._cachedConfigState);
4241
+ return _context40.a(2, this._cachedConfigState);
4187
4242
  case 1:
4188
4243
  this._cachedConfigState = this.createConfiguratorState();
4189
- return _context39.a(2, this._cachedConfigState);
4244
+ return _context40.a(2, this._cachedConfigState);
4190
4245
  }
4191
- }, _callee39, this);
4246
+ }, _callee40, this);
4192
4247
  }));
4193
4248
  function getConfiguratorState() {
4194
4249
  return _getConfiguratorState6.apply(this, arguments);
@@ -4198,61 +4253,61 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4198
4253
  }, {
4199
4254
  key: "onAttributesUpdated",
4200
4255
  value: function () {
4201
- var _onAttributesUpdated6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee40(attributeName) {
4256
+ var _onAttributesUpdated6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee41(attributeName) {
4202
4257
  var state, viewer, variationIDs, variationIDsList, variationSKUs, variationSKUList, configState, _variationIDs3, _variationIDsList3, _configState5, _variationSKUs3, _variationSKUList3;
4203
- return _regenerator().w(function (_context40) {
4204
- while (1) switch (_context40.n) {
4258
+ return _regenerator().w(function (_context41) {
4259
+ while (1) switch (_context41.n) {
4205
4260
  case 0:
4206
4261
  state = this._state;
4207
4262
  if (!(state === plattar_controller_1.ControllerState.Renderer)) {
4208
- _context40.n = 3;
4263
+ _context41.n = 3;
4209
4264
  break;
4210
4265
  }
4211
4266
  viewer = this.element;
4212
4267
  if (!viewer) {
4213
- _context40.n = 2;
4268
+ _context41.n = 2;
4214
4269
  break;
4215
4270
  }
4216
4271
  if (!(attributeName === "variation-id")) {
4217
- _context40.n = 1;
4272
+ _context41.n = 1;
4218
4273
  break;
4219
4274
  }
4220
4275
  variationIDs = this.getAttribute("variation-id");
4221
4276
  variationIDsList = variationIDs ? variationIDs.split(",") : [];
4222
4277
  if (!(variationIDsList.length > 0)) {
4223
- _context40.n = 1;
4278
+ _context41.n = 1;
4224
4279
  break;
4225
4280
  }
4226
- _context40.n = 1;
4281
+ _context41.n = 1;
4227
4282
  return viewer.messenger.selectVariationID(variationIDsList);
4228
4283
  case 1:
4229
4284
  if (!(attributeName === "variation-sku")) {
4230
- _context40.n = 2;
4285
+ _context41.n = 2;
4231
4286
  break;
4232
4287
  }
4233
4288
  variationSKUs = this.getAttribute("variation-sku");
4234
4289
  variationSKUList = variationSKUs ? variationSKUs.split(",") : [];
4235
4290
  if (!(variationSKUList.length > 0)) {
4236
- _context40.n = 2;
4291
+ _context41.n = 2;
4237
4292
  break;
4238
4293
  }
4239
- _context40.n = 2;
4294
+ _context41.n = 2;
4240
4295
  return viewer.messenger.selectVariationSKU(variationSKUList);
4241
4296
  case 2:
4242
- return _context40.a(2);
4297
+ return _context41.a(2);
4243
4298
  case 3:
4244
4299
  if (!(state === plattar_controller_1.ControllerState.QRCode)) {
4245
- _context40.n = 8;
4300
+ _context41.n = 8;
4246
4301
  break;
4247
4302
  }
4248
4303
  if (!(attributeName === "variation-id")) {
4249
- _context40.n = 5;
4304
+ _context41.n = 5;
4250
4305
  break;
4251
4306
  }
4252
- _context40.n = 4;
4307
+ _context41.n = 4;
4253
4308
  return this.getConfiguratorState();
4254
4309
  case 4:
4255
- configState = _context40.v;
4310
+ configState = _context41.v;
4256
4311
  _variationIDs3 = this.getAttribute("variation-id");
4257
4312
  _variationIDsList3 = _variationIDs3 ? _variationIDs3.split(",") : [];
4258
4313
  _variationIDsList3.forEach(function (variationID) {
@@ -4260,13 +4315,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4260
4315
  });
4261
4316
  case 5:
4262
4317
  if (!(attributeName === "variation-sku")) {
4263
- _context40.n = 7;
4318
+ _context41.n = 7;
4264
4319
  break;
4265
4320
  }
4266
- _context40.n = 6;
4321
+ _context41.n = 6;
4267
4322
  return this.getConfiguratorState();
4268
4323
  case 6:
4269
- _configState5 = _context40.v;
4324
+ _configState5 = _context41.v;
4270
4325
  _variationSKUs3 = this.getAttribute("variation-sku");
4271
4326
  _variationSKUList3 = _variationSKUs3 ? _variationSKUs3.split(",") : [];
4272
4327
  _variationSKUList3.forEach(function (variationSKU) {
@@ -4274,13 +4329,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4274
4329
  });
4275
4330
  case 7:
4276
4331
  this.startQRCode(this._prevQROpt);
4277
- return _context40.a(2);
4332
+ return _context41.a(2);
4278
4333
  case 8:
4279
- return _context40.a(2);
4334
+ return _context41.a(2);
4280
4335
  }
4281
- }, _callee40, this);
4336
+ }, _callee41, this);
4282
4337
  }));
4283
- function onAttributesUpdated(_x14) {
4338
+ function onAttributesUpdated(_x16) {
4284
4339
  return _onAttributesUpdated6.apply(this, arguments);
4285
4340
  }
4286
4341
  return onAttributesUpdated;
@@ -4298,17 +4353,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4298
4353
  }, {
4299
4354
  key: "startQRCode",
4300
4355
  value: function () {
4301
- var _startQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee41(options) {
4356
+ var _startQRCode2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee42(options) {
4302
4357
  var _this30 = this;
4303
4358
  var sceneID, opt, viewer, width, height, dst;
4304
- return _regenerator().w(function (_context41) {
4305
- while (1) switch (_context41.n) {
4359
+ return _regenerator().w(function (_context42) {
4360
+ while (1) switch (_context42.n) {
4306
4361
  case 0:
4307
4362
  // remove the old renderer instance if any
4308
4363
  this.removeRenderer();
4309
4364
  sceneID = this.getAttribute("scene-id");
4310
4365
  if (sceneID) {
4311
- _context41.n = 1;
4366
+ _context42.n = 1;
4312
4367
  break;
4313
4368
  }
4314
4369
  throw new Error("WebXRController.startQRCode() - minimum required attributes not set, use scene-id as a minimum");
@@ -4336,16 +4391,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4336
4391
  viewer.setAttribute("url", opt.url || dst);
4337
4392
  this._state = plattar_controller_1.ControllerState.QRCode;
4338
4393
  this._prevQROpt = opt;
4339
- return _context41.a(2, new Promise(function (accept, reject) {
4394
+ return _context42.a(2, new Promise(function (accept, reject) {
4340
4395
  viewer.onload = function () {
4341
4396
  return accept(viewer);
4342
4397
  };
4343
4398
  _this30.append(viewer);
4344
4399
  }));
4345
4400
  }
4346
- }, _callee41, this);
4401
+ }, _callee42, this);
4347
4402
  }));
4348
- function startQRCode(_x15) {
4403
+ function startQRCode(_x17) {
4349
4404
  return _startQRCode2.apply(this, arguments);
4350
4405
  }
4351
4406
  return startQRCode;
@@ -4353,23 +4408,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4353
4408
  }, {
4354
4409
  key: "startRenderer",
4355
4410
  value: function () {
4356
- var _startRenderer5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee42() {
4411
+ var _startRenderer5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee43() {
4357
4412
  var _this31 = this;
4358
4413
  var sceneID, width, height, server, viewer, showAR, showUI;
4359
- return _regenerator().w(function (_context42) {
4360
- while (1) switch (_context42.n) {
4414
+ return _regenerator().w(function (_context43) {
4415
+ while (1) switch (_context43.n) {
4361
4416
  case 0:
4362
4417
  // remove the old renderer instance if any
4363
4418
  this.removeRenderer();
4364
4419
  if (util_1.Util.canAugment()) {
4365
- _context42.n = 1;
4420
+ _context43.n = 1;
4366
4421
  break;
4367
4422
  }
4368
- return _context42.a(2, this.startQRCode(this._GetDefaultQROptions()));
4423
+ return _context43.a(2, this.startQRCode(this._GetDefaultQROptions()));
4369
4424
  case 1:
4370
4425
  sceneID = this.getAttribute("scene-id");
4371
4426
  if (sceneID) {
4372
- _context42.n = 2;
4427
+ _context43.n = 2;
4373
4428
  break;
4374
4429
  }
4375
4430
  throw new Error("WebXRController.startRenderer() - minimum required attributes not set, use scene-id as a minimum");
@@ -4392,12 +4447,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4392
4447
  if (showUI) {
4393
4448
  viewer.setAttribute("show-ui", showUI);
4394
4449
  }
4395
- return _context42.a(2, new Promise(function (accept, reject) {
4450
+ return _context43.a(2, new Promise(function (accept, reject) {
4396
4451
  _this31.append(viewer);
4397
4452
  return accept(viewer);
4398
4453
  }));
4399
4454
  }
4400
- }, _callee42, this);
4455
+ }, _callee43, this);
4401
4456
  }));
4402
4457
  function startRenderer() {
4403
4458
  return _startRenderer5.apply(this, arguments);
@@ -4407,15 +4462,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4407
4462
  }, {
4408
4463
  key: "initAR",
4409
4464
  value: function () {
4410
- var _initAR5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee43() {
4411
- return _regenerator().w(function (_context43) {
4412
- while (1) switch (_context43.n) {
4465
+ var _initAR5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee44() {
4466
+ return _regenerator().w(function (_context44) {
4467
+ while (1) switch (_context44.n) {
4413
4468
  case 0:
4414
4469
  throw new Error("WebXRController.initAR() - cannot proceed as AR not available in webxr");
4415
4470
  case 1:
4416
- return _context43.a(2);
4471
+ return _context44.a(2);
4417
4472
  }
4418
- }, _callee43);
4473
+ }, _callee44);
4419
4474
  }));
4420
4475
  function initAR() {
4421
4476
  return _initAR5.apply(this, arguments);
@@ -4682,19 +4737,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4682
4737
  }, {
4683
4738
  key: "initAR",
4684
4739
  value: function () {
4685
- var _initAR6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee44() {
4686
- return _regenerator().w(function (_context44) {
4687
- while (1) switch (_context44.n) {
4740
+ var _initAR6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45() {
4741
+ return _regenerator().w(function (_context45) {
4742
+ while (1) switch (_context45.n) {
4688
4743
  case 0:
4689
4744
  if (this._controller) {
4690
- _context44.n = 1;
4745
+ _context45.n = 1;
4691
4746
  break;
4692
4747
  }
4693
4748
  throw new Error("PlattarEmbed.initAR() - cannot execute as controller has not loaded yet");
4694
4749
  case 1:
4695
- return _context44.a(2, this._controller.initAR());
4750
+ return _context45.a(2, this._controller.initAR());
4696
4751
  }
4697
- }, _callee44, this);
4752
+ }, _callee45, this);
4698
4753
  }));
4699
4754
  function initAR() {
4700
4755
  return _initAR6.apply(this, arguments);
@@ -4704,19 +4759,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4704
4759
  }, {
4705
4760
  key: "startAR",
4706
4761
  value: function () {
4707
- var _startAR2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee45() {
4708
- return _regenerator().w(function (_context45) {
4709
- while (1) switch (_context45.n) {
4762
+ var _startAR2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46() {
4763
+ return _regenerator().w(function (_context46) {
4764
+ while (1) switch (_context46.n) {
4710
4765
  case 0:
4711
4766
  if (this._controller) {
4712
- _context45.n = 1;
4767
+ _context46.n = 1;
4713
4768
  break;
4714
4769
  }
4715
4770
  throw new Error("PlattarEmbed.startAR() - cannot execute as controller has not loaded yet");
4716
4771
  case 1:
4717
- return _context45.a(2, this._controller.startAR());
4772
+ return _context46.a(2, this._controller.startAR());
4718
4773
  }
4719
- }, _callee45, this);
4774
+ }, _callee46, this);
4720
4775
  }));
4721
4776
  function startAR() {
4722
4777
  return _startAR2.apply(this, arguments);
@@ -4726,19 +4781,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4726
4781
  }, {
4727
4782
  key: "startViewer",
4728
4783
  value: function () {
4729
- var _startViewer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee46() {
4730
- return _regenerator().w(function (_context46) {
4731
- while (1) switch (_context46.n) {
4784
+ var _startViewer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47() {
4785
+ return _regenerator().w(function (_context47) {
4786
+ while (1) switch (_context47.n) {
4732
4787
  case 0:
4733
4788
  if (this._controller) {
4734
- _context46.n = 1;
4789
+ _context47.n = 1;
4735
4790
  break;
4736
4791
  }
4737
4792
  throw new Error("PlattarEmbed.startViewer() - cannot execute as controller has not loaded yet");
4738
4793
  case 1:
4739
- return _context46.a(2, this._controller.startRenderer());
4794
+ return _context47.a(2, this._controller.startRenderer());
4740
4795
  }
4741
- }, _callee46, this);
4796
+ }, _callee47, this);
4742
4797
  }));
4743
4798
  function startViewer() {
4744
4799
  return _startViewer.apply(this, arguments);
@@ -4748,22 +4803,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4748
4803
  }, {
4749
4804
  key: "startQRCode",
4750
4805
  value: function () {
4751
- var _startQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee47() {
4806
+ var _startQRCode3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48() {
4752
4807
  var options,
4753
- _args47 = arguments;
4754
- return _regenerator().w(function (_context47) {
4755
- while (1) switch (_context47.n) {
4808
+ _args48 = arguments;
4809
+ return _regenerator().w(function (_context48) {
4810
+ while (1) switch (_context48.n) {
4756
4811
  case 0:
4757
- options = _args47.length > 0 && _args47[0] !== undefined ? _args47[0] : null;
4812
+ options = _args48.length > 0 && _args48[0] !== undefined ? _args48[0] : null;
4758
4813
  if (this._controller) {
4759
- _context47.n = 1;
4814
+ _context48.n = 1;
4760
4815
  break;
4761
4816
  }
4762
4817
  throw new Error("PlattarEmbed.startQRCode() - cannot execute as controller has not loaded yet");
4763
4818
  case 1:
4764
- return _context47.a(2, this._controller.startQRCode(options));
4819
+ return _context48.a(2, this._controller.startQRCode(options));
4765
4820
  }
4766
- }, _callee47, this);
4821
+ }, _callee48, this);
4767
4822
  }));
4768
4823
  function startQRCode() {
4769
4824
  return _startQRCode3.apply(this, arguments);
@@ -4958,7 +5013,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4958
5013
  "./util/util": 19,
4959
5014
  "./version": 20,
4960
5015
  "@plattar/plattar-qrcode": 117,
4961
- "@plattar/plattar-web": 139
5016
+ "@plattar/plattar-web": 134
4962
5017
  }],
4963
5018
  18: [function (require, module, exports) {
4964
5019
  "use strict";
@@ -5363,17 +5418,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5363
5418
  }, {
5364
5419
  key: "encodeSceneGraphID",
5365
5420
  value: function () {
5366
- var _encodeSceneGraphID = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee48() {
5367
- var graph, url, response, data, _t33;
5368
- return _regenerator().w(function (_context48) {
5369
- while (1) switch (_context48.p = _context48.n) {
5421
+ var _encodeSceneGraphID = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee49() {
5422
+ var graph, url, response, data, _t34;
5423
+ return _regenerator().w(function (_context49) {
5424
+ while (1) switch (_context49.p = _context49.n) {
5370
5425
  case 0:
5371
5426
  graph = this.sceneGraph; // some scene-graphs are very large in size, we store it remotely
5372
5427
  // this storage will expire in 10 minutes so this is a non-permanent version
5373
5428
  // and is designed for quick ar
5374
5429
  url = plattar_api_1.Server.location().type === 'staging' ? 'https://c.plattar.space/v3/redir/store' : 'https://c.plattar.com/v3/redir/store'; // finally send our scene-graph to the backend to generate the AR file and return
5375
- _context48.p = 1;
5376
- _context48.n = 2;
5430
+ _context49.p = 1;
5431
+ _context49.n = 2;
5377
5432
  return fetch(url, {
5378
5433
  method: "POST",
5379
5434
  headers: {
@@ -5388,26 +5443,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5388
5443
  })
5389
5444
  });
5390
5445
  case 2:
5391
- response = _context48.v;
5446
+ response = _context49.v;
5392
5447
  if (response.ok) {
5393
- _context48.n = 3;
5448
+ _context49.n = 3;
5394
5449
  break;
5395
5450
  }
5396
5451
  throw new Error("ConfiguratorState.encodeSceneGraphID() - network response was not ok ".concat(response.status));
5397
5452
  case 3:
5398
- _context48.n = 4;
5453
+ _context49.n = 4;
5399
5454
  return response.json();
5400
5455
  case 4:
5401
- data = _context48.v;
5402
- return _context48.a(2, data.data.id);
5456
+ data = _context49.v;
5457
+ return _context49.a(2, data.data.id);
5403
5458
  case 5:
5404
- _context48.p = 5;
5405
- _t33 = _context48.v;
5406
- throw new Error("ConfiguratorState.encodeSceneGraphID() - there was a request error to ".concat(url, ", error was ").concat(_t33.message));
5459
+ _context49.p = 5;
5460
+ _t34 = _context49.v;
5461
+ throw new Error("ConfiguratorState.encodeSceneGraphID() - there was a request error to ".concat(url, ", error was ").concat(_t34.message));
5407
5462
  case 6:
5408
- return _context48.a(2);
5463
+ return _context49.a(2);
5409
5464
  }
5410
- }, _callee48, this, [[1, 5]]);
5465
+ }, _callee49, this, [[1, 5]]);
5411
5466
  }));
5412
5467
  function encodeSceneGraphID() {
5413
5468
  return _encodeSceneGraphID.apply(this, arguments);
@@ -5462,20 +5517,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5462
5517
  }, {
5463
5518
  key: "decodeState",
5464
5519
  value: (function () {
5465
- var _decodeState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee49() {
5520
+ var _decodeState = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee50() {
5466
5521
  var sceneID,
5467
5522
  state,
5468
5523
  configState,
5469
5524
  fscene,
5470
5525
  scene,
5471
- _args49 = arguments;
5472
- return _regenerator().w(function (_context49) {
5473
- while (1) switch (_context49.n) {
5526
+ _args50 = arguments;
5527
+ return _regenerator().w(function (_context50) {
5528
+ while (1) switch (_context50.n) {
5474
5529
  case 0:
5475
- sceneID = _args49.length > 0 && _args49[0] !== undefined ? _args49[0] : null;
5476
- state = _args49.length > 1 && _args49[1] !== undefined ? _args49[1] : null;
5530
+ sceneID = _args50.length > 0 && _args50[0] !== undefined ? _args50[0] : null;
5531
+ state = _args50.length > 1 && _args50[1] !== undefined ? _args50[1] : null;
5477
5532
  if (!(!sceneID || !state)) {
5478
- _context49.n = 1;
5533
+ _context50.n = 1;
5479
5534
  break;
5480
5535
  }
5481
5536
  throw new Error("ConfiguratorState.decodeState(sceneID, state) - sceneID and state must be defined");
@@ -5487,16 +5542,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5487
5542
  fscene.include(plattar_api_1.SceneProduct);
5488
5543
  fscene.include(plattar_api_1.SceneModel);
5489
5544
  fscene.include(plattar_api_1.SceneProduct.include(plattar_api_1.Product.include(plattar_api_1.ProductVariation)));
5490
- _context49.n = 2;
5545
+ _context50.n = 2;
5491
5546
  return fscene.get();
5492
5547
  case 2:
5493
- scene = _context49.v;
5494
- return _context49.a(2, {
5548
+ scene = _context50.v;
5549
+ return _context50.a(2, {
5495
5550
  scene: scene,
5496
5551
  state: configState
5497
5552
  });
5498
5553
  }
5499
- }, _callee49);
5554
+ }, _callee50);
5500
5555
  }));
5501
5556
  function decodeState() {
5502
5557
  return _decodeState.apply(this, arguments);
@@ -5513,7 +5568,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5513
5568
  }, {
5514
5569
  key: "decodeScene",
5515
5570
  value: (function () {
5516
- var _decodeScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee50() {
5571
+ var _decodeScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee51() {
5517
5572
  var sceneID,
5518
5573
  configState,
5519
5574
  fscene,
@@ -5521,13 +5576,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5521
5576
  sceneProducts,
5522
5577
  sceneModels,
5523
5578
  products,
5524
- _args50 = arguments;
5525
- return _regenerator().w(function (_context50) {
5526
- while (1) switch (_context50.n) {
5579
+ _args51 = arguments;
5580
+ return _regenerator().w(function (_context51) {
5581
+ while (1) switch (_context51.n) {
5527
5582
  case 0:
5528
- sceneID = _args50.length > 0 && _args50[0] !== undefined ? _args50[0] : null;
5583
+ sceneID = _args51.length > 0 && _args51[0] !== undefined ? _args51[0] : null;
5529
5584
  if (sceneID) {
5530
- _context50.n = 1;
5585
+ _context51.n = 1;
5531
5586
  break;
5532
5587
  }
5533
5588
  throw new Error("ConfiguratorState.decodeScene(sceneID) - sceneID must be defined");
@@ -5539,10 +5594,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5539
5594
  fscene.include(plattar_api_1.SceneModel);
5540
5595
  fscene.include(plattar_api_1.Product);
5541
5596
  fscene.include(plattar_api_1.SceneProduct.include(plattar_api_1.Product.include(plattar_api_1.ProductVariation)));
5542
- _context50.n = 2;
5597
+ _context51.n = 2;
5543
5598
  return fscene.get();
5544
5599
  case 2:
5545
- scene = _context50.v;
5600
+ scene = _context51.v;
5546
5601
  sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
5547
5602
  sceneModels = scene.relationships.filter(plattar_api_1.SceneModel);
5548
5603
  products = scene.relationships.filter(plattar_api_1.Product); // add our scene models
@@ -5586,12 +5641,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5586
5641
  });
5587
5642
  }
5588
5643
  });
5589
- return _context50.a(2, {
5644
+ return _context51.a(2, {
5590
5645
  scene: scene,
5591
5646
  state: configState
5592
5647
  });
5593
5648
  }
5594
- }, _callee50);
5649
+ }, _callee51);
5595
5650
  }));
5596
5651
  function decodeScene() {
5597
5652
  return _decodeScene.apply(this, arguments);
@@ -5743,7 +5798,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5743
5798
  Object.defineProperty(exports, "__esModule", {
5744
5799
  value: true
5745
5800
  });
5746
- exports["default"] = "2.7.1";
5801
+ exports["default"] = "2.7.2";
5747
5802
  }, {}],
5748
5803
  21: [function (require, module, exports) {
5749
5804
  "use strict";
@@ -7757,10 +7812,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7757
7812
  exports.Util = Util;
7758
7813
  }, {}],
7759
7814
  47: [function (require, module, exports) {
7760
- arguments[4][20][0].apply(exports, arguments);
7761
- }, {
7762
- "dup": 20
7763
- }],
7815
+ "use strict";
7816
+
7817
+ Object.defineProperty(exports, "__esModule", {
7818
+ value: true
7819
+ });
7820
+ exports["default"] = "2.7.1";
7821
+ }, {}],
7764
7822
  48: [function (require, module, exports) {
7765
7823
  "use strict";
7766
7824
 
@@ -8410,7 +8468,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8410
8468
  module.exports = PlattarQuery;
8411
8469
  }, {
8412
8470
  "../util/plattar-util.js": 113,
8413
- "node-fetch": 145
8471
+ "node-fetch": 140
8414
8472
  }],
8415
8473
  50: [function (require, module, exports) {
8416
8474
  (function (process) {
@@ -8634,8 +8692,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8634
8692
  }).call(this);
8635
8693
  }).call(this, require('_process'));
8636
8694
  }, {
8637
- "_process": 147,
8638
- "node-fetch": 145
8695
+ "_process": 142,
8696
+ "node-fetch": 140
8639
8697
  }],
8640
8698
  51: [function (require, module, exports) {
8641
8699
  var PlattarBase = require("./interfaces/plattar-base.js");
@@ -10783,528 +10841,100 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10783
10841
  });
10784
10842
  if (this._optionsHash !== newHash) {
10785
10843
  this._optionsHash = newHash;
10786
- this._qrCode.update(this._options);
10787
- this._UpdateCanvas(width, height);
10788
- }
10789
- }
10790
- }, {
10791
- key: "_IsFetchAPISupported",
10792
- value: function _IsFetchAPISupported() {
10793
- return "fetch" in window;
10794
- }
10795
- }, {
10796
- key: "_ShortenURL",
10797
- value: function _ShortenURL(url) {
10798
- var _this64 = this;
10799
- return new Promise(function (accept, reject) {
10800
- if (!_this64._IsFetchAPISupported()) {
10801
- return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
10802
- }
10803
- try {
10804
- var b64Link = btoa(url);
10805
- var serverType = _this64.hasAttribute("server") ? _this64.getAttribute("server") : "production";
10806
- fetch(serverType === "staging" ? "https://c.plattar.space/shorten" : "https://c.plattar.com/shorten", {
10807
- cache: "no-store",
10808
- method: "POST",
10809
- headers: {
10810
- "Content-Type": "application/json"
10811
- },
10812
- body: JSON.stringify({
10813
- data: {
10814
- attributes: {
10815
- url: b64Link,
10816
- isBase64: true
10817
- }
10818
- }
10819
- })
10820
- }).then(function (response) {
10821
- if (!response.ok) {
10822
- throw new Error("PlattarQR._ShortenURL() - response was invalid");
10823
- }
10824
- return response.json();
10825
- }).then(function (json) {
10826
- return accept(json.data.attributes.url);
10827
- })["catch"](function () {
10828
- return reject(new Error("PlattarQR._ShortenURL() - there was an unexpected issue generating short url"));
10829
- });
10830
- } catch (err) {
10831
- return reject(err);
10832
- }
10833
- });
10834
- }
10835
- }]);
10836
- }(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
10837
- module.exports = BaseElement;
10838
- }, {
10839
- "object-hash": 146,
10840
- "qr-code-styling": 148
10841
- }],
10842
- 116: [function (require, module, exports) {
10843
- var BaseElement = require("./base/base-element.js");
10844
- var QRCodeElement = /*#__PURE__*/function (_BaseElement) {
10845
- function QRCodeElement() {
10846
- _classCallCheck(this, QRCodeElement);
10847
- return _callSuper(this, QRCodeElement);
10848
- }
10849
- _inherits(QRCodeElement, _BaseElement);
10850
- return _createClass(QRCodeElement);
10851
- }(BaseElement);
10852
- module.exports = QRCodeElement;
10853
- }, {
10854
- "./base/base-element.js": 115
10855
- }],
10856
- 117: [function (require, module, exports) {
10857
- "use strict";
10858
-
10859
- var QRCodeElement = require("./elements/qrcode-element.js");
10860
- var Version = require("./version");
10861
- if (customElements) {
10862
- if (customElements.get("plattar-qrcode") === undefined) {
10863
- customElements.define("plattar-qrcode", QRCodeElement);
10864
- }
10865
- }
10866
- console.log("using @plattar/plattar-qrcode v" + Version);
10867
- module.exports = {
10868
- version: Version
10869
- };
10870
- }, {
10871
- "./elements/qrcode-element.js": 116,
10872
- "./version": 118
10873
- }],
10874
- 118: [function (require, module, exports) {
10875
- arguments[4][114][0].apply(exports, arguments);
10876
- }, {
10877
- "dup": 114
10878
- }],
10879
- 119: [function (require, module, exports) {
10880
- "use strict";
10881
-
10882
- var __importDefault = this && this.__importDefault || function (mod) {
10883
- return mod && mod.__esModule ? mod : {
10884
- "default": mod
10885
- };
10886
- };
10887
- Object.defineProperty(exports, "__esModule", {
10888
- value: true
10889
- });
10890
- exports.Configurator = void 0;
10891
- var plattar_api_1 = require("@plattar/plattar-api");
10892
- var object_hash_1 = __importDefault(require("object-hash"));
10893
- var remote_request_1 = require("./remote-request");
10894
- var Configurator = /*#__PURE__*/function () {
10895
- function Configurator() {
10896
- _classCallCheck(this, Configurator);
10897
- _defineProperty(this, "_maps", void 0);
10898
- _defineProperty(this, "_attrHash", void 0);
10899
- _defineProperty(this, "quality", 100);
10900
- _defineProperty(this, "output", "glb");
10901
- _defineProperty(this, "server", "production");
10902
- _defineProperty(this, "retry", 0);
10903
- this._maps = [];
10904
- this._attrHash = [];
10905
- }
10906
- return _createClass(Configurator, [{
10907
- key: "add",
10908
- value: function add() {
10909
- var sceneProduct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
10910
- var productVariation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
10911
- this.addSceneProduct(sceneProduct, productVariation);
10912
- }
10913
- }, {
10914
- key: "addSceneProduct",
10915
- value: function addSceneProduct() {
10916
- var sceneProduct = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
10917
- var productVariation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
10918
- if (!sceneProduct) {
10919
- throw new Error("Configurator.addSceneProduct() - sceneProduct input was null or undefined");
10920
- }
10921
- if (!productVariation) {
10922
- throw new Error("Configurator.addSceneProduct() - productVariation input was null or undefined");
10923
- }
10924
- var map = {
10925
- sceneproduct: null,
10926
- productvariation: null
10927
- };
10928
- if (sceneProduct instanceof plattar_api_1.SceneProduct && productVariation instanceof plattar_api_1.ProductVariation) {
10929
- map.sceneproduct = sceneProduct.id;
10930
- map.productvariation = productVariation.id;
10931
- this._maps.push(map);
10932
- return;
10933
- }
10934
- if ((typeof sceneProduct === "string" || sceneProduct instanceof String) && (typeof productVariation === "string" || productVariation instanceof String)) {
10935
- map.sceneproduct = sceneProduct;
10936
- map.productvariation = productVariation;
10937
- this._maps.push(map);
10938
- return;
10939
- }
10940
- throw new Error("Configurator.addSceneProduct() - mismatched instance types for inputs");
10941
- }
10942
- }, {
10943
- key: "addProduct",
10944
- value: function addProduct() {
10945
- var product = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
10946
- var productVariation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
10947
- if (!product) {
10948
- throw new Error("Configurator.addProduct() - product input was null or undefined");
10949
- }
10950
- if (!productVariation) {
10951
- throw new Error("Configurator.addProduct() - productVariation input was null or undefined");
10952
- }
10953
- var map = {
10954
- productvariation: null,
10955
- product: null
10956
- };
10957
- if (product instanceof plattar_api_1.Product && productVariation instanceof plattar_api_1.ProductVariation) {
10958
- map.product = product.id;
10959
- map.productvariation = productVariation.id;
10960
- this._maps.push(map);
10961
- return;
10962
- }
10963
- if ((typeof product === "string" || product instanceof String) && (typeof productVariation === "string" || productVariation instanceof String)) {
10964
- map.product = product;
10965
- map.productvariation = productVariation;
10966
- this._maps.push(map);
10967
- return;
10968
- }
10969
- throw new Error("Configurator.addProduct() - mismatched instance types for inputs");
10970
- }
10971
- }, {
10972
- key: "addModel",
10973
- value: function addModel() {
10974
- var sceneModel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
10975
- if (!sceneModel) {
10976
- throw new Error("Configurator.addModel() - sceneModel input was null or undefined");
10977
- }
10978
- var map = {
10979
- scenemodel: null
10980
- };
10981
- if (sceneModel instanceof plattar_api_1.SceneModel) {
10982
- map.scenemodel = sceneModel.id;
10983
- this._maps.push(map);
10984
- return;
10985
- }
10986
- if (typeof sceneModel === "string") {
10987
- map.scenemodel = sceneModel;
10988
- this._maps.push(map);
10989
- return;
10990
- }
10991
- throw new Error("Configurator.addModel() - mismatched instance types for inputs");
10992
- }
10993
- }, {
10994
- key: "get",
10995
- value: function get() {
10996
- var _this65 = this;
10997
- return new Promise(function (accept, reject) {
10998
- _this65._CalculateHash().then(function () {
10999
- remote_request_1.RemoteRequest.request(_this65._GetPayload(), _this65.retry < 0 ? 0 : _this65.retry).then(accept)["catch"](reject);
11000
- })["catch"](function (_err) {
11001
- reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
11002
- });
11003
- });
11004
- }
11005
- }, {
11006
- key: "_CalculateHash",
11007
- value: function _CalculateHash() {
11008
- var _this66 = this;
11009
- return new Promise(function (accept, reject) {
11010
- var promises = [];
11011
- var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
11012
- plattar_api_1.Server.create(plattar_api_1.Server.match(_this66.server));
11013
- _this66._maps.forEach(function (map) {
11014
- if (map.productvariation) {
11015
- promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
11016
- }
11017
- if (map.sceneproduct) {
11018
- promises.push(new plattar_api_1.SceneProduct(map.sceneproduct).get());
11019
- }
11020
- if (map.scenemodel) {
11021
- promises.push(new plattar_api_1.SceneModel(map.scenemodel).get());
11022
- }
11023
- if (map.product) {
11024
- promises.push(new plattar_api_1.Product(map.product).get());
11025
- }
11026
- });
11027
- Promise.all(promises).then(function (values) {
11028
- values.forEach(function (value) {
11029
- _this66._attrHash.push(value.attributes);
11030
- });
11031
- // reset server back
11032
- plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
11033
- accept();
11034
- })["catch"](function () {
11035
- // reset server back
11036
- plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
11037
- reject(new Error("Configurator._CalculateHash() - unexpected error"));
11038
- });
11039
- });
11040
- }
11041
- }, {
11042
- key: "_GetPayload",
11043
- value: function _GetPayload() {
11044
- var converter = this.output === "vto" ? "config_to_reality" : "config_to_model";
11045
- var load = {
11046
- options: {
11047
- converter: converter,
11048
- quality: this.quality,
11049
- output: this.output,
11050
- server: this.server
11051
- },
11052
- data: {
11053
- maps: this._maps
11054
- }
11055
- };
11056
- if (this._attrHash.length > 0) {
11057
- load.options.hash = object_hash_1["default"].MD5(this._attrHash) + object_hash_1["default"].MD5(load);
11058
- } else {
11059
- load.options.hash = object_hash_1["default"].MD5(load);
11060
- }
11061
- return load;
11062
- }
11063
- }]);
11064
- }();
11065
- exports.Configurator = Configurator;
11066
- }, {
11067
- "./remote-request": 121,
11068
- "@plattar/plattar-api": 48,
11069
- "object-hash": 146
11070
- }],
11071
- 120: [function (require, module, exports) {
11072
- "use strict";
11073
-
11074
- var __importDefault = this && this.__importDefault || function (mod) {
11075
- return mod && mod.__esModule ? mod : {
11076
- "default": mod
11077
- };
11078
- };
11079
- Object.defineProperty(exports, "__esModule", {
11080
- value: true
11081
- });
11082
- exports.ModelConverter = void 0;
11083
- var plattar_api_1 = require("@plattar/plattar-api");
11084
- var object_hash_1 = __importDefault(require("object-hash"));
11085
- var remote_request_1 = require("./remote-request");
11086
- var ModelConverter = /*#__PURE__*/function () {
11087
- function ModelConverter() {
11088
- _classCallCheck(this, ModelConverter);
11089
- _defineProperty(this, "_attrHash", void 0);
11090
- _defineProperty(this, "_model", null);
11091
- _defineProperty(this, "quality", 100);
11092
- _defineProperty(this, "output", "glb");
11093
- _defineProperty(this, "server", "production");
11094
- _defineProperty(this, "retry", 0);
11095
- this._attrHash = [];
11096
- }
11097
- return _createClass(ModelConverter, [{
11098
- key: "model",
11099
- get: function get() {
11100
- return this._model;
11101
- },
11102
- set: function set(newModel) {
11103
- if (!newModel) {
11104
- return;
11105
- }
11106
- if (newModel instanceof plattar_api_1.FileModel) {
11107
- this._model = newModel.id;
11108
- this._attrHash.push(object_hash_1["default"].MD5(newModel.attributes));
11109
- return;
11110
- }
11111
- this._model = newModel;
11112
- }
11113
- }, {
11114
- key: "get",
11115
- value: function get() {
11116
- var _this67 = this;
11117
- return new Promise(function (accept, reject) {
11118
- if (!_this67._model) {
11119
- return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
11120
- }
11121
- remote_request_1.RemoteRequest.request(_this67._Payload, _this67.retry < 0 ? 0 : _this67.retry).then(accept)["catch"](reject);
11122
- });
11123
- }
11124
- }, {
11125
- key: "_Payload",
11126
- get: function get() {
11127
- var load = {
11128
- options: {
11129
- converter: "gltf_to_model",
11130
- quality: this.quality,
11131
- output: this.output,
11132
- server: this.server
11133
- },
11134
- data: {
11135
- model: this._model
11136
- }
11137
- };
11138
- if (this._attrHash.length > 0) {
11139
- load.options.hash = object_hash_1["default"].MD5(this._attrHash) + object_hash_1["default"].MD5(load);
11140
- } else {
11141
- load.options.hash = object_hash_1["default"].MD5(load);
11142
- }
11143
- return load;
11144
- }
11145
- }]);
11146
- }();
11147
- exports.ModelConverter = ModelConverter;
11148
- }, {
11149
- "./remote-request": 121,
11150
- "@plattar/plattar-api": 48,
11151
- "object-hash": 146
11152
- }],
11153
- 121: [function (require, module, exports) {
11154
- "use strict";
11155
-
11156
- Object.defineProperty(exports, "__esModule", {
11157
- value: true
11158
- });
11159
- exports.RemoteRequest = void 0;
11160
- /**
11161
- * This is used by the core types to perform remote requests
11162
- */
11163
- var RemoteRequest = /*#__PURE__*/function () {
11164
- function RemoteRequest() {
11165
- _classCallCheck(this, RemoteRequest);
11166
- }
11167
- return _createClass(RemoteRequest, null, [{
11168
- key: "request",
11169
- value: function request(payload) {
11170
- var retry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
11171
- return new Promise(function (accept, reject) {
11172
- if (retry >= 0) {
11173
- RemoteRequest._send(payload).then(accept)["catch"](function (err) {
11174
- var newretry = retry - 1;
11175
- if (newretry < 0) {
11176
- return reject(err);
11177
- }
11178
- console.error("RemoteRequest.request() - retry number " + newretry);
11179
- console.error(err);
11180
- setTimeout(function () {
11181
- RemoteRequest.request(payload, newretry).then(accept)["catch"](reject);
11182
- }, 500);
11183
- });
11184
- } else {
11185
- return reject(new Error("RemoteRequest.request() - attempted all retries without success"));
11186
- }
11187
- });
10844
+ this._qrCode.update(this._options);
10845
+ this._UpdateCanvas(width, height);
10846
+ }
10847
+ }
10848
+ }, {
10849
+ key: "_IsFetchAPISupported",
10850
+ value: function _IsFetchAPISupported() {
10851
+ return "fetch" in window;
11188
10852
  }
11189
10853
  }, {
11190
- key: "_send",
11191
- value: function _send(payload) {
10854
+ key: "_ShortenURL",
10855
+ value: function _ShortenURL(url) {
10856
+ var _this64 = this;
11192
10857
  return new Promise(function (accept, reject) {
11193
- var endpoint = payload.options.server === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://3gbnq7wuw2.execute-api.ap-southeast-2.amazonaws.com/main/xrutils";
11194
- var reqopts = {
11195
- method: "POST",
11196
- headers: {
11197
- 'Accept': 'application/json',
11198
- 'Content-Type': 'application/json'
11199
- },
11200
- body: JSON.stringify(payload)
11201
- };
11202
- fetch(endpoint, reqopts).then(function (res) {
11203
- if (res.ok) {
11204
- try {
11205
- return res.json();
11206
- } catch (err) {
11207
- return new Error("RemoteRequest.request() - critical error occured, cannot proceed");
10858
+ if (!_this64._IsFetchAPISupported()) {
10859
+ return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
10860
+ }
10861
+ try {
10862
+ var b64Link = btoa(url);
10863
+ var serverType = _this64.hasAttribute("server") ? _this64.getAttribute("server") : "production";
10864
+ fetch(serverType === "staging" ? "https://c.plattar.space/shorten" : "https://c.plattar.com/shorten", {
10865
+ cache: "no-store",
10866
+ method: "POST",
10867
+ headers: {
10868
+ "Content-Type": "application/json"
10869
+ },
10870
+ body: JSON.stringify({
10871
+ data: {
10872
+ attributes: {
10873
+ url: b64Link,
10874
+ isBase64: true
10875
+ }
10876
+ }
10877
+ })
10878
+ }).then(function (response) {
10879
+ if (!response.ok) {
10880
+ throw new Error("PlattarQR._ShortenURL() - response was invalid");
11208
10881
  }
11209
- }
11210
- return new Error("RemoteRequest.request() - unexpected error occured, cannot proceed. error message is " + res.statusText);
11211
- }).then(function (json) {
11212
- if (json instanceof Error) {
11213
- reject(json);
11214
- } else {
11215
- accept(json);
11216
- }
11217
- });
10882
+ return response.json();
10883
+ }).then(function (json) {
10884
+ return accept(json.data.attributes.url);
10885
+ })["catch"](function () {
10886
+ return reject(new Error("PlattarQR._ShortenURL() - there was an unexpected issue generating short url"));
10887
+ });
10888
+ } catch (err) {
10889
+ return reject(err);
10890
+ }
11218
10891
  });
11219
10892
  }
11220
10893
  }]);
11221
- }();
11222
- exports.RemoteRequest = RemoteRequest;
11223
- }, {}],
11224
- 122: [function (require, module, exports) {
10894
+ }(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
10895
+ module.exports = BaseElement;
10896
+ }, {
10897
+ "object-hash": 141,
10898
+ "qr-code-styling": 143
10899
+ }],
10900
+ 116: [function (require, module, exports) {
10901
+ var BaseElement = require("./base/base-element.js");
10902
+ var QRCodeElement = /*#__PURE__*/function (_BaseElement) {
10903
+ function QRCodeElement() {
10904
+ _classCallCheck(this, QRCodeElement);
10905
+ return _callSuper(this, QRCodeElement);
10906
+ }
10907
+ _inherits(QRCodeElement, _BaseElement);
10908
+ return _createClass(QRCodeElement);
10909
+ }(BaseElement);
10910
+ module.exports = QRCodeElement;
10911
+ }, {
10912
+ "./base/base-element.js": 115
10913
+ }],
10914
+ 117: [function (require, module, exports) {
11225
10915
  "use strict";
11226
10916
 
11227
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
11228
- if (k2 === undefined) k2 = k;
11229
- var desc = Object.getOwnPropertyDescriptor(m, k);
11230
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11231
- desc = {
11232
- enumerable: true,
11233
- get: function get() {
11234
- return m[k];
11235
- }
11236
- };
10917
+ var QRCodeElement = require("./elements/qrcode-element.js");
10918
+ var Version = require("./version");
10919
+ if (customElements) {
10920
+ if (customElements.get("plattar-qrcode") === undefined) {
10921
+ customElements.define("plattar-qrcode", QRCodeElement);
11237
10922
  }
11238
- Object.defineProperty(o, k2, desc);
11239
- } : function (o, m, k, k2) {
11240
- if (k2 === undefined) k2 = k;
11241
- o[k2] = m[k];
11242
- });
11243
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
11244
- Object.defineProperty(o, "default", {
11245
- enumerable: true,
11246
- value: v
11247
- });
11248
- } : function (o, v) {
11249
- o["default"] = v;
11250
- });
11251
- var __importStar = this && this.__importStar || function () {
11252
- var _ownKeys3 = function ownKeys(o) {
11253
- _ownKeys3 = Object.getOwnPropertyNames || function (o) {
11254
- var ar = [];
11255
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
11256
- return ar;
11257
- };
11258
- return _ownKeys3(o);
11259
- };
11260
- return function (mod) {
11261
- if (mod && mod.__esModule) return mod;
11262
- var result = {};
11263
- if (mod != null) for (var k = _ownKeys3(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
11264
- __setModuleDefault(result, mod);
11265
- return result;
11266
- };
11267
- }();
11268
- var __importDefault = this && this.__importDefault || function (mod) {
11269
- return mod && mod.__esModule ? mod : {
11270
- "default": mod
11271
- };
10923
+ }
10924
+ console.log("using @plattar/plattar-qrcode v" + Version);
10925
+ module.exports = {
10926
+ version: Version
11272
10927
  };
11273
- Object.defineProperty(exports, "__esModule", {
11274
- value: true
11275
- });
11276
- exports.version = exports.ModelConverter = exports.Configurator = void 0;
11277
- var configurator_1 = require("./core/configurator");
11278
- Object.defineProperty(exports, "Configurator", {
11279
- enumerable: true,
11280
- get: function get() {
11281
- return configurator_1.Configurator;
11282
- }
11283
- });
11284
- var model_converter_1 = require("./core/model-converter");
11285
- Object.defineProperty(exports, "ModelConverter", {
11286
- enumerable: true,
11287
- get: function get() {
11288
- return model_converter_1.ModelConverter;
11289
- }
11290
- });
11291
- exports.version = __importStar(require("./version"));
11292
- var version_1 = __importDefault(require("./version"));
11293
- console.log("using @plattar/plattar-services v" + version_1["default"]);
11294
10928
  }, {
11295
- "./core/configurator": 119,
11296
- "./core/model-converter": 120,
11297
- "./version": 123
10929
+ "./elements/qrcode-element.js": 116,
10930
+ "./version": 118
10931
+ }],
10932
+ 118: [function (require, module, exports) {
10933
+ arguments[4][114][0].apply(exports, arguments);
10934
+ }, {
10935
+ "dup": 114
11298
10936
  }],
11299
- 123: [function (require, module, exports) {
11300
- "use strict";
11301
-
11302
- Object.defineProperty(exports, "__esModule", {
11303
- value: true
11304
- });
11305
- exports["default"] = "2.7.2";
11306
- }, {}],
11307
- 124: [function (require, module, exports) {
10937
+ 119: [function (require, module, exports) {
11308
10938
  var BaseElement = require("./base/base-element.js");
11309
10939
  var AdhocElement = /*#__PURE__*/function (_BaseElement2) {
11310
10940
  function AdhocElement() {
@@ -11371,9 +11001,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11371
11001
  }(BaseElement);
11372
11002
  module.exports = AdhocElement;
11373
11003
  }, {
11374
- "./base/base-element.js": 125
11004
+ "./base/base-element.js": 120
11375
11005
  }],
11376
- 125: [function (require, module, exports) {
11006
+ 120: [function (require, module, exports) {
11377
11007
  var Util = require("../../util/util");
11378
11008
  var ElementController = require("../controllers/element-controller");
11379
11009
  var _require = require("@plattar/context-messenger"),
@@ -11502,18 +11132,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11502
11132
  }, {
11503
11133
  key: "allMappedAttributes",
11504
11134
  get: function get() {
11505
- var _this68 = this;
11135
+ var _this65 = this;
11506
11136
  var map = new Map();
11507
11137
  var coreAttr = this.coreAttributes;
11508
11138
  var optAttr = this.optionalAttributes;
11509
11139
  coreAttr.forEach(function (ele) {
11510
- if (_this68.hasAttribute(ele.key)) {
11511
- map.set(ele.map, _this68.getAttribute(ele.key));
11140
+ if (_this65.hasAttribute(ele.key)) {
11141
+ map.set(ele.map, _this65.getAttribute(ele.key));
11512
11142
  }
11513
11143
  });
11514
11144
  optAttr.forEach(function (ele) {
11515
- if (_this68.hasAttribute(ele.key)) {
11516
- map.set(ele.map, _this68.getAttribute(ele.key));
11145
+ if (_this65.hasAttribute(ele.key)) {
11146
+ map.set(ele.map, _this65.getAttribute(ele.key));
11517
11147
  }
11518
11148
  });
11519
11149
  return map;
@@ -11567,11 +11197,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11567
11197
  }(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
11568
11198
  module.exports = BaseElement;
11569
11199
  }, {
11570
- "../../util/util": 140,
11571
- "../controllers/element-controller": 127,
11200
+ "../../util/util": 135,
11201
+ "../controllers/element-controller": 122,
11572
11202
  "@plattar/context-messenger": 25
11573
11203
  }],
11574
- 126: [function (require, module, exports) {
11204
+ 121: [function (require, module, exports) {
11575
11205
  var BaseElement = require("./base/base-element.js");
11576
11206
  var ConfiguratorElement = /*#__PURE__*/function (_BaseElement3) {
11577
11207
  function ConfiguratorElement() {
@@ -11630,16 +11260,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11630
11260
  }(BaseElement);
11631
11261
  module.exports = ConfiguratorElement;
11632
11262
  }, {
11633
- "./base/base-element.js": 125
11263
+ "./base/base-element.js": 120
11634
11264
  }],
11635
- 127: [function (require, module, exports) {
11265
+ 122: [function (require, module, exports) {
11636
11266
  var Util = require("../../util/util.js");
11637
11267
  var _require2 = require("@plattar/context-messenger"),
11638
11268
  messenger = _require2.messenger;
11639
11269
  var IFrameController = require("./iframe-controller.js");
11640
11270
  var ElementController = /*#__PURE__*/function () {
11641
11271
  function ElementController(element) {
11642
- var _this69 = this;
11272
+ var _this66 = this;
11643
11273
  _classCallCheck(this, ElementController);
11644
11274
  this._element = element;
11645
11275
 
@@ -11652,7 +11282,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11652
11282
  var mutation = _step8.value;
11653
11283
  if (mutation.type === 'attributes' && element.usesAttribute(mutation.attributeName)) {
11654
11284
  if (element.hasAllCoreAttributes) {
11655
- _this69._load();
11285
+ _this66._load();
11656
11286
  }
11657
11287
  }
11658
11288
  }
@@ -11730,15 +11360,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11730
11360
  }();
11731
11361
  module.exports = ElementController;
11732
11362
  }, {
11733
- "../../util/util.js": 140,
11734
- "./iframe-controller.js": 128,
11363
+ "../../util/util.js": 135,
11364
+ "./iframe-controller.js": 123,
11735
11365
  "@plattar/context-messenger": 25
11736
11366
  }],
11737
- 128: [function (require, module, exports) {
11367
+ 123: [function (require, module, exports) {
11738
11368
  var Util = require("../../util/util.js");
11739
11369
  var IFrameController = /*#__PURE__*/function () {
11740
11370
  function IFrameController(element, src, id) {
11741
- var _this70 = this;
11371
+ var _this67 = this;
11742
11372
  var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
11743
11373
  _classCallCheck(this, IFrameController);
11744
11374
  this._iframe = document.createElement("iframe");
@@ -11748,7 +11378,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11748
11378
  if (!element.hasAttribute("sameorigin")) {
11749
11379
  this._iframe.onload = function () {
11750
11380
  if (onelemload) {
11751
- onelemload(_this70._iframe);
11381
+ onelemload(_this67._iframe);
11752
11382
  }
11753
11383
  };
11754
11384
  }
@@ -11830,9 +11460,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11830
11460
  }();
11831
11461
  module.exports = IFrameController;
11832
11462
  }, {
11833
- "../../util/util.js": 140
11463
+ "../../util/util.js": 135
11834
11464
  }],
11835
- 129: [function (require, module, exports) {
11465
+ 124: [function (require, module, exports) {
11836
11466
  var BaseElement = require("./base/base-element.js");
11837
11467
  var EditorElement = /*#__PURE__*/function (_BaseElement4) {
11838
11468
  function EditorElement() {
@@ -11854,9 +11484,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11854
11484
  }(BaseElement);
11855
11485
  module.exports = EditorElement;
11856
11486
  }, {
11857
- "./base/base-element.js": 125
11487
+ "./base/base-element.js": 120
11858
11488
  }],
11859
- 130: [function (require, module, exports) {
11489
+ 125: [function (require, module, exports) {
11860
11490
  var BaseElement = require("./base/base-element.js");
11861
11491
  var EWallElement = /*#__PURE__*/function (_BaseElement5) {
11862
11492
  function EWallElement() {
@@ -11878,9 +11508,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11878
11508
  }(BaseElement);
11879
11509
  module.exports = EWallElement;
11880
11510
  }, {
11881
- "./base/base-element.js": 125
11511
+ "./base/base-element.js": 120
11882
11512
  }],
11883
- 131: [function (require, module, exports) {
11513
+ 126: [function (require, module, exports) {
11884
11514
  var BaseElement = require("./base/base-element.js");
11885
11515
  var FaceARElement = /*#__PURE__*/function (_BaseElement6) {
11886
11516
  function FaceARElement() {
@@ -11922,9 +11552,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11922
11552
  }(BaseElement);
11923
11553
  module.exports = FaceARElement;
11924
11554
  }, {
11925
- "./base/base-element.js": 125
11555
+ "./base/base-element.js": 120
11926
11556
  }],
11927
- 132: [function (require, module, exports) {
11557
+ 127: [function (require, module, exports) {
11928
11558
  var BaseElement = require("./base/base-element.js");
11929
11559
  var GalleryElement = /*#__PURE__*/function (_BaseElement7) {
11930
11560
  function GalleryElement() {
@@ -11951,9 +11581,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
11951
11581
  }(BaseElement);
11952
11582
  module.exports = GalleryElement;
11953
11583
  }, {
11954
- "./base/base-element.js": 125
11584
+ "./base/base-element.js": 120
11955
11585
  }],
11956
- 133: [function (require, module, exports) {
11586
+ 128: [function (require, module, exports) {
11957
11587
  var BaseElement = require("./base/base-element.js");
11958
11588
  var LauncherElement = /*#__PURE__*/function (_BaseElement8) {
11959
11589
  function LauncherElement() {
@@ -12010,9 +11640,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12010
11640
  }(BaseElement);
12011
11641
  module.exports = LauncherElement;
12012
11642
  }, {
12013
- "./base/base-element.js": 125
11643
+ "./base/base-element.js": 120
12014
11644
  }],
12015
- 134: [function (require, module, exports) {
11645
+ 129: [function (require, module, exports) {
12016
11646
  var BaseElement = require("./base/base-element.js");
12017
11647
  var ModelElement = /*#__PURE__*/function (_BaseElement9) {
12018
11648
  function ModelElement() {
@@ -12053,9 +11683,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12053
11683
  }(BaseElement);
12054
11684
  module.exports = ModelElement;
12055
11685
  }, {
12056
- "./base/base-element.js": 125
11686
+ "./base/base-element.js": 120
12057
11687
  }],
12058
- 135: [function (require, module, exports) {
11688
+ 130: [function (require, module, exports) {
12059
11689
  var BaseElement = require("./base/base-element.js");
12060
11690
  var ProductElement = /*#__PURE__*/function (_BaseElement0) {
12061
11691
  function ProductElement() {
@@ -12099,9 +11729,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12099
11729
  }(BaseElement);
12100
11730
  module.exports = ProductElement;
12101
11731
  }, {
12102
- "./base/base-element.js": 125
11732
+ "./base/base-element.js": 120
12103
11733
  }],
12104
- 136: [function (require, module, exports) {
11734
+ 131: [function (require, module, exports) {
12105
11735
  var BaseElement = require("./base/base-element.js");
12106
11736
  var StudioElement = /*#__PURE__*/function (_BaseElement1) {
12107
11737
  function StudioElement() {
@@ -12134,9 +11764,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12134
11764
  }(BaseElement);
12135
11765
  module.exports = StudioElement;
12136
11766
  }, {
12137
- "./base/base-element.js": 125
11767
+ "./base/base-element.js": 120
12138
11768
  }],
12139
- 137: [function (require, module, exports) {
11769
+ 132: [function (require, module, exports) {
12140
11770
  var BaseElement = require("./base/base-element.js");
12141
11771
  var ViewerElement = /*#__PURE__*/function (_BaseElement10) {
12142
11772
  function ViewerElement() {
@@ -12175,9 +11805,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12175
11805
  }(BaseElement);
12176
11806
  module.exports = ViewerElement;
12177
11807
  }, {
12178
- "./base/base-element.js": 125
11808
+ "./base/base-element.js": 120
12179
11809
  }],
12180
- 138: [function (require, module, exports) {
11810
+ 133: [function (require, module, exports) {
12181
11811
  var BaseElement = require("./base/base-element.js");
12182
11812
  var WebXRElement = /*#__PURE__*/function (_BaseElement11) {
12183
11813
  function WebXRElement() {
@@ -12199,9 +11829,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12199
11829
  }(BaseElement);
12200
11830
  module.exports = WebXRElement;
12201
11831
  }, {
12202
- "./base/base-element.js": 125
11832
+ "./base/base-element.js": 120
12203
11833
  }],
12204
- 139: [function (require, module, exports) {
11834
+ 134: [function (require, module, exports) {
12205
11835
  "use strict";
12206
11836
 
12207
11837
  var WebXRElement = require("./elements/webxr-element.js");
@@ -12258,21 +11888,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12258
11888
  version: Version
12259
11889
  };
12260
11890
  }, {
12261
- "./elements/adhoc-element.js": 124,
12262
- "./elements/configurator-element.js": 126,
12263
- "./elements/editor-element.js": 129,
12264
- "./elements/ewall-element.js": 130,
12265
- "./elements/facear-element.js": 131,
12266
- "./elements/gallery-element.js": 132,
12267
- "./elements/launcher-element.js": 133,
12268
- "./elements/model-element.js": 134,
12269
- "./elements/product-element.js": 135,
12270
- "./elements/studio-element.js": 136,
12271
- "./elements/viewer-element.js": 137,
12272
- "./elements/webxr-element.js": 138,
12273
- "./version": 141
11891
+ "./elements/adhoc-element.js": 119,
11892
+ "./elements/configurator-element.js": 121,
11893
+ "./elements/editor-element.js": 124,
11894
+ "./elements/ewall-element.js": 125,
11895
+ "./elements/facear-element.js": 126,
11896
+ "./elements/gallery-element.js": 127,
11897
+ "./elements/launcher-element.js": 128,
11898
+ "./elements/model-element.js": 129,
11899
+ "./elements/product-element.js": 130,
11900
+ "./elements/studio-element.js": 131,
11901
+ "./elements/viewer-element.js": 132,
11902
+ "./elements/webxr-element.js": 133,
11903
+ "./version": 136
12274
11904
  }],
12275
- 140: [function (require, module, exports) {
11905
+ 135: [function (require, module, exports) {
12276
11906
  var Util = /*#__PURE__*/function () {
12277
11907
  function Util() {
12278
11908
  _classCallCheck(this, Util);
@@ -12344,10 +11974,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12344
11974
  }();
12345
11975
  module.exports = Util;
12346
11976
  }, {}],
12347
- 141: [function (require, module, exports) {
11977
+ 136: [function (require, module, exports) {
12348
11978
  module.exports = "2.7.2";
12349
11979
  }, {}],
12350
- 142: [function (require, module, exports) {
11980
+ 137: [function (require, module, exports) {
12351
11981
  'use strict';
12352
11982
 
12353
11983
  exports.byteLength = byteLength;
@@ -12453,7 +12083,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
12453
12083
  return parts.join('');
12454
12084
  }
12455
12085
  }, {}],
12456
- 143: [function (require, module, exports) {
12086
+ 138: [function (require, module, exports) {
12457
12087
  (function (Buffer) {
12458
12088
  (function () {
12459
12089
  /*!
@@ -13951,11 +13581,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
13951
13581
  }).call(this);
13952
13582
  }).call(this, require("buffer").Buffer);
13953
13583
  }, {
13954
- "base64-js": 142,
13955
- "buffer": 143,
13956
- "ieee754": 144
13584
+ "base64-js": 137,
13585
+ "buffer": 138,
13586
+ "ieee754": 139
13957
13587
  }],
13958
- 144: [function (require, module, exports) {
13588
+ 139: [function (require, module, exports) {
13959
13589
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
13960
13590
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
13961
13591
  var e, m;
@@ -14031,7 +13661,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
14031
13661
  buffer[offset + i - d] |= s * 128;
14032
13662
  };
14033
13663
  }, {}],
14034
- 145: [function (require, module, exports) {
13664
+ 140: [function (require, module, exports) {
14035
13665
  (function (global) {
14036
13666
  (function () {
14037
13667
  "use strict";
@@ -14065,7 +13695,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
14065
13695
  }).call(this);
14066
13696
  }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
14067
13697
  }, {}],
14068
- 146: [function (require, module, exports) {
13698
+ 141: [function (require, module, exports) {
14069
13699
  (function (global) {
14070
13700
  (function () {
14071
13701
  !function (e) {
@@ -15065,7 +14695,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
15065
14695
  }).call(this);
15066
14696
  }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
15067
14697
  }, {}],
15068
- 147: [function (require, module, exports) {
14698
+ 142: [function (require, module, exports) {
15069
14699
  // shim for using process in browser
15070
14700
  var process = module.exports = {};
15071
14701
 
@@ -15242,7 +14872,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
15242
14872
  return 0;
15243
14873
  };
15244
14874
  }, {}],
15245
- 148: [function (require, module, exports) {
14875
+ 143: [function (require, module, exports) {
15246
14876
  (function (Buffer) {
15247
14877
  (function () {
15248
14878
  !function (t, e) {
@@ -15254,8 +14884,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
15254
14884
  var i,
15255
14885
  r,
15256
14886
  n = function () {
15257
- var t = function t(_t34, e) {
15258
- var i = _t34,
14887
+ var t = function t(_t35, e) {
14888
+ var i = _t35,
15259
14889
  r = s[e],
15260
14890
  n = null,
15261
14891
  o = 0,
@@ -16067,8 +15697,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16067
15697
  return $;
16068
15698
  }
16069
15699
  });
16070
- var t = function t(_t35) {
16071
- return !!_t35 && "object" == _typeof(_t35) && !Array.isArray(_t35);
15700
+ var t = function t(_t36) {
15701
+ return !!_t36 && "object" == _typeof(_t36) && !Array.isArray(_t36);
16072
15702
  };
16073
15703
  function e(i) {
16074
15704
  for (var _len10 = arguments.length, r = new Array(_len10 > 1 ? _len10 - 1 : 0), _key10 = 1; _key10 < _len10; _key10++) {
@@ -16147,78 +15777,78 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16147
15777
  }, {
16148
15778
  key: "_basicDot",
16149
15779
  value: function _basicDot(t) {
16150
- var _this71 = this;
15780
+ var _this68 = this;
16151
15781
  var e = t.size,
16152
15782
  i = t.x,
16153
15783
  r = t.y;
16154
15784
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16155
15785
  draw: function draw() {
16156
- _this71._element = _this71._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), _this71._element.setAttribute("cx", String(i + e / 2)), _this71._element.setAttribute("cy", String(r + e / 2)), _this71._element.setAttribute("r", String(e / 2));
15786
+ _this68._element = _this68._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), _this68._element.setAttribute("cx", String(i + e / 2)), _this68._element.setAttribute("cy", String(r + e / 2)), _this68._element.setAttribute("r", String(e / 2));
16157
15787
  }
16158
15788
  }));
16159
15789
  }
16160
15790
  }, {
16161
15791
  key: "_basicSquare",
16162
15792
  value: function _basicSquare(t) {
16163
- var _this72 = this;
15793
+ var _this69 = this;
16164
15794
  var e = t.size,
16165
15795
  i = t.x,
16166
15796
  r = t.y;
16167
15797
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16168
15798
  draw: function draw() {
16169
- _this72._element = _this72._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), _this72._element.setAttribute("x", String(i)), _this72._element.setAttribute("y", String(r)), _this72._element.setAttribute("width", String(e)), _this72._element.setAttribute("height", String(e));
15799
+ _this69._element = _this69._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), _this69._element.setAttribute("x", String(i)), _this69._element.setAttribute("y", String(r)), _this69._element.setAttribute("width", String(e)), _this69._element.setAttribute("height", String(e));
16170
15800
  }
16171
15801
  }));
16172
15802
  }
16173
15803
  }, {
16174
15804
  key: "_basicSideRounded",
16175
15805
  value: function _basicSideRounded(t) {
16176
- var _this73 = this;
15806
+ var _this70 = this;
16177
15807
  var e = t.size,
16178
15808
  i = t.x,
16179
15809
  r = t.y;
16180
15810
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16181
15811
  draw: function draw() {
16182
- _this73._element = _this73._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this73._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ") + e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, 0 ").concat(-e));
15812
+ _this70._element = _this70._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this70._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ") + e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, 0 ").concat(-e));
16183
15813
  }
16184
15814
  }));
16185
15815
  }
16186
15816
  }, {
16187
15817
  key: "_basicCornerRounded",
16188
15818
  value: function _basicCornerRounded(t) {
16189
- var _this74 = this;
15819
+ var _this71 = this;
16190
15820
  var e = t.size,
16191
15821
  i = t.x,
16192
15822
  r = t.y;
16193
15823
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16194
15824
  draw: function draw() {
16195
- _this74._element = _this74._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this74._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "v ") + -e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(-e / 2, " ").concat(-e / 2));
15825
+ _this71._element = _this71._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this71._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "v ") + -e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(-e / 2, " ").concat(-e / 2));
16196
15826
  }
16197
15827
  }));
16198
15828
  }
16199
15829
  }, {
16200
15830
  key: "_basicCornerExtraRounded",
16201
15831
  value: function _basicCornerExtraRounded(t) {
16202
- var _this75 = this;
15832
+ var _this72 = this;
16203
15833
  var e = t.size,
16204
15834
  i = t.x,
16205
15835
  r = t.y;
16206
15836
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16207
15837
  draw: function draw() {
16208
- _this75._element = _this75._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this75._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "a ").concat(e, " ").concat(e, ", 0, 0, 0, ").concat(-e, " ").concat(-e));
15838
+ _this72._element = _this72._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this72._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "a ").concat(e, " ").concat(e, ", 0, 0, 0, ").concat(-e, " ").concat(-e));
16209
15839
  }
16210
15840
  }));
16211
15841
  }
16212
15842
  }, {
16213
15843
  key: "_basicCornersRounded",
16214
15844
  value: function _basicCornersRounded(t) {
16215
- var _this76 = this;
15845
+ var _this73 = this;
16216
15846
  var e = t.size,
16217
15847
  i = t.x,
16218
15848
  r = t.y;
16219
15849
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16220
15850
  draw: function draw() {
16221
- _this76._element = _this76._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this76._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ") + e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(e / 2, " ").concat(e / 2, "h ") + e / 2 + "v " + -e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(-e / 2, " ").concat(-e / 2));
15851
+ _this73._element = _this73._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this73._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ") + e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(e / 2, " ").concat(e / 2, "h ") + e / 2 + "v " + -e / 2 + "a ".concat(e / 2, " ").concat(e / 2, ", 0, 0, 0, ").concat(-e / 2, " ").concat(-e / 2));
16222
15852
  }
16223
15853
  }));
16224
15854
  }
@@ -16458,42 +16088,42 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16458
16088
  }, {
16459
16089
  key: "_basicDot",
16460
16090
  value: function _basicDot(t) {
16461
- var _this77 = this;
16091
+ var _this74 = this;
16462
16092
  var e = t.size,
16463
16093
  i = t.x,
16464
16094
  r = t.y,
16465
16095
  n = e / 7;
16466
16096
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16467
16097
  draw: function draw() {
16468
- _this77._element = _this77._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this77._element.setAttribute("clip-rule", "evenodd"), _this77._element.setAttribute("d", "M ".concat(i + e / 2, " ").concat(r, "a ").concat(e / 2, " ").concat(e / 2, " 0 1 0 0.1 0zm 0 ").concat(n, "a ").concat(e / 2 - n, " ").concat(e / 2 - n, " 0 1 1 -0.1 0Z"));
16098
+ _this74._element = _this74._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this74._element.setAttribute("clip-rule", "evenodd"), _this74._element.setAttribute("d", "M ".concat(i + e / 2, " ").concat(r, "a ").concat(e / 2, " ").concat(e / 2, " 0 1 0 0.1 0zm 0 ").concat(n, "a ").concat(e / 2 - n, " ").concat(e / 2 - n, " 0 1 1 -0.1 0Z"));
16469
16099
  }
16470
16100
  }));
16471
16101
  }
16472
16102
  }, {
16473
16103
  key: "_basicSquare",
16474
16104
  value: function _basicSquare(t) {
16475
- var _this78 = this;
16105
+ var _this75 = this;
16476
16106
  var e = t.size,
16477
16107
  i = t.x,
16478
16108
  r = t.y,
16479
16109
  n = e / 7;
16480
16110
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16481
16111
  draw: function draw() {
16482
- _this78._element = _this78._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this78._element.setAttribute("clip-rule", "evenodd"), _this78._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "v ") + -e + "z" + "M ".concat(i + n, " ").concat(r + n, "h ") + (e - 2 * n) + "v " + (e - 2 * n) + "h " + (2 * n - e) + "z");
16112
+ _this75._element = _this75._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this75._element.setAttribute("clip-rule", "evenodd"), _this75._element.setAttribute("d", "M ".concat(i, " ").concat(r, "v ").concat(e, "h ").concat(e, "v ") + -e + "z" + "M ".concat(i + n, " ").concat(r + n, "h ") + (e - 2 * n) + "v " + (e - 2 * n) + "h " + (2 * n - e) + "z");
16483
16113
  }
16484
16114
  }));
16485
16115
  }
16486
16116
  }, {
16487
16117
  key: "_basicExtraRounded",
16488
16118
  value: function _basicExtraRounded(t) {
16489
- var _this79 = this;
16119
+ var _this76 = this;
16490
16120
  var e = t.size,
16491
16121
  i = t.x,
16492
16122
  r = t.y,
16493
16123
  n = e / 7;
16494
16124
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16495
16125
  draw: function draw() {
16496
- _this79._element = _this79._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this79._element.setAttribute("clip-rule", "evenodd"), _this79._element.setAttribute("d", "M ".concat(i, " ").concat(r + 2.5 * n, "v ") + 2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * n, " ").concat(2.5 * n, "h ") + 2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * n, " ").concat(2.5 * -n, "v ") + -2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * -n, " ").concat(2.5 * -n, "h ") + -2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * -n, " ").concat(2.5 * n) + "M ".concat(i + 2.5 * n, " ").concat(r + n, "h ") + 2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * n, " ").concat(1.5 * n, "v ") + 2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * -n, " ").concat(1.5 * n, "h ") + -2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * -n, " ").concat(1.5 * -n, "v ") + -2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * n, " ").concat(1.5 * -n));
16126
+ _this76._element = _this76._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), _this76._element.setAttribute("clip-rule", "evenodd"), _this76._element.setAttribute("d", "M ".concat(i, " ").concat(r + 2.5 * n, "v ") + 2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * n, " ").concat(2.5 * n, "h ") + 2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * n, " ").concat(2.5 * -n, "v ") + -2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * -n, " ").concat(2.5 * -n, "h ") + -2 * n + "a ".concat(2.5 * n, " ").concat(2.5 * n, ", 0, 0, 0, ").concat(2.5 * -n, " ").concat(2.5 * n) + "M ".concat(i + 2.5 * n, " ").concat(r + n, "h ") + 2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * n, " ").concat(1.5 * n, "v ") + 2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * -n, " ").concat(1.5 * n, "h ") + -2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * -n, " ").concat(1.5 * -n, "v ") + -2 * n + "a ".concat(1.5 * n, " ").concat(1.5 * n, ", 0, 0, 1, ").concat(1.5 * n, " ").concat(1.5 * -n));
16497
16127
  }
16498
16128
  }));
16499
16129
  }
@@ -16582,26 +16212,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16582
16212
  }, {
16583
16213
  key: "_basicDot",
16584
16214
  value: function _basicDot(t) {
16585
- var _this80 = this;
16215
+ var _this77 = this;
16586
16216
  var e = t.size,
16587
16217
  i = t.x,
16588
16218
  r = t.y;
16589
16219
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16590
16220
  draw: function draw() {
16591
- _this80._element = _this80._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), _this80._element.setAttribute("cx", String(i + e / 2)), _this80._element.setAttribute("cy", String(r + e / 2)), _this80._element.setAttribute("r", String(e / 2));
16221
+ _this77._element = _this77._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), _this77._element.setAttribute("cx", String(i + e / 2)), _this77._element.setAttribute("cy", String(r + e / 2)), _this77._element.setAttribute("r", String(e / 2));
16592
16222
  }
16593
16223
  }));
16594
16224
  }
16595
16225
  }, {
16596
16226
  key: "_basicSquare",
16597
16227
  value: function _basicSquare(t) {
16598
- var _this81 = this;
16228
+ var _this78 = this;
16599
16229
  var e = t.size,
16600
16230
  i = t.x,
16601
16231
  r = t.y;
16602
16232
  this._rotateFigure(Object.assign(Object.assign({}, t), {
16603
16233
  draw: function draw() {
16604
- _this81._element = _this81._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), _this81._element.setAttribute("x", String(i)), _this81._element.setAttribute("y", String(r)), _this81._element.setAttribute("width", String(e)), _this81._element.setAttribute("height", String(e));
16234
+ _this78._element = _this78._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), _this78._element.setAttribute("x", String(i)), _this78._element.setAttribute("y", String(r)), _this78._element.setAttribute("width", String(e)), _this78._element.setAttribute("height", String(e));
16605
16235
  }
16606
16236
  }));
16607
16237
  }
@@ -16640,10 +16270,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16640
16270
  w = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
16641
16271
  var p = /*#__PURE__*/function () {
16642
16272
  function p(t, e) {
16643
- var _this82 = this;
16273
+ var _this79 = this;
16644
16274
  _classCallCheck(this, p);
16645
16275
  this._roundSize = function (t) {
16646
- return _this82._options.dotsOptions.roundSize ? Math.floor(t) : t;
16276
+ return _this79._options.dotsOptions.roundSize ? Math.floor(t) : t;
16647
16277
  }, this._window = e, this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(t.width)), this._element.setAttribute("height", String(t.height)), this._element.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), t.dotsOptions.roundSize || this._element.setAttribute("shape-rendering", "crispEdges"), this._element.setAttribute("viewBox", "0 0 ".concat(t.width, " ").concat(t.height)), this._defs = this._window.document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._imageUri = t.image, this._instanceId = p.instanceCount++, this._options = t;
16648
16278
  }
16649
16279
  return _createClass(p, [{
@@ -16664,11 +16294,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16664
16294
  }, {
16665
16295
  key: "drawQR",
16666
16296
  value: function () {
16667
- var _drawQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee51(t) {
16668
- var _this83 = this;
16669
- var e, i, r, n, s, _this$_options, _t36, _i2, _r5, _a, _t37;
16670
- return _regenerator().w(function (_context51) {
16671
- while (1) switch (_context51.n) {
16297
+ var _drawQR = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee52(t) {
16298
+ var _this80 = this;
16299
+ var e, i, r, n, s, _this$_options, _t37, _i2, _r5, _a, _t38;
16300
+ return _regenerator().w(function (_context52) {
16301
+ while (1) switch (_context52.n) {
16672
16302
  case 0:
16673
16303
  e = t.getModuleCount(), i = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, r = this._options.shape === g ? i / Math.sqrt(2) : i, n = this._roundSize(r / e);
16674
16304
  s = {
@@ -16678,19 +16308,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16678
16308
  height: 0
16679
16309
  };
16680
16310
  if (!(this._qr = t, this._options.image)) {
16681
- _context51.n = 3;
16311
+ _context52.n = 3;
16682
16312
  break;
16683
16313
  }
16684
- _context51.n = 1;
16314
+ _context52.n = 1;
16685
16315
  return this.loadImage();
16686
16316
  case 1:
16687
16317
  if (this._image) {
16688
- _context51.n = 2;
16318
+ _context52.n = 2;
16689
16319
  break;
16690
16320
  }
16691
- return _context51.a(2);
16321
+ return _context52.a(2);
16692
16322
  case 2:
16693
- _this$_options = this._options, _t36 = _this$_options.imageOptions, _i2 = _this$_options.qrOptions, _r5 = _t36.imageSize * o[_i2.errorCorrectionLevel], _a = Math.floor(_r5 * e * e);
16323
+ _this$_options = this._options, _t37 = _this$_options.imageOptions, _i2 = _this$_options.qrOptions, _r5 = _t37.imageSize * o[_i2.errorCorrectionLevel], _a = Math.floor(_r5 * e * e);
16694
16324
  s = function (_ref16) {
16695
16325
  var t = _ref16.originalHeight,
16696
16326
  e = _ref16.originalWidth,
@@ -16729,15 +16359,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16729
16359
  this.drawBackground();
16730
16360
  this.drawDots(function (t, i) {
16731
16361
  var r, n, o, a, h, d;
16732
- return !(_this83._options.imageOptions.hideBackgroundDots && t >= (e - s.hideYDots) / 2 && t < (e + s.hideYDots) / 2 && i >= (e - s.hideXDots) / 2 && i < (e + s.hideXDots) / 2 || (null === (r = f[t]) || void 0 === r ? void 0 : r[i]) || (null === (n = f[t - e + 7]) || void 0 === n ? void 0 : n[i]) || (null === (o = f[t]) || void 0 === o ? void 0 : o[i - e + 7]) || (null === (a = w[t]) || void 0 === a ? void 0 : a[i]) || (null === (h = w[t - e + 7]) || void 0 === h ? void 0 : h[i]) || (null === (d = w[t]) || void 0 === d ? void 0 : d[i - e + 7]));
16362
+ return !(_this80._options.imageOptions.hideBackgroundDots && t >= (e - s.hideYDots) / 2 && t < (e + s.hideYDots) / 2 && i >= (e - s.hideXDots) / 2 && i < (e + s.hideXDots) / 2 || (null === (r = f[t]) || void 0 === r ? void 0 : r[i]) || (null === (n = f[t - e + 7]) || void 0 === n ? void 0 : n[i]) || (null === (o = f[t]) || void 0 === o ? void 0 : o[i - e + 7]) || (null === (a = w[t]) || void 0 === a ? void 0 : a[i]) || (null === (h = w[t - e + 7]) || void 0 === h ? void 0 : h[i]) || (null === (d = w[t]) || void 0 === d ? void 0 : d[i - e + 7]));
16733
16363
  });
16734
16364
  this.drawCorners();
16735
- _t37 = this._options.image;
16736
- if (!_t37) {
16737
- _context51.n = 4;
16365
+ _t38 = this._options.image;
16366
+ if (!_t38) {
16367
+ _context52.n = 4;
16738
16368
  break;
16739
16369
  }
16740
- _context51.n = 4;
16370
+ _context52.n = 4;
16741
16371
  return this.drawImage({
16742
16372
  width: s.width,
16743
16373
  height: s.height,
@@ -16745,11 +16375,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16745
16375
  dotSize: n
16746
16376
  });
16747
16377
  case 4:
16748
- return _context51.a(2);
16378
+ return _context52.a(2);
16749
16379
  }
16750
- }, _callee51, this);
16380
+ }, _callee52, this);
16751
16381
  }));
16752
- function drawQR(_x16) {
16382
+ function drawQR(_x18) {
16753
16383
  return _drawQR.apply(this, arguments);
16754
16384
  }
16755
16385
  return drawQR;
@@ -16766,8 +16396,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16766
16396
  var s = n.height,
16767
16397
  _a2 = n.width;
16768
16398
  if (_r6 || _o) {
16769
- var _t38 = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect");
16770
- this._backgroundClipPath = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", "clip-path-background-color-".concat(this._instanceId)), this._defs.appendChild(this._backgroundClipPath), (null === (i = n.backgroundOptions) || void 0 === i ? void 0 : i.round) && (s = _a2 = Math.min(n.width, n.height), _t38.setAttribute("rx", String(s / 2 * n.backgroundOptions.round))), _t38.setAttribute("x", String(this._roundSize((n.width - _a2) / 2))), _t38.setAttribute("y", String(this._roundSize((n.height - s) / 2))), _t38.setAttribute("width", String(_a2)), _t38.setAttribute("height", String(s)), this._backgroundClipPath.appendChild(_t38), this._createColor({
16399
+ var _t39 = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect");
16400
+ this._backgroundClipPath = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", "clip-path-background-color-".concat(this._instanceId)), this._defs.appendChild(this._backgroundClipPath), (null === (i = n.backgroundOptions) || void 0 === i ? void 0 : i.round) && (s = _a2 = Math.min(n.width, n.height), _t39.setAttribute("rx", String(s / 2 * n.backgroundOptions.round))), _t39.setAttribute("x", String(this._roundSize((n.width - _a2) / 2))), _t39.setAttribute("y", String(this._roundSize((n.height - s) / 2))), _t39.setAttribute("width", String(_a2)), _t39.setAttribute("height", String(s)), this._backgroundClipPath.appendChild(_t39), this._createColor({
16771
16401
  options: _r6,
16772
16402
  color: _o,
16773
16403
  additionalRotation: 0,
@@ -16783,7 +16413,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16783
16413
  }, {
16784
16414
  key: "drawDots",
16785
16415
  value: function drawDots(t) {
16786
- var _this84 = this;
16416
+ var _this81 = this;
16787
16417
  var e, i;
16788
16418
  if (!this._qr) throw "QR code is not defined";
16789
16419
  var r = this._options,
@@ -16811,9 +16441,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16811
16441
  });
16812
16442
  var _loop2 = function _loop2(_e3) {
16813
16443
  var _loop5 = function _loop5(_r9) {
16814
- t && !t(_e3, _r9) || (null === (i = _this84._qr) || void 0 === i ? void 0 : i.isDark(_e3, _r9)) && (c.draw(d + _r9 * h, u + _e3 * h, h, function (i, o) {
16815
- return !(_r9 + i < 0 || _e3 + o < 0 || _r9 + i >= n || _e3 + o >= n) && !(t && !t(_e3 + o, _r9 + i)) && !!_this84._qr && _this84._qr.isDark(_e3 + o, _r9 + i);
16816
- }), c._element && _this84._dotsClipPath && _this84._dotsClipPath.appendChild(c._element));
16444
+ t && !t(_e3, _r9) || (null === (i = _this81._qr) || void 0 === i ? void 0 : i.isDark(_e3, _r9)) && (c.draw(d + _r9 * h, u + _e3 * h, h, function (i, o) {
16445
+ return !(_r9 + i < 0 || _e3 + o < 0 || _r9 + i >= n || _e3 + o >= n) && !(t && !t(_e3 + o, _r9 + i)) && !!_this81._qr && _this81._qr.isDark(_e3 + o, _r9 + i);
16446
+ }), c._element && _this81._dotsClipPath && _this81._dotsClipPath.appendChild(c._element));
16817
16447
  };
16818
16448
  for (var _r9 = 0; _r9 < n; _r9++) {
16819
16449
  _loop5(_r9);
@@ -16823,36 +16453,36 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16823
16453
  _loop2(_e3);
16824
16454
  }
16825
16455
  if (r.shape === g) {
16826
- var _t39 = this._roundSize((o / h - n) / 2),
16827
- _e4 = n + 2 * _t39,
16828
- _i3 = d - _t39 * h,
16829
- _r7 = u - _t39 * h,
16456
+ var _t40 = this._roundSize((o / h - n) / 2),
16457
+ _e4 = n + 2 * _t40,
16458
+ _i3 = d - _t40 * h,
16459
+ _r7 = u - _t40 * h,
16830
16460
  s = [],
16831
16461
  _a3 = this._roundSize(_e4 / 2);
16832
16462
  for (var _i4 = 0; _i4 < _e4; _i4++) {
16833
16463
  s[_i4] = [];
16834
- for (var _r8 = 0; _r8 < _e4; _r8++) _i4 >= _t39 - 1 && _i4 <= _e4 - _t39 && _r8 >= _t39 - 1 && _r8 <= _e4 - _t39 || Math.sqrt((_i4 - _a3) * (_i4 - _a3) + (_r8 - _a3) * (_r8 - _a3)) > _a3 ? s[_i4][_r8] = 0 : s[_i4][_r8] = this._qr.isDark(_r8 - 2 * _t39 < 0 ? _r8 : _r8 >= n ? _r8 - 2 * _t39 : _r8 - _t39, _i4 - 2 * _t39 < 0 ? _i4 : _i4 >= n ? _i4 - 2 * _t39 : _i4 - _t39) ? 1 : 0;
16464
+ for (var _r8 = 0; _r8 < _e4; _r8++) _i4 >= _t40 - 1 && _i4 <= _e4 - _t40 && _r8 >= _t40 - 1 && _r8 <= _e4 - _t40 || Math.sqrt((_i4 - _a3) * (_i4 - _a3) + (_r8 - _a3) * (_r8 - _a3)) > _a3 ? s[_i4][_r8] = 0 : s[_i4][_r8] = this._qr.isDark(_r8 - 2 * _t40 < 0 ? _r8 : _r8 >= n ? _r8 - 2 * _t40 : _r8 - _t40, _i4 - 2 * _t40 < 0 ? _i4 : _i4 >= n ? _i4 - 2 * _t40 : _i4 - _t40) ? 1 : 0;
16835
16465
  }
16836
- var _loop3 = function _loop3(_t40) {
16466
+ var _loop3 = function _loop3(_t41) {
16837
16467
  var _loop4 = function _loop4(_n) {
16838
- s[_t40][_n] && (c.draw(_i3 + _n * h, _r7 + _t40 * h, h, function (e, i) {
16468
+ s[_t41][_n] && (c.draw(_i3 + _n * h, _r7 + _t41 * h, h, function (e, i) {
16839
16469
  var r;
16840
- return !!(null === (r = s[_t40 + i]) || void 0 === r ? void 0 : r[_n + e]);
16841
- }), c._element && _this84._dotsClipPath && _this84._dotsClipPath.appendChild(c._element));
16470
+ return !!(null === (r = s[_t41 + i]) || void 0 === r ? void 0 : r[_n + e]);
16471
+ }), c._element && _this81._dotsClipPath && _this81._dotsClipPath.appendChild(c._element));
16842
16472
  };
16843
16473
  for (var _n = 0; _n < _e4; _n++) {
16844
16474
  _loop4(_n);
16845
16475
  }
16846
16476
  };
16847
- for (var _t40 = 0; _t40 < _e4; _t40++) {
16848
- _loop3(_t40);
16477
+ for (var _t41 = 0; _t41 < _e4; _t41++) {
16478
+ _loop3(_t41);
16849
16479
  }
16850
16480
  }
16851
16481
  }
16852
16482
  }, {
16853
16483
  key: "drawCorners",
16854
16484
  value: function drawCorners() {
16855
- var _this85 = this;
16485
+ var _this82 = this;
16856
16486
  if (!this._qr) throw "QR code is not defined";
16857
16487
  var t = this._element,
16858
16488
  e = this._options;
@@ -16873,9 +16503,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16873
16503
  var g, _, m, b, y, x, S, C, A, M, $, O, D, k;
16874
16504
  var z = _p + t * o * (i - 7),
16875
16505
  B = v + r * o * (i - 7);
16876
- var P = _this85._dotsClipPath,
16877
- I = _this85._dotsClipPath;
16878
- if (((null === (g = e.cornersSquareOptions) || void 0 === g ? void 0 : g.gradient) || (null === (_ = e.cornersSquareOptions) || void 0 === _ ? void 0 : _.color)) && (P = _this85._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), P.setAttribute("id", "clip-path-corners-square-color-".concat(t, "-").concat(r, "-").concat(_this85._instanceId)), _this85._defs.appendChild(P), _this85._cornersSquareClipPath = _this85._cornersDotClipPath = I = P, _this85._createColor({
16506
+ var P = _this82._dotsClipPath,
16507
+ I = _this82._dotsClipPath;
16508
+ if (((null === (g = e.cornersSquareOptions) || void 0 === g ? void 0 : g.gradient) || (null === (_ = e.cornersSquareOptions) || void 0 === _ ? void 0 : _.color)) && (P = _this82._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), P.setAttribute("id", "clip-path-corners-square-color-".concat(t, "-").concat(r, "-").concat(_this82._instanceId)), _this82._defs.appendChild(P), _this82._cornersSquareClipPath = _this82._cornersDotClipPath = I = P, _this82._createColor({
16879
16509
  options: null === (m = e.cornersSquareOptions) || void 0 === m ? void 0 : m.gradient,
16880
16510
  color: null === (b = e.cornersSquareOptions) || void 0 === b ? void 0 : b.color,
16881
16511
  additionalRotation: n,
@@ -16883,26 +16513,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16883
16513
  y: B,
16884
16514
  height: a,
16885
16515
  width: a,
16886
- name: "corners-square-color-".concat(t, "-").concat(r, "-").concat(_this85._instanceId)
16516
+ name: "corners-square-color-".concat(t, "-").concat(r, "-").concat(_this82._instanceId)
16887
16517
  })), (null === (y = e.cornersSquareOptions) || void 0 === y ? void 0 : y.type) && h.includes(e.cornersSquareOptions.type)) {
16888
- var _t41 = new d({
16889
- svg: _this85._element,
16518
+ var _t42 = new d({
16519
+ svg: _this82._element,
16890
16520
  type: e.cornersSquareOptions.type,
16891
- window: _this85._window
16521
+ window: _this82._window
16892
16522
  });
16893
- _t41.draw(z, B, a, n), _t41._element && P && P.appendChild(_t41._element);
16523
+ _t42.draw(z, B, a, n), _t42._element && P && P.appendChild(_t42._element);
16894
16524
  } else {
16895
- var _t42 = new s({
16896
- svg: _this85._element,
16525
+ var _t43 = new s({
16526
+ svg: _this82._element,
16897
16527
  type: (null === (x = e.cornersSquareOptions) || void 0 === x ? void 0 : x.type) || e.dotsOptions.type,
16898
- window: _this85._window
16528
+ window: _this82._window
16899
16529
  });
16900
16530
  var _loop6 = function _loop6(_e5) {
16901
16531
  var _loop7 = function _loop7(_i5) {
16902
- (null === (S = f[_e5]) || void 0 === S ? void 0 : S[_i5]) && (_t42.draw(z + _i5 * o, B + _e5 * o, o, function (t, r) {
16532
+ (null === (S = f[_e5]) || void 0 === S ? void 0 : S[_i5]) && (_t43.draw(z + _i5 * o, B + _e5 * o, o, function (t, r) {
16903
16533
  var n;
16904
16534
  return !!(null === (n = f[_e5 + r]) || void 0 === n ? void 0 : n[_i5 + t]);
16905
- }), _t42._element && P && P.appendChild(_t42._element));
16535
+ }), _t43._element && P && P.appendChild(_t43._element));
16906
16536
  };
16907
16537
  for (var _i5 = 0; _i5 < f[_e5].length; _i5++) {
16908
16538
  _loop7(_i5);
@@ -16912,7 +16542,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16912
16542
  _loop6(_e5);
16913
16543
  }
16914
16544
  }
16915
- if (((null === (C = e.cornersDotOptions) || void 0 === C ? void 0 : C.gradient) || (null === (A = e.cornersDotOptions) || void 0 === A ? void 0 : A.color)) && (I = _this85._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), I.setAttribute("id", "clip-path-corners-dot-color-".concat(t, "-").concat(r, "-").concat(_this85._instanceId)), _this85._defs.appendChild(I), _this85._cornersDotClipPath = I, _this85._createColor({
16545
+ if (((null === (C = e.cornersDotOptions) || void 0 === C ? void 0 : C.gradient) || (null === (A = e.cornersDotOptions) || void 0 === A ? void 0 : A.color)) && (I = _this82._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), I.setAttribute("id", "clip-path-corners-dot-color-".concat(t, "-").concat(r, "-").concat(_this82._instanceId)), _this82._defs.appendChild(I), _this82._cornersDotClipPath = I, _this82._createColor({
16916
16546
  options: null === (M = e.cornersDotOptions) || void 0 === M ? void 0 : M.gradient,
16917
16547
  color: null === ($ = e.cornersDotOptions) || void 0 === $ ? void 0 : $.color,
16918
16548
  additionalRotation: n,
@@ -16920,26 +16550,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16920
16550
  y: B + 2 * o,
16921
16551
  height: u,
16922
16552
  width: u,
16923
- name: "corners-dot-color-".concat(t, "-").concat(r, "-").concat(_this85._instanceId)
16553
+ name: "corners-dot-color-".concat(t, "-").concat(r, "-").concat(_this82._instanceId)
16924
16554
  })), (null === (O = e.cornersDotOptions) || void 0 === O ? void 0 : O.type) && c.includes(e.cornersDotOptions.type)) {
16925
- var _t43 = new l({
16926
- svg: _this85._element,
16555
+ var _t44 = new l({
16556
+ svg: _this82._element,
16927
16557
  type: e.cornersDotOptions.type,
16928
- window: _this85._window
16558
+ window: _this82._window
16929
16559
  });
16930
- _t43.draw(z + 2 * o, B + 2 * o, u, n), _t43._element && I && I.appendChild(_t43._element);
16560
+ _t44.draw(z + 2 * o, B + 2 * o, u, n), _t44._element && I && I.appendChild(_t44._element);
16931
16561
  } else {
16932
- var _t44 = new s({
16933
- svg: _this85._element,
16562
+ var _t45 = new s({
16563
+ svg: _this82._element,
16934
16564
  type: (null === (D = e.cornersDotOptions) || void 0 === D ? void 0 : D.type) || e.dotsOptions.type,
16935
- window: _this85._window
16565
+ window: _this82._window
16936
16566
  });
16937
16567
  var _loop8 = function _loop8(_e6) {
16938
16568
  var _loop9 = function _loop9(_i6) {
16939
- (null === (k = w[_e6]) || void 0 === k ? void 0 : k[_i6]) && (_t44.draw(z + _i6 * o, B + _e6 * o, o, function (t, r) {
16569
+ (null === (k = w[_e6]) || void 0 === k ? void 0 : k[_i6]) && (_t45.draw(z + _i6 * o, B + _e6 * o, o, function (t, r) {
16940
16570
  var n;
16941
16571
  return !!(null === (n = w[_e6 + r]) || void 0 === n ? void 0 : n[_i6 + t]);
16942
- }), _t44._element && I && I.appendChild(_t44._element));
16572
+ }), _t45._element && I && I.appendChild(_t45._element));
16943
16573
  };
16944
16574
  for (var _i6 = 0; _i6 < w[_e6].length; _i6++) {
16945
16575
  _loop9(_i6);
@@ -16954,37 +16584,37 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16954
16584
  }, {
16955
16585
  key: "loadImage",
16956
16586
  value: function loadImage() {
16957
- var _this86 = this;
16587
+ var _this83 = this;
16958
16588
  return new Promise(function (t, e) {
16959
16589
  var i;
16960
- var r = _this86._options;
16590
+ var r = _this83._options;
16961
16591
  if (!r.image) return e("Image is not defined");
16962
16592
  if (null === (i = r.nodeCanvas) || void 0 === i ? void 0 : i.loadImage) r.nodeCanvas.loadImage(r.image).then(function (e) {
16963
16593
  var i, n;
16964
- if (_this86._image = e, _this86._options.imageOptions.saveAsBlob) {
16965
- var _t45 = null === (i = r.nodeCanvas) || void 0 === i ? void 0 : i.createCanvas(_this86._image.width, _this86._image.height);
16966
- null === (n = null == _t45 ? void 0 : _t45.getContext("2d")) || void 0 === n || n.drawImage(e, 0, 0), _this86._imageUri = null == _t45 ? void 0 : _t45.toDataURL();
16594
+ if (_this83._image = e, _this83._options.imageOptions.saveAsBlob) {
16595
+ var _t46 = null === (i = r.nodeCanvas) || void 0 === i ? void 0 : i.createCanvas(_this83._image.width, _this83._image.height);
16596
+ null === (n = null == _t46 ? void 0 : _t46.getContext("2d")) || void 0 === n || n.drawImage(e, 0, 0), _this83._imageUri = null == _t46 ? void 0 : _t46.toDataURL();
16967
16597
  }
16968
16598
  t();
16969
16599
  })["catch"](e);else {
16970
- var _e7 = new _this86._window.Image();
16971
- "string" == typeof r.imageOptions.crossOrigin && (_e7.crossOrigin = r.imageOptions.crossOrigin), _this86._image = _e7, _e7.onload = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee53() {
16972
- var _t46;
16973
- return _regenerator().w(function (_context53) {
16974
- while (1) switch (_context53.n) {
16600
+ var _e7 = new _this83._window.Image();
16601
+ "string" == typeof r.imageOptions.crossOrigin && (_e7.crossOrigin = r.imageOptions.crossOrigin), _this83._image = _e7, _e7.onload = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee54() {
16602
+ var _t47;
16603
+ return _regenerator().w(function (_context54) {
16604
+ while (1) switch (_context54.n) {
16975
16605
  case 0:
16976
- _t46 = _this86._options.imageOptions.saveAsBlob;
16977
- if (!_t46) {
16978
- _context53.n = 2;
16606
+ _t47 = _this83._options.imageOptions.saveAsBlob;
16607
+ if (!_t47) {
16608
+ _context54.n = 2;
16979
16609
  break;
16980
16610
  }
16981
- _context53.n = 1;
16611
+ _context54.n = 1;
16982
16612
  return function () {
16983
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee52(t, e) {
16984
- return _regenerator().w(function (_context52) {
16985
- while (1) switch (_context52.n) {
16613
+ var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee53(t, e) {
16614
+ return _regenerator().w(function (_context53) {
16615
+ while (1) switch (_context53.n) {
16986
16616
  case 0:
16987
- return _context52.a(2, new Promise(function (i) {
16617
+ return _context53.a(2, new Promise(function (i) {
16988
16618
  var r = new e.XMLHttpRequest();
16989
16619
  r.onload = function () {
16990
16620
  var t = new e.FileReader();
@@ -16994,20 +16624,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
16994
16624
  }, r.open("GET", t), r.responseType = "blob", r.send();
16995
16625
  }));
16996
16626
  }
16997
- }, _callee52);
16627
+ }, _callee53);
16998
16628
  }));
16999
- return function (_x17, _x18) {
16629
+ return function (_x19, _x20) {
17000
16630
  return _ref20.apply(this, arguments);
17001
16631
  };
17002
- }()(r.image || "", _this86._window);
16632
+ }()(r.image || "", _this83._window);
17003
16633
  case 1:
17004
- _this86._imageUri = _context53.v;
16634
+ _this83._imageUri = _context54.v;
17005
16635
  case 2:
17006
16636
  t();
17007
16637
  case 3:
17008
- return _context53.a(2);
16638
+ return _context54.a(2);
17009
16639
  }
17010
- }, _callee53);
16640
+ }, _callee54);
17011
16641
  })), _e7.src = r.image;
17012
16642
  }
17013
16643
  });
@@ -17015,20 +16645,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17015
16645
  }, {
17016
16646
  key: "drawImage",
17017
16647
  value: function () {
17018
- var _drawImage = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee54(_ref21) {
16648
+ var _drawImage = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee55(_ref21) {
17019
16649
  var t, e, i, r, n, o, s, a, h, d, u, c;
17020
- return _regenerator().w(function (_context54) {
17021
- while (1) switch (_context54.n) {
16650
+ return _regenerator().w(function (_context55) {
16651
+ while (1) switch (_context55.n) {
17022
16652
  case 0:
17023
16653
  t = _ref21.width, e = _ref21.height, i = _ref21.count, r = _ref21.dotSize;
17024
16654
  n = this._options, o = this._roundSize((n.width - i * r) / 2), s = this._roundSize((n.height - i * r) / 2), a = o + this._roundSize(n.imageOptions.margin + (i * r - t) / 2), h = s + this._roundSize(n.imageOptions.margin + (i * r - e) / 2), d = t - 2 * n.imageOptions.margin, u = e - 2 * n.imageOptions.margin, c = this._window.document.createElementNS("http://www.w3.org/2000/svg", "image");
17025
16655
  c.setAttribute("href", this._imageUri || ""), c.setAttribute("xlink:href", this._imageUri || ""), c.setAttribute("x", String(a)), c.setAttribute("y", String(h)), c.setAttribute("width", "".concat(d, "px")), c.setAttribute("height", "".concat(u, "px")), this._element.appendChild(c);
17026
16656
  case 1:
17027
- return _context54.a(2);
16657
+ return _context55.a(2);
17028
16658
  }
17029
- }, _callee54, this);
16659
+ }, _callee55, this);
17030
16660
  }));
17031
- function drawImage(_x19) {
16661
+ function drawImage(_x21) {
17032
16662
  return _drawImage.apply(this, arguments);
17033
16663
  }
17034
16664
  return drawImage;
@@ -17036,7 +16666,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17036
16666
  }, {
17037
16667
  key: "_createColor",
17038
16668
  value: function _createColor(_ref22) {
17039
- var _this87 = this;
16669
+ var _this84 = this;
17040
16670
  var t = _ref22.options,
17041
16671
  e = _ref22.color,
17042
16672
  i = _ref22.additionalRotation,
@@ -17061,7 +16691,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17061
16691
  t.colorStops.forEach(function (_ref23) {
17062
16692
  var t = _ref23.offset,
17063
16693
  i = _ref23.color;
17064
- var r = _this87._window.document.createElementNS("http://www.w3.org/2000/svg", "stop");
16694
+ var r = _this84._window.document.createElementNS("http://www.w3.org/2000/svg", "stop");
17065
16695
  r.setAttribute("offset", 100 * t + "%"), r.setAttribute("stop-color", i), _e8.appendChild(r);
17066
16696
  }), d.setAttribute("fill", "url('#".concat(a, "')")), this._defs.appendChild(_e8);
17067
16697
  } else e && d.setAttribute("fill", e);
@@ -17073,7 +16703,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17073
16703
  var v = p,
17074
16704
  _ = "canvas",
17075
16705
  m = {};
17076
- for (var _t47 = 0; _t47 <= 40; _t47++) m[_t47] = _t47;
16706
+ for (var _t48 = 0; _t48 <= 40; _t48++) m[_t48] = _t48;
17077
16707
  var b = {
17078
16708
  type: _,
17079
16709
  shape: "square",
@@ -17151,37 +16781,37 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17151
16781
  return _createClass(M, [{
17152
16782
  key: "_setupSvg",
17153
16783
  value: function _setupSvg() {
17154
- var _this88 = this;
16784
+ var _this85 = this;
17155
16785
  if (!this._qr) return;
17156
16786
  var t = new v(this._options, this._window);
17157
16787
  this._svg = t.getElement(), this._svgDrawingPromise = t.drawQR(this._qr).then(function () {
17158
16788
  var e;
17159
- _this88._svg && (null === (e = _this88._extension) || void 0 === e || e.call(_this88, t.getElement(), _this88._options));
16789
+ _this85._svg && (null === (e = _this85._extension) || void 0 === e || e.call(_this85, t.getElement(), _this85._options));
17160
16790
  });
17161
16791
  }
17162
16792
  }, {
17163
16793
  key: "_setupCanvas",
17164
16794
  value: function _setupCanvas() {
17165
- var _this89 = this;
16795
+ var _this86 = this;
17166
16796
  var t, e;
17167
16797
  this._qr && ((null === (t = this._options.nodeCanvas) || void 0 === t ? void 0 : t.createCanvas) ? (this._nodeCanvas = this._options.nodeCanvas.createCanvas(this._options.width, this._options.height), this._nodeCanvas.width = this._options.width, this._nodeCanvas.height = this._options.height) : (this._domCanvas = document.createElement("canvas"), this._domCanvas.width = this._options.width, this._domCanvas.height = this._options.height), this._setupSvg(), this._canvasDrawingPromise = null === (e = this._svgDrawingPromise) || void 0 === e ? void 0 : e.then(function () {
17168
16798
  var t;
17169
- if (!_this89._svg) return;
17170
- var e = _this89._svg,
17171
- i = new _this89._window.XMLSerializer().serializeToString(e),
16799
+ if (!_this86._svg) return;
16800
+ var e = _this86._svg,
16801
+ i = new _this86._window.XMLSerializer().serializeToString(e),
17172
16802
  r = btoa(i),
17173
16803
  n = "data:".concat(A("svg"), ";base64,").concat(r);
17174
- if (null === (t = _this89._options.nodeCanvas) || void 0 === t ? void 0 : t.loadImage) return _this89._options.nodeCanvas.loadImage(n).then(function (t) {
16804
+ if (null === (t = _this86._options.nodeCanvas) || void 0 === t ? void 0 : t.loadImage) return _this86._options.nodeCanvas.loadImage(n).then(function (t) {
17175
16805
  var e, i;
17176
- t.width = _this89._options.width, t.height = _this89._options.height, null === (i = null === (e = _this89._nodeCanvas) || void 0 === e ? void 0 : e.getContext("2d")) || void 0 === i || i.drawImage(t, 0, 0);
16806
+ t.width = _this86._options.width, t.height = _this86._options.height, null === (i = null === (e = _this86._nodeCanvas) || void 0 === e ? void 0 : e.getContext("2d")) || void 0 === i || i.drawImage(t, 0, 0);
17177
16807
  });
17178
16808
  {
17179
- var _t48 = new _this89._window.Image();
16809
+ var _t49 = new _this86._window.Image();
17180
16810
  return new Promise(function (e) {
17181
- _t48.onload = function () {
16811
+ _t49.onload = function () {
17182
16812
  var i, r;
17183
- null === (r = null === (i = _this89._domCanvas) || void 0 === i ? void 0 : i.getContext("2d")) || void 0 === r || r.drawImage(_t48, 0, 0), e();
17184
- }, _t48.src = n;
16813
+ null === (r = null === (i = _this86._domCanvas) || void 0 === i ? void 0 : i.getContext("2d")) || void 0 === r || r.drawImage(_t49, 0, 0), e();
16814
+ }, _t49.src = n;
17185
16815
  });
17186
16816
  }
17187
16817
  }));
@@ -17189,41 +16819,41 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17189
16819
  }, {
17190
16820
  key: "_getElement",
17191
16821
  value: function () {
17192
- var _getElement2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee55() {
16822
+ var _getElement2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee56() {
17193
16823
  var t,
17194
- _args55 = arguments,
17195
- _t49;
17196
- return _regenerator().w(function (_context55) {
17197
- while (1) switch (_context55.n) {
16824
+ _args56 = arguments,
16825
+ _t50;
16826
+ return _regenerator().w(function (_context56) {
16827
+ while (1) switch (_context56.n) {
17198
16828
  case 0:
17199
- t = _args55.length > 0 && _args55[0] !== undefined ? _args55[0] : "png";
16829
+ t = _args56.length > 0 && _args56[0] !== undefined ? _args56[0] : "png";
17200
16830
  if (this._qr) {
17201
- _context55.n = 1;
16831
+ _context56.n = 1;
17202
16832
  break;
17203
16833
  }
17204
16834
  throw "QR code is empty";
17205
16835
  case 1:
17206
16836
  if (!("svg" === t.toLowerCase())) {
17207
- _context55.n = 3;
16837
+ _context56.n = 3;
17208
16838
  break;
17209
16839
  }
17210
16840
  this._svg && this._svgDrawingPromise || this._setupSvg();
17211
- _context55.n = 2;
16841
+ _context56.n = 2;
17212
16842
  return this._svgDrawingPromise;
17213
16843
  case 2:
17214
- _t49 = this._svg;
17215
- _context55.n = 5;
16844
+ _t50 = this._svg;
16845
+ _context56.n = 5;
17216
16846
  break;
17217
16847
  case 3:
17218
16848
  (this._domCanvas || this._nodeCanvas) && this._canvasDrawingPromise || this._setupCanvas();
17219
- _context55.n = 4;
16849
+ _context56.n = 4;
17220
16850
  return this._canvasDrawingPromise;
17221
16851
  case 4:
17222
- _t49 = this._domCanvas || this._nodeCanvas;
16852
+ _t50 = this._domCanvas || this._nodeCanvas;
17223
16853
  case 5:
17224
- return _context55.a(2, _t49);
16854
+ return _context56.a(2, _t50);
17225
16855
  }
17226
- }, _callee55, this);
16856
+ }, _callee56, this);
17227
16857
  }));
17228
16858
  function _getElement() {
17229
16859
  return _getElement2.apply(this, arguments);
@@ -17266,43 +16896,43 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17266
16896
  }, {
17267
16897
  key: "getRawData",
17268
16898
  value: function () {
17269
- var _getRawData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee56() {
16899
+ var _getRawData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee57() {
17270
16900
  var t,
17271
16901
  e,
17272
16902
  i,
17273
- _t50,
17274
- _args56 = arguments;
17275
- return _regenerator().w(function (_context56) {
17276
- while (1) switch (_context56.n) {
16903
+ _t51,
16904
+ _args57 = arguments;
16905
+ return _regenerator().w(function (_context57) {
16906
+ while (1) switch (_context57.n) {
17277
16907
  case 0:
17278
- t = _args56.length > 0 && _args56[0] !== undefined ? _args56[0] : "png";
16908
+ t = _args57.length > 0 && _args57[0] !== undefined ? _args57[0] : "png";
17279
16909
  if (this._qr) {
17280
- _context56.n = 1;
16910
+ _context57.n = 1;
17281
16911
  break;
17282
16912
  }
17283
16913
  throw "QR code is empty";
17284
16914
  case 1:
17285
- _context56.n = 2;
16915
+ _context57.n = 2;
17286
16916
  return this._getElement(t);
17287
16917
  case 2:
17288
- e = _context56.v;
16918
+ e = _context57.v;
17289
16919
  i = A(t);
17290
16920
  if (e) {
17291
- _context56.n = 3;
16921
+ _context57.n = 3;
17292
16922
  break;
17293
16923
  }
17294
- return _context56.a(2, null);
16924
+ return _context57.a(2, null);
17295
16925
  case 3:
17296
16926
  if (!("svg" === t.toLowerCase())) {
17297
- _context56.n = 4;
16927
+ _context57.n = 4;
17298
16928
  break;
17299
16929
  }
17300
- _t50 = "<?xml version=\"1.0\" standalone=\"no\"?>\r\n".concat(new this._window.XMLSerializer().serializeToString(e));
17301
- return _context56.a(2, "undefined" == typeof Blob || this._options.jsdom ? Buffer.from(_t50) : new Blob([_t50], {
16930
+ _t51 = "<?xml version=\"1.0\" standalone=\"no\"?>\r\n".concat(new this._window.XMLSerializer().serializeToString(e));
16931
+ return _context57.a(2, "undefined" == typeof Blob || this._options.jsdom ? Buffer.from(_t51) : new Blob([_t51], {
17302
16932
  type: i
17303
16933
  }));
17304
16934
  case 4:
17305
- return _context56.a(2, new Promise(function (t) {
16935
+ return _context57.a(2, new Promise(function (t) {
17306
16936
  var r = e;
17307
16937
  if ("toBuffer" in r) {
17308
16938
  if ("image/png" === i) t(r.toBuffer(i));else if ("image/jpeg" === i) t(r.toBuffer(i));else {
@@ -17312,7 +16942,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17312
16942
  } else "toBlob" in r && r.toBlob(t, i, 1);
17313
16943
  }));
17314
16944
  }
17315
- }, _callee56, this);
16945
+ }, _callee57, this);
17316
16946
  }));
17317
16947
  function getRawData() {
17318
16948
  return _getRawData.apply(this, arguments);
@@ -17322,39 +16952,39 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17322
16952
  }, {
17323
16953
  key: "download",
17324
16954
  value: function () {
17325
- var _download = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee57(t) {
17326
- var e, i, r, _t51;
17327
- return _regenerator().w(function (_context57) {
17328
- while (1) switch (_context57.n) {
16955
+ var _download = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee58(t) {
16956
+ var e, i, r, _t52;
16957
+ return _regenerator().w(function (_context58) {
16958
+ while (1) switch (_context58.n) {
17329
16959
  case 0:
17330
16960
  if (this._qr) {
17331
- _context57.n = 1;
16961
+ _context58.n = 1;
17332
16962
  break;
17333
16963
  }
17334
16964
  throw "QR code is empty";
17335
16965
  case 1:
17336
16966
  if (!("undefined" == typeof Blob)) {
17337
- _context57.n = 2;
16967
+ _context58.n = 2;
17338
16968
  break;
17339
16969
  }
17340
16970
  throw "Cannot download in Node.js, call getRawData instead.";
17341
16971
  case 2:
17342
16972
  e = "png", i = "qr";
17343
16973
  "string" == typeof t ? (e = t, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : "object" == _typeof(t) && null !== t && (t.name && (i = t.name), t.extension && (e = t.extension));
17344
- _context57.n = 3;
16974
+ _context58.n = 3;
17345
16975
  return this._getElement(e);
17346
16976
  case 3:
17347
- r = _context57.v;
16977
+ r = _context58.v;
17348
16978
  if (r) if ("svg" === e.toLowerCase()) {
17349
- _t51 = new XMLSerializer().serializeToString(r);
17350
- _t51 = '<?xml version="1.0" standalone="no"?>\r\n' + _t51, n("data:".concat(A(e), ";charset=utf-8,").concat(encodeURIComponent(_t51)), "".concat(i, ".svg"));
16979
+ _t52 = new XMLSerializer().serializeToString(r);
16980
+ _t52 = '<?xml version="1.0" standalone="no"?>\r\n' + _t52, n("data:".concat(A(e), ";charset=utf-8,").concat(encodeURIComponent(_t52)), "".concat(i, ".svg"));
17351
16981
  } else n(r.toDataURL(A(e)), "".concat(i, ".").concat(e));
17352
16982
  case 4:
17353
- return _context57.a(2);
16983
+ return _context58.a(2);
17354
16984
  }
17355
- }, _callee57, this);
16985
+ }, _callee58, this);
17356
16986
  }));
17357
- function download(_x20) {
16987
+ function download(_x22) {
17358
16988
  return _download.apply(this, arguments);
17359
16989
  }
17360
16990
  return download;
@@ -17373,7 +17003,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
17373
17003
  }).call(this);
17374
17004
  }).call(this, require("buffer").Buffer);
17375
17005
  }, {
17376
- "buffer": 143
17006
+ "buffer": 138
17377
17007
  }]
17378
17008
  }, {}, [17])(17);
17379
17009
  });