@subiz/widget-v4 4.1.168 → 4.1.169

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.
Files changed (37) hide show
  1. package/compiled_src/lib.js +2 -0
  2. package/compiled_src/store/api.js +0 -1
  3. package/compiled_src/store/api_fake.js +0 -1
  4. package/compiled_src/util/common.js +24 -0
  5. package/dist/198a92fcacc.app.js +1 -0
  6. package/dist/{198a731cfbb.chat.html → 198a92fcacc.chat.html} +1 -1
  7. package/dist/{198a731cfbb.library.js → 198a92fcacc.chat.js} +1 -1
  8. package/dist/{198a731cfbb.form.html → 198a92fcacc.form.html} +1 -1
  9. package/dist/198a92fcacc.form.js +1 -0
  10. package/dist/{198a731cfbb.index.html → 198a92fcacc.index.html} +3 -2
  11. package/dist/{198a731cfbb.library.html → 198a92fcacc.library.html} +3 -2
  12. package/dist/198a92fcacc.library.js +1 -0
  13. package/dist/{198a731cfbb.preview.html → 198a92fcacc.preview.html} +1 -1
  14. package/dist/198a92fcacc.preview.js +1 -0
  15. package/dist/198a92fcacc.webview.js +1 -0
  16. package/dist/HASH +1 -1
  17. package/dist/screenshoot.js +29 -2
  18. package/package.json +6 -6
  19. package/src/lib.js +2 -0
  20. package/src/store/api.js +0 -1
  21. package/src/store/api_fake.js +0 -1
  22. package/src/util/common.js +28 -0
  23. package/dist/198a731cfbb.app.js +0 -1
  24. package/dist/198a731cfbb.chat.js +0 -1
  25. package/dist/198a731cfbb.form.js +0 -1
  26. package/dist/198a731cfbb.preview.js +0 -1
  27. package/dist/198a731cfbb.webview.js +0 -1
  28. /package/dist/{198a731cfbb.127.js → 198a92fcacc.127.js} +0 -0
  29. /package/dist/{198a731cfbb.132.js → 198a92fcacc.132.js} +0 -0
  30. /package/dist/{198a731cfbb.185.js → 198a92fcacc.185.js} +0 -0
  31. /package/dist/{198a731cfbb.27.js → 198a92fcacc.27.js} +0 -0
  32. /package/dist/{198a731cfbb.278.js → 198a92fcacc.278.js} +0 -0
  33. /package/dist/{198a731cfbb.339.js → 198a92fcacc.339.js} +0 -0
  34. /package/dist/{198a731cfbb.459.js → 198a92fcacc.459.js} +0 -0
  35. /package/dist/{198a731cfbb.490.js → 198a92fcacc.490.js} +0 -0
  36. /package/dist/{198a731cfbb.74.js → 198a92fcacc.74.js} +0 -0
  37. /package/dist/{198a731cfbb.997.js → 198a92fcacc.997.js} +0 -0
@@ -112,7 +112,9 @@ class Widget {
112
112
  if (!id) return {
113
113
  error: 'empty_account_id'
114
114
  };
115
+ if (typeof sbz_info != 'undefined') sbz_info.set_account_1 = _index.default.Date.now();
115
116
  let outmask = await this.store.init(id, mask);
117
+ if (typeof sbz_info != 'undefined') sbz_info.set_account_2 = _index.default.Date.now();
116
118
  _index.default.setTimeout(() => window.postMessage({
117
119
  type: 'widget_loaded',
118
120
  account_id: id
@@ -10,7 +10,6 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
10
10
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  const ajax = require('@subiz/ajax/src/ajax.js');
13
- ajax.env.XMLHttpRequest = _index.default.XMLHttpRequest;
14
13
  function jsonifyTextPlain(param, done) {
15
14
  let req = param.request;
16
15
  if (req.content_type === 'text/plain' && req.body !== undefined) req.body = _index.default.stringify(req.body);
@@ -10,7 +10,6 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
10
10
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  const ajax = require('@subiz/ajax/src/ajax.js');
13
- ajax.env.XMLHttpRequest = window.XMLHttpRequest;
14
13
  function jsonifyTextPlain(param, done) {
15
14
  let req = param.request;
16
15
  if (req.content_type === 'text/plain' && req.body !== undefined) req.body = _index.default.stringify(req.body);
@@ -77,6 +77,7 @@ exports.unicodeToAscii = unicodeToAscii;
77
77
  exports.unixSec = unixSec;
78
78
  exports.usersOfConvo = usersOfConvo;
79
79
  var op = require('./op.js');
80
+ const ajax = require('@subiz/ajax/src/ajax.js');
80
81
  function rgbToHsl(r, g, b) {
81
82
  ;
82
83
  r /= 255, g /= 255, b /= 255;
@@ -266,6 +267,29 @@ var setInterval = exports.setInterval = f.contentWindow.setInterval.bind(f.conte
266
267
  var clearInterval = exports.clearInterval = f.contentWindow.clearInterval.bind(f.contentWindow);
267
268
  var clearTimeout = exports.clearTimeout = f.contentWindow.clearTimeout.bind(f.contentWindow);
268
269
  var XMLHttpRequest = exports.XMLHttpRequest = f.contentWindow.XMLHttpRequest;
270
+ const _originalOpen = XMLHttpRequest.prototype.open;
271
+ const _originalSend = XMLHttpRequest.prototype.send;
272
+ XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
273
+ this._url = url;
274
+ return _originalOpen.apply(this, arguments);
275
+ };
276
+ XMLHttpRequest.prototype.send = function (body) {
277
+ let old = this.onreadystatechange;
278
+ this.onreadystatechange = function (a, b, c) {
279
+ if (this.readyState != 4) return;
280
+ if (this.status >= 400 || this.status == 0) {
281
+ if (typeof sbz_logs == 'object') sbz_logs.push({
282
+ type: 'xhrfailed',
283
+ url: this._url,
284
+ status: this.status,
285
+ response: this.responseText
286
+ });
287
+ }
288
+ old(a, b, c);
289
+ };
290
+ return _originalSend.apply(this, arguments);
291
+ };
292
+ ajax.env.XMLHttpRequest = XMLHttpRequest;
269
293
  function convoOfEv(ev) {
270
294
  if (!ev) return '';
271
295
  return op.get(ev, 'data.conversation.id', op.get(ev, 'data.message.conversation_id'));