@subiz/widget-v4 4.1.167 → 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 (43) hide show
  1. package/app.js +2 -0
  2. package/compiled_src/lib.js +4 -0
  3. package/compiled_src/plugin.js +1 -0
  4. package/compiled_src/store/api.js +0 -1
  5. package/compiled_src/store/api_fake.js +0 -1
  6. package/compiled_src/util/common.js +24 -0
  7. package/dist/198a92fcacc.app.js +1 -0
  8. package/dist/{198a3614cdc.chat.html → 198a92fcacc.chat.html} +1 -1
  9. package/dist/198a92fcacc.chat.js +1 -0
  10. package/dist/{198a3614cdc.form.html → 198a92fcacc.form.html} +1 -1
  11. package/dist/198a92fcacc.form.js +1 -0
  12. package/dist/{198a3614cdc.index.html → 198a92fcacc.index.html} +3 -2
  13. package/dist/{198a3614cdc.library.html → 198a92fcacc.library.html} +3 -2
  14. package/dist/198a92fcacc.library.js +1 -0
  15. package/dist/{198a3614cdc.preview.html → 198a92fcacc.preview.html} +1 -1
  16. package/dist/198a92fcacc.preview.js +1 -0
  17. package/dist/198a92fcacc.webview.js +1 -0
  18. package/dist/HASH +1 -1
  19. package/dist/screenshoot.js +55 -35
  20. package/index.html +1 -0
  21. package/package.json +6 -6
  22. package/src/lib.js +6 -0
  23. package/src/plugin.js +1 -0
  24. package/src/store/api.js +0 -1
  25. package/src/store/api_fake.js +0 -1
  26. package/src/util/common.js +28 -0
  27. package/tracking.js +114 -36
  28. package/dist/198a3614cdc.app.js +0 -1
  29. package/dist/198a3614cdc.chat.js +0 -1
  30. package/dist/198a3614cdc.form.js +0 -1
  31. package/dist/198a3614cdc.library.js +0 -1
  32. package/dist/198a3614cdc.preview.js +0 -1
  33. package/dist/198a3614cdc.webview.js +0 -1
  34. /package/dist/{198a3614cdc.127.js → 198a92fcacc.127.js} +0 -0
  35. /package/dist/{198a3614cdc.132.js → 198a92fcacc.132.js} +0 -0
  36. /package/dist/{198a3614cdc.185.js → 198a92fcacc.185.js} +0 -0
  37. /package/dist/{198a3614cdc.27.js → 198a92fcacc.27.js} +0 -0
  38. /package/dist/{198a3614cdc.278.js → 198a92fcacc.278.js} +0 -0
  39. /package/dist/{198a3614cdc.339.js → 198a92fcacc.339.js} +0 -0
  40. /package/dist/{198a3614cdc.459.js → 198a92fcacc.459.js} +0 -0
  41. /package/dist/{198a3614cdc.490.js → 198a92fcacc.490.js} +0 -0
  42. /package/dist/{198a3614cdc.74.js → 198a92fcacc.74.js} +0 -0
  43. /package/dist/{198a3614cdc.997.js → 198a92fcacc.997.js} +0 -0
package/app.js CHANGED
@@ -122,7 +122,9 @@ function init() {
122
122
  queue.forEach(callV2)
123
123
  }
124
124
 
125
+ if (typeof sbz_info != 'undefined') sbz_info.init = Date.now()
125
126
  apiV4.store.readyGate.entry().then(function () {
127
+ if (typeof sbz_info != 'undefined') sbz_info.store_ready = Date.now()
126
128
  apiV4.store.track()
127
129
  RunBot(apiV4.store)
128
130
  })
@@ -108,10 +108,13 @@ class Widget {
108
108
  return outmask;
109
109
  }
110
110
  async setAccount(id, $container, mask, cb) {
111
+ if (typeof sbz_info != 'undefined') sbz_info.set_account = _index.default.Date.now();
111
112
  if (!id) return {
112
113
  error: 'empty_account_id'
113
114
  };
115
+ if (typeof sbz_info != 'undefined') sbz_info.set_account_1 = _index.default.Date.now();
114
116
  let outmask = await this.store.init(id, mask);
117
+ if (typeof sbz_info != 'undefined') sbz_info.set_account_2 = _index.default.Date.now();
115
118
  _index.default.setTimeout(() => window.postMessage({
116
119
  type: 'widget_loaded',
117
120
  account_id: id
@@ -124,6 +127,7 @@ class Widget {
124
127
  _index.default.clearInterval(clean);
125
128
  }, 1000);
126
129
  this.domGate.open();
130
+ if (typeof sbz_info != 'undefined') sbz_info.set_account_done = _index.default.Date.now();
127
131
  cb && cb(outmask);
128
132
  return outmask;
129
133
  }
@@ -61,6 +61,7 @@ function Plugin(plugin, store, $container, lib) {
61
61
  if (!$div) return;
62
62
  if (!this.t) return;
63
63
  if (plugin.type === 'chatbox') {
64
+ if (typeof sbz_info != 'undefined') sbz_info.render_chatbox = _index.default.Date.now();
64
65
  (0, _preact.render)((0, _preact.h)(_main.default, {
65
66
  destroy: _destroy,
66
67
  plugin: plugin,
@@ -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'));