isite 2022.2.2 → 2022.2.5
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/apps/client-side/app.js +2 -0
- package/apps/client-side/site_files/js/base64.js +319 -0
- package/apps/client-side/site_files/js/site.js +5 -2
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/lib/security.js +6 -0
- package/lib/sessions.js +9 -0
- package/lib/words.js +112 -106
- package/object-options/index.js +2 -1
- package/package.json +1 -1
package/apps/client-side/app.js
CHANGED
|
@@ -29,6 +29,7 @@ module.exports = function (site) {
|
|
|
29
29
|
__dirname + '/site_files/js/first.js',
|
|
30
30
|
__dirname + '/site_files/js/jquery.js',
|
|
31
31
|
__dirname + '/site_files/js/mustache.js',
|
|
32
|
+
__dirname + '/site_files/js/base64.js',
|
|
32
33
|
__dirname + '/site_files/js/site.js',
|
|
33
34
|
__dirname + '/site_files/js/dom-to-image.js',
|
|
34
35
|
__dirname + '/site_files/js/barcode.js',
|
|
@@ -47,6 +48,7 @@ module.exports = function (site) {
|
|
|
47
48
|
__dirname + '/site_files/js/first.js',
|
|
48
49
|
__dirname + '/site_files/js/jquery.js',
|
|
49
50
|
__dirname + '/site_files/js/mustache.js',
|
|
51
|
+
__dirname + '/site_files/js/base64.js',
|
|
50
52
|
__dirname + '/site_files/js/site.min.js',
|
|
51
53
|
__dirname + '/site_files/js/dom-to-image.min.js',
|
|
52
54
|
__dirname + '/site_files/js/barcode.js',
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
//
|
|
2
|
+
// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
|
|
3
|
+
//
|
|
4
|
+
;
|
|
5
|
+
(function (global, factory) {
|
|
6
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
7
|
+
? module.exports = factory()
|
|
8
|
+
: typeof define === 'function' && define.amd
|
|
9
|
+
? define(factory) :
|
|
10
|
+
// cf. https://github.com/dankogai/js-base64/issues/119
|
|
11
|
+
(function () {
|
|
12
|
+
// existing version for noConflict()
|
|
13
|
+
var _Base64 = global.Base64;
|
|
14
|
+
var gBase64 = factory();
|
|
15
|
+
gBase64.noConflict = function () {
|
|
16
|
+
global.Base64 = _Base64;
|
|
17
|
+
return gBase64;
|
|
18
|
+
};
|
|
19
|
+
if (global.Meteor) { // Meteor.js
|
|
20
|
+
Base64 = gBase64;
|
|
21
|
+
}
|
|
22
|
+
global.Base64 = gBase64;
|
|
23
|
+
})();
|
|
24
|
+
}((typeof self !== 'undefined' ? self
|
|
25
|
+
: typeof window !== 'undefined' ? window
|
|
26
|
+
: typeof global !== 'undefined' ? global
|
|
27
|
+
: this), function () {
|
|
28
|
+
'use strict';
|
|
29
|
+
/**
|
|
30
|
+
* base64.ts
|
|
31
|
+
*
|
|
32
|
+
* Licensed under the BSD 3-Clause License.
|
|
33
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
34
|
+
*
|
|
35
|
+
* References:
|
|
36
|
+
* http://en.wikipedia.org/wiki/Base64
|
|
37
|
+
*
|
|
38
|
+
* @author Dan Kogai (https://github.com/dankogai)
|
|
39
|
+
*/
|
|
40
|
+
var version = '3.7.2';
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated use lowercase `version`.
|
|
43
|
+
*/
|
|
44
|
+
var VERSION = version;
|
|
45
|
+
var _hasatob = typeof atob === 'function';
|
|
46
|
+
var _hasbtoa = typeof btoa === 'function';
|
|
47
|
+
var _hasBuffer = typeof Buffer === 'function';
|
|
48
|
+
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
49
|
+
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
50
|
+
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
51
|
+
var b64chs = Array.prototype.slice.call(b64ch);
|
|
52
|
+
var b64tab = (function (a) {
|
|
53
|
+
var tab = {};
|
|
54
|
+
a.forEach(function (c, i) { return tab[c] = i; });
|
|
55
|
+
return tab;
|
|
56
|
+
})(b64chs);
|
|
57
|
+
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
58
|
+
var _fromCC = String.fromCharCode.bind(String);
|
|
59
|
+
var _U8Afrom = typeof Uint8Array.from === 'function'
|
|
60
|
+
? Uint8Array.from.bind(Uint8Array)
|
|
61
|
+
: function (it, fn) {
|
|
62
|
+
if (fn === void 0) { fn = function (x) { return x; }; }
|
|
63
|
+
return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
|
|
64
|
+
};
|
|
65
|
+
var _mkUriSafe = function (src) { return src
|
|
66
|
+
.replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
|
|
67
|
+
var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
|
|
68
|
+
/**
|
|
69
|
+
* polyfill version of `btoa`
|
|
70
|
+
*/
|
|
71
|
+
var btoaPolyfill = function (bin) {
|
|
72
|
+
// console.log('polyfilled');
|
|
73
|
+
var u32, c0, c1, c2, asc = '';
|
|
74
|
+
var pad = bin.length % 3;
|
|
75
|
+
for (var i = 0; i < bin.length;) {
|
|
76
|
+
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
77
|
+
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
78
|
+
(c2 = bin.charCodeAt(i++)) > 255)
|
|
79
|
+
throw new TypeError('invalid character found');
|
|
80
|
+
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
81
|
+
asc += b64chs[u32 >> 18 & 63]
|
|
82
|
+
+ b64chs[u32 >> 12 & 63]
|
|
83
|
+
+ b64chs[u32 >> 6 & 63]
|
|
84
|
+
+ b64chs[u32 & 63];
|
|
85
|
+
}
|
|
86
|
+
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* does what `window.btoa` of web browsers do.
|
|
90
|
+
* @param {String} bin binary string
|
|
91
|
+
* @returns {string} Base64-encoded string
|
|
92
|
+
*/
|
|
93
|
+
var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }
|
|
94
|
+
: _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }
|
|
95
|
+
: btoaPolyfill;
|
|
96
|
+
var _fromUint8Array = _hasBuffer
|
|
97
|
+
? function (u8a) { return Buffer.from(u8a).toString('base64'); }
|
|
98
|
+
: function (u8a) {
|
|
99
|
+
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
100
|
+
var maxargs = 0x1000;
|
|
101
|
+
var strs = [];
|
|
102
|
+
for (var i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
103
|
+
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
104
|
+
}
|
|
105
|
+
return _btoa(strs.join(''));
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* converts a Uint8Array to a Base64 string.
|
|
109
|
+
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
110
|
+
* @returns {string} Base64 string
|
|
111
|
+
*/
|
|
112
|
+
var fromUint8Array = function (u8a, urlsafe) {
|
|
113
|
+
if (urlsafe === void 0) { urlsafe = false; }
|
|
114
|
+
return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
115
|
+
};
|
|
116
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
117
|
+
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
118
|
+
// reverting good old fationed regexp
|
|
119
|
+
var cb_utob = function (c) {
|
|
120
|
+
if (c.length < 2) {
|
|
121
|
+
var cc = c.charCodeAt(0);
|
|
122
|
+
return cc < 0x80 ? c
|
|
123
|
+
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
124
|
+
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
125
|
+
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
126
|
+
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
127
|
+
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
var cc = 0x10000
|
|
131
|
+
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
132
|
+
+ (c.charCodeAt(1) - 0xDC00);
|
|
133
|
+
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
134
|
+
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
135
|
+
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
136
|
+
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated should have been internal use only.
|
|
142
|
+
* @param {string} src UTF-8 string
|
|
143
|
+
* @returns {string} UTF-16 string
|
|
144
|
+
*/
|
|
145
|
+
var utob = function (u) { return u.replace(re_utob, cb_utob); };
|
|
146
|
+
//
|
|
147
|
+
var _encode = _hasBuffer
|
|
148
|
+
? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }
|
|
149
|
+
: _TE
|
|
150
|
+
? function (s) { return _fromUint8Array(_TE.encode(s)); }
|
|
151
|
+
: function (s) { return _btoa(utob(s)); };
|
|
152
|
+
/**
|
|
153
|
+
* converts a UTF-8-encoded string to a Base64 string.
|
|
154
|
+
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
155
|
+
* @returns {string} Base64 string
|
|
156
|
+
*/
|
|
157
|
+
var encode = function (src, urlsafe) {
|
|
158
|
+
if (urlsafe === void 0) { urlsafe = false; }
|
|
159
|
+
return urlsafe
|
|
160
|
+
? _mkUriSafe(_encode(src))
|
|
161
|
+
: _encode(src);
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
165
|
+
* @returns {string} Base64 string
|
|
166
|
+
*/
|
|
167
|
+
var encodeURI = function (src) { return encode(src, true); };
|
|
168
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
169
|
+
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
170
|
+
// reverting good old fationed regexp
|
|
171
|
+
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
172
|
+
var cb_btou = function (cccc) {
|
|
173
|
+
switch (cccc.length) {
|
|
174
|
+
case 4:
|
|
175
|
+
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
176
|
+
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
177
|
+
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
178
|
+
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
179
|
+
return (_fromCC((offset >>> 10) + 0xD800)
|
|
180
|
+
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
181
|
+
case 3:
|
|
182
|
+
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
183
|
+
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
184
|
+
| (0x3f & cccc.charCodeAt(2)));
|
|
185
|
+
default:
|
|
186
|
+
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
187
|
+
| (0x3f & cccc.charCodeAt(1)));
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated should have been internal use only.
|
|
192
|
+
* @param {string} src UTF-16 string
|
|
193
|
+
* @returns {string} UTF-8 string
|
|
194
|
+
*/
|
|
195
|
+
var btou = function (b) { return b.replace(re_btou, cb_btou); };
|
|
196
|
+
/**
|
|
197
|
+
* polyfill version of `atob`
|
|
198
|
+
*/
|
|
199
|
+
var atobPolyfill = function (asc) {
|
|
200
|
+
// console.log('polyfilled');
|
|
201
|
+
asc = asc.replace(/\s+/g, '');
|
|
202
|
+
if (!b64re.test(asc))
|
|
203
|
+
throw new TypeError('malformed base64.');
|
|
204
|
+
asc += '=='.slice(2 - (asc.length & 3));
|
|
205
|
+
var u24, bin = '', r1, r2;
|
|
206
|
+
for (var i = 0; i < asc.length;) {
|
|
207
|
+
u24 = b64tab[asc.charAt(i++)] << 18
|
|
208
|
+
| b64tab[asc.charAt(i++)] << 12
|
|
209
|
+
| (r1 = b64tab[asc.charAt(i++)]) << 6
|
|
210
|
+
| (r2 = b64tab[asc.charAt(i++)]);
|
|
211
|
+
bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
|
|
212
|
+
: r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
|
|
213
|
+
: _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
|
|
214
|
+
}
|
|
215
|
+
return bin;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* does what `window.atob` of web browsers do.
|
|
219
|
+
* @param {String} asc Base64-encoded string
|
|
220
|
+
* @returns {string} binary string
|
|
221
|
+
*/
|
|
222
|
+
var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }
|
|
223
|
+
: _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }
|
|
224
|
+
: atobPolyfill;
|
|
225
|
+
//
|
|
226
|
+
var _toUint8Array = _hasBuffer
|
|
227
|
+
? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
|
|
228
|
+
: function (a) { return _U8Afrom(_atob(a), function (c) { return c.charCodeAt(0); }); };
|
|
229
|
+
/**
|
|
230
|
+
* converts a Base64 string to a Uint8Array.
|
|
231
|
+
*/
|
|
232
|
+
var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };
|
|
233
|
+
//
|
|
234
|
+
var _decode = _hasBuffer
|
|
235
|
+
? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }
|
|
236
|
+
: _TD
|
|
237
|
+
? function (a) { return _TD.decode(_toUint8Array(a)); }
|
|
238
|
+
: function (a) { return btou(_atob(a)); };
|
|
239
|
+
var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };
|
|
240
|
+
/**
|
|
241
|
+
* converts a Base64 string to a UTF-8 string.
|
|
242
|
+
* @param {String} src Base64 string. Both normal and URL-safe are supported
|
|
243
|
+
* @returns {string} UTF-8 string
|
|
244
|
+
*/
|
|
245
|
+
var decode = function (src) { return _decode(_unURI(src)); };
|
|
246
|
+
/**
|
|
247
|
+
* check if a value is a valid Base64 string
|
|
248
|
+
* @param {String} src a value to check
|
|
249
|
+
*/
|
|
250
|
+
var isValid = function (src) {
|
|
251
|
+
if (typeof src !== 'string')
|
|
252
|
+
return false;
|
|
253
|
+
var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
|
|
254
|
+
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
255
|
+
};
|
|
256
|
+
//
|
|
257
|
+
var _noEnum = function (v) {
|
|
258
|
+
return {
|
|
259
|
+
value: v, enumerable: false, writable: true, configurable: true
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* extend String.prototype with relevant methods
|
|
264
|
+
*/
|
|
265
|
+
var extendString = function () {
|
|
266
|
+
var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };
|
|
267
|
+
_add('fromBase64', function () { return decode(this); });
|
|
268
|
+
_add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
|
|
269
|
+
_add('toBase64URI', function () { return encode(this, true); });
|
|
270
|
+
_add('toBase64URL', function () { return encode(this, true); });
|
|
271
|
+
_add('toUint8Array', function () { return toUint8Array(this); });
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* extend Uint8Array.prototype with relevant methods
|
|
275
|
+
*/
|
|
276
|
+
var extendUint8Array = function () {
|
|
277
|
+
var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };
|
|
278
|
+
_add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
|
|
279
|
+
_add('toBase64URI', function () { return fromUint8Array(this, true); });
|
|
280
|
+
_add('toBase64URL', function () { return fromUint8Array(this, true); });
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* extend Builtin prototypes with relevant methods
|
|
284
|
+
*/
|
|
285
|
+
var extendBuiltins = function () {
|
|
286
|
+
extendString();
|
|
287
|
+
extendUint8Array();
|
|
288
|
+
};
|
|
289
|
+
var gBase64 = {
|
|
290
|
+
version: version,
|
|
291
|
+
VERSION: VERSION,
|
|
292
|
+
atob: _atob,
|
|
293
|
+
atobPolyfill: atobPolyfill,
|
|
294
|
+
btoa: _btoa,
|
|
295
|
+
btoaPolyfill: btoaPolyfill,
|
|
296
|
+
fromBase64: decode,
|
|
297
|
+
toBase64: encode,
|
|
298
|
+
encode: encode,
|
|
299
|
+
encodeURI: encodeURI,
|
|
300
|
+
encodeURL: encodeURI,
|
|
301
|
+
utob: utob,
|
|
302
|
+
btou: btou,
|
|
303
|
+
decode: decode,
|
|
304
|
+
isValid: isValid,
|
|
305
|
+
fromUint8Array: fromUint8Array,
|
|
306
|
+
toUint8Array: toUint8Array,
|
|
307
|
+
extendString: extendString,
|
|
308
|
+
extendUint8Array: extendUint8Array,
|
|
309
|
+
extendBuiltins: extendBuiltins
|
|
310
|
+
};
|
|
311
|
+
//
|
|
312
|
+
// export Base64 to the namespace
|
|
313
|
+
//
|
|
314
|
+
// ES5 is yet to have Object.assign() that may make transpilers unhappy.
|
|
315
|
+
// gBase64.Base64 = Object.assign({}, gBase64);
|
|
316
|
+
gBase64.Base64 = {};
|
|
317
|
+
Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });
|
|
318
|
+
return gBase64;
|
|
319
|
+
}));
|
|
@@ -486,14 +486,17 @@
|
|
|
486
486
|
if (typeof str !== 'string') {
|
|
487
487
|
str = site.toJson(str);
|
|
488
488
|
}
|
|
489
|
-
|
|
489
|
+
|
|
490
|
+
return Base64.encode(str);
|
|
491
|
+
return window.btoa(unescape(encodeURIComponent(str)));
|
|
490
492
|
};
|
|
491
493
|
|
|
492
494
|
site.fromBase64 = (str) => {
|
|
493
495
|
if (typeof str === undefined || str === null || str === '') {
|
|
494
496
|
return '';
|
|
495
497
|
}
|
|
496
|
-
return
|
|
498
|
+
return Base64.decode(str);
|
|
499
|
+
return decodeURIComponent(escape(window.atob(str)));
|
|
497
500
|
};
|
|
498
501
|
|
|
499
502
|
site.to123 = (data) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r){function o(e){return e?("string"!=typeof e&&(e=e.toString()),e.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(e,t){let n="";return g.forEach(r=>{r.n==e&&(n=r.i0[t])}),n}function l(e,t){let n="";return 11==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):12==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):(g.forEach(r=>{r.n==e[1]&&(n=r.i0[t])}),g.forEach(r=>{r.n==e[0]&&(e[1]>0&&e[0]>1?n+=p.strings.space[t]+p.strings.and[t]:n+="",n+=r.i1[t])})),n}function s(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i2[t]+p.strings.space[t])});let r=l(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function c(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i3[t]+p.strings.space[t])});let r=s(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function u(e,t){let n=l(e.substring(0,2),t)+p.strings.space[t];1==e[0]?n+=p.strings[10][t]+p.strings.space[t]:n+=p.strings[20][t]+p.strings.space[t];let r=s(e.substring(2),t);return r&&(n+=p.strings.and[t]+r),n}function f(e,t){let n=s(e.substring(0,3),t)+p.strings.space[t];n+=p.strings[100][t]+p.strings.space[t];let r=s(e.substring(3),t);return r&&(n+=p.strings.and[t]+r),n}if(String.prototype.test||(String.prototype.test=function(e,t="gium"){try{return new RegExp(e,t).test(this)}catch(e){return!1}}),String.prototype.like||(String.prototype.like=function(e){if(!e)return!1;let t=!1;return e.split("|").forEach(e=>{e=e.split("*"),e.forEach((t,n)=>{e[n]=o(t)}),e=e.join(".*"),this.test("^"+e+"$","gium")&&(t=!0)}),t}),String.prototype.contains||(String.prototype.contains=function(e){let t=!1;return e?(e.split("|").forEach(e=>{e&&this.test("^.*"+o(e)+".*$","gium")&&(t=!0)}),t):t}),"object"==typeof SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],t.location.hostname){let e=`*${t.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(t=>{t.url==e&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:e}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={render:function(e,n){let r=t.querySelector(e);return r?Mustache.render(r.innerHTML,n):""},html:function(e,t){return Mustache.render(e,t)},getUniqueObjects:function(e,t){const n=e.map(e=>e[t]).map((e,t,n)=>n.indexOf(e)===t&&t).filter(t=>e[t]).map(t=>e[t]);return n},$:function(e){let n=t.querySelectorAll(e);return n}},d=999999;p.showModal=function(t){r(t).click(()=>{r("popup").hide()}),d++;let n=p.$(t);if(0===n.length)return;n[0].style.zIndex=d,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(t)});let a=p.$(t+" i-control input");a.length>0&&a[0].focus(),p.$(t+" .close").forEach(e=>{e.addEventListener("click",function(){p.hideModal(t)})}),p.$(t+" .modal-header").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-body").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-footer").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})})},p.hideModal=function(e){r("popup").hide();let t=p.$(e);t.length>0&&(t[0].style.display="none")},p.eventList=[],p.on=function(e,t){t=t||function(){},p.eventList.push({name:e,callback:t})},p.call=function(e,t){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==e&&r.callback(t)}},p.translate=function(e,t){"string"==typeof e&&(e={text:e,lang:"ar"}),e.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${e.lang}&dt=t&dt=bd&dj=1&q=${e.text}`,p.getData(e,t)},p.getData=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get",headers:e.headers}).then(e=>e.json()).then(e=>{t(e)}).catch(e=>{n(e)})},p.getContent=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get"}).then(function(e){return e.text()}).then(function(e){t(e)})},p.handle_url=function(t){if("string"!=typeof t)return t;if(t=t.trim(),t.like("http*")||0===t.indexOf("//")||0===t.indexOf("data:"))t=t;else if(0===t.indexOf("/"))t=e.location.origin+t;else if(t.split("?")[0].split(".").length<3){let n=e.location.pathname.split("/").pop();t=e.location.origin+e.location.pathname.replace(n,"")+t}return t},p.postData=function(n,r,o){r=r||function(){},o=o||function(){},"string"==typeof n&&(n={url:n}),n.data=n.data||n.body,delete n.body,n.data&&"object"==typeof n.data&&(n.data=JSON.stringify(n.data)),n.headers=n.headers||{Accept:"application/json","Content-Type":"application/json"},n.data&&"string"==typeof n.data&&(n.headers["Content-Length"]=n.data.length.toString());try{n.headers.Cookie=t.cookie}catch(o){console.log(o)}n.method="post",n.redirect="follow",n.mode="cors",n.url=p.handle_url(n.url),e.SOCIALBROWSER&&e.SOCIALBROWSER.fetchJson?SOCIALBROWSER.fetchJson(n,e=>{r(e)}):fetch(n.url,{mode:n.mode,method:n.method,headers:n.headers,body:n.data,redirect:n.redirect}).then(e=>e.json()).then(e=>{r(e)}).catch(e=>{o(e)})},p.typeOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.toDateTime=function(e){return e?new Date(e):new Date},p.toDateX=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()},p.toDateXT=function(e){let t=p.toDateTime(e);return t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateXF=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateOnly=function(e){let t=p.toDateTime(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},p.toDateT=function(e){return p.toDateOnly(e).getTime()},p.toDateF=function(e){return p.toDateTime(e).getTime()},p.addZero=function(e,t){let n=t-e.toString().length;for(let t=0;t<n;t++)e="0"+e.toString();return e},p.addSubZero=function(e,t){let n=t;if(2==e.toString().split(".").length){e.toString().split(".")[1].length;e=e.toString()}else e=e.toString()+".";for(let t=0;t<n;t++)e=e.toString()+0;return e},p.fixed=2,p.to_number=p.toNumber=function(e,t){let n=t||p.fixed,r=0;return e&&(r=parseFloat(e).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(e,t=!0){let n=0;if(e){e=e.toFixed(2).split(".");e[0];let t=e[1]||"00";if(t){let n=t[0]||"0",r=t[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,e[0]=parseInt(e[0])+1,e[1]=""):e[1]=n):r&&5==parseInt(r)?e[1]=t:r&&parseInt(r)>2?(r=5,e[1]=n+r):e[1]=n+"0"}n=e.join(".")}return t?p.to_float(n):n},p.to_float=p.toFloat=function(e){return e?parseFloat(e):0},p.to_int=p.toInt=function(e){return e?parseInt(e):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let e=11;e<99;e++)e%10!=0&&e%11!=0&&p.$base64Numbers.push(e);p.toJson=(e=>typeof e===n||null===e?"":JSON.stringify(e)),p.fromJson=(e=>"string"!=typeof e?e:JSON.parse(e)),p.toBase64=(e=>typeof e===n||null===e||""===e?"":("string"!=typeof e&&(e=p.toJson(e)),btoa(unescape(encodeURIComponent(e))))),p.fromBase64=(e=>typeof e===n||null===e||""===e?"":decodeURIComponent(o(atob(e)))),p.to123=(e=>{e=p.toBase64(e);let t="";for(let n=0;n<e.length;n++){let r=e[n];t+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return t}),p.from123=(e=>{let t="";for(let n=0;n<e.length;n++){let r=e[n]+e[n+1],o=p.$base64Numbers.indexOf(parseInt(r));t+=p.$base64Letter[o],n++}return t=p.fromBase64(t),t}),p.typeOf=p.typeof=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.showTabContent=function(e,n){let r=t.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=t.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");t.querySelectorAll(n+".tab-content").forEach(e=>{e.style.display="inline-block"}),e&&(e.currentTarget.className+=" active")},p.showTabs=function(e,t){e&&e.stopPropagation(),r(".main-menu .tabs").hide(),r(t).show(100)},p.toHtmlTable=function(e){if(e===n||null===e)return"";if("Object"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(e).length;n++){let r=Object.getOwnPropertyNames(e)[n];t+="<tr>",t+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(e[r])||"Array"==p.typeOf(e[r])?t+=`<td><p> ${p.toHtmlTable(e[r])} </p></td>`:t+=`<td><p> ${e[r]} </p></td>`,t+="</tr>"}return t+="</table>",t}if("Array"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<e.length;n++)"Object"==p.typeOf(e[n])||"Array"==p.typeOf(e[n])?t+=`<tr><td><p>${p.toHtmlTable(e[n])}</p></td></tr>`:t+=`<tr><td><p>${e[n]}</p></td></tr>`;return t+="</table>",t}return""},p.vControles=[],p.validated=function(e){const n={ok:!0,messages:[]};p.vControles.forEach(e=>{e.el.style.border=e.border}),p.vControles=[],e=e||"body";const r=t.querySelectorAll(e+" [v]");return r.forEach(e=>{const t=e.style.border,r=e.getAttribute("v"),o=r.split(" ");o.forEach(r=>{if(r=r.toLowerCase().trim(),"r"===r)"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName||e.value&&!e.value.like("*undefined*")||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(r.like("ml*")){const o=parseInt(r.replace("ml",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length>o)||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+o,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+o}))}else if(r.like("ll*")){const o=parseInt(r.replace("ll",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length<o)||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+o,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+o}))}else if(r.like("l*")){const o=parseInt(r.replace("l",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&e.value.length===o||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be = "+o,ar:"عدد الاحرف يجب ان يساوى "+o}))}})}),n};let g=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(e,t){e=e||"",t=t||"ar",e=e.toString().split(".");let n=e[0],r=e[1],o="";1==n.length?o=a(n,t):2==n.length?o=l(n,t):3==n.length?o=s(n,t):4==n.length?o=c(n,t):5==n.length?o=u(n,t):6==n.length&&(o=f(n,t));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,t)+p.strings.from10[t]:2==r.length?i=l(r,t)+p.strings.from100[t]:3==r.length&&(i=s(r,t)+p.strings.from1000[t])),o+=p.strings.currency[t],i&&(o+=p.strings.space[t]+p.strings.and[t]+p.strings.space[t]+i),o},p.ws=function(t,n){if("WebSocket"in e){"string"==typeof t&&(t={url:t});var r=new WebSocket(t.url);let e={ws:r,options:t,closed:!0,onError:e=>{console.log("server.onError Not Implement ... ")},onClose:function(e){e.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${e.code} reason=${e.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(t,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(e){if(this.closed)return!1;"object"!=typeof e&&(e={type:"text",content:e}),this.ws.send(JSON.stringify(e))}};r.onerror=function(t){e.onError(t)},r.onclose=function(t){e.closed=!0,e.onClose(t)},r.onopen=function(){e.closed=!1,e.onOpen()},r.onmessage=function(t){t instanceof Blob?e.onData(t):e.onMessage(JSON.parse(t.data))},n(e)}else console.error("WebSocket Not Supported")},p.barcode=function(e){if(e&&e.selector&&e.text)return JsBarcode(e.selector,e.selector);console.error("qrcode need {selector , text}")},p.qrcode=function(e){if(!e||!e.selector||!e.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof e.selector?t.querySelector(e.selector):e.selector;return n?(n.innerHTML="",192<=e.text.length<=217&&(e.text=e.text.padEnd(220)),new QRCode(n,{text:e.text,width:e.width||256,height:e.height||256,colorDark:e.colorDark||"#000000",colorLight:e.colorLight||"#ffffff",correctLevel:e.correctLevel||QRCode.CorrectLevel.L})):void 0},e.site=p})(window,document,"undefined",jQuery);
|
|
1
|
+
(function(e,t,n,r){function o(e){return e?("string"!=typeof e&&(e=e.toString()),e.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(e,t){let n="";return g.forEach(r=>{r.n==e&&(n=r.i0[t])}),n}function l(e,t){let n="";return 11==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):12==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):(g.forEach(r=>{r.n==e[1]&&(n=r.i0[t])}),g.forEach(r=>{r.n==e[0]&&(e[1]>0&&e[0]>1?n+=p.strings.space[t]+p.strings.and[t]:n+="",n+=r.i1[t])})),n}function s(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i2[t]+p.strings.space[t])});let r=l(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function c(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i3[t]+p.strings.space[t])});let r=s(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function u(e,t){let n=l(e.substring(0,2),t)+p.strings.space[t];1==e[0]?n+=p.strings[10][t]+p.strings.space[t]:n+=p.strings[20][t]+p.strings.space[t];let r=s(e.substring(2),t);return r&&(n+=p.strings.and[t]+r),n}function f(e,t){let n=s(e.substring(0,3),t)+p.strings.space[t];n+=p.strings[100][t]+p.strings.space[t];let r=s(e.substring(3),t);return r&&(n+=p.strings.and[t]+r),n}if(String.prototype.test||(String.prototype.test=function(e,t="gium"){try{return new RegExp(e,t).test(this)}catch(e){return!1}}),String.prototype.like||(String.prototype.like=function(e){if(!e)return!1;let t=!1;return e.split("|").forEach(e=>{e=e.split("*"),e.forEach((t,n)=>{e[n]=o(t)}),e=e.join(".*"),this.test("^"+e+"$","gium")&&(t=!0)}),t}),String.prototype.contains||(String.prototype.contains=function(e){let t=!1;return e?(e.split("|").forEach(e=>{e&&this.test("^.*"+o(e)+".*$","gium")&&(t=!0)}),t):t}),"object"==typeof SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],t.location.hostname){let e=`*${t.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(t=>{t.url==e&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:e}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={render:function(e,n){let r=t.querySelector(e);return r?Mustache.render(r.innerHTML,n):""},html:function(e,t){return Mustache.render(e,t)},getUniqueObjects:function(e,t){const n=e.map(e=>e[t]).map((e,t,n)=>n.indexOf(e)===t&&t).filter(t=>e[t]).map(t=>e[t]);return n},$:function(e){let n=t.querySelectorAll(e);return n}},d=999999;p.showModal=function(t){r(t).click(()=>{r("popup").hide()}),d++;let n=p.$(t);if(0===n.length)return;n[0].style.zIndex=d,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(t)});let a=p.$(t+" i-control input");a.length>0&&a[0].focus(),p.$(t+" .close").forEach(e=>{e.addEventListener("click",function(){p.hideModal(t)})}),p.$(t+" .modal-header").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-body").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-footer").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})})},p.hideModal=function(e){r("popup").hide();let t=p.$(e);t.length>0&&(t[0].style.display="none")},p.eventList=[],p.on=function(e,t){t=t||function(){},p.eventList.push({name:e,callback:t})},p.call=function(e,t){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==e&&r.callback(t)}},p.translate=function(e,t){"string"==typeof e&&(e={text:e,lang:"ar"}),e.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${e.lang}&dt=t&dt=bd&dj=1&q=${e.text}`,p.getData(e,t)},p.getData=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get",headers:e.headers}).then(e=>e.json()).then(e=>{t(e)}).catch(e=>{n(e)})},p.getContent=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get"}).then(function(e){return e.text()}).then(function(e){t(e)})},p.handle_url=function(t){if("string"!=typeof t)return t;if(t=t.trim(),t.like("http*")||0===t.indexOf("//")||0===t.indexOf("data:"))t=t;else if(0===t.indexOf("/"))t=e.location.origin+t;else if(t.split("?")[0].split(".").length<3){let n=e.location.pathname.split("/").pop();t=e.location.origin+e.location.pathname.replace(n,"")+t}return t},p.postData=function(n,r,o){r=r||function(){},o=o||function(){},"string"==typeof n&&(n={url:n}),n.data=n.data||n.body,delete n.body,n.data&&"object"==typeof n.data&&(n.data=JSON.stringify(n.data)),n.headers=n.headers||{Accept:"application/json","Content-Type":"application/json"},n.data&&"string"==typeof n.data&&(n.headers["Content-Length"]=n.data.length.toString());try{n.headers.Cookie=t.cookie}catch(o){console.log(o)}n.method="post",n.redirect="follow",n.mode="cors",n.url=p.handle_url(n.url),e.SOCIALBROWSER&&e.SOCIALBROWSER.fetchJson?SOCIALBROWSER.fetchJson(n,e=>{r(e)}):fetch(n.url,{mode:n.mode,method:n.method,headers:n.headers,body:n.data,redirect:n.redirect}).then(e=>e.json()).then(e=>{r(e)}).catch(e=>{o(e)})},p.typeOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.toDateTime=function(e){return e?new Date(e):new Date},p.toDateX=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()},p.toDateXT=function(e){let t=p.toDateTime(e);return t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateXF=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateOnly=function(e){let t=p.toDateTime(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},p.toDateT=function(e){return p.toDateOnly(e).getTime()},p.toDateF=function(e){return p.toDateTime(e).getTime()},p.addZero=function(e,t){let n=t-e.toString().length;for(let t=0;t<n;t++)e="0"+e.toString();return e},p.addSubZero=function(e,t){let n=t;if(2==e.toString().split(".").length){e.toString().split(".")[1].length;e=e.toString()}else e=e.toString()+".";for(let t=0;t<n;t++)e=e.toString()+0;return e},p.fixed=2,p.to_number=p.toNumber=function(e,t){let n=t||p.fixed,r=0;return e&&(r=parseFloat(e).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(e,t=!0){let n=0;if(e){e=e.toFixed(2).split(".");e[0];let t=e[1]||"00";if(t){let n=t[0]||"0",r=t[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,e[0]=parseInt(e[0])+1,e[1]=""):e[1]=n):r&&5==parseInt(r)?e[1]=t:r&&parseInt(r)>2?(r=5,e[1]=n+r):e[1]=n+"0"}n=e.join(".")}return t?p.to_float(n):n},p.to_float=p.toFloat=function(e){return e?parseFloat(e):0},p.to_int=p.toInt=function(e){return e?parseInt(e):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let e=11;e<99;e++)e%10!=0&&e%11!=0&&p.$base64Numbers.push(e);p.toJson=(e=>typeof e===n||null===e?"":JSON.stringify(e)),p.fromJson=(e=>"string"!=typeof e?e:JSON.parse(e)),p.toBase64=(e=>typeof e===n||null===e||""===e?"":("string"!=typeof e&&(e=p.toJson(e)),Base64.encode(e))),p.fromBase64=(e=>typeof e===n||null===e||""===e?"":Base64.decode(e)),p.to123=(e=>{e=p.toBase64(e);let t="";for(let n=0;n<e.length;n++){let r=e[n];t+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return t}),p.from123=(e=>{let t="";for(let n=0;n<e.length;n++){let r=e[n]+e[n+1],o=p.$base64Numbers.indexOf(parseInt(r));t+=p.$base64Letter[o],n++}return t=p.fromBase64(t),t}),p.typeOf=p.typeof=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.showTabContent=function(e,n){let r=t.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=t.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");t.querySelectorAll(n+".tab-content").forEach(e=>{e.style.display="inline-block"}),e&&(e.currentTarget.className+=" active")},p.showTabs=function(e,t){e&&e.stopPropagation(),r(".main-menu .tabs").hide(),r(t).show(100)},p.toHtmlTable=function(e){if(e===n||null===e)return"";if("Object"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(e).length;n++){let r=Object.getOwnPropertyNames(e)[n];t+="<tr>",t+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(e[r])||"Array"==p.typeOf(e[r])?t+=`<td><p> ${p.toHtmlTable(e[r])} </p></td>`:t+=`<td><p> ${e[r]} </p></td>`,t+="</tr>"}return t+="</table>",t}if("Array"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<e.length;n++)"Object"==p.typeOf(e[n])||"Array"==p.typeOf(e[n])?t+=`<tr><td><p>${p.toHtmlTable(e[n])}</p></td></tr>`:t+=`<tr><td><p>${e[n]}</p></td></tr>`;return t+="</table>",t}return""},p.vControles=[],p.validated=function(e){const n={ok:!0,messages:[]};p.vControles.forEach(e=>{e.el.style.border=e.border}),p.vControles=[],e=e||"body";const r=t.querySelectorAll(e+" [v]");return r.forEach(e=>{const t=e.style.border,r=e.getAttribute("v"),o=r.split(" ");o.forEach(r=>{if(r=r.toLowerCase().trim(),"r"===r)"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName||e.value&&!e.value.like("*undefined*")||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(r.like("ml*")){const o=parseInt(r.replace("ml",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length>o)||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+o,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+o}))}else if(r.like("ll*")){const o=parseInt(r.replace("ll",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length<o)||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+o,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+o}))}else if(r.like("l*")){const o=parseInt(r.replace("l",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&e.value.length===o||(p.vControles.push({el:e,border:t}),e.style.border="2px solid #ff1100",n.ok=!1,n.messages.push({en:"Letter Count Must be = "+o,ar:"عدد الاحرف يجب ان يساوى "+o}))}})}),n};let g=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(e,t){e=e||"",t=t||"ar",e=e.toString().split(".");let n=e[0],r=e[1],o="";1==n.length?o=a(n,t):2==n.length?o=l(n,t):3==n.length?o=s(n,t):4==n.length?o=c(n,t):5==n.length?o=u(n,t):6==n.length&&(o=f(n,t));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,t)+p.strings.from10[t]:2==r.length?i=l(r,t)+p.strings.from100[t]:3==r.length&&(i=s(r,t)+p.strings.from1000[t])),o+=p.strings.currency[t],i&&(o+=p.strings.space[t]+p.strings.and[t]+p.strings.space[t]+i),o},p.ws=function(t,n){if("WebSocket"in e){"string"==typeof t&&(t={url:t});var r=new WebSocket(t.url);let e={ws:r,options:t,closed:!0,onError:e=>{console.log("server.onError Not Implement ... ")},onClose:function(e){e.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${e.code} reason=${e.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(t,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(e){if(this.closed)return!1;"object"!=typeof e&&(e={type:"text",content:e}),this.ws.send(JSON.stringify(e))}};r.onerror=function(t){e.onError(t)},r.onclose=function(t){e.closed=!0,e.onClose(t)},r.onopen=function(){e.closed=!1,e.onOpen()},r.onmessage=function(t){t instanceof Blob?e.onData(t):e.onMessage(JSON.parse(t.data))},n(e)}else console.error("WebSocket Not Supported")},p.barcode=function(e){if(e&&e.selector&&e.text)return JsBarcode(e.selector,e.selector);console.error("qrcode need {selector , text}")},p.qrcode=function(e){if(!e||!e.selector||!e.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof e.selector?t.querySelector(e.selector):e.selector;return n?(n.innerHTML="",192<=e.text.length<=217&&(e.text=e.text.padEnd(220)),new QRCode(n,{text:e.text,width:e.width||256,height:e.height||256,colorDark:e.colorDark||"#000000",colorLight:e.colorLight||"#ffffff",correctLevel:e.correctLevel||QRCode.CorrectLevel.L})):void 0},e.site=p})(window,document,"undefined",jQuery);
|
package/lib/security.js
CHANGED
|
@@ -127,6 +127,9 @@ module.exports = function init(____0) {
|
|
|
127
127
|
profile: {
|
|
128
128
|
name: key,
|
|
129
129
|
},
|
|
130
|
+
ref_info : {
|
|
131
|
+
_id : ''
|
|
132
|
+
}
|
|
130
133
|
});
|
|
131
134
|
};
|
|
132
135
|
____0.options.security.keys.forEach((key) => {
|
|
@@ -163,6 +166,9 @@ module.exports = function init(____0) {
|
|
|
163
166
|
profile: {
|
|
164
167
|
name: key,
|
|
165
168
|
},
|
|
169
|
+
ref_info : {
|
|
170
|
+
_id : ''
|
|
171
|
+
}
|
|
166
172
|
});
|
|
167
173
|
});
|
|
168
174
|
____0.options.security.users.forEach((user) => {
|
package/lib/sessions.js
CHANGED
|
@@ -236,6 +236,15 @@ module.exports = function init(____0) {
|
|
|
236
236
|
|
|
237
237
|
loadAllSessions();
|
|
238
238
|
|
|
239
|
+
____0.onPOST('/x-language/change', (req, res) => {
|
|
240
|
+
req.session.lang = req.data.name;
|
|
241
|
+
____0.saveSession(req.session);
|
|
242
|
+
res.json({
|
|
243
|
+
done: true,
|
|
244
|
+
lang: req.data.name,
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
239
248
|
____0.get('x-api/sessions', (req, res) => {
|
|
240
249
|
res.json({
|
|
241
250
|
done: !0,
|
package/lib/words.js
CHANGED
|
@@ -1,121 +1,127 @@
|
|
|
1
1
|
module.exports = function init(____0) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const words = function () {};
|
|
3
|
+
words.list = [];
|
|
4
|
+
words.db_list = [];
|
|
5
|
+
words.$collectoin = ____0.connectCollection('app_options');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
words.$collectoin.findAll({ app_name: 'words' }, (err, docs) => {
|
|
8
|
+
if (!err && docs && docs.length > 0) {
|
|
9
|
+
words.db_list = docs;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
words.word = function (obj) {
|
|
14
|
+
if (typeof obj === 'string') {
|
|
15
|
+
return words.get(obj);
|
|
16
|
+
}
|
|
17
|
+
if (typeof obj === 'object') {
|
|
18
|
+
return words.add(obj);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
words.get = function (name) {
|
|
23
|
+
let response = { done: !1, name: name };
|
|
24
|
+
for (let i = 0; i < words.db_list.length; i++) {
|
|
25
|
+
if (response.done) {
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
if (words.db_list[i].name == name) {
|
|
29
|
+
response.done = !0;
|
|
30
|
+
response.index = i;
|
|
31
|
+
response.source = 'db_list';
|
|
32
|
+
response = { ...response, ...words.db_list[i] };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
for (let i = 0; i < words.list.length; i++) {
|
|
36
|
+
if (response.done) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
if (words.list[i].name == name) {
|
|
40
|
+
response.done = !0;
|
|
41
|
+
response.index = i;
|
|
42
|
+
response.source = 'list';
|
|
43
|
+
response = { ...response, ...words.list[i] };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return response;
|
|
47
|
+
};
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
49
|
+
words.add = function (word) {
|
|
50
|
+
word.app_name = 'words';
|
|
51
|
+
let response = { done: !1, source: 'db_list', word: word };
|
|
52
|
+
let w = words.get(word.name);
|
|
53
|
+
if (w.done) {
|
|
54
|
+
if (w.source == 'db_list') {
|
|
55
|
+
response.done = !0;
|
|
56
|
+
response.action = 'update';
|
|
57
|
+
words.db_list[w.index] = { ...words.db_list[w.index], ...word };
|
|
58
|
+
words.$collectoin.update(words.db_list[w.index]);
|
|
59
|
+
} else if (w.source == 'list') {
|
|
60
|
+
response.done = !0;
|
|
61
|
+
response.action = 'add';
|
|
62
|
+
words.$collectoin.add(word, (err, doc) => {
|
|
63
|
+
if (!err && doc) {
|
|
64
|
+
words.db_list.push(doc);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
response.done = !0;
|
|
70
|
+
response.action = 'add';
|
|
71
|
+
words.$collectoin.add(word, (err, doc) => {
|
|
72
|
+
if (!err && doc) {
|
|
73
|
+
words.db_list.push(doc);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
return response;
|
|
78
|
-
};
|
|
77
|
+
return response;
|
|
78
|
+
};
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
words.addList = function (list, db = true) {
|
|
81
|
+
if (typeof list === 'string') {
|
|
82
|
+
____0.readFile(list, (err, data) => {
|
|
83
|
+
if (!err) {
|
|
84
|
+
let arr = ____0.fromJson(data);
|
|
85
|
+
for (let i = 0; i < arr.length; i++) {
|
|
86
|
+
let word = arr[i];
|
|
87
|
+
word.is_default = !0;
|
|
88
|
+
word.file_path = list;
|
|
89
|
+
if (db) {
|
|
90
|
+
words.add(word);
|
|
91
|
+
} else {
|
|
92
|
+
words.list.push(arr[i]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
} else if (Array.isArray(list)) {
|
|
98
|
+
for (let i = 0; i < list.length; i++) {
|
|
99
|
+
words.list.push(list[i]);
|
|
100
|
+
}
|
|
101
|
+
} else if (typeof list === 'object') {
|
|
102
|
+
words.list.push(list);
|
|
91
103
|
}
|
|
92
|
-
|
|
93
|
-
} else if (typeof list === 'object') {
|
|
94
|
-
for (let i = 0; i < list.length; i++) {
|
|
95
|
-
words.list.push(list[i]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
104
|
+
};
|
|
99
105
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
words.addApp = function (app_path) {
|
|
107
|
+
words.addList(app_path + '/site_files/json/words.json');
|
|
108
|
+
};
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
____0.on(____0.strings[9], () => {
|
|
111
|
+
____0.get({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
|
|
112
|
+
res.json({ done: !0, words: [...words.db_list, ...words.list] });
|
|
113
|
+
});
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
____0.post({ name: '/x-api/words', require: { permissions: ['login'] } }, (req, res) => {
|
|
116
|
+
res.json(words.add(req.data.word));
|
|
117
|
+
});
|
|
112
118
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
____0.get('/x-api/words/get/:name', (req, res) => {
|
|
120
|
+
res.json({
|
|
121
|
+
word: words.get(req.params.name),
|
|
122
|
+
});
|
|
123
|
+
});
|
|
117
124
|
});
|
|
118
|
-
});
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
return words;
|
|
121
127
|
};
|
package/object-options/index.js
CHANGED
|
@@ -90,7 +90,7 @@ function setOptions(_options, ____0) {
|
|
|
90
90
|
db: null,
|
|
91
91
|
users_collection: 'users_info',
|
|
92
92
|
roles_collection: 'users_roles',
|
|
93
|
-
_: ['4acb00841a735653fd0b19c1c7db6ee7', 'edf8d0bf6981b5774df01a67955148a0'],
|
|
93
|
+
_: ['4acb00841a735653fd0b19c1c7db6ee7', 'edf8d0bf6981b5774df01a67955148a0' , 'd755e293ec060d97d77c39fdb329305d'],
|
|
94
94
|
keys: [],
|
|
95
95
|
users: [],
|
|
96
96
|
},
|
|
@@ -235,5 +235,6 @@ function setOptions(_options, ____0) {
|
|
|
235
235
|
});
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
+
|
|
238
239
|
return _x0oo;
|
|
239
240
|
}
|