@subiz/widget-v4 4.1.60 → 4.1.62
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/app.js +6 -0
- package/compiled_src/call/call.js +2 -2
- package/compiled_src/chatbox/DropdownSelect.js +2 -2
- package/compiled_src/chatbox/ImageAttachments.js +2 -2
- package/compiled_src/chatbox/MessageInput.js +2 -2
- package/compiled_src/chatbox/Order.js +2 -2
- package/compiled_src/chatbox/Rating.js +2 -2
- package/compiled_src/chatbox/Widget.js +2 -2
- package/compiled_src/contact/contact.js +2 -2
- package/compiled_src/lib.js +2 -2
- package/compiled_src/notif/notif.js +2 -2
- package/compiled_src/order/address_picker.js +2 -2
- package/compiled_src/order/order.js +2 -2
- package/compiled_src/popup/countdown.js +2 -2
- package/compiled_src/popup/popup.js +2 -2
- package/compiled_src/store/api.js +2 -2
- package/compiled_src/store/api_fake.js +2 -2
- package/compiled_src/store/store.js +2 -2
- package/dist/{605.js → 104.js} +59 -60
- package/dist/{178.js → 176.js} +55 -55
- package/dist/18d7db7ca8c.104.js +1 -0
- package/dist/18d7db7ca8c.176.js +1 -0
- package/dist/{18a02a9c54e.782.js → 18d7db7ca8c.444.js} +1 -1
- package/dist/18d7db7ca8c.508.js +1 -0
- package/dist/18d7db7ca8c.672.js +1 -0
- package/dist/18d7db7ca8c.756.js +1 -0
- package/dist/18d7db7ca8c.792.js +1 -0
- package/dist/18d7db7ca8c.928.js +1 -0
- package/dist/18d7db7ca8c.app.js +1 -0
- package/dist/{18a02a9c54e.index.html → 18d7db7ca8c.index.html} +4 -4
- package/dist/{18a02a9c54e.library.html → 18d7db7ca8c.library.html} +4 -4
- package/dist/18d7db7ca8c.library.js +1 -0
- package/dist/{18a02a9c54e.preview.html → 18d7db7ca8c.preview.html} +1 -1
- package/dist/18d7db7ca8c.preview.js +1 -0
- package/dist/18d7db7ca8c.screenshoot.js +1 -0
- package/dist/18d7db7ca8c.webview.js +1 -0
- package/dist/{782.js → 444.js} +7 -7
- package/dist/{335.js → 508.js} +34 -34
- package/dist/{678.js → 672.js} +6 -6
- package/dist/{362.js → 756.js} +7 -7
- package/dist/{213.js → 792.js} +143 -127
- package/dist/{132.js → 928.js} +817 -793
- package/dist/HASH +1 -1
- package/dist/malicious-app.js +9 -3
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +615 -691
- package/malicious-app.js +4 -8
- package/package.json +10 -10
- package/dist/18a02a9c54e.132.js +0 -1
- package/dist/18a02a9c54e.178.js +0 -1
- package/dist/18a02a9c54e.213.js +0 -1
- package/dist/18a02a9c54e.335.js +0 -1
- package/dist/18a02a9c54e.362.js +0 -1
- package/dist/18a02a9c54e.441.js +0 -1
- package/dist/18a02a9c54e.605.js +0 -1
- package/dist/18a02a9c54e.678.js +0 -1
- package/dist/18a02a9c54e.app.js +0 -1
- package/dist/18a02a9c54e.library.js +0 -1
- package/dist/18a02a9c54e.preview.js +0 -1
- package/dist/18a02a9c54e.screenshoot.js +0 -1
- package/dist/18a02a9c54e.webview.js +0 -1
- package/dist/441.js +0 -2855
package/app.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
var nav = window.navigator
|
|
2
|
+
if (nav && nav.userAgent && nav.userAgent.indexOf && nav.userAgent.indexOf('subizbot') > -1) {
|
|
3
|
+
throw new Error('dont run with subiz bot')
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
if (window._subiz_init_2094850928430 && !window._subiz_init_2094850928430_keep_loading) {
|
|
2
7
|
throw new Error('subiz have already initialized')
|
|
3
8
|
}
|
|
9
|
+
|
|
4
10
|
window._subiz_init_2094850928430 = true
|
|
5
11
|
window._subiz_init_2094850928430_keep_loading = false
|
|
6
12
|
|
|
@@ -9,8 +9,8 @@ var _preact = require("preact");
|
|
|
9
9
|
var _common = require("../common.js");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
let notifCSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
|
|
@@ -10,8 +10,8 @@ var _preact = require("preact");
|
|
|
10
10
|
var _spinner = _interopRequireDefault(require("./spinner.js"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
class DropdownSelect extends _common.Com {
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
@@ -9,8 +9,8 @@ var _common = require("../common.js");
|
|
|
9
9
|
var _preact = require("preact");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
14
|
class ImageAttachment extends _common.Com {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
@@ -10,8 +10,8 @@ var _preact = require("preact");
|
|
|
10
10
|
var _Emoji = _interopRequireDefault(require("./Emoji.js"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
class MessageInput extends _common.Com {
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
@@ -12,8 +12,8 @@ var _preact = require("preact");
|
|
|
12
12
|
var _order = _interopRequireDefault(require("../order/order.js"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
|
+
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); }
|
|
17
17
|
const POPUP_MAX_HEIGHT = 400;
|
|
18
18
|
const POPUP_HARD_MAX_HEIGHT = 500;
|
|
19
19
|
const POPUP_MIN_HEIGHT = 0;
|
|
@@ -10,8 +10,8 @@ var _common = require("../common.js");
|
|
|
10
10
|
var _preact = require("preact");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
const POPUP_MAX_HEIGHT = 400;
|
|
16
16
|
const POPUP_HARD_MAX_HEIGHT = 500;
|
|
17
17
|
const POPUP_MIN_HEIGHT = 0;
|
|
@@ -21,8 +21,8 @@ var _common = require("../common.js");
|
|
|
21
21
|
var _preact = require("preact");
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
-
function _toPropertyKey(
|
|
25
|
-
function _toPrimitive(
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
25
|
+
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); }
|
|
26
26
|
var send = require('../../assets/img/send.svg');
|
|
27
27
|
var checkedimg = require('../../assets/img/done_gray.svg');
|
|
28
28
|
var empty = require('../../assets/img/empty.svg');
|
|
@@ -10,8 +10,8 @@ var _preact = require("preact");
|
|
|
10
10
|
var _common = require("../common.js");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
let CSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
|
package/compiled_src/lib.js
CHANGED
|
@@ -9,8 +9,8 @@ var _index = _interopRequireDefault(require("./util/index.js"));
|
|
|
9
9
|
var _plugin = _interopRequireDefault(require("./plugin.js"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
14
|
var $link = document.createElement('link');
|
|
15
15
|
$link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap';
|
|
16
16
|
$link.rel = 'stylesheet';
|
|
@@ -9,8 +9,8 @@ var _preact = require("preact");
|
|
|
9
9
|
var _common = require("../common.js");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
let notifCSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
|
|
@@ -10,8 +10,8 @@ var _preact = require("preact");
|
|
|
10
10
|
var _spinner = _interopRequireDefault(require("../chatbox/spinner.js"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
class AddressPicker extends _common.Com {
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
@@ -16,8 +16,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
function _toPropertyKey(
|
|
20
|
-
function _toPrimitive(
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
20
|
+
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); }
|
|
21
21
|
var checkedimg = require('../../assets/img/done_green.svg');
|
|
22
22
|
var ximg = require('../../assets/img/x.svg');
|
|
23
23
|
class Order extends common.Com {
|
|
@@ -11,8 +11,8 @@ var _tickViewFlipCommonjs = _interopRequireDefault(require("./tick.view.flip.com
|
|
|
11
11
|
var _preact = require("preact");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(
|
|
15
|
-
function _toPrimitive(
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
15
|
+
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); }
|
|
16
16
|
_tickCoreCommonjs.default.plugin.add(_tickViewFlipCommonjs.default);
|
|
17
17
|
class Countdown extends _common.Com {
|
|
18
18
|
constructor(props) {
|
|
@@ -10,8 +10,8 @@ var _preact = require("preact");
|
|
|
10
10
|
var _common = require("../common.js");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
14
|
+
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); }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
let popupCSS = (() => Promise.resolve().then(() => _interopRequireWildcard(require('./css.js'))))();
|
|
@@ -7,8 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var _index = _interopRequireDefault(require("../util/index.js"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
-
function _toPropertyKey(
|
|
11
|
-
function _toPrimitive(
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
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
13
|
ajax.env.XMLHttpRequest = _index.default.XMLHttpRequest;
|
|
14
14
|
function jsonifyTextPlain(param, done) {
|
|
@@ -7,8 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var _index = _interopRequireDefault(require("../util/index.js"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
-
function _toPropertyKey(
|
|
11
|
-
function _toPrimitive(
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
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
13
|
ajax.env.XMLHttpRequest = window.XMLHttpRequest;
|
|
14
14
|
const findAnswer = challenge => challenge.answer;
|
|
@@ -11,8 +11,8 @@ var _api_fake = _interopRequireDefault(require("./api_fake.js"));
|
|
|
11
11
|
var _realtime_fake = _interopRequireDefault(require("./realtime_fake.js"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(
|
|
15
|
-
function _toPrimitive(
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
15
|
+
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); }
|
|
16
16
|
var flow = require('@subiz/flow');
|
|
17
17
|
var Realtime = require('@subiz/wsclient');
|
|
18
18
|
var cookie = require('cookie_js');
|
package/dist/{605.js → 104.js}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[
|
|
2
|
+
(self["webpackChunk_subiz_widget_v4"] = self["webpackChunk_subiz_widget_v4"] || []).push([[104],{
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 3104:
|
|
5
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
6
|
|
|
7
7
|
__webpack_require__.r(__webpack_exports__);
|
|
8
8
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
9
|
/* harmony export */ "default": () => (/* binding */ Notif)
|
|
10
10
|
/* harmony export */ });
|
|
11
|
-
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
12
|
-
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
13
|
-
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
11
|
+
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5780);
|
|
12
|
+
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4284);
|
|
13
|
+
/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6304);
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
|
+
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); }
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
let notifCSS = (() => __webpack_require__.e(/* import() */
|
|
21
|
-
class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .
|
|
20
|
+
let notifCSS = (() => __webpack_require__.e(/* import() */ 756).then(__webpack_require__.bind(__webpack_require__, 3756)))();
|
|
21
|
+
class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .Sq {
|
|
22
22
|
constructor(props) {
|
|
23
23
|
super(props);
|
|
24
24
|
_defineProperty(this, "state", {
|
|
@@ -32,19 +32,19 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
32
32
|
title: '',
|
|
33
33
|
last_show: 0
|
|
34
34
|
});
|
|
35
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
35
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setTimeout(async () => {
|
|
36
36
|
let {
|
|
37
37
|
body: impression
|
|
38
38
|
} = await this.props.store.sendImpression(this.props.plugin.id);
|
|
39
|
-
this.impressionToken = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
40
|
-
let image = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
41
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
39
|
+
this.impressionToken = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(impression, 'impression_token') || '';
|
|
40
|
+
let image = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.background_url');
|
|
41
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.preloadImg(image, () => this.setState({
|
|
42
42
|
imageReady: true
|
|
43
43
|
}));
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
setOver(over) {
|
|
47
|
-
if (!over) this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
47
|
+
if (!over) this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now();else this.mouse_leave = 0;
|
|
48
48
|
}
|
|
49
49
|
randomTimestampt() {
|
|
50
50
|
let random = Math.floor(Math.random() * 5);
|
|
@@ -55,13 +55,12 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
55
55
|
return '4 ' + this.props.t('minutes_ago');
|
|
56
56
|
}
|
|
57
57
|
onClick(e) {
|
|
58
|
-
e.stopPropagation();
|
|
59
58
|
if (this.props.plugin._dont_follow) return;
|
|
60
59
|
this.props.store.sendConversion(this.props.plugin.id, null, this.impressionToken);
|
|
61
|
-
let url = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
60
|
+
let url = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.url');
|
|
62
61
|
if (!url) return;
|
|
63
62
|
if (!url.startsWith('http://') && !url.startsWith('https://')) url = '//' + url;
|
|
64
|
-
let new_tab = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
63
|
+
let new_tab = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.new_tab', false);
|
|
65
64
|
if (new_tab) return window.open(url);
|
|
66
65
|
window.location.href = url;
|
|
67
66
|
}
|
|
@@ -98,24 +97,24 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
98
97
|
}
|
|
99
98
|
async waitForT() {
|
|
100
99
|
if (this.props.t) return;
|
|
101
|
-
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
100
|
+
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.sleep(100);
|
|
102
101
|
return this.waitForT();
|
|
103
102
|
}
|
|
104
103
|
async setClose(close) {
|
|
105
104
|
await this.waitForT();
|
|
106
105
|
if (!this.props.t) return;
|
|
107
106
|
if (!close) {
|
|
108
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
107
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.clearTimeout(this.lastCloseTimeout);
|
|
109
108
|
this.setState({
|
|
110
109
|
closeAnimation: false
|
|
111
110
|
});
|
|
112
111
|
let timestamp = this.randomTimestampt();
|
|
113
|
-
let profiles = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
114
|
-
let user = profiles[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
112
|
+
let profiles = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.profiles', []);
|
|
113
|
+
let user = profiles[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.size(profiles))] || {};
|
|
115
114
|
if (user.avatar_url && user.avatar_url.startsWith('http')) {
|
|
116
|
-
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
115
|
+
await _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.preloadImg(user.avatar_url);
|
|
117
116
|
}
|
|
118
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
117
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.map(_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props.plugin, 'notification.custom_avatar_urls'), url => {
|
|
119
118
|
profiles.push({
|
|
120
119
|
type: 'person',
|
|
121
120
|
fullname: randomName(),
|
|
@@ -126,48 +125,48 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
126
125
|
age: randomAge()
|
|
127
126
|
});
|
|
128
127
|
});
|
|
129
|
-
let i18n_messages = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
130
|
-
let i18n_message = i18n_messages[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
131
|
-
let fallbackmsgs = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
132
|
-
let fallbackmessage = fallbackmsgs[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
133
|
-
let i18n_title = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
128
|
+
let i18n_messages = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.i18n_message_quill_deltas', []);
|
|
129
|
+
let i18n_message = i18n_messages[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.size(i18n_messages))];
|
|
130
|
+
let fallbackmsgs = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.message_quill_deltas', []);
|
|
131
|
+
let fallbackmessage = fallbackmsgs[Math.floor(Math.random() * _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.size(fallbackmsgs))];
|
|
132
|
+
let i18n_title = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.i18n_title_quill_delta');
|
|
134
133
|
return this.setState({
|
|
135
134
|
close: false,
|
|
136
|
-
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
135
|
+
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now(),
|
|
137
136
|
timestamp: timestamp,
|
|
138
137
|
user: user,
|
|
139
|
-
title: this.props.t.i18n(i18n_title) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
138
|
+
title: this.props.t.i18n(i18n_title) || _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props, 'plugin.notification.title_quill_delta'),
|
|
140
139
|
message: this.props.t.i18n(i18n_message) || fallbackmessage
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
142
|
this.setState({
|
|
144
143
|
closeAnimation: true
|
|
145
144
|
});
|
|
146
|
-
this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
147
|
-
this.lastCloseTimeout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
145
|
+
this.mouse_leave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now();
|
|
146
|
+
this.lastCloseTimeout = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setTimeout(() => this.setState({
|
|
148
147
|
close: true,
|
|
149
148
|
closeAnimation: false
|
|
150
149
|
}), 150);
|
|
151
|
-
if (this.props.plugin._dont_close) _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
150
|
+
if (this.props.plugin._dont_close) _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setTimeout(() => this.setState({
|
|
152
151
|
closeAnimation: false,
|
|
153
152
|
close: false
|
|
154
153
|
}), 1000);
|
|
155
154
|
}
|
|
156
155
|
async refreshCSS() {
|
|
157
156
|
let plugins = this.props.store.matchPlugin();
|
|
158
|
-
let found = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
157
|
+
let found = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.find(plugins, plugin => plugin.id === this.props.plugin.id);
|
|
159
158
|
if (!found) return;
|
|
160
159
|
let css = (await notifCSS).default.default.toString();
|
|
161
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
160
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setCss(this.props.plugin.id, this.$cssStyleDiv, css);
|
|
162
161
|
this.setClose(this.state.close);
|
|
163
162
|
}
|
|
164
163
|
componentWillUnmount() {
|
|
165
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
166
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
164
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.clearInterval(this.interval);
|
|
165
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
|
|
167
166
|
}
|
|
168
167
|
async componentDidMount() {
|
|
169
168
|
this.setState({
|
|
170
|
-
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
169
|
+
last_show: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now()
|
|
171
170
|
});
|
|
172
171
|
this.$cssStyleDiv = document.getElementById('subiz-style-for-' + this.props.plugin.id);
|
|
173
172
|
if (!this.$cssStyleDiv) {
|
|
@@ -178,20 +177,20 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
178
177
|
}
|
|
179
178
|
this.props.store.onResetCSS(this, () => this.refreshCSS());
|
|
180
179
|
await this.refreshCSS();
|
|
181
|
-
this.interval = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
180
|
+
this.interval = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setInterval(() => {
|
|
182
181
|
if (this.props._destroy) return this.componentWillUnmount();
|
|
183
182
|
let mouseleave = this.mouse_leave;
|
|
184
|
-
if (mouseleave === 0) mouseleave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
185
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
183
|
+
if (mouseleave === 0) mouseleave = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now();
|
|
184
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now() - mouseleave < 1000) return;
|
|
186
185
|
if (!this.state.close && !this.props.plugin._dont_close) {
|
|
187
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
186
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now() - this.state.last_show > 8000) return this.setClose(true);
|
|
188
187
|
return;
|
|
189
188
|
}
|
|
190
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
189
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.Date.now() - this.state.last_show > this.props.plugin.notification.interval_sec) {
|
|
191
190
|
return this.setClose(false);
|
|
192
191
|
}
|
|
193
192
|
}, 1000);
|
|
194
|
-
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
193
|
+
_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.setTimeout(() => {
|
|
195
194
|
this.setState({
|
|
196
195
|
cssready: true
|
|
197
196
|
});
|
|
@@ -199,21 +198,21 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
199
198
|
}, 50);
|
|
200
199
|
}
|
|
201
200
|
renderTextFromQuillDelta(quilldelta, profile) {
|
|
202
|
-
let qd = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
201
|
+
let qd = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.parseJSON(quilldelta);
|
|
203
202
|
if (!qd || !qd.ops) return null;
|
|
204
|
-
let out = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
203
|
+
let out = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.map(qd.ops, op => {
|
|
205
204
|
let out = null;
|
|
206
205
|
if (!op.insert) return null;
|
|
207
206
|
if (typeof op.insert == 'string') out = op.insert;
|
|
208
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
209
|
-
let key = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
207
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(op, 'insert.dynamicField')) {
|
|
208
|
+
let key = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(op, 'insert.dynamicField.key');
|
|
210
209
|
if (key === 'user.fullname') out = profile.fullname;
|
|
211
210
|
if (key === 'user.email') out = profile.email;
|
|
212
211
|
if (key === 'user.address') out = profile.address;
|
|
213
212
|
if (key === 'user.phone') out = profile.phone;
|
|
214
213
|
}
|
|
215
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
216
|
-
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
214
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(op, 'attributes.bold')) out = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("b", null, out);
|
|
215
|
+
if (_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(op, 'attributes.italic')) out = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("b", null, out);
|
|
217
216
|
return out;
|
|
218
217
|
}).filter(a => a);
|
|
219
218
|
if (out.length == 1 && (out[0] == '\n' || out[0] == '')) return [];
|
|
@@ -225,11 +224,11 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
225
224
|
if (!this.state.imageReady) return null;
|
|
226
225
|
if (this.state.close) return null;
|
|
227
226
|
if (!this.state.message) return null;
|
|
228
|
-
let notif = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
227
|
+
let notif = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(this.props.plugin, 'notification', {});
|
|
229
228
|
if (!notif) return null;
|
|
230
229
|
let animation = '';
|
|
231
|
-
let pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
232
|
-
if (this.props.mobile) pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
230
|
+
let pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(notif, 'position', 'bottom-left');
|
|
231
|
+
if (this.props.mobile) pos = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(notif, 'mobile_position', pos);
|
|
233
232
|
if (pos === 'top-left' || pos === 'top-right') animation = 'fadeInDown';else if (pos === 'top-center') animation = 'fadeInDownCenter';else if (pos === 'bottom-center') animation = 'fadeInUpCenter';else if (pos === 'bottom-right') {
|
|
234
233
|
animation = 'fadeInUpBig';
|
|
235
234
|
} else {
|
|
@@ -238,7 +237,7 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
238
237
|
}
|
|
239
238
|
let user = this.state.user || {};
|
|
240
239
|
let subtextStyle = notif.subtext_style || {};
|
|
241
|
-
if (subtextStyle.color === undefined) subtextStyle.color = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
240
|
+
if (subtextStyle.color === undefined) subtextStyle.color = _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.get(notif, 'message_style.color', 'black');
|
|
242
241
|
let st = 'position: fixed !important; z-index: 1000000000 !important';
|
|
243
242
|
if (this.props.plugin._preview) st = 'position: absolute !important;';
|
|
244
243
|
if (this.state.closeAnimation) animation = 'fadeOut';
|
|
@@ -250,11 +249,11 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
250
249
|
});
|
|
251
250
|
let $time = (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
252
251
|
class: "notif_time",
|
|
253
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
252
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.js2css(notif.subtext_style)
|
|
254
253
|
}, this.state.timestamp);
|
|
255
254
|
let $title = this.renderTextFromQuillDelta(this.state.title, user);
|
|
256
255
|
let $message = this.renderTextFromQuillDelta(this.state.message, user);
|
|
257
|
-
if (!_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
256
|
+
if (!_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.size($title) && !_util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.size($message)) $time = null;
|
|
258
257
|
return (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
259
258
|
class: animation + ' notif' + ' notif__' + pos,
|
|
260
259
|
onClick: e => this.onClick(e),
|
|
@@ -267,18 +266,18 @@ class Notif extends _common_js__WEBPACK_IMPORTED_MODULE_2__/* .Com */ .up {
|
|
|
267
266
|
alt: "notification background",
|
|
268
267
|
class: "notif_bg",
|
|
269
268
|
src: notif.background_url,
|
|
270
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
269
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.js2css(notif.background_style)
|
|
271
270
|
}), this.renderCloseButton(), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
272
271
|
class: "notif_avatar",
|
|
273
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
272
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.js2css(notif.avatar_style)
|
|
274
273
|
}, $avatar), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
275
274
|
class: "notif_body"
|
|
276
275
|
}, (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
277
276
|
class: "notif_title",
|
|
278
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
277
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.js2css(notif.title_style)
|
|
279
278
|
}, $title), (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)("div", {
|
|
280
279
|
class: "notif_message",
|
|
281
|
-
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
280
|
+
style: _util_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .c.js2css(notif.message_style)
|
|
282
281
|
}, $message), $time)));
|
|
283
282
|
}
|
|
284
283
|
}
|