@plattar/plattar-ar-adapter 1.128.1 → 1.130.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.
- package/build/es2015/plattar-ar-adapter.js +511 -365
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +146 -41
- package/build/es2019/plattar-ar-adapter.min.js +2 -2
- package/dist/ar/launcher-ar.d.ts +8 -0
- package/dist/ar/launcher-ar.js +11 -1
- package/dist/ar/model-ar.js +4 -2
- package/dist/ar/product-ar.js +11 -2
- package/dist/ar/raw-ar.js +4 -2
- package/dist/ar/scene-ar.js +7 -2
- package/dist/embed/controllers/configurator-controller.d.ts +1 -4
- package/dist/embed/controllers/configurator-controller.js +1 -4
- package/dist/embed/controllers/plattar-controller.d.ts +20 -5
- package/dist/embed/controllers/plattar-controller.js +84 -0
- package/dist/embed/controllers/product-controller.d.ts +1 -4
- package/dist/embed/controllers/product-controller.js +1 -4
- package/dist/embed/controllers/viewer-controller.d.ts +1 -4
- package/dist/embed/controllers/viewer-controller.js +6 -14
- package/dist/embed/controllers/vto-controller.d.ts +1 -4
- package/dist/embed/controllers/vto-controller.js +1 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -7
|
@@ -120,6 +120,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
120
120
|
var LauncherAR = /*#__PURE__*/function () {
|
|
121
121
|
function LauncherAR() {
|
|
122
122
|
_classCallCheck(this, LauncherAR);
|
|
123
|
+
|
|
124
|
+
this._opt = {
|
|
125
|
+
anchor: "horizontal_vertical"
|
|
126
|
+
};
|
|
123
127
|
}
|
|
124
128
|
/**
|
|
125
129
|
* Initialise and launch with a single function call. this is mostly for convenience.
|
|
@@ -139,6 +143,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
139
143
|
})["catch"](reject);
|
|
140
144
|
});
|
|
141
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* AR Options used for launching AR
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
}, {
|
|
151
|
+
key: "options",
|
|
152
|
+
get: function get() {
|
|
153
|
+
return this._opt;
|
|
154
|
+
}
|
|
142
155
|
}]);
|
|
143
156
|
|
|
144
157
|
return LauncherAR;
|
|
@@ -272,8 +285,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
272
285
|
|
|
273
286
|
|
|
274
287
|
if (util_1.Util.canSceneViewer()) {
|
|
275
|
-
|
|
276
|
-
|
|
288
|
+
var arviewer = new scene_viewer_1["default"]();
|
|
289
|
+
arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
|
|
290
|
+
arviewer.isVertical = _this3.options.anchor === "vertical" ? true : false;
|
|
291
|
+
_this3._ar = arviewer;
|
|
277
292
|
return accept(_this3);
|
|
278
293
|
} // otherwise, we didn't have AR available - it should never really reach this stage as this should be caught
|
|
279
294
|
// earlier in the process
|
|
@@ -516,8 +531,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
516
531
|
|
|
517
532
|
|
|
518
533
|
if (util_1.Util.canSceneViewer()) {
|
|
519
|
-
|
|
520
|
-
|
|
534
|
+
var arviewer = new scene_viewer_1["default"]();
|
|
535
|
+
arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
|
|
536
|
+
arviewer.isVertical = _this5.options.anchor === "vertical" ? true : false;
|
|
537
|
+
var scene = product.relationships.find(plattar_api_1.Scene);
|
|
538
|
+
|
|
539
|
+
if (scene) {
|
|
540
|
+
var sceneOpt = scene.attributes.custom_json || {};
|
|
541
|
+
|
|
542
|
+
if (sceneOpt.anchor === "vertical") {
|
|
543
|
+
arviewer.isVertical = true;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
_this5._ar = arviewer;
|
|
521
548
|
return accept(_this5);
|
|
522
549
|
} // otherwise, we didn't have AR available - it should never really reach this stage as this should be caught
|
|
523
550
|
// earlier in the process
|
|
@@ -687,8 +714,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
687
714
|
|
|
688
715
|
if (util_1.Util.canSceneViewer()) {
|
|
689
716
|
if (lowerLoc.endsWith("glb") || lowerLoc.endsWith("gltf")) {
|
|
690
|
-
|
|
691
|
-
|
|
717
|
+
var arviewer = new scene_viewer_1["default"]();
|
|
718
|
+
arviewer.modelUrl = modelLocation;
|
|
719
|
+
arviewer.isVertical = _this7.options.anchor === "vertical" ? true : false;
|
|
720
|
+
_this7._ar = arviewer;
|
|
692
721
|
return accept(_this7);
|
|
693
722
|
}
|
|
694
723
|
|
|
@@ -916,8 +945,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
916
945
|
|
|
917
946
|
if (util_1.Util.canSceneViewer()) {
|
|
918
947
|
return _this9._ComposeScene(scene, "glb").then(function (modelUrl) {
|
|
919
|
-
|
|
920
|
-
|
|
948
|
+
var arviewer = new scene_viewer_1["default"]();
|
|
949
|
+
arviewer.modelUrl = modelUrl;
|
|
950
|
+
arviewer.isVertical = _this9.options.anchor === "vertical" ? true : false;
|
|
951
|
+
|
|
952
|
+
if (sceneOpt.anchor === "vertical") {
|
|
953
|
+
arviewer.isVertical = true;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
_this9._ar = arviewer;
|
|
921
957
|
return accept(_this9);
|
|
922
958
|
})["catch"](reject);
|
|
923
959
|
} // otherwise, we didn't have AR available - it should never really reach this stage as this should be caught
|
|
@@ -1106,15 +1142,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1106
1142
|
var _super6 = _createSuper(ConfiguratorController);
|
|
1107
1143
|
|
|
1108
1144
|
function ConfiguratorController(parent) {
|
|
1109
|
-
var _this12;
|
|
1110
|
-
|
|
1111
1145
|
_classCallCheck(this, ConfiguratorController);
|
|
1112
1146
|
|
|
1113
|
-
|
|
1114
|
-
_this12._state = plattar_controller_1.ControllerState.None;
|
|
1115
|
-
_this12._element = null;
|
|
1116
|
-
_this12._prevQROpt = null;
|
|
1117
|
-
return _this12;
|
|
1147
|
+
return _super6.call(this, parent);
|
|
1118
1148
|
}
|
|
1119
1149
|
|
|
1120
1150
|
_createClass(ConfiguratorController, [{
|
|
@@ -1128,22 +1158,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1128
1158
|
}
|
|
1129
1159
|
}
|
|
1130
1160
|
}, {
|
|
1131
|
-
key: "
|
|
1132
|
-
value: function
|
|
1133
|
-
var
|
|
1161
|
+
key: "startViewerQRCode",
|
|
1162
|
+
value: function startViewerQRCode(options) {
|
|
1163
|
+
var _this12 = this;
|
|
1134
1164
|
|
|
1135
1165
|
return new Promise(function (accept, reject) {
|
|
1136
1166
|
// remove the old renderer instance if any
|
|
1137
|
-
|
|
1167
|
+
_this12.removeRenderer();
|
|
1138
1168
|
|
|
1139
|
-
var sceneID =
|
|
1169
|
+
var sceneID = _this12.getAttribute("scene-id");
|
|
1140
1170
|
|
|
1141
1171
|
if (sceneID) {
|
|
1142
1172
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1143
1173
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1144
1174
|
|
|
1145
|
-
var width =
|
|
1146
|
-
var height =
|
|
1175
|
+
var width = _this12.getAttribute("width") || "500px";
|
|
1176
|
+
var height = _this12.getAttribute("height") || "500px";
|
|
1147
1177
|
viewer.setAttribute("width", width);
|
|
1148
1178
|
viewer.setAttribute("height", height);
|
|
1149
1179
|
|
|
@@ -1161,9 +1191,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1161
1191
|
|
|
1162
1192
|
var dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID; // optional attributes
|
|
1163
1193
|
|
|
1164
|
-
var configState =
|
|
1194
|
+
var configState = _this12.getAttribute("config-state");
|
|
1165
1195
|
|
|
1166
|
-
var showAR =
|
|
1196
|
+
var showAR = _this12.getAttribute("show-ar");
|
|
1167
1197
|
|
|
1168
1198
|
if (configState) {
|
|
1169
1199
|
dst += "&config_state=" + configState;
|
|
@@ -1179,11 +1209,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1179
1209
|
return accept(viewer);
|
|
1180
1210
|
};
|
|
1181
1211
|
|
|
1182
|
-
|
|
1212
|
+
_this12.append(viewer);
|
|
1183
1213
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1214
|
+
_this12._element = viewer;
|
|
1215
|
+
_this12._state = plattar_controller_1.ControllerState.QRCode;
|
|
1216
|
+
_this12._prevQROpt = opt;
|
|
1187
1217
|
return;
|
|
1188
1218
|
}
|
|
1189
1219
|
|
|
@@ -1193,28 +1223,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1193
1223
|
}, {
|
|
1194
1224
|
key: "startRenderer",
|
|
1195
1225
|
value: function startRenderer() {
|
|
1196
|
-
var
|
|
1226
|
+
var _this13 = this;
|
|
1197
1227
|
|
|
1198
1228
|
return new Promise(function (accept, reject) {
|
|
1199
1229
|
// remove the old renderer instance if any
|
|
1200
|
-
|
|
1230
|
+
_this13.removeRenderer();
|
|
1201
1231
|
|
|
1202
|
-
var sceneID =
|
|
1232
|
+
var sceneID = _this13.getAttribute("scene-id");
|
|
1203
1233
|
|
|
1204
1234
|
if (sceneID) {
|
|
1205
1235
|
// required attributes with defaults for plattar-configurator node
|
|
1206
|
-
var width =
|
|
1207
|
-
var height =
|
|
1208
|
-
var server =
|
|
1236
|
+
var width = _this13.getAttribute("width") || "500px";
|
|
1237
|
+
var height = _this13.getAttribute("height") || "500px";
|
|
1238
|
+
var server = _this13.getAttribute("server") || "production";
|
|
1209
1239
|
var viewer = document.createElement("plattar-configurator");
|
|
1210
1240
|
viewer.setAttribute("width", width);
|
|
1211
1241
|
viewer.setAttribute("height", height);
|
|
1212
1242
|
viewer.setAttribute("server", server);
|
|
1213
1243
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1214
1244
|
|
|
1215
|
-
var configState =
|
|
1245
|
+
var configState = _this13.getAttribute("config-state");
|
|
1216
1246
|
|
|
1217
|
-
var showAR =
|
|
1247
|
+
var showAR = _this13.getAttribute("show-ar");
|
|
1218
1248
|
|
|
1219
1249
|
if (configState) {
|
|
1220
1250
|
viewer.setAttribute("config-state", configState);
|
|
@@ -1228,10 +1258,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1228
1258
|
return accept(viewer);
|
|
1229
1259
|
};
|
|
1230
1260
|
|
|
1231
|
-
|
|
1261
|
+
_this13.append(viewer);
|
|
1232
1262
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1263
|
+
_this13._element = viewer;
|
|
1264
|
+
_this13._state = plattar_controller_1.ControllerState.Renderer;
|
|
1235
1265
|
return;
|
|
1236
1266
|
}
|
|
1237
1267
|
|
|
@@ -1241,24 +1271,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1241
1271
|
}, {
|
|
1242
1272
|
key: "initAR",
|
|
1243
1273
|
value: function initAR() {
|
|
1244
|
-
var
|
|
1274
|
+
var _this14 = this;
|
|
1245
1275
|
|
|
1246
1276
|
return new Promise(function (accept, reject) {
|
|
1247
1277
|
if (!util_1.Util.canAugment()) {
|
|
1248
1278
|
return reject(new Error("ConfiguratorController.initAR() - cannot proceed as AR not available in context"));
|
|
1249
1279
|
}
|
|
1250
1280
|
|
|
1251
|
-
var arMode =
|
|
1281
|
+
var arMode = _this14.getAttribute("ar-mode") || "generated";
|
|
1252
1282
|
|
|
1253
1283
|
switch (arMode.toLowerCase()) {
|
|
1254
1284
|
case "inherited":
|
|
1255
|
-
|
|
1285
|
+
_this14._InitARInherited(accept, reject);
|
|
1256
1286
|
|
|
1257
1287
|
return;
|
|
1258
1288
|
|
|
1259
1289
|
case "generated":
|
|
1260
1290
|
default:
|
|
1261
|
-
|
|
1291
|
+
_this14._InitARGenerated(accept, reject);
|
|
1262
1292
|
|
|
1263
1293
|
}
|
|
1264
1294
|
});
|
|
@@ -1414,6 +1444,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1414
1444
|
value: true
|
|
1415
1445
|
});
|
|
1416
1446
|
exports.PlattarController = exports.ControllerState = void 0;
|
|
1447
|
+
|
|
1448
|
+
var plattar_api_1 = require("@plattar/plattar-api");
|
|
1449
|
+
|
|
1417
1450
|
var ControllerState;
|
|
1418
1451
|
|
|
1419
1452
|
(function (ControllerState) {
|
|
@@ -1430,6 +1463,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1430
1463
|
function PlattarController(parent) {
|
|
1431
1464
|
_classCallCheck(this, PlattarController);
|
|
1432
1465
|
|
|
1466
|
+
this._state = ControllerState.None;
|
|
1467
|
+
this._element = null;
|
|
1468
|
+
this._prevQROpt = null;
|
|
1433
1469
|
this._parent = parent;
|
|
1434
1470
|
}
|
|
1435
1471
|
/**
|
|
@@ -1444,15 +1480,128 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1444
1480
|
* Initialise and start AR mode if available
|
|
1445
1481
|
*/
|
|
1446
1482
|
function startAR() {
|
|
1447
|
-
var
|
|
1483
|
+
var _this15 = this;
|
|
1448
1484
|
|
|
1449
1485
|
return new Promise(function (accept, reject) {
|
|
1450
|
-
|
|
1486
|
+
_this15.initAR().then(function (launcher) {
|
|
1451
1487
|
launcher.start();
|
|
1452
1488
|
accept();
|
|
1453
1489
|
})["catch"](reject);
|
|
1454
1490
|
});
|
|
1455
1491
|
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Decide which QR Code to render according to the qr-type attribute
|
|
1494
|
+
* @param options
|
|
1495
|
+
* @returns
|
|
1496
|
+
*/
|
|
1497
|
+
|
|
1498
|
+
}, {
|
|
1499
|
+
key: "startQRCode",
|
|
1500
|
+
value: function startQRCode(options) {
|
|
1501
|
+
var qrType = this.getAttribute("qr-type") || "viewer";
|
|
1502
|
+
|
|
1503
|
+
switch (qrType.toLowerCase()) {
|
|
1504
|
+
case "ar":
|
|
1505
|
+
return this.startARQRCode(options);
|
|
1506
|
+
|
|
1507
|
+
case "viewer":
|
|
1508
|
+
default:
|
|
1509
|
+
return this.startViewerQRCode(options);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Displays a QR Code that sends the user direct to AR
|
|
1514
|
+
* @param options
|
|
1515
|
+
* @returns
|
|
1516
|
+
*/
|
|
1517
|
+
|
|
1518
|
+
}, {
|
|
1519
|
+
key: "startARQRCode",
|
|
1520
|
+
value: function startARQRCode(options) {
|
|
1521
|
+
var _this16 = this;
|
|
1522
|
+
|
|
1523
|
+
return new Promise(function (accept, reject) {
|
|
1524
|
+
// remove the old renderer instance if any
|
|
1525
|
+
_this16.removeRenderer();
|
|
1526
|
+
|
|
1527
|
+
var opt = options || PlattarController.DEFAULT_QR_OPTIONS;
|
|
1528
|
+
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1529
|
+
|
|
1530
|
+
var width = _this16.getAttribute("width") || "500px";
|
|
1531
|
+
var height = _this16.getAttribute("height") || "500px";
|
|
1532
|
+
viewer.setAttribute("width", width);
|
|
1533
|
+
viewer.setAttribute("height", height);
|
|
1534
|
+
|
|
1535
|
+
if (opt.color) {
|
|
1536
|
+
viewer.setAttribute("color", opt.color);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
if (opt.margin) {
|
|
1540
|
+
viewer.setAttribute("margin", "" + opt.margin);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
if (opt.qrType) {
|
|
1544
|
+
viewer.setAttribute("qr-type", opt.qrType);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
var qrOptions = btoa(JSON.stringify(opt));
|
|
1548
|
+
var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
|
|
1549
|
+
|
|
1550
|
+
var sceneID = _this16.getAttribute("scene-id");
|
|
1551
|
+
|
|
1552
|
+
var configState = _this16.getAttribute("config-state");
|
|
1553
|
+
|
|
1554
|
+
var embedType = _this16.getAttribute("embed-type");
|
|
1555
|
+
|
|
1556
|
+
var productID = _this16.getAttribute("product-id");
|
|
1557
|
+
|
|
1558
|
+
var sceneProductID = _this16.getAttribute("scene-product-id");
|
|
1559
|
+
|
|
1560
|
+
var variationID = _this16.getAttribute("variation-id");
|
|
1561
|
+
|
|
1562
|
+
var arMode = _this16.getAttribute("ar-mode");
|
|
1563
|
+
|
|
1564
|
+
if (configState) {
|
|
1565
|
+
dst += "&config_state=" + configState;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
if (embedType) {
|
|
1569
|
+
dst += "&embed_type=" + embedType;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
if (productID) {
|
|
1573
|
+
dst += "&product_id=" + productID;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
if (sceneProductID) {
|
|
1577
|
+
dst += "&scene_product_id=" + sceneProductID;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
if (variationID) {
|
|
1581
|
+
dst += "&variation_id=" + variationID;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
if (arMode) {
|
|
1585
|
+
dst += "&ar_mode=" + arMode;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
if (sceneID) {
|
|
1589
|
+
dst += "&scene_id=" + sceneID;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
viewer.setAttribute("url", opt.url || dst);
|
|
1593
|
+
|
|
1594
|
+
viewer.onload = function () {
|
|
1595
|
+
return accept(viewer);
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
_this16._element = viewer;
|
|
1599
|
+
_this16._state = ControllerState.QRCode;
|
|
1600
|
+
_this16._prevQROpt = opt;
|
|
1601
|
+
|
|
1602
|
+
_this16.append(viewer);
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1456
1605
|
/**
|
|
1457
1606
|
* Returns the Parent Instance
|
|
1458
1607
|
*/
|
|
@@ -1501,7 +1650,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1501
1650
|
}();
|
|
1502
1651
|
|
|
1503
1652
|
exports.PlattarController = PlattarController;
|
|
1504
|
-
}, {
|
|
1653
|
+
}, {
|
|
1654
|
+
"@plattar/plattar-api": 42
|
|
1655
|
+
}],
|
|
1505
1656
|
9: [function (require, module, exports) {
|
|
1506
1657
|
"use strict";
|
|
1507
1658
|
|
|
@@ -1528,15 +1679,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1528
1679
|
var _super7 = _createSuper(ProductController);
|
|
1529
1680
|
|
|
1530
1681
|
function ProductController(parent) {
|
|
1531
|
-
var _this17;
|
|
1532
|
-
|
|
1533
1682
|
_classCallCheck(this, ProductController);
|
|
1534
1683
|
|
|
1535
|
-
|
|
1536
|
-
_this17._state = plattar_controller_1.ControllerState.None;
|
|
1537
|
-
_this17._element = null;
|
|
1538
|
-
_this17._prevQROpt = null;
|
|
1539
|
-
return _this17;
|
|
1684
|
+
return _super7.call(this, parent);
|
|
1540
1685
|
}
|
|
1541
1686
|
|
|
1542
1687
|
_createClass(ProductController, [{
|
|
@@ -1565,22 +1710,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1565
1710
|
}
|
|
1566
1711
|
}
|
|
1567
1712
|
}, {
|
|
1568
|
-
key: "
|
|
1569
|
-
value: function
|
|
1570
|
-
var
|
|
1713
|
+
key: "startViewerQRCode",
|
|
1714
|
+
value: function startViewerQRCode(options) {
|
|
1715
|
+
var _this17 = this;
|
|
1571
1716
|
|
|
1572
1717
|
return new Promise(function (accept, reject) {
|
|
1573
1718
|
// remove the old renderer instance if any
|
|
1574
|
-
|
|
1719
|
+
_this17.removeRenderer();
|
|
1575
1720
|
|
|
1576
|
-
var productID =
|
|
1721
|
+
var productID = _this17.getAttribute("product-id");
|
|
1577
1722
|
|
|
1578
1723
|
if (productID) {
|
|
1579
1724
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1580
1725
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1581
1726
|
|
|
1582
|
-
var width =
|
|
1583
|
-
var height =
|
|
1727
|
+
var width = _this17.getAttribute("width") || "500px";
|
|
1728
|
+
var height = _this17.getAttribute("height") || "500px";
|
|
1584
1729
|
viewer.setAttribute("width", width);
|
|
1585
1730
|
viewer.setAttribute("height", height);
|
|
1586
1731
|
|
|
@@ -1597,9 +1742,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1597
1742
|
} // optional attributes
|
|
1598
1743
|
|
|
1599
1744
|
|
|
1600
|
-
var variationID =
|
|
1745
|
+
var variationID = _this17.getAttribute("variation-id");
|
|
1601
1746
|
|
|
1602
|
-
var showAR =
|
|
1747
|
+
var showAR = _this17.getAttribute("show-ar");
|
|
1603
1748
|
|
|
1604
1749
|
var dst = plattar_api_1.Server.location().base + "renderer/product.html?product_id=" + productID;
|
|
1605
1750
|
|
|
@@ -1617,11 +1762,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1617
1762
|
return accept(viewer);
|
|
1618
1763
|
};
|
|
1619
1764
|
|
|
1620
|
-
|
|
1765
|
+
_this17.append(viewer);
|
|
1621
1766
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1767
|
+
_this17._element = viewer;
|
|
1768
|
+
_this17._state = plattar_controller_1.ControllerState.QRCode;
|
|
1769
|
+
_this17._prevQROpt = opt;
|
|
1625
1770
|
return;
|
|
1626
1771
|
}
|
|
1627
1772
|
|
|
@@ -1631,28 +1776,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1631
1776
|
}, {
|
|
1632
1777
|
key: "startRenderer",
|
|
1633
1778
|
value: function startRenderer() {
|
|
1634
|
-
var
|
|
1779
|
+
var _this18 = this;
|
|
1635
1780
|
|
|
1636
1781
|
return new Promise(function (accept, reject) {
|
|
1637
1782
|
// remove the old renderer instance if any
|
|
1638
|
-
|
|
1783
|
+
_this18.removeRenderer();
|
|
1639
1784
|
|
|
1640
|
-
var productID =
|
|
1785
|
+
var productID = _this18.getAttribute("product-id");
|
|
1641
1786
|
|
|
1642
1787
|
if (productID) {
|
|
1643
1788
|
// required attributes with defaults for plattar-product node
|
|
1644
|
-
var width =
|
|
1645
|
-
var height =
|
|
1646
|
-
var server =
|
|
1789
|
+
var width = _this18.getAttribute("width") || "500px";
|
|
1790
|
+
var height = _this18.getAttribute("height") || "500px";
|
|
1791
|
+
var server = _this18.getAttribute("server") || "production";
|
|
1647
1792
|
var viewer = document.createElement("plattar-product");
|
|
1648
1793
|
viewer.setAttribute("width", width);
|
|
1649
1794
|
viewer.setAttribute("height", height);
|
|
1650
1795
|
viewer.setAttribute("server", server);
|
|
1651
1796
|
viewer.setAttribute("product-id", productID); // optional attributes
|
|
1652
1797
|
|
|
1653
|
-
var variationID =
|
|
1798
|
+
var variationID = _this18.getAttribute("variation-id");
|
|
1654
1799
|
|
|
1655
|
-
var showAR =
|
|
1800
|
+
var showAR = _this18.getAttribute("show-ar");
|
|
1656
1801
|
|
|
1657
1802
|
if (variationID) {
|
|
1658
1803
|
viewer.setAttribute("variation-id", variationID);
|
|
@@ -1666,10 +1811,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1666
1811
|
return accept(viewer);
|
|
1667
1812
|
};
|
|
1668
1813
|
|
|
1669
|
-
|
|
1814
|
+
_this18.append(viewer);
|
|
1670
1815
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1816
|
+
_this18._element = viewer;
|
|
1817
|
+
_this18._state = plattar_controller_1.ControllerState.Renderer;
|
|
1673
1818
|
return;
|
|
1674
1819
|
}
|
|
1675
1820
|
|
|
@@ -1679,17 +1824,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1679
1824
|
}, {
|
|
1680
1825
|
key: "initAR",
|
|
1681
1826
|
value: function initAR() {
|
|
1682
|
-
var
|
|
1827
|
+
var _this19 = this;
|
|
1683
1828
|
|
|
1684
1829
|
return new Promise(function (accept, reject) {
|
|
1685
1830
|
if (!util_1.Util.canAugment()) {
|
|
1686
1831
|
return reject(new Error("ProductController.initAR() - cannot proceed as AR not available in context"));
|
|
1687
1832
|
}
|
|
1688
1833
|
|
|
1689
|
-
var productID =
|
|
1834
|
+
var productID = _this19.getAttribute("product-id");
|
|
1690
1835
|
|
|
1691
1836
|
if (productID) {
|
|
1692
|
-
var variationID =
|
|
1837
|
+
var variationID = _this19.getAttribute("variation-id");
|
|
1693
1838
|
|
|
1694
1839
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1695
1840
|
return product.init().then(accept)["catch"](reject);
|
|
@@ -1739,9 +1884,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1739
1884
|
|
|
1740
1885
|
var product_ar_1 = require("../../ar/product-ar");
|
|
1741
1886
|
|
|
1742
|
-
var
|
|
1887
|
+
var scene_ar_1 = require("../../ar/scene-ar");
|
|
1743
1888
|
|
|
1744
|
-
var
|
|
1889
|
+
var scene_product_ar_1 = require("../../ar/scene-product-ar");
|
|
1745
1890
|
|
|
1746
1891
|
var util_1 = require("../../util/util");
|
|
1747
1892
|
|
|
@@ -1757,15 +1902,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1757
1902
|
var _super8 = _createSuper(ViewerController);
|
|
1758
1903
|
|
|
1759
1904
|
function ViewerController(parent) {
|
|
1760
|
-
var _this21;
|
|
1761
|
-
|
|
1762
1905
|
_classCallCheck(this, ViewerController);
|
|
1763
1906
|
|
|
1764
|
-
|
|
1765
|
-
_this21._state = plattar_controller_1.ControllerState.None;
|
|
1766
|
-
_this21._element = null;
|
|
1767
|
-
_this21._prevQROpt = null;
|
|
1768
|
-
return _this21;
|
|
1907
|
+
return _super8.call(this, parent);
|
|
1769
1908
|
}
|
|
1770
1909
|
|
|
1771
1910
|
_createClass(ViewerController, [{
|
|
@@ -1795,22 +1934,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1795
1934
|
}
|
|
1796
1935
|
}
|
|
1797
1936
|
}, {
|
|
1798
|
-
key: "
|
|
1799
|
-
value: function
|
|
1800
|
-
var
|
|
1937
|
+
key: "startViewerQRCode",
|
|
1938
|
+
value: function startViewerQRCode(options) {
|
|
1939
|
+
var _this20 = this;
|
|
1801
1940
|
|
|
1802
1941
|
return new Promise(function (accept, reject) {
|
|
1803
1942
|
// remove the old renderer instance if any
|
|
1804
|
-
|
|
1943
|
+
_this20.removeRenderer();
|
|
1805
1944
|
|
|
1806
|
-
var sceneID =
|
|
1945
|
+
var sceneID = _this20.getAttribute("scene-id");
|
|
1807
1946
|
|
|
1808
1947
|
if (sceneID) {
|
|
1809
1948
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1810
1949
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1811
1950
|
|
|
1812
|
-
var width =
|
|
1813
|
-
var height =
|
|
1951
|
+
var width = _this20.getAttribute("width") || "500px";
|
|
1952
|
+
var height = _this20.getAttribute("height") || "500px";
|
|
1814
1953
|
viewer.setAttribute("width", width);
|
|
1815
1954
|
viewer.setAttribute("height", height);
|
|
1816
1955
|
|
|
@@ -1828,11 +1967,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1828
1967
|
|
|
1829
1968
|
var dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID; // optional attributes
|
|
1830
1969
|
|
|
1831
|
-
var productID =
|
|
1970
|
+
var productID = _this20.getAttribute("product-id") || _this20.getAttribute("scene-product-id");
|
|
1832
1971
|
|
|
1833
|
-
var variationID =
|
|
1972
|
+
var variationID = _this20.getAttribute("variation-id");
|
|
1834
1973
|
|
|
1835
|
-
var showAR =
|
|
1974
|
+
var showAR = _this20.getAttribute("show-ar");
|
|
1836
1975
|
|
|
1837
1976
|
if (productID) {
|
|
1838
1977
|
dst += "&productId=" + productID;
|
|
@@ -1852,11 +1991,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1852
1991
|
return accept(viewer);
|
|
1853
1992
|
};
|
|
1854
1993
|
|
|
1855
|
-
|
|
1994
|
+
_this20.append(viewer);
|
|
1856
1995
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1996
|
+
_this20._element = viewer;
|
|
1997
|
+
_this20._state = plattar_controller_1.ControllerState.QRCode;
|
|
1998
|
+
_this20._prevQROpt = opt;
|
|
1860
1999
|
return;
|
|
1861
2000
|
}
|
|
1862
2001
|
|
|
@@ -1866,30 +2005,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1866
2005
|
}, {
|
|
1867
2006
|
key: "startRenderer",
|
|
1868
2007
|
value: function startRenderer() {
|
|
1869
|
-
var
|
|
2008
|
+
var _this21 = this;
|
|
1870
2009
|
|
|
1871
2010
|
return new Promise(function (accept, reject) {
|
|
1872
2011
|
// remove the old renderer instance if any
|
|
1873
|
-
|
|
2012
|
+
_this21.removeRenderer();
|
|
1874
2013
|
|
|
1875
|
-
var sceneID =
|
|
2014
|
+
var sceneID = _this21.getAttribute("scene-id");
|
|
1876
2015
|
|
|
1877
2016
|
if (sceneID) {
|
|
1878
2017
|
// required attributes with defaults for plattar-viewer node
|
|
1879
|
-
var width =
|
|
1880
|
-
var height =
|
|
1881
|
-
var server =
|
|
2018
|
+
var width = _this21.getAttribute("width") || "500px";
|
|
2019
|
+
var height = _this21.getAttribute("height") || "500px";
|
|
2020
|
+
var server = _this21.getAttribute("server") || "production";
|
|
1882
2021
|
var viewer = document.createElement("plattar-viewer");
|
|
1883
2022
|
viewer.setAttribute("width", width);
|
|
1884
2023
|
viewer.setAttribute("height", height);
|
|
1885
2024
|
viewer.setAttribute("server", server);
|
|
1886
2025
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1887
2026
|
|
|
1888
|
-
var productID =
|
|
2027
|
+
var productID = _this21.getAttribute("product-id") || _this21.getAttribute("scene-product-id");
|
|
1889
2028
|
|
|
1890
|
-
var variationID =
|
|
2029
|
+
var variationID = _this21.getAttribute("variation-id");
|
|
1891
2030
|
|
|
1892
|
-
var showAR =
|
|
2031
|
+
var showAR = _this21.getAttribute("show-ar");
|
|
1893
2032
|
|
|
1894
2033
|
if (productID) {
|
|
1895
2034
|
viewer.setAttribute("product-id", productID);
|
|
@@ -1907,10 +2046,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1907
2046
|
return accept(viewer);
|
|
1908
2047
|
};
|
|
1909
2048
|
|
|
1910
|
-
|
|
2049
|
+
_this21.append(viewer);
|
|
1911
2050
|
|
|
1912
|
-
|
|
1913
|
-
|
|
2051
|
+
_this21._element = viewer;
|
|
2052
|
+
_this21._state = plattar_controller_1.ControllerState.Renderer;
|
|
1914
2053
|
return;
|
|
1915
2054
|
}
|
|
1916
2055
|
|
|
@@ -1920,48 +2059,41 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1920
2059
|
}, {
|
|
1921
2060
|
key: "initAR",
|
|
1922
2061
|
value: function initAR() {
|
|
1923
|
-
var
|
|
2062
|
+
var _this22 = this;
|
|
1924
2063
|
|
|
1925
2064
|
return new Promise(function (accept, reject) {
|
|
1926
2065
|
if (!util_1.Util.canAugment()) {
|
|
1927
2066
|
return reject(new Error("ViewerController.initAR() - cannot proceed as AR not available in context"));
|
|
1928
2067
|
}
|
|
1929
2068
|
|
|
1930
|
-
var productID =
|
|
2069
|
+
var productID = _this22.getAttribute("product-id"); // use product-id if available
|
|
1931
2070
|
|
|
1932
2071
|
|
|
1933
2072
|
if (productID) {
|
|
1934
|
-
var variationID =
|
|
2073
|
+
var variationID = _this22.getAttribute("variation-id");
|
|
1935
2074
|
|
|
1936
2075
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1937
2076
|
return product.init().then(accept)["catch"](reject);
|
|
1938
2077
|
}
|
|
1939
2078
|
|
|
1940
|
-
var sceneProductID =
|
|
2079
|
+
var sceneProductID = _this22.getAttribute("scene-product-id"); // use scene-product-id if available
|
|
1941
2080
|
|
|
1942
2081
|
|
|
1943
2082
|
if (sceneProductID) {
|
|
1944
|
-
var _variationID =
|
|
2083
|
+
var _variationID = _this22.getAttribute("variation-id");
|
|
1945
2084
|
|
|
1946
2085
|
var _product = new scene_product_ar_1.SceneProductAR(sceneProductID, _variationID);
|
|
1947
2086
|
|
|
1948
2087
|
return _product.init().then(accept)["catch"](reject);
|
|
1949
2088
|
}
|
|
1950
2089
|
|
|
1951
|
-
var sceneID =
|
|
2090
|
+
var sceneID = _this22.getAttribute("scene-id"); // fallback to using default SceneAR implementation
|
|
1952
2091
|
|
|
1953
2092
|
|
|
1954
2093
|
if (sceneID) {
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
if (first) {
|
|
1959
|
-
var sceneProductAR = new scene_product_ar_1.SceneProductAR(first.scene_product_id, first.product_variation_id);
|
|
1960
|
-
return sceneProductAR.init().then(accept)["catch"](reject);
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
return reject(new Error("ViewerController.initAR() - your scene does not contain any valid products"));
|
|
1964
|
-
})["catch"](reject);
|
|
2094
|
+
var sceneAR = new scene_ar_1.SceneAR(sceneID);
|
|
2095
|
+
sceneAR.init().then(accept)["catch"](reject);
|
|
2096
|
+
return;
|
|
1965
2097
|
}
|
|
1966
2098
|
|
|
1967
2099
|
return reject(new Error("ViewerController.initAR() - minimum required attributes not set, use scene-id as a minimum"));
|
|
@@ -1992,8 +2124,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1992
2124
|
exports.ViewerController = ViewerController;
|
|
1993
2125
|
}, {
|
|
1994
2126
|
"../../ar/product-ar": 3,
|
|
2127
|
+
"../../ar/scene-ar": 5,
|
|
1995
2128
|
"../../ar/scene-product-ar": 6,
|
|
1996
|
-
"../../util/configurator-state": 14,
|
|
1997
2129
|
"../../util/util": 15,
|
|
1998
2130
|
"./plattar-controller": 8,
|
|
1999
2131
|
"@plattar/plattar-api": 42
|
|
@@ -2028,15 +2160,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2028
2160
|
var _super9 = _createSuper(VTOController);
|
|
2029
2161
|
|
|
2030
2162
|
function VTOController(parent) {
|
|
2031
|
-
var _this25;
|
|
2032
|
-
|
|
2033
2163
|
_classCallCheck(this, VTOController);
|
|
2034
2164
|
|
|
2035
|
-
|
|
2036
|
-
_this25._state = plattar_controller_1.ControllerState.None;
|
|
2037
|
-
_this25._element = null;
|
|
2038
|
-
_this25._prevQROpt = null;
|
|
2039
|
-
return _this25;
|
|
2165
|
+
return _super9.call(this, parent);
|
|
2040
2166
|
}
|
|
2041
2167
|
|
|
2042
2168
|
_createClass(VTOController, [{
|
|
@@ -2050,22 +2176,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2050
2176
|
}
|
|
2051
2177
|
}
|
|
2052
2178
|
}, {
|
|
2053
|
-
key: "
|
|
2054
|
-
value: function
|
|
2055
|
-
var
|
|
2179
|
+
key: "startViewerQRCode",
|
|
2180
|
+
value: function startViewerQRCode(options) {
|
|
2181
|
+
var _this23 = this;
|
|
2056
2182
|
|
|
2057
2183
|
return new Promise(function (accept, reject) {
|
|
2058
2184
|
// remove the old renderer instance if any
|
|
2059
|
-
|
|
2185
|
+
_this23.removeRenderer();
|
|
2060
2186
|
|
|
2061
|
-
var sceneID =
|
|
2187
|
+
var sceneID = _this23.getAttribute("scene-id");
|
|
2062
2188
|
|
|
2063
2189
|
if (sceneID) {
|
|
2064
2190
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
2065
2191
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
2066
2192
|
|
|
2067
|
-
var width =
|
|
2068
|
-
var height =
|
|
2193
|
+
var width = _this23.getAttribute("width") || "500px";
|
|
2194
|
+
var height = _this23.getAttribute("height") || "500px";
|
|
2069
2195
|
viewer.setAttribute("width", width);
|
|
2070
2196
|
viewer.setAttribute("height", height);
|
|
2071
2197
|
|
|
@@ -2083,9 +2209,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2083
2209
|
|
|
2084
2210
|
var dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID; // optional attributes
|
|
2085
2211
|
|
|
2086
|
-
var configState =
|
|
2212
|
+
var configState = _this23.getAttribute("config-state");
|
|
2087
2213
|
|
|
2088
|
-
var showAR =
|
|
2214
|
+
var showAR = _this23.getAttribute("show-ar");
|
|
2089
2215
|
|
|
2090
2216
|
if (configState) {
|
|
2091
2217
|
dst += "&config_state=" + configState;
|
|
@@ -2101,11 +2227,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2101
2227
|
return accept(viewer);
|
|
2102
2228
|
};
|
|
2103
2229
|
|
|
2104
|
-
|
|
2230
|
+
_this23.append(viewer);
|
|
2105
2231
|
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2232
|
+
_this23._element = viewer;
|
|
2233
|
+
_this23._state = plattar_controller_1.ControllerState.QRCode;
|
|
2234
|
+
_this23._prevQROpt = opt;
|
|
2109
2235
|
return;
|
|
2110
2236
|
}
|
|
2111
2237
|
|
|
@@ -2115,28 +2241,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2115
2241
|
}, {
|
|
2116
2242
|
key: "startRenderer",
|
|
2117
2243
|
value: function startRenderer() {
|
|
2118
|
-
var
|
|
2244
|
+
var _this24 = this;
|
|
2119
2245
|
|
|
2120
2246
|
return new Promise(function (accept, reject) {
|
|
2121
2247
|
// remove the old renderer instance if any
|
|
2122
|
-
|
|
2248
|
+
_this24.removeRenderer();
|
|
2123
2249
|
|
|
2124
|
-
var sceneID =
|
|
2250
|
+
var sceneID = _this24.getAttribute("scene-id");
|
|
2125
2251
|
|
|
2126
2252
|
if (sceneID) {
|
|
2127
2253
|
// required attributes with defaults for plattar-facear node
|
|
2128
|
-
var width =
|
|
2129
|
-
var height =
|
|
2130
|
-
var server =
|
|
2254
|
+
var width = _this24.getAttribute("width") || "500px";
|
|
2255
|
+
var height = _this24.getAttribute("height") || "500px";
|
|
2256
|
+
var server = _this24.getAttribute("server") || "production";
|
|
2131
2257
|
var viewer = document.createElement("plattar-facear");
|
|
2132
2258
|
viewer.setAttribute("width", width);
|
|
2133
2259
|
viewer.setAttribute("height", height);
|
|
2134
2260
|
viewer.setAttribute("server", server);
|
|
2135
2261
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
2136
2262
|
|
|
2137
|
-
var configState =
|
|
2263
|
+
var configState = _this24.getAttribute("config-state");
|
|
2138
2264
|
|
|
2139
|
-
var showAR =
|
|
2265
|
+
var showAR = _this24.getAttribute("show-ar");
|
|
2140
2266
|
|
|
2141
2267
|
if (configState) {
|
|
2142
2268
|
viewer.setAttribute("config-state", configState);
|
|
@@ -2150,10 +2276,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2150
2276
|
return accept(viewer);
|
|
2151
2277
|
};
|
|
2152
2278
|
|
|
2153
|
-
|
|
2279
|
+
_this24.append(viewer);
|
|
2154
2280
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2281
|
+
_this24._element = viewer;
|
|
2282
|
+
_this24._state = plattar_controller_1.ControllerState.Renderer;
|
|
2157
2283
|
return;
|
|
2158
2284
|
}
|
|
2159
2285
|
|
|
@@ -2163,7 +2289,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2163
2289
|
}, {
|
|
2164
2290
|
key: "initAR",
|
|
2165
2291
|
value: function initAR() {
|
|
2166
|
-
var
|
|
2292
|
+
var _this25 = this;
|
|
2167
2293
|
|
|
2168
2294
|
return new Promise(function (accept, reject) {
|
|
2169
2295
|
if (!util_1.Util.canAugment()) {
|
|
@@ -2174,17 +2300,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2174
2300
|
return reject(new Error("VTOController.initAR() - cannot proceed as VTO AR only available on IOS Mobile devices"));
|
|
2175
2301
|
}
|
|
2176
2302
|
|
|
2177
|
-
var arMode =
|
|
2303
|
+
var arMode = _this25.getAttribute("ar-mode") || "generated";
|
|
2178
2304
|
|
|
2179
2305
|
switch (arMode.toLowerCase()) {
|
|
2180
2306
|
case "inherited":
|
|
2181
|
-
|
|
2307
|
+
_this25._InitARInherited(accept, reject);
|
|
2182
2308
|
|
|
2183
2309
|
return;
|
|
2184
2310
|
|
|
2185
2311
|
case "generated":
|
|
2186
2312
|
default:
|
|
2187
|
-
|
|
2313
|
+
_this25._InitARGenerated(accept, reject);
|
|
2188
2314
|
|
|
2189
2315
|
}
|
|
2190
2316
|
});
|
|
@@ -2359,15 +2485,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2359
2485
|
var _super10 = _createSuper(PlattarEmbed);
|
|
2360
2486
|
|
|
2361
2487
|
function PlattarEmbed() {
|
|
2362
|
-
var
|
|
2488
|
+
var _this26;
|
|
2363
2489
|
|
|
2364
2490
|
_classCallCheck(this, PlattarEmbed);
|
|
2365
2491
|
|
|
2366
|
-
|
|
2492
|
+
_this26 = _super10.call(this); // this is the current embed type, viewer by default
|
|
2367
2493
|
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
return
|
|
2494
|
+
_this26._currentType = EmbedType.Viewer;
|
|
2495
|
+
_this26._controller = null;
|
|
2496
|
+
return _this26;
|
|
2371
2497
|
}
|
|
2372
2498
|
|
|
2373
2499
|
_createClass(PlattarEmbed, [{
|
|
@@ -2378,7 +2504,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2378
2504
|
}, {
|
|
2379
2505
|
key: "connectedCallback",
|
|
2380
2506
|
value: function connectedCallback() {
|
|
2381
|
-
var
|
|
2507
|
+
var _this27 = this;
|
|
2382
2508
|
|
|
2383
2509
|
var embedType = this.hasAttribute("embed-type") ? this.getAttribute("embed-type") : "viewer";
|
|
2384
2510
|
|
|
@@ -2404,7 +2530,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2404
2530
|
var observer = new MutationObserver(function (mutations) {
|
|
2405
2531
|
mutations.forEach(function (mutation) {
|
|
2406
2532
|
if (mutation.type === "attributes") {
|
|
2407
|
-
|
|
2533
|
+
_this27._OnAttributesUpdated();
|
|
2408
2534
|
}
|
|
2409
2535
|
});
|
|
2410
2536
|
});
|
|
@@ -2440,66 +2566,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2440
2566
|
} else if (init === "ar-fallback-qrcode") {
|
|
2441
2567
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2442
2568
|
})["catch"](function (_err) {
|
|
2443
|
-
|
|
2569
|
+
_this27.startQRCode();
|
|
2444
2570
|
});
|
|
2445
2571
|
} else if (init === "ar-fallback-viewer") {
|
|
2446
2572
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2447
2573
|
})["catch"](function (_err) {
|
|
2448
|
-
|
|
2574
|
+
_this27.startViewer();
|
|
2449
2575
|
});
|
|
2450
2576
|
}
|
|
2451
2577
|
}
|
|
2452
2578
|
}, {
|
|
2453
2579
|
key: "initAR",
|
|
2454
2580
|
value: function initAR() {
|
|
2455
|
-
var
|
|
2581
|
+
var _this28 = this;
|
|
2456
2582
|
|
|
2457
2583
|
return new Promise(function (accept, reject) {
|
|
2458
|
-
if (!
|
|
2584
|
+
if (!_this28._controller) {
|
|
2459
2585
|
return reject(new Error("PlattarEmbed.initAR() - cannot execute as controller has not loaded yet"));
|
|
2460
2586
|
}
|
|
2461
2587
|
|
|
2462
|
-
return
|
|
2588
|
+
return _this28._controller.initAR().then(accept)["catch"](reject);
|
|
2463
2589
|
});
|
|
2464
2590
|
}
|
|
2465
2591
|
}, {
|
|
2466
2592
|
key: "startAR",
|
|
2467
2593
|
value: function startAR() {
|
|
2468
|
-
var
|
|
2594
|
+
var _this29 = this;
|
|
2469
2595
|
|
|
2470
2596
|
return new Promise(function (accept, reject) {
|
|
2471
|
-
if (!
|
|
2597
|
+
if (!_this29._controller) {
|
|
2472
2598
|
return reject(new Error("PlattarEmbed.startAR() - cannot execute as controller has not loaded yet"));
|
|
2473
2599
|
}
|
|
2474
2600
|
|
|
2475
|
-
return
|
|
2601
|
+
return _this29._controller.startAR().then(accept)["catch"](reject);
|
|
2476
2602
|
});
|
|
2477
2603
|
}
|
|
2478
2604
|
}, {
|
|
2479
2605
|
key: "startViewer",
|
|
2480
2606
|
value: function startViewer() {
|
|
2481
|
-
var
|
|
2607
|
+
var _this30 = this;
|
|
2482
2608
|
|
|
2483
2609
|
return new Promise(function (accept, reject) {
|
|
2484
|
-
if (!
|
|
2610
|
+
if (!_this30._controller) {
|
|
2485
2611
|
return reject(new Error("PlattarEmbed.startViewer() - cannot execute as controller has not loaded yet"));
|
|
2486
2612
|
}
|
|
2487
2613
|
|
|
2488
|
-
return
|
|
2614
|
+
return _this30._controller.startRenderer().then(accept)["catch"](reject);
|
|
2489
2615
|
});
|
|
2490
2616
|
}
|
|
2491
2617
|
}, {
|
|
2492
2618
|
key: "startQRCode",
|
|
2493
2619
|
value: function startQRCode() {
|
|
2494
|
-
var
|
|
2620
|
+
var _this31 = this;
|
|
2495
2621
|
|
|
2496
2622
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
2497
2623
|
return new Promise(function (accept, reject) {
|
|
2498
|
-
if (!
|
|
2624
|
+
if (!_this31._controller) {
|
|
2499
2625
|
return reject(new Error("PlattarEmbed.startQRCode() - cannot execute as controller has not loaded yet"));
|
|
2500
2626
|
}
|
|
2501
2627
|
|
|
2502
|
-
return
|
|
2628
|
+
return _this31._controller.startQRCode(options).then(accept)["catch"](reject);
|
|
2503
2629
|
});
|
|
2504
2630
|
}
|
|
2505
2631
|
/**
|
|
@@ -2594,11 +2720,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2594
2720
|
Object.defineProperty(exports, "__esModule", {
|
|
2595
2721
|
value: true
|
|
2596
2722
|
});
|
|
2597
|
-
exports.ConfiguratorState = exports.Util = exports.RawAR = exports.ModelAR = exports.SceneAR = exports.SceneProductAR = exports.ProductAR = exports.version = exports.PlattarQRCode = exports.PlattarWeb = void 0;
|
|
2723
|
+
exports.ConfiguratorState = exports.Util = exports.RawAR = exports.ModelAR = exports.SceneAR = exports.SceneProductAR = exports.ProductAR = exports.LauncherAR = exports.version = exports.PlattarQRCode = exports.PlattarWeb = void 0;
|
|
2598
2724
|
exports.PlattarWeb = __importStar(require("@plattar/plattar-web"));
|
|
2599
2725
|
exports.PlattarQRCode = __importStar(require("@plattar/plattar-qrcode"));
|
|
2600
2726
|
exports.version = __importStar(require("./version"));
|
|
2601
2727
|
|
|
2728
|
+
var launcher_ar_1 = require("./ar/launcher-ar");
|
|
2729
|
+
|
|
2730
|
+
Object.defineProperty(exports, "LauncherAR", {
|
|
2731
|
+
enumerable: true,
|
|
2732
|
+
get: function get() {
|
|
2733
|
+
return launcher_ar_1.LauncherAR;
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
|
|
2602
2737
|
var product_ar_1 = require("./ar/product-ar");
|
|
2603
2738
|
|
|
2604
2739
|
Object.defineProperty(exports, "ProductAR", {
|
|
@@ -2674,6 +2809,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2674
2809
|
|
|
2675
2810
|
console.log("using @plattar/plattar-ar-adapter v" + version_1["default"]);
|
|
2676
2811
|
}, {
|
|
2812
|
+
"./ar/launcher-ar": 1,
|
|
2677
2813
|
"./ar/model-ar": 2,
|
|
2678
2814
|
"./ar/product-ar": 3,
|
|
2679
2815
|
"./ar/raw-ar": 4,
|
|
@@ -3108,7 +3244,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3108
3244
|
Object.defineProperty(exports, "__esModule", {
|
|
3109
3245
|
value: true
|
|
3110
3246
|
});
|
|
3111
|
-
exports["default"] = "1.
|
|
3247
|
+
exports["default"] = "1.130.2";
|
|
3112
3248
|
}, {}],
|
|
3113
3249
|
17: [function (require, module, exports) {
|
|
3114
3250
|
"use strict";
|
|
@@ -3147,17 +3283,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3147
3283
|
var _super11 = _createSuper(QuicklookViewer);
|
|
3148
3284
|
|
|
3149
3285
|
function QuicklookViewer() {
|
|
3150
|
-
var
|
|
3286
|
+
var _this32;
|
|
3151
3287
|
|
|
3152
3288
|
_classCallCheck(this, QuicklookViewer);
|
|
3153
3289
|
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3290
|
+
_this32 = _super11.call(this);
|
|
3291
|
+
_this32.araction = null;
|
|
3292
|
+
_this32.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
|
|
3157
3293
|
|
|
3158
|
-
|
|
3294
|
+
_this32.arcallback = function () {};
|
|
3159
3295
|
|
|
3160
|
-
return
|
|
3296
|
+
return _this32;
|
|
3161
3297
|
}
|
|
3162
3298
|
|
|
3163
3299
|
_createClass(QuicklookViewer, [{
|
|
@@ -3173,7 +3309,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3173
3309
|
}, {
|
|
3174
3310
|
key: "start",
|
|
3175
3311
|
value: function start() {
|
|
3176
|
-
var
|
|
3312
|
+
var _this33 = this;
|
|
3177
3313
|
|
|
3178
3314
|
if (!this.modelUrl) {
|
|
3179
3315
|
throw new Error("QuicklookViewer.start() - model url not set, use QuicklookViewer.modelUrl");
|
|
@@ -3188,7 +3324,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3188
3324
|
if (araction) {
|
|
3189
3325
|
var handleQuicklook = function handleQuicklook(event) {
|
|
3190
3326
|
if (event.data === "_apple_ar_quicklook_button_tapped") {
|
|
3191
|
-
|
|
3327
|
+
_this33.arcallback();
|
|
3192
3328
|
}
|
|
3193
3329
|
|
|
3194
3330
|
document.body.removeChild(anchor);
|
|
@@ -3295,16 +3431,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3295
3431
|
var _super13 = _createSuper(SceneViewer);
|
|
3296
3432
|
|
|
3297
3433
|
function SceneViewer() {
|
|
3298
|
-
var
|
|
3434
|
+
var _this34;
|
|
3299
3435
|
|
|
3300
3436
|
_classCallCheck(this, SceneViewer);
|
|
3301
3437
|
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
return
|
|
3438
|
+
_this34 = _super13.call(this);
|
|
3439
|
+
_this34.araction = null;
|
|
3440
|
+
_this34.isVertical = false;
|
|
3441
|
+
_this34.titleHTML = "<b>" + document.title;
|
|
3442
|
+
_this34.isVertical = false;
|
|
3443
|
+
return _this34;
|
|
3308
3444
|
}
|
|
3309
3445
|
|
|
3310
3446
|
_createClass(SceneViewer, [{
|
|
@@ -3416,7 +3552,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3416
3552
|
|
|
3417
3553
|
var Memory = /*#__PURE__*/function () {
|
|
3418
3554
|
function Memory(messengerInstance) {
|
|
3419
|
-
var
|
|
3555
|
+
var _this35 = this;
|
|
3420
3556
|
|
|
3421
3557
|
_classCallCheck(this, Memory);
|
|
3422
3558
|
|
|
@@ -3425,11 +3561,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3425
3561
|
this._permMemory = new PermanentMemory(messengerInstance);
|
|
3426
3562
|
|
|
3427
3563
|
this._messenger.self.__memory__set_temp_var = function (name, data) {
|
|
3428
|
-
|
|
3564
|
+
_this35._tempMemory[name] = data;
|
|
3429
3565
|
};
|
|
3430
3566
|
|
|
3431
3567
|
this._messenger.self.__memory__set_perm_var = function (name, data) {
|
|
3432
|
-
|
|
3568
|
+
_this35._permMemory[name] = data;
|
|
3433
3569
|
};
|
|
3434
3570
|
}
|
|
3435
3571
|
|
|
@@ -3927,20 +4063,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3927
4063
|
}, {
|
|
3928
4064
|
key: "exec",
|
|
3929
4065
|
value: function exec() {
|
|
3930
|
-
var
|
|
4066
|
+
var _this36 = this;
|
|
3931
4067
|
|
|
3932
4068
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
3933
4069
|
args[_key3] = arguments[_key3];
|
|
3934
4070
|
}
|
|
3935
4071
|
|
|
3936
4072
|
return new Promise(function (accept, reject) {
|
|
3937
|
-
if (!
|
|
3938
|
-
return reject(new Error("WrappedLocalFunction.exec() function with name " +
|
|
4073
|
+
if (!_this36._value) {
|
|
4074
|
+
return reject(new Error("WrappedLocalFunction.exec() function with name " + _this36._funcName + "() is not defined"));
|
|
3939
4075
|
}
|
|
3940
4076
|
|
|
3941
4077
|
try {
|
|
3942
4078
|
// otherwise execute the function
|
|
3943
|
-
var rObject =
|
|
4079
|
+
var rObject = _this36._execute.apply(_this36, args); // we need to check if the returned object is a Promise, if so, handle it
|
|
3944
4080
|
// differently. This can happen if the function wants to execute asyn
|
|
3945
4081
|
|
|
3946
4082
|
|
|
@@ -4004,7 +4140,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4004
4140
|
|
|
4005
4141
|
var GlobalEventHandler = /*#__PURE__*/function () {
|
|
4006
4142
|
function GlobalEventHandler() {
|
|
4007
|
-
var
|
|
4143
|
+
var _this37 = this;
|
|
4008
4144
|
|
|
4009
4145
|
_classCallCheck(this, GlobalEventHandler);
|
|
4010
4146
|
|
|
@@ -4026,10 +4162,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4026
4162
|
|
|
4027
4163
|
if (jsonData && jsonData.event && jsonData.data) {
|
|
4028
4164
|
// see if there are any listeners for this
|
|
4029
|
-
if (
|
|
4165
|
+
if (_this37._eventListeners[jsonData.event]) {
|
|
4030
4166
|
var remoteInterface = new RemoteInterface(evt.source, evt.origin); // loop through and call all the event handlers
|
|
4031
4167
|
|
|
4032
|
-
|
|
4168
|
+
_this37._eventListeners[jsonData.event].forEach(function (callback) {
|
|
4033
4169
|
try {
|
|
4034
4170
|
callback(remoteInterface, jsonData.data);
|
|
4035
4171
|
} catch (e) {
|
|
@@ -4225,40 +4361,40 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4225
4361
|
}, {
|
|
4226
4362
|
key: "_registerListeners",
|
|
4227
4363
|
value: function _registerListeners() {
|
|
4228
|
-
var
|
|
4364
|
+
var _this38 = this;
|
|
4229
4365
|
|
|
4230
4366
|
GlobalEventHandler.instance().listen("__messenger__child_init", function (src, data) {
|
|
4231
4367
|
var iframeID = src.id; // check reserved key list
|
|
4232
4368
|
|
|
4233
4369
|
switch (iframeID) {
|
|
4234
4370
|
case undefined:
|
|
4235
|
-
throw new Error("Messenger[" +
|
|
4371
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4236
4372
|
|
|
4237
4373
|
case "self":
|
|
4238
|
-
throw new Error("Messenger[" +
|
|
4374
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4239
4375
|
|
|
4240
4376
|
case "parent":
|
|
4241
|
-
throw new Error("Messenger[" +
|
|
4377
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4242
4378
|
|
|
4243
4379
|
case "id":
|
|
4244
|
-
throw new Error("Messenger[" +
|
|
4380
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4245
4381
|
|
|
4246
4382
|
case "onload":
|
|
4247
|
-
throw new Error("Messenger[" +
|
|
4383
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4248
4384
|
|
|
4249
4385
|
default:
|
|
4250
4386
|
break;
|
|
4251
4387
|
} // initialise the child iframe as a messenger pipe
|
|
4252
4388
|
|
|
4253
4389
|
|
|
4254
|
-
|
|
4390
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4255
4391
|
|
|
4256
|
-
|
|
4392
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4257
4393
|
|
|
4258
4394
|
|
|
4259
|
-
|
|
4395
|
+
_this38._broadcaster._push(iframeID);
|
|
4260
4396
|
|
|
4261
|
-
var callbacks =
|
|
4397
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4262
4398
|
|
|
4263
4399
|
if (callbacks.has(iframeID)) {
|
|
4264
4400
|
var array = callbacks.get(iframeID);
|
|
@@ -4282,33 +4418,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4282
4418
|
|
|
4283
4419
|
switch (iframeID) {
|
|
4284
4420
|
case undefined:
|
|
4285
|
-
throw new Error("Messenger[" +
|
|
4421
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4286
4422
|
|
|
4287
4423
|
case "self":
|
|
4288
|
-
throw new Error("Messenger[" +
|
|
4424
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4289
4425
|
|
|
4290
4426
|
case "parent":
|
|
4291
|
-
throw new Error("Messenger[" +
|
|
4427
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4292
4428
|
|
|
4293
4429
|
case "id":
|
|
4294
|
-
throw new Error("Messenger[" +
|
|
4430
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4295
4431
|
|
|
4296
4432
|
case "onload":
|
|
4297
|
-
throw new Error("Messenger[" +
|
|
4433
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4298
4434
|
|
|
4299
4435
|
default:
|
|
4300
4436
|
break;
|
|
4301
4437
|
} // initialise the child iframe as a messenger pipe
|
|
4302
4438
|
|
|
4303
4439
|
|
|
4304
|
-
|
|
4440
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4305
4441
|
|
|
4306
|
-
|
|
4442
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4307
4443
|
|
|
4308
4444
|
|
|
4309
|
-
|
|
4445
|
+
_this38._broadcaster._push(iframeID);
|
|
4310
4446
|
|
|
4311
|
-
var callbacks =
|
|
4447
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4312
4448
|
|
|
4313
4449
|
if (callbacks.has(iframeID)) {
|
|
4314
4450
|
var array = callbacks.get(iframeID);
|
|
@@ -4328,11 +4464,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4328
4464
|
});
|
|
4329
4465
|
GlobalEventHandler.instance().listen("__messenger__parent_init", function (src, data) {
|
|
4330
4466
|
var iframeID = "parent";
|
|
4331
|
-
|
|
4467
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4332
4468
|
|
|
4333
|
-
|
|
4469
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4334
4470
|
|
|
4335
|
-
var callbacks =
|
|
4471
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4336
4472
|
|
|
4337
4473
|
if (callbacks.has(iframeID)) {
|
|
4338
4474
|
var array = callbacks.get(iframeID);
|
|
@@ -4357,11 +4493,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4357
4493
|
|
|
4358
4494
|
GlobalEventHandler.instance().listen("__messenger__parent_init_inv", function (src, data) {
|
|
4359
4495
|
var iframeID = "parent";
|
|
4360
|
-
|
|
4496
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4361
4497
|
|
|
4362
|
-
|
|
4498
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4363
4499
|
|
|
4364
|
-
var callbacks =
|
|
4500
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4365
4501
|
|
|
4366
4502
|
if (callbacks.has(iframeID)) {
|
|
4367
4503
|
var array = callbacks.get(iframeID);
|
|
@@ -4599,7 +4735,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4599
4735
|
|
|
4600
4736
|
var WrappedRemoteFunction = /*#__PURE__*/function () {
|
|
4601
4737
|
function WrappedRemoteFunction(funcName, remoteInterface) {
|
|
4602
|
-
var
|
|
4738
|
+
var _this39 = this;
|
|
4603
4739
|
|
|
4604
4740
|
_classCallCheck(this, WrappedRemoteFunction);
|
|
4605
4741
|
|
|
@@ -4610,19 +4746,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4610
4746
|
GlobalEventHandler.instance().listen("__messenger__exec_fnc_result", function (src, data) {
|
|
4611
4747
|
var instanceID = data.instance_id; // the function name must match
|
|
4612
4748
|
|
|
4613
|
-
if (data.function_name !==
|
|
4749
|
+
if (data.function_name !== _this39._funcName) {
|
|
4614
4750
|
return;
|
|
4615
4751
|
} // the instance ID must be found, otherwise this is a rogue execution
|
|
4616
4752
|
// that can be ignored (should not happen)
|
|
4617
4753
|
|
|
4618
4754
|
|
|
4619
|
-
if (!
|
|
4755
|
+
if (!_this39._callInstances[instanceID]) {
|
|
4620
4756
|
return;
|
|
4621
4757
|
}
|
|
4622
4758
|
|
|
4623
|
-
var promise =
|
|
4759
|
+
var promise = _this39._callInstances[instanceID]; // remove the old instance
|
|
4624
4760
|
|
|
4625
|
-
delete
|
|
4761
|
+
delete _this39._callInstances[instanceID]; // perform the promise callbacks
|
|
4626
4762
|
|
|
4627
4763
|
if (data.function_status === "success") {
|
|
4628
4764
|
promise.accept(data.function_args);
|
|
@@ -4639,7 +4775,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4639
4775
|
_createClass(WrappedRemoteFunction, [{
|
|
4640
4776
|
key: "exec",
|
|
4641
4777
|
value: function exec() {
|
|
4642
|
-
var
|
|
4778
|
+
var _this40 = this;
|
|
4643
4779
|
|
|
4644
4780
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
4645
4781
|
args[_key4] = arguments[_key4];
|
|
@@ -4659,14 +4795,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4659
4795
|
|
|
4660
4796
|
return new Promise(function (accept, reject) {
|
|
4661
4797
|
// save this promise to be executed later
|
|
4662
|
-
|
|
4798
|
+
_this40._callInstances[instanceID] = {
|
|
4663
4799
|
accept: accept,
|
|
4664
4800
|
reject: reject
|
|
4665
4801
|
}; // execute this event in another context
|
|
4666
4802
|
|
|
4667
|
-
|
|
4803
|
+
_this40._remoteInterface.send("__messenger__exec_fnc", {
|
|
4668
4804
|
instance_id: instanceID,
|
|
4669
|
-
function_name:
|
|
4805
|
+
function_name: _this40._funcName,
|
|
4670
4806
|
function_args: args
|
|
4671
4807
|
});
|
|
4672
4808
|
});
|
|
@@ -4815,7 +4951,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4815
4951
|
|
|
4816
4952
|
var Analytics = /*#__PURE__*/function () {
|
|
4817
4953
|
function Analytics(applicationID) {
|
|
4818
|
-
var
|
|
4954
|
+
var _this41 = this;
|
|
4819
4955
|
|
|
4820
4956
|
_classCallCheck(this, Analytics);
|
|
4821
4957
|
|
|
@@ -4832,21 +4968,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4832
4968
|
|
|
4833
4969
|
this._handlePageHide = function () {
|
|
4834
4970
|
if (document.visibilityState === "hidden") {
|
|
4835
|
-
|
|
4836
|
-
} else if (
|
|
4971
|
+
_this41._pageTime = new Date();
|
|
4972
|
+
} else if (_this41._pageTime) {
|
|
4837
4973
|
var time2 = new Date();
|
|
4838
4974
|
|
|
4839
|
-
var diff = time2.getTime() -
|
|
4975
|
+
var diff = time2.getTime() - _this41._pageTime.getTime();
|
|
4840
4976
|
|
|
4841
|
-
var data =
|
|
4977
|
+
var data = _this41.data;
|
|
4842
4978
|
data.push("eventAction", "View Time");
|
|
4843
4979
|
data.push("viewTime", diff);
|
|
4844
4980
|
data.push("eventLabel", diff);
|
|
4845
4981
|
|
|
4846
|
-
|
|
4982
|
+
_this41.write();
|
|
4847
4983
|
|
|
4848
|
-
|
|
4849
|
-
document.removeEventListener("visibilitychange",
|
|
4984
|
+
_this41._pageTime = null;
|
|
4985
|
+
document.removeEventListener("visibilitychange", _this41._handlePageHide, false);
|
|
4850
4986
|
}
|
|
4851
4987
|
};
|
|
4852
4988
|
}
|
|
@@ -4854,7 +4990,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4854
4990
|
_createClass(Analytics, [{
|
|
4855
4991
|
key: "query",
|
|
4856
4992
|
value: function query() {
|
|
4857
|
-
var
|
|
4993
|
+
var _this42 = this;
|
|
4858
4994
|
|
|
4859
4995
|
var _query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
4860
4996
|
|
|
@@ -4863,11 +4999,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4863
4999
|
return reject(new Error("Analytics.query() - provided query was null"));
|
|
4864
5000
|
}
|
|
4865
5001
|
|
|
4866
|
-
var url =
|
|
5002
|
+
var url = _this42.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
4867
5003
|
var data = {
|
|
4868
5004
|
type: "read",
|
|
4869
|
-
application_id:
|
|
4870
|
-
event:
|
|
5005
|
+
application_id: _this42._applicationID,
|
|
5006
|
+
event: _this42.event,
|
|
4871
5007
|
data: _query
|
|
4872
5008
|
};
|
|
4873
5009
|
basic_http_1["default"].exec("POST", url, data).then(function (result) {
|
|
@@ -4878,21 +5014,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4878
5014
|
}, {
|
|
4879
5015
|
key: "write",
|
|
4880
5016
|
value: function write() {
|
|
4881
|
-
var
|
|
5017
|
+
var _this43 = this;
|
|
4882
5018
|
|
|
4883
5019
|
return new Promise(function (accept, reject) {
|
|
4884
|
-
var data =
|
|
4885
|
-
var url =
|
|
4886
|
-
data.push("applicationId",
|
|
5020
|
+
var data = _this43._data;
|
|
5021
|
+
var url = _this43.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
5022
|
+
data.push("applicationId", _this43._applicationID);
|
|
4887
5023
|
var sendData = {
|
|
4888
5024
|
type: "write",
|
|
4889
|
-
application_id:
|
|
4890
|
-
origin:
|
|
4891
|
-
event:
|
|
5025
|
+
application_id: _this43._applicationID,
|
|
5026
|
+
origin: _this43.origin,
|
|
5027
|
+
event: _this43.event,
|
|
4892
5028
|
data: data.data
|
|
4893
5029
|
};
|
|
4894
5030
|
|
|
4895
|
-
if (
|
|
5031
|
+
if (_this43.isBeacon === false) {
|
|
4896
5032
|
basic_http_1["default"].exec("POST", url, sendData).then(function (result) {
|
|
4897
5033
|
accept(result && result.results ? result.results : {});
|
|
4898
5034
|
})["catch"](reject);
|
|
@@ -5449,11 +5585,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5449
5585
|
}, {
|
|
5450
5586
|
key: "_get",
|
|
5451
5587
|
value: function _get(opt) {
|
|
5452
|
-
var
|
|
5588
|
+
var _this44 = this;
|
|
5453
5589
|
|
|
5454
5590
|
return new Promise(function (resolve, reject) {
|
|
5455
|
-
var target =
|
|
5456
|
-
var server =
|
|
5591
|
+
var target = _this44.target;
|
|
5592
|
+
var server = _this44.server; // we cannot perform a GET request without an ID
|
|
5457
5593
|
|
|
5458
5594
|
if (!target.id) {
|
|
5459
5595
|
reject(new Error("PlattarQuery." + target.type() + ".get() - object id is missing"));
|
|
@@ -5478,16 +5614,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5478
5614
|
var origin = server.originLocation.api_read;
|
|
5479
5615
|
var auth = server.authToken;
|
|
5480
5616
|
var headers = {
|
|
5481
|
-
'cookie': 'laravel_session=' +
|
|
5617
|
+
'cookie': 'laravel_session=' + _this44.getCookie('laravel_session')
|
|
5482
5618
|
};
|
|
5483
5619
|
Object.assign(headers, auth);
|
|
5484
5620
|
var reqopts = {
|
|
5485
5621
|
method: "GET",
|
|
5486
5622
|
headers: headers
|
|
5487
5623
|
};
|
|
5488
|
-
var includeQuery =
|
|
5624
|
+
var includeQuery = _this44._IncludeQuery;
|
|
5489
5625
|
|
|
5490
|
-
var params =
|
|
5626
|
+
var params = _this44._ParamFor("get");
|
|
5491
5627
|
|
|
5492
5628
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5493
5629
|
|
|
@@ -5528,11 +5664,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5528
5664
|
}, {
|
|
5529
5665
|
key: "_update",
|
|
5530
5666
|
value: function _update() {
|
|
5531
|
-
var
|
|
5667
|
+
var _this45 = this;
|
|
5532
5668
|
|
|
5533
5669
|
return new Promise(function (resolve, reject) {
|
|
5534
|
-
var target =
|
|
5535
|
-
var server =
|
|
5670
|
+
var target = _this45.target;
|
|
5671
|
+
var server = _this45.server; // we cannot perform a GET request without an ID
|
|
5536
5672
|
|
|
5537
5673
|
if (!target.id) {
|
|
5538
5674
|
reject(new Error("PlattarQuery." + target.type() + ".update() - object id is missing"));
|
|
@@ -5545,7 +5681,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5545
5681
|
var headers = {
|
|
5546
5682
|
'Accept': 'application/json',
|
|
5547
5683
|
'Content-Type': 'application/json',
|
|
5548
|
-
'cookie': 'laravel_session=' +
|
|
5684
|
+
'cookie': 'laravel_session=' + _this45.getCookie('laravel_session')
|
|
5549
5685
|
};
|
|
5550
5686
|
Object.assign(headers, auth);
|
|
5551
5687
|
var reqopts = {
|
|
@@ -5560,7 +5696,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5560
5696
|
})
|
|
5561
5697
|
};
|
|
5562
5698
|
|
|
5563
|
-
var params =
|
|
5699
|
+
var params = _this45._ParamFor("update");
|
|
5564
5700
|
|
|
5565
5701
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5566
5702
|
|
|
@@ -5602,18 +5738,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5602
5738
|
}, {
|
|
5603
5739
|
key: "_create",
|
|
5604
5740
|
value: function _create() {
|
|
5605
|
-
var
|
|
5741
|
+
var _this46 = this;
|
|
5606
5742
|
|
|
5607
5743
|
return new Promise(function (resolve, reject) {
|
|
5608
|
-
var target =
|
|
5609
|
-
var server =
|
|
5744
|
+
var target = _this46.target;
|
|
5745
|
+
var server = _this46.server; // otherwise, proceed with the fetching op
|
|
5610
5746
|
|
|
5611
5747
|
var origin = server.originLocation.api_write;
|
|
5612
5748
|
var auth = server.authToken;
|
|
5613
5749
|
var headers = {
|
|
5614
5750
|
'Accept': 'application/json',
|
|
5615
5751
|
'Content-Type': 'application/json',
|
|
5616
|
-
'cookie': 'laravel_session=' +
|
|
5752
|
+
'cookie': 'laravel_session=' + _this46.getCookie('laravel_session')
|
|
5617
5753
|
};
|
|
5618
5754
|
Object.assign(headers, auth);
|
|
5619
5755
|
var reqopts = {
|
|
@@ -5627,7 +5763,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5627
5763
|
})
|
|
5628
5764
|
};
|
|
5629
5765
|
|
|
5630
|
-
var params =
|
|
5766
|
+
var params = _this46._ParamFor("create");
|
|
5631
5767
|
|
|
5632
5768
|
var endpoint = origin + target.type();
|
|
5633
5769
|
|
|
@@ -5671,11 +5807,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5671
5807
|
}, {
|
|
5672
5808
|
key: "_delete",
|
|
5673
5809
|
value: function _delete() {
|
|
5674
|
-
var
|
|
5810
|
+
var _this47 = this;
|
|
5675
5811
|
|
|
5676
5812
|
return new Promise(function (resolve, reject) {
|
|
5677
|
-
var target =
|
|
5678
|
-
var server =
|
|
5813
|
+
var target = _this47.target;
|
|
5814
|
+
var server = _this47.server; // we cannot perform a GET request without an ID
|
|
5679
5815
|
|
|
5680
5816
|
if (!target.id) {
|
|
5681
5817
|
reject(new Error("PlattarQuery." + target.type() + ".delete() - object id is missing"));
|
|
@@ -5688,7 +5824,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5688
5824
|
var headers = {
|
|
5689
5825
|
'Accept': 'application/json',
|
|
5690
5826
|
'Content-Type': 'application/json',
|
|
5691
|
-
'cookie': 'laravel_session=' +
|
|
5827
|
+
'cookie': 'laravel_session=' + _this47.getCookie('laravel_session')
|
|
5692
5828
|
};
|
|
5693
5829
|
Object.assign(headers, auth);
|
|
5694
5830
|
var reqopts = {
|
|
@@ -5703,7 +5839,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5703
5839
|
})
|
|
5704
5840
|
};
|
|
5705
5841
|
|
|
5706
|
-
var params =
|
|
5842
|
+
var params = _this47._ParamFor("delete");
|
|
5707
5843
|
|
|
5708
5844
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5709
5845
|
|
|
@@ -5766,7 +5902,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5766
5902
|
}, {
|
|
5767
5903
|
key: "_include",
|
|
5768
5904
|
value: function _include(args) {
|
|
5769
|
-
var
|
|
5905
|
+
var _this48 = this;
|
|
5770
5906
|
|
|
5771
5907
|
if (!args || args.length <= 0) {
|
|
5772
5908
|
return this;
|
|
@@ -5779,21 +5915,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5779
5915
|
if (Array.isArray(obj)) {
|
|
5780
5916
|
obj.forEach(function (strObject) {
|
|
5781
5917
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
5782
|
-
|
|
5918
|
+
_this48._getIncludeQuery.push(strObject);
|
|
5783
5919
|
} else {
|
|
5784
|
-
throw new Error("PlattarQuery." +
|
|
5920
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument of Array must only include Strings");
|
|
5785
5921
|
}
|
|
5786
5922
|
});
|
|
5787
5923
|
} else if (PlattarUtil.isPlattarObject(obj)) {
|
|
5788
5924
|
var type = obj.type();
|
|
5789
5925
|
|
|
5790
5926
|
if (Array.isArray(type)) {
|
|
5791
|
-
|
|
5927
|
+
_this48._include(type);
|
|
5792
5928
|
} else {
|
|
5793
|
-
|
|
5929
|
+
_this48._getIncludeQuery.push(type);
|
|
5794
5930
|
}
|
|
5795
5931
|
} else {
|
|
5796
|
-
throw new Error("PlattarQuery." +
|
|
5932
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
5797
5933
|
}
|
|
5798
5934
|
});
|
|
5799
5935
|
return this;
|
|
@@ -5933,13 +6069,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5933
6069
|
}, {
|
|
5934
6070
|
key: "auth",
|
|
5935
6071
|
value: function auth(token, opt) {
|
|
5936
|
-
var
|
|
6072
|
+
var _this49 = this;
|
|
5937
6073
|
|
|
5938
6074
|
var copt = opt || {
|
|
5939
6075
|
validate: false
|
|
5940
6076
|
};
|
|
5941
6077
|
return new Promise(function (resolve, reject) {
|
|
5942
|
-
var server =
|
|
6078
|
+
var server = _this49.originLocation.api_write;
|
|
5943
6079
|
|
|
5944
6080
|
if (!server) {
|
|
5945
6081
|
reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));
|
|
@@ -5952,10 +6088,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5952
6088
|
}
|
|
5953
6089
|
|
|
5954
6090
|
if (!copt.validate) {
|
|
5955
|
-
|
|
6091
|
+
_this49._authToken = {
|
|
5956
6092
|
"plattar-auth-token": token
|
|
5957
6093
|
};
|
|
5958
|
-
resolve(
|
|
6094
|
+
resolve(_this49);
|
|
5959
6095
|
return;
|
|
5960
6096
|
}
|
|
5961
6097
|
|
|
@@ -5968,10 +6104,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5968
6104
|
};
|
|
5969
6105
|
fetch(endpoint, options).then(function (res) {
|
|
5970
6106
|
if (res.ok) {
|
|
5971
|
-
|
|
6107
|
+
_this49._authToken = {
|
|
5972
6108
|
"plattar-auth-token": token
|
|
5973
6109
|
};
|
|
5974
|
-
resolve(
|
|
6110
|
+
resolve(_this49);
|
|
5975
6111
|
} else {
|
|
5976
6112
|
reject(new Error("Plattar.auth(token) - failed to validate authentication token at " + endpoint));
|
|
5977
6113
|
}
|
|
@@ -5981,7 +6117,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5981
6117
|
}, {
|
|
5982
6118
|
key: "origin",
|
|
5983
6119
|
value: function origin(server, opt) {
|
|
5984
|
-
var
|
|
6120
|
+
var _this50 = this;
|
|
5985
6121
|
|
|
5986
6122
|
var copt = opt || {
|
|
5987
6123
|
validate: false
|
|
@@ -5993,8 +6129,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5993
6129
|
}
|
|
5994
6130
|
|
|
5995
6131
|
if (!copt.validate) {
|
|
5996
|
-
|
|
5997
|
-
resolve(
|
|
6132
|
+
_this50._serverLocation = server;
|
|
6133
|
+
resolve(_this50);
|
|
5998
6134
|
return;
|
|
5999
6135
|
}
|
|
6000
6136
|
|
|
@@ -6004,8 +6140,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6004
6140
|
};
|
|
6005
6141
|
fetch(endpoint, options).then(function (res) {
|
|
6006
6142
|
if (res.ok) {
|
|
6007
|
-
|
|
6008
|
-
resolve(
|
|
6143
|
+
_this50._serverLocation = server;
|
|
6144
|
+
resolve(_this50);
|
|
6009
6145
|
} else {
|
|
6010
6146
|
reject(new Error("Plattar.origin(server) - failed to ping server at " + endpoint));
|
|
6011
6147
|
}
|
|
@@ -6421,17 +6557,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6421
6557
|
var _super25 = _createSuper(FileBase);
|
|
6422
6558
|
|
|
6423
6559
|
function FileBase(id, server) {
|
|
6424
|
-
var
|
|
6560
|
+
var _this51;
|
|
6425
6561
|
|
|
6426
6562
|
_classCallCheck(this, FileBase);
|
|
6427
6563
|
|
|
6428
|
-
|
|
6564
|
+
_this51 = _super25.call(this, id, server || Server["default"]());
|
|
6429
6565
|
|
|
6430
|
-
if (
|
|
6566
|
+
if (_this51.constructor === FileBase) {
|
|
6431
6567
|
throw new Error("FileBase is abstract and cannot be created");
|
|
6432
6568
|
}
|
|
6433
6569
|
|
|
6434
|
-
return
|
|
6570
|
+
return _this51;
|
|
6435
6571
|
}
|
|
6436
6572
|
|
|
6437
6573
|
_createClass(FileBase, [{
|
|
@@ -6626,17 +6762,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6626
6762
|
var _super30 = _createSuper(PlattarBase);
|
|
6627
6763
|
|
|
6628
6764
|
function PlattarBase(id, server) {
|
|
6629
|
-
var
|
|
6765
|
+
var _this52;
|
|
6630
6766
|
|
|
6631
6767
|
_classCallCheck(this, PlattarBase);
|
|
6632
6768
|
|
|
6633
|
-
|
|
6769
|
+
_this52 = _super30.call(this, id, server || Server["default"]());
|
|
6634
6770
|
|
|
6635
|
-
if (
|
|
6771
|
+
if (_this52.constructor === PlattarBase) {
|
|
6636
6772
|
throw new Error("PlattarBase is abstract and cannot be created");
|
|
6637
6773
|
}
|
|
6638
6774
|
|
|
6639
|
-
return
|
|
6775
|
+
return _this52;
|
|
6640
6776
|
}
|
|
6641
6777
|
|
|
6642
6778
|
return _createClass(PlattarBase);
|
|
@@ -6708,7 +6844,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6708
6844
|
}, {
|
|
6709
6845
|
key: "filter",
|
|
6710
6846
|
value: function filter(obj, id) {
|
|
6711
|
-
var
|
|
6847
|
+
var _this53 = this;
|
|
6712
6848
|
|
|
6713
6849
|
if (!obj) {
|
|
6714
6850
|
return [];
|
|
@@ -6726,7 +6862,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6726
6862
|
if (Array.isArray(type)) {
|
|
6727
6863
|
var compiledList = [];
|
|
6728
6864
|
type.forEach(function (inObject) {
|
|
6729
|
-
var retArray =
|
|
6865
|
+
var retArray = _this53.filter(inObject, id);
|
|
6730
6866
|
|
|
6731
6867
|
if (retArray.length > 0) {
|
|
6732
6868
|
compiledList = compiledList.concat(retArray);
|
|
@@ -6929,7 +7065,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6929
7065
|
}, {
|
|
6930
7066
|
key: "include",
|
|
6931
7067
|
value: function include() {
|
|
6932
|
-
var
|
|
7068
|
+
var _this54 = this;
|
|
6933
7069
|
|
|
6934
7070
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
6935
7071
|
args[_key6] = arguments[_key6];
|
|
@@ -6945,15 +7081,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6945
7081
|
if (Array.isArray(obj)) {
|
|
6946
7082
|
obj.forEach(function (strObject) {
|
|
6947
7083
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
6948
|
-
includes.push("".concat(
|
|
7084
|
+
includes.push("".concat(_this54.type(), ".").concat(strObject));
|
|
6949
7085
|
} else {
|
|
6950
|
-
throw new Error("PlattarObject." +
|
|
7086
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument of Array must only include Strings");
|
|
6951
7087
|
}
|
|
6952
7088
|
});
|
|
6953
7089
|
} else if (obj.prototype instanceof PlattarObject) {
|
|
6954
|
-
includes.push("".concat(
|
|
7090
|
+
includes.push("".concat(_this54.type(), ".").concat(obj.type()));
|
|
6955
7091
|
} else {
|
|
6956
|
-
throw new Error("PlattarObject." +
|
|
7092
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
6957
7093
|
}
|
|
6958
7094
|
});
|
|
6959
7095
|
return includes;
|
|
@@ -7124,17 +7260,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7124
7260
|
var _super36 = _createSuper(CardBase);
|
|
7125
7261
|
|
|
7126
7262
|
function CardBase(id, server) {
|
|
7127
|
-
var
|
|
7263
|
+
var _this55;
|
|
7128
7264
|
|
|
7129
7265
|
_classCallCheck(this, CardBase);
|
|
7130
7266
|
|
|
7131
|
-
|
|
7267
|
+
_this55 = _super36.call(this, id, server || Server["default"]());
|
|
7132
7268
|
|
|
7133
|
-
if (
|
|
7269
|
+
if (_this55.constructor === CardBase) {
|
|
7134
7270
|
throw new Error("CardBase is abstract and cannot be created");
|
|
7135
7271
|
}
|
|
7136
7272
|
|
|
7137
|
-
return
|
|
7273
|
+
return _this55;
|
|
7138
7274
|
}
|
|
7139
7275
|
|
|
7140
7276
|
_createClass(CardBase, null, [{
|
|
@@ -7560,17 +7696,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7560
7696
|
var _super50 = _createSuper(ProductBase);
|
|
7561
7697
|
|
|
7562
7698
|
function ProductBase(id, server) {
|
|
7563
|
-
var
|
|
7699
|
+
var _this56;
|
|
7564
7700
|
|
|
7565
7701
|
_classCallCheck(this, ProductBase);
|
|
7566
7702
|
|
|
7567
|
-
|
|
7703
|
+
_this56 = _super50.call(this, id, server || Server["default"]());
|
|
7568
7704
|
|
|
7569
|
-
if (
|
|
7705
|
+
if (_this56.constructor === ProductBase) {
|
|
7570
7706
|
throw new Error("ProductBase is abstract and cannot be created");
|
|
7571
7707
|
}
|
|
7572
7708
|
|
|
7573
|
-
return
|
|
7709
|
+
return _this56;
|
|
7574
7710
|
}
|
|
7575
7711
|
|
|
7576
7712
|
_createClass(ProductBase, null, [{
|
|
@@ -7717,17 +7853,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7717
7853
|
var _super55 = _createSuper(SceneBase);
|
|
7718
7854
|
|
|
7719
7855
|
function SceneBase(id, server) {
|
|
7720
|
-
var
|
|
7856
|
+
var _this57;
|
|
7721
7857
|
|
|
7722
7858
|
_classCallCheck(this, SceneBase);
|
|
7723
7859
|
|
|
7724
|
-
|
|
7860
|
+
_this57 = _super55.call(this, id, server || Server["default"]());
|
|
7725
7861
|
|
|
7726
|
-
if (
|
|
7862
|
+
if (_this57.constructor === SceneBase) {
|
|
7727
7863
|
throw new Error("SceneBase is abstract and cannot be created");
|
|
7728
7864
|
}
|
|
7729
7865
|
|
|
7730
|
-
return
|
|
7866
|
+
return _this57;
|
|
7731
7867
|
}
|
|
7732
7868
|
|
|
7733
7869
|
_createClass(SceneBase, null, [{
|
|
@@ -8668,7 +8804,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8668
8804
|
_createClass(BaseElement, [{
|
|
8669
8805
|
key: "connectedCallback",
|
|
8670
8806
|
value: function connectedCallback() {
|
|
8671
|
-
var
|
|
8807
|
+
var _this58 = this;
|
|
8672
8808
|
|
|
8673
8809
|
if (this.hasAttribute("url")) {
|
|
8674
8810
|
this.renderQRCode();
|
|
@@ -8677,8 +8813,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8677
8813
|
var observer = new MutationObserver(function (mutations) {
|
|
8678
8814
|
mutations.forEach(function (mutation) {
|
|
8679
8815
|
if (mutation.type === "attributes") {
|
|
8680
|
-
if (
|
|
8681
|
-
|
|
8816
|
+
if (_this58.hasAttribute("url")) {
|
|
8817
|
+
_this58.renderQRCode();
|
|
8682
8818
|
}
|
|
8683
8819
|
}
|
|
8684
8820
|
});
|
|
@@ -8702,7 +8838,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8702
8838
|
}, {
|
|
8703
8839
|
key: "renderQRCode",
|
|
8704
8840
|
value: function renderQRCode() {
|
|
8705
|
-
var
|
|
8841
|
+
var _this59 = this;
|
|
8706
8842
|
|
|
8707
8843
|
var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
|
|
8708
8844
|
|
|
@@ -8812,11 +8948,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8812
8948
|
|
|
8813
8949
|
if (shortenURL && shortenURL.toLowerCase() === "true") {
|
|
8814
8950
|
this._ShortenURL(url).then(function (newURL) {
|
|
8815
|
-
|
|
8951
|
+
_this59._GenerateQRCode(newURL, width, height);
|
|
8816
8952
|
})["catch"](function (_err) {
|
|
8817
8953
|
console.warn(_err); // ignore error and just generate normal QR Code
|
|
8818
8954
|
|
|
8819
|
-
|
|
8955
|
+
_this59._GenerateQRCode(url, width, height);
|
|
8820
8956
|
});
|
|
8821
8957
|
} else {
|
|
8822
8958
|
this._GenerateQRCode(url, width, height);
|
|
@@ -8876,10 +9012,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8876
9012
|
}, {
|
|
8877
9013
|
key: "_ShortenURL",
|
|
8878
9014
|
value: function _ShortenURL(url) {
|
|
8879
|
-
var
|
|
9015
|
+
var _this60 = this;
|
|
8880
9016
|
|
|
8881
9017
|
return new Promise(function (accept, reject) {
|
|
8882
|
-
if (!
|
|
9018
|
+
if (!_this60._IsFetchAPISupported()) {
|
|
8883
9019
|
return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
|
|
8884
9020
|
}
|
|
8885
9021
|
|
|
@@ -9107,11 +9243,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9107
9243
|
}, {
|
|
9108
9244
|
key: "get",
|
|
9109
9245
|
value: function get() {
|
|
9110
|
-
var
|
|
9246
|
+
var _this61 = this;
|
|
9111
9247
|
|
|
9112
9248
|
return new Promise(function (accept, reject) {
|
|
9113
|
-
|
|
9114
|
-
remote_request_1.RemoteRequest.request(
|
|
9249
|
+
_this61._CalculateHash().then(function () {
|
|
9250
|
+
remote_request_1.RemoteRequest.request(_this61._GetPayload(), _this61.retry < 0 ? 0 : _this61.retry).then(accept)["catch"](reject);
|
|
9115
9251
|
})["catch"](function (_err) {
|
|
9116
9252
|
reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
|
|
9117
9253
|
});
|
|
@@ -9120,14 +9256,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9120
9256
|
}, {
|
|
9121
9257
|
key: "_CalculateHash",
|
|
9122
9258
|
value: function _CalculateHash() {
|
|
9123
|
-
var
|
|
9259
|
+
var _this62 = this;
|
|
9124
9260
|
|
|
9125
9261
|
return new Promise(function (accept, reject) {
|
|
9126
9262
|
var promises = [];
|
|
9127
9263
|
var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
|
|
9128
|
-
plattar_api_1.Server.create(plattar_api_1.Server.match(
|
|
9264
|
+
plattar_api_1.Server.create(plattar_api_1.Server.match(_this62.server));
|
|
9129
9265
|
|
|
9130
|
-
|
|
9266
|
+
_this62._maps.forEach(function (map) {
|
|
9131
9267
|
if (map.productvariation) {
|
|
9132
9268
|
promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
|
|
9133
9269
|
}
|
|
@@ -9147,7 +9283,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9147
9283
|
|
|
9148
9284
|
Promise.all(promises).then(function (values) {
|
|
9149
9285
|
values.forEach(function (value) {
|
|
9150
|
-
|
|
9286
|
+
_this62._attrHash.push(value.attributes);
|
|
9151
9287
|
}); // reset server back
|
|
9152
9288
|
|
|
9153
9289
|
plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
|
|
@@ -9249,14 +9385,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9249
9385
|
}, {
|
|
9250
9386
|
key: "get",
|
|
9251
9387
|
value: function get() {
|
|
9252
|
-
var
|
|
9388
|
+
var _this63 = this;
|
|
9253
9389
|
|
|
9254
9390
|
return new Promise(function (accept, reject) {
|
|
9255
|
-
if (!
|
|
9391
|
+
if (!_this63._model) {
|
|
9256
9392
|
return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
|
|
9257
9393
|
}
|
|
9258
9394
|
|
|
9259
|
-
remote_request_1.RemoteRequest.request(
|
|
9395
|
+
remote_request_1.RemoteRequest.request(_this63._Payload, _this63.retry < 0 ? 0 : _this63.retry).then(accept)["catch"](reject);
|
|
9260
9396
|
});
|
|
9261
9397
|
}
|
|
9262
9398
|
}, {
|
|
@@ -9505,6 +9641,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9505
9641
|
get: function get() {
|
|
9506
9642
|
return this._controller ? this._controller.context : undefined;
|
|
9507
9643
|
}
|
|
9644
|
+
}, {
|
|
9645
|
+
key: "parent",
|
|
9646
|
+
get: function get() {
|
|
9647
|
+
return this._controller ? this._controller.parent : undefined;
|
|
9648
|
+
}
|
|
9508
9649
|
}, {
|
|
9509
9650
|
key: "element",
|
|
9510
9651
|
get: function get() {
|
|
@@ -9577,19 +9718,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9577
9718
|
}, {
|
|
9578
9719
|
key: "allMappedAttributes",
|
|
9579
9720
|
get: function get() {
|
|
9580
|
-
var
|
|
9721
|
+
var _this64 = this;
|
|
9581
9722
|
|
|
9582
9723
|
var map = new Map();
|
|
9583
9724
|
var coreAttr = this.coreAttributes;
|
|
9584
9725
|
var optAttr = this.optionalAttributes;
|
|
9585
9726
|
coreAttr.forEach(function (ele) {
|
|
9586
|
-
if (
|
|
9587
|
-
map.set(ele.map,
|
|
9727
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9728
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9588
9729
|
}
|
|
9589
9730
|
});
|
|
9590
9731
|
optAttr.forEach(function (ele) {
|
|
9591
|
-
if (
|
|
9592
|
-
map.set(ele.map,
|
|
9732
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9733
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9593
9734
|
}
|
|
9594
9735
|
});
|
|
9595
9736
|
return map;
|
|
@@ -9689,7 +9830,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9689
9830
|
|
|
9690
9831
|
var ElementController = /*#__PURE__*/function () {
|
|
9691
9832
|
function ElementController(element) {
|
|
9692
|
-
var
|
|
9833
|
+
var _this65 = this;
|
|
9693
9834
|
|
|
9694
9835
|
_classCallCheck(this, ElementController);
|
|
9695
9836
|
|
|
@@ -9705,7 +9846,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9705
9846
|
|
|
9706
9847
|
if (mutation.type === 'attributes' && element.usesCoreAttribute(mutation.attributeName)) {
|
|
9707
9848
|
if (element.hasAllCoreAttributes) {
|
|
9708
|
-
|
|
9849
|
+
_this65._load();
|
|
9709
9850
|
}
|
|
9710
9851
|
}
|
|
9711
9852
|
}
|
|
@@ -9784,6 +9925,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9784
9925
|
get: function get() {
|
|
9785
9926
|
return messenger.self;
|
|
9786
9927
|
}
|
|
9928
|
+
}, {
|
|
9929
|
+
key: "parent",
|
|
9930
|
+
get: function get() {
|
|
9931
|
+
return messenger.parent;
|
|
9932
|
+
}
|
|
9787
9933
|
}, {
|
|
9788
9934
|
key: "controller",
|
|
9789
9935
|
get: function get() {
|
|
@@ -9805,7 +9951,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9805
9951
|
|
|
9806
9952
|
var IFrameController = /*#__PURE__*/function () {
|
|
9807
9953
|
function IFrameController(element, src, id) {
|
|
9808
|
-
var
|
|
9954
|
+
var _this66 = this;
|
|
9809
9955
|
|
|
9810
9956
|
var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
9811
9957
|
|
|
@@ -9817,7 +9963,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9817
9963
|
if (!element.hasAttribute("sameorigin")) {
|
|
9818
9964
|
this._iframe.onload = function () {
|
|
9819
9965
|
if (onelemload) {
|
|
9820
|
-
onelemload(
|
|
9966
|
+
onelemload(_this66._iframe);
|
|
9821
9967
|
}
|
|
9822
9968
|
};
|
|
9823
9969
|
}
|
|
@@ -9958,15 +10104,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9958
10104
|
var _super76 = _createSuper(EWallElement);
|
|
9959
10105
|
|
|
9960
10106
|
function EWallElement() {
|
|
9961
|
-
var
|
|
10107
|
+
var _this67;
|
|
9962
10108
|
|
|
9963
10109
|
_classCallCheck(this, EWallElement);
|
|
9964
10110
|
|
|
9965
|
-
|
|
10111
|
+
_this67 = _super76.call(this);
|
|
9966
10112
|
var tag = document.createElement("script");
|
|
9967
10113
|
tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
|
|
9968
10114
|
tag.defer = true;
|
|
9969
|
-
return
|
|
10115
|
+
return _this67;
|
|
9970
10116
|
}
|
|
9971
10117
|
|
|
9972
10118
|
_createClass(EWallElement, [{
|
|
@@ -10434,7 +10580,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
10434
10580
|
module.exports = Util;
|
|
10435
10581
|
}, {}],
|
|
10436
10582
|
129: [function (require, module, exports) {
|
|
10437
|
-
module.exports = "1.
|
|
10583
|
+
module.exports = "1.129.1";
|
|
10438
10584
|
}, {}],
|
|
10439
10585
|
130: [function (require, module, exports) {
|
|
10440
10586
|
(function (global) {
|