dl-common-util 0.0.1
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/dl-common-util.d.ts +96 -0
- package/dl-common-util.js +1028 -0
- package/dl-common-util.js.map +1 -0
- package/kotlin-kotlin-stdlib-js-ir.js +4755 -0
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
- package/package.json +10 -0
|
@@ -0,0 +1,1028 @@
|
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof define === 'function' && define.amd)
|
|
3
|
+
define(['exports', 'pinyin-pro', './kotlin-kotlin-stdlib-js-ir.js'], factory);
|
|
4
|
+
else if (typeof exports === 'object')
|
|
5
|
+
factory(module.exports, require('pinyin-pro'), require('./kotlin-kotlin-stdlib-js-ir.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof PinyinPro === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module 'dl-common-util'. Its dependency 'pinyin-pro' was not found. Please, check whether 'pinyin-pro' is loaded prior to 'dl-common-util'.");
|
|
9
|
+
}
|
|
10
|
+
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module 'dl-common-util'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'dl-common-util'.");
|
|
12
|
+
}
|
|
13
|
+
root['dl-common-util'] = factory(typeof this['dl-common-util'] === 'undefined' ? {} : this['dl-common-util'], PinyinPro, this['kotlin-kotlin-stdlib-js-ir']);
|
|
14
|
+
}
|
|
15
|
+
}(this, function (_, PinyinPro, kotlin_kotlin) {
|
|
16
|
+
'use strict';
|
|
17
|
+
//region block: imports
|
|
18
|
+
var imul = Math.imul;
|
|
19
|
+
var toInt = kotlin_kotlin.$_$.n1;
|
|
20
|
+
var toLong = kotlin_kotlin.$_$.o1;
|
|
21
|
+
var VOID = kotlin_kotlin.$_$.x1;
|
|
22
|
+
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.d;
|
|
23
|
+
var THROW_CCE = kotlin_kotlin.$_$.u1;
|
|
24
|
+
var isCharSequence = kotlin_kotlin.$_$.w;
|
|
25
|
+
var trim = kotlin_kotlin.$_$.s1;
|
|
26
|
+
var toString = kotlin_kotlin.$_$.d1;
|
|
27
|
+
var copyOfRange = kotlin_kotlin.$_$.k;
|
|
28
|
+
var indexOf = kotlin_kotlin.$_$.l;
|
|
29
|
+
var contentEquals = kotlin_kotlin.$_$.j;
|
|
30
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.b;
|
|
31
|
+
var toList = kotlin_kotlin.$_$.o;
|
|
32
|
+
var toByteArray = kotlin_kotlin.$_$.n;
|
|
33
|
+
var _UByte___init__impl__g9hnc4 = kotlin_kotlin.$_$.g;
|
|
34
|
+
var toString_0 = kotlin_kotlin.$_$.r1;
|
|
35
|
+
var _UByte___get_data__impl__jof9qr = kotlin_kotlin.$_$.h;
|
|
36
|
+
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.f;
|
|
37
|
+
var toByte = kotlin_kotlin.$_$.b1;
|
|
38
|
+
var encodeToByteArray = kotlin_kotlin.$_$.h1;
|
|
39
|
+
var decodeToString = kotlin_kotlin.$_$.g1;
|
|
40
|
+
var iterator = kotlin_kotlin.$_$.j1;
|
|
41
|
+
var toString_1 = kotlin_kotlin.$_$.p1;
|
|
42
|
+
var replace = kotlin_kotlin.$_$.k1;
|
|
43
|
+
var Regex_init_$Create$ = kotlin_kotlin.$_$.c;
|
|
44
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.e;
|
|
45
|
+
var charSequenceLength = kotlin_kotlin.$_$.t;
|
|
46
|
+
var getProgressionLastElement = kotlin_kotlin.$_$.q;
|
|
47
|
+
var toIntOrNull = kotlin_kotlin.$_$.m1;
|
|
48
|
+
var numberToChar = kotlin_kotlin.$_$.x;
|
|
49
|
+
var THROW_ISE = kotlin_kotlin.$_$.v1;
|
|
50
|
+
var Unit_getInstance = kotlin_kotlin.$_$.i;
|
|
51
|
+
var Enum = kotlin_kotlin.$_$.t1;
|
|
52
|
+
var protoOf = kotlin_kotlin.$_$.z;
|
|
53
|
+
var defineProp = kotlin_kotlin.$_$.v;
|
|
54
|
+
var classMeta = kotlin_kotlin.$_$.u;
|
|
55
|
+
var setMetadataFor = kotlin_kotlin.$_$.a1;
|
|
56
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.w1;
|
|
57
|
+
var primitiveArrayConcat = kotlin_kotlin.$_$.a;
|
|
58
|
+
var indexOf_0 = kotlin_kotlin.$_$.i1;
|
|
59
|
+
var toString_2 = kotlin_kotlin.$_$.q1;
|
|
60
|
+
var map = kotlin_kotlin.$_$.e1;
|
|
61
|
+
var StringBuilder = kotlin_kotlin.$_$.f1;
|
|
62
|
+
var toCharArray = kotlin_kotlin.$_$.l1;
|
|
63
|
+
var charArrayIterator = kotlin_kotlin.$_$.r;
|
|
64
|
+
var toShort = kotlin_kotlin.$_$.c1;
|
|
65
|
+
var charSequenceGet = kotlin_kotlin.$_$.s;
|
|
66
|
+
var toTypedArray = kotlin_kotlin.$_$.p;
|
|
67
|
+
var objectMeta = kotlin_kotlin.$_$.y;
|
|
68
|
+
var joinToString = kotlin_kotlin.$_$.m;
|
|
69
|
+
//endregion
|
|
70
|
+
//region block: pre-declaration
|
|
71
|
+
setMetadataFor(ChecksumType, 'ChecksumType', classMeta, Enum);
|
|
72
|
+
setMetadataFor(GBKHelper, 'GBKHelper', objectMeta);
|
|
73
|
+
//endregion
|
|
74
|
+
function toUnsignedInt(_this__u8e3s4) {
|
|
75
|
+
return toInt(toHexString(_this__u8e3s4), 16);
|
|
76
|
+
}
|
|
77
|
+
function toUnsignedLong(_this__u8e3s4) {
|
|
78
|
+
return toLong(toHexString(_this__u8e3s4), 16);
|
|
79
|
+
}
|
|
80
|
+
function toBinString(_this__u8e3s4, space) {
|
|
81
|
+
space = space === VOID ? false : space;
|
|
82
|
+
var builder = StringBuilder_init_$Create$();
|
|
83
|
+
var inductionVariable = 0;
|
|
84
|
+
var last = _this__u8e3s4.length;
|
|
85
|
+
while (inductionVariable < last) {
|
|
86
|
+
var byte = _this__u8e3s4[inductionVariable];
|
|
87
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
88
|
+
builder.o6(toBinStringByByte(byte));
|
|
89
|
+
if (space) {
|
|
90
|
+
builder.o6(' ');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// Inline function 'kotlin.text.trim' call
|
|
94
|
+
var tmp0_trim = builder.toString();
|
|
95
|
+
return toString(trim(isCharSequence(tmp0_trim) ? tmp0_trim : THROW_CCE()));
|
|
96
|
+
}
|
|
97
|
+
function toHexString(_this__u8e3s4, space, uppercase) {
|
|
98
|
+
space = space === VOID ? false : space;
|
|
99
|
+
uppercase = uppercase === VOID ? false : uppercase;
|
|
100
|
+
var builder = StringBuilder_init_$Create$();
|
|
101
|
+
var inductionVariable = 0;
|
|
102
|
+
var last = _this__u8e3s4.length;
|
|
103
|
+
while (inductionVariable < last) {
|
|
104
|
+
var byte = _this__u8e3s4[inductionVariable];
|
|
105
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
106
|
+
builder.o6(toHexStringByByte(byte));
|
|
107
|
+
if (space) {
|
|
108
|
+
builder.o6(' ');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Inline function 'kotlin.text.trim' call
|
|
112
|
+
var tmp0_trim = builder.toString();
|
|
113
|
+
var result = toString(trim(isCharSequence(tmp0_trim) ? tmp0_trim : THROW_CCE()));
|
|
114
|
+
var tmp;
|
|
115
|
+
if (uppercase) {
|
|
116
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
117
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
118
|
+
tmp = result.toUpperCase();
|
|
119
|
+
} else {
|
|
120
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
121
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
122
|
+
tmp = result.toLowerCase();
|
|
123
|
+
}
|
|
124
|
+
return tmp;
|
|
125
|
+
}
|
|
126
|
+
function indexOf_1(_this__u8e3s4, bs) {
|
|
127
|
+
var index = 0;
|
|
128
|
+
while (true) {
|
|
129
|
+
var temp = copyOfRange(_this__u8e3s4, index, _this__u8e3s4.length);
|
|
130
|
+
var i = indexOf(temp, bs[0]);
|
|
131
|
+
if (i < 0)
|
|
132
|
+
return -1;
|
|
133
|
+
index = index + (i + 1 | 0) | 0;
|
|
134
|
+
if ((i + bs.length | 0) > temp.length)
|
|
135
|
+
return -1;
|
|
136
|
+
if (contentEquals(copyOfRange(temp, i, i + bs.length | 0), bs)) {
|
|
137
|
+
return index - 1 | 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function fillLengthByByteArray(_this__u8e3s4, length, filler, isInStart, isForced) {
|
|
142
|
+
filler = filler === VOID ? 0 : filler;
|
|
143
|
+
isInStart = isInStart === VOID ? true : isInStart;
|
|
144
|
+
isForced = isForced === VOID ? true : isForced;
|
|
145
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
146
|
+
var list = ArrayList_init_$Create$();
|
|
147
|
+
if (!isInStart) {
|
|
148
|
+
list.j3(toList(_this__u8e3s4));
|
|
149
|
+
}
|
|
150
|
+
if (_this__u8e3s4.length < length) {
|
|
151
|
+
var inductionVariable = 0;
|
|
152
|
+
var last = length - _this__u8e3s4.length | 0;
|
|
153
|
+
if (inductionVariable < last)
|
|
154
|
+
do {
|
|
155
|
+
var i = inductionVariable;
|
|
156
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
157
|
+
list.d(filler);
|
|
158
|
+
}
|
|
159
|
+
while (inductionVariable < last);
|
|
160
|
+
}
|
|
161
|
+
if (isInStart) {
|
|
162
|
+
list.j3(toList(_this__u8e3s4));
|
|
163
|
+
}
|
|
164
|
+
var tmp;
|
|
165
|
+
if (isForced) {
|
|
166
|
+
tmp = isInStart ? toByteArray(list.v3(list.i() - length | 0, list.i())) : toByteArray(list.v3(0, length));
|
|
167
|
+
} else {
|
|
168
|
+
tmp = toByteArray(list);
|
|
169
|
+
}
|
|
170
|
+
return tmp;
|
|
171
|
+
}
|
|
172
|
+
function toBinStringByByte(_this__u8e3s4) {
|
|
173
|
+
var tmp$ret$0;
|
|
174
|
+
// Inline function 'kotlin.toUByte' call
|
|
175
|
+
tmp$ret$0 = _UByte___init__impl__g9hnc4(_this__u8e3s4);
|
|
176
|
+
return fillLength(toString_0(tmp$ret$0, 2), 8);
|
|
177
|
+
}
|
|
178
|
+
function toHexStringByByte(_this__u8e3s4, uppercase) {
|
|
179
|
+
uppercase = uppercase === VOID ? false : uppercase;
|
|
180
|
+
var tmp$ret$0;
|
|
181
|
+
// Inline function 'kotlin.toUByte' call
|
|
182
|
+
tmp$ret$0 = _UByte___init__impl__g9hnc4(_this__u8e3s4);
|
|
183
|
+
var result = fillLength(toString_0(tmp$ret$0, 16), 2);
|
|
184
|
+
var tmp;
|
|
185
|
+
if (uppercase) {
|
|
186
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
187
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
188
|
+
tmp = result.toUpperCase();
|
|
189
|
+
} else {
|
|
190
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
191
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
192
|
+
tmp = result.toLowerCase();
|
|
193
|
+
}
|
|
194
|
+
return tmp;
|
|
195
|
+
}
|
|
196
|
+
function toUnsignedIntByByte(_this__u8e3s4) {
|
|
197
|
+
// Inline function 'kotlin.UByte.toInt' call
|
|
198
|
+
// Inline function 'kotlin.toUByte' call
|
|
199
|
+
var tmp0_toInt = _UByte___init__impl__g9hnc4(_this__u8e3s4);
|
|
200
|
+
return _UByte___get_data__impl__jof9qr(tmp0_toInt) & 255;
|
|
201
|
+
}
|
|
202
|
+
function toByteArrayByCharArray(_this__u8e3s4) {
|
|
203
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
204
|
+
var byteList = ArrayList_init_$Create$();
|
|
205
|
+
var inductionVariable = 0;
|
|
206
|
+
var last = _this__u8e3s4.length;
|
|
207
|
+
while (inductionVariable < last) {
|
|
208
|
+
var char = _this__u8e3s4[inductionVariable];
|
|
209
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
210
|
+
var tmp$ret$1;
|
|
211
|
+
// Inline function 'kotlin.code' call
|
|
212
|
+
tmp$ret$1 = Char__toInt_impl_vasixd(char);
|
|
213
|
+
byteList.d(toByte(tmp$ret$1));
|
|
214
|
+
}
|
|
215
|
+
return toByteArray(byteList);
|
|
216
|
+
}
|
|
217
|
+
function encodeGBK(_this__u8e3s4) {
|
|
218
|
+
return encodeGBKDo(_this__u8e3s4);
|
|
219
|
+
}
|
|
220
|
+
function decodeGBK(_this__u8e3s4) {
|
|
221
|
+
return decodeGBKDo(_this__u8e3s4);
|
|
222
|
+
}
|
|
223
|
+
function encodeUTF8(_this__u8e3s4) {
|
|
224
|
+
return encodeToByteArray(_this__u8e3s4);
|
|
225
|
+
}
|
|
226
|
+
function decodeUTF8(_this__u8e3s4) {
|
|
227
|
+
return decodeToString(_this__u8e3s4);
|
|
228
|
+
}
|
|
229
|
+
function encodeUnicode(_this__u8e3s4) {
|
|
230
|
+
var hex = encodeUnicodeString(_this__u8e3s4, false);
|
|
231
|
+
return toByteArrayFromHex(hex);
|
|
232
|
+
}
|
|
233
|
+
function encodeUnicodeString(_this__u8e3s4, isNeedU) {
|
|
234
|
+
var builder = StringBuilder_init_$Create$();
|
|
235
|
+
// Inline function 'kotlin.collections.iterator' call
|
|
236
|
+
var tmp0_iterator = iterator(_this__u8e3s4);
|
|
237
|
+
while (tmp0_iterator.g()) {
|
|
238
|
+
var c = tmp0_iterator.h().p2_1;
|
|
239
|
+
var tmp$ret$1;
|
|
240
|
+
// Inline function 'kotlin.code' call
|
|
241
|
+
tmp$ret$1 = Char__toInt_impl_vasixd(c);
|
|
242
|
+
var item = toString_1(tmp$ret$1, 16);
|
|
243
|
+
if (isNeedU) {
|
|
244
|
+
builder.o6('\\u');
|
|
245
|
+
}
|
|
246
|
+
builder.o6(fillLength(item, 4));
|
|
247
|
+
}
|
|
248
|
+
return builder.toString();
|
|
249
|
+
}
|
|
250
|
+
function decodeUnicodeByByteArray(_this__u8e3s4) {
|
|
251
|
+
return decodeUnicode(toHexString(_this__u8e3s4));
|
|
252
|
+
}
|
|
253
|
+
function decodeUnicode(_this__u8e3s4) {
|
|
254
|
+
var value = replace(replace(_this__u8e3s4, '\\u', ''), ' ', '');
|
|
255
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
256
|
+
var regex = Regex_init_$Create$('[A-Fa-f0-9]+');
|
|
257
|
+
var isMatch = regex.a7(value);
|
|
258
|
+
if (!isMatch)
|
|
259
|
+
return '';
|
|
260
|
+
var builder = StringBuilder_init_$Create$();
|
|
261
|
+
var str = value;
|
|
262
|
+
if (!((value.length % 4 | 0) === 0)) {
|
|
263
|
+
str = fillLength(value, imul((value.length / 4 | 0) + 1 | 0, 4), _Char___init__impl__6a9atx(48), false);
|
|
264
|
+
}
|
|
265
|
+
var nestedLast = charSequenceLength(str) - 1 | 0;
|
|
266
|
+
var inductionVariable = 0;
|
|
267
|
+
var last = getProgressionLastElement(0, nestedLast, 4);
|
|
268
|
+
if (inductionVariable <= last)
|
|
269
|
+
do {
|
|
270
|
+
var i = inductionVariable;
|
|
271
|
+
inductionVariable = inductionVariable + 4 | 0;
|
|
272
|
+
var end = i + 4 | 0;
|
|
273
|
+
if (str.length >= end) {
|
|
274
|
+
// Inline function 'kotlin.text.substring' call
|
|
275
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
276
|
+
var item = str.substring(i, end);
|
|
277
|
+
var tmp1_elvis_lhs = toIntOrNull(item, 16);
|
|
278
|
+
var data = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
|
|
279
|
+
if (!(data === 0)) {
|
|
280
|
+
builder.q2(numberToChar(data));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
while (!(i === last));
|
|
285
|
+
return builder.toString();
|
|
286
|
+
}
|
|
287
|
+
function encodeASCII(_this__u8e3s4) {
|
|
288
|
+
return toByteArrayFromHex(encodeASCIIString(_this__u8e3s4));
|
|
289
|
+
}
|
|
290
|
+
function encodeASCIIString(_this__u8e3s4) {
|
|
291
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
292
|
+
var regex = Regex_init_$Create$('[\\u0020-\\u007e]+');
|
|
293
|
+
var isMatch = regex.a7(_this__u8e3s4);
|
|
294
|
+
if (!isMatch)
|
|
295
|
+
return '';
|
|
296
|
+
var builder = StringBuilder_init_$Create$();
|
|
297
|
+
// Inline function 'kotlin.collections.iterator' call
|
|
298
|
+
var tmp0_iterator = iterator(_this__u8e3s4);
|
|
299
|
+
while (tmp0_iterator.g()) {
|
|
300
|
+
var c = tmp0_iterator.h().p2_1;
|
|
301
|
+
var tmp$ret$2;
|
|
302
|
+
// Inline function 'kotlin.code' call
|
|
303
|
+
tmp$ret$2 = Char__toInt_impl_vasixd(c);
|
|
304
|
+
var item = toString_1(tmp$ret$2, 16);
|
|
305
|
+
builder.o6(fillLength(item, 2));
|
|
306
|
+
}
|
|
307
|
+
return builder.toString();
|
|
308
|
+
}
|
|
309
|
+
function decodeASCII(_this__u8e3s4) {
|
|
310
|
+
var value = replace(_this__u8e3s4, ' ', '');
|
|
311
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
312
|
+
var regex = Regex_init_$Create$('[A-Fa-f0-9]+');
|
|
313
|
+
var isMatch = regex.a7(value);
|
|
314
|
+
if (!isMatch)
|
|
315
|
+
return '';
|
|
316
|
+
var builder = StringBuilder_init_$Create$();
|
|
317
|
+
var str = value;
|
|
318
|
+
if (!((value.length % 2 | 0) === 0)) {
|
|
319
|
+
str = fillLength(value, imul((value.length / 2 | 0) + 1 | 0, 2), _Char___init__impl__6a9atx(48), false);
|
|
320
|
+
}
|
|
321
|
+
var nestedLast = charSequenceLength(str) - 1 | 0;
|
|
322
|
+
var inductionVariable = 0;
|
|
323
|
+
var last = getProgressionLastElement(0, nestedLast, 2);
|
|
324
|
+
if (inductionVariable <= last)
|
|
325
|
+
do {
|
|
326
|
+
var i = inductionVariable;
|
|
327
|
+
inductionVariable = inductionVariable + 2 | 0;
|
|
328
|
+
// Inline function 'kotlin.text.substring' call
|
|
329
|
+
var tmp0_substring = str;
|
|
330
|
+
var tmp1_substring = i + 2 | 0;
|
|
331
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
332
|
+
var temp = tmp0_substring.substring(i, tmp1_substring);
|
|
333
|
+
builder.q2(numberToChar(toInt(temp, 16)));
|
|
334
|
+
}
|
|
335
|
+
while (!(i === last));
|
|
336
|
+
return builder.toString();
|
|
337
|
+
}
|
|
338
|
+
function decodeASCIIByByteArray(_this__u8e3s4) {
|
|
339
|
+
return decodeASCII(toHexString(_this__u8e3s4));
|
|
340
|
+
}
|
|
341
|
+
var ChecksumType_AND_instance;
|
|
342
|
+
var ChecksumType_OR_instance;
|
|
343
|
+
var ChecksumType_XOR_instance;
|
|
344
|
+
function values() {
|
|
345
|
+
return [ChecksumType_AND_getInstance(), ChecksumType_OR_getInstance(), ChecksumType_XOR_getInstance()];
|
|
346
|
+
}
|
|
347
|
+
function valueOf(value) {
|
|
348
|
+
switch (value) {
|
|
349
|
+
case 'AND':
|
|
350
|
+
return ChecksumType_AND_getInstance();
|
|
351
|
+
case 'OR':
|
|
352
|
+
return ChecksumType_OR_getInstance();
|
|
353
|
+
case 'XOR':
|
|
354
|
+
return ChecksumType_XOR_getInstance();
|
|
355
|
+
default:
|
|
356
|
+
ChecksumType_initEntries();
|
|
357
|
+
THROW_ISE();
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
var ChecksumType_entriesInitialized;
|
|
362
|
+
function ChecksumType_initEntries() {
|
|
363
|
+
if (ChecksumType_entriesInitialized)
|
|
364
|
+
return Unit_getInstance();
|
|
365
|
+
ChecksumType_entriesInitialized = true;
|
|
366
|
+
ChecksumType_AND_instance = new ChecksumType('AND', 0);
|
|
367
|
+
ChecksumType_OR_instance = new ChecksumType('OR', 1);
|
|
368
|
+
ChecksumType_XOR_instance = new ChecksumType('XOR', 2);
|
|
369
|
+
}
|
|
370
|
+
function ChecksumType(name, ordinal) {
|
|
371
|
+
Enum.call(this, name, ordinal);
|
|
372
|
+
}
|
|
373
|
+
defineProp(protoOf(ChecksumType), 'name', protoOf(ChecksumType).l8, VOID);
|
|
374
|
+
defineProp(protoOf(ChecksumType), 'ordinal', protoOf(ChecksumType).m8, VOID);
|
|
375
|
+
function assertChecksum(_this__u8e3s4, type) {
|
|
376
|
+
type = type === VOID ? ChecksumType_XOR_getInstance() : type;
|
|
377
|
+
if (_this__u8e3s4.length < 2)
|
|
378
|
+
return false;
|
|
379
|
+
var end = _this__u8e3s4.length - 1 | 0;
|
|
380
|
+
var num = getChecksum(_this__u8e3s4, type, 0, end);
|
|
381
|
+
return num === _this__u8e3s4[end];
|
|
382
|
+
}
|
|
383
|
+
function getChecksum(_this__u8e3s4, type, start, end) {
|
|
384
|
+
type = type === VOID ? ChecksumType_XOR_getInstance() : type;
|
|
385
|
+
start = start === VOID ? 0 : start;
|
|
386
|
+
end = end === VOID ? _this__u8e3s4.length : end;
|
|
387
|
+
var num = 0;
|
|
388
|
+
var inductionVariable = start;
|
|
389
|
+
if (inductionVariable < end)
|
|
390
|
+
do {
|
|
391
|
+
var i = inductionVariable;
|
|
392
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
393
|
+
var tmp;
|
|
394
|
+
switch (type.k8_1) {
|
|
395
|
+
case 0:
|
|
396
|
+
tmp = toByte(num + _this__u8e3s4[i]);
|
|
397
|
+
break;
|
|
398
|
+
case 1:
|
|
399
|
+
// Inline function 'kotlin.experimental.or' call
|
|
400
|
+
|
|
401
|
+
var tmp0_or = num;
|
|
402
|
+
var tmp1_or = _this__u8e3s4[i];
|
|
403
|
+
tmp = toByte(tmp0_or | tmp1_or);
|
|
404
|
+
break;
|
|
405
|
+
case 2:
|
|
406
|
+
// Inline function 'kotlin.experimental.xor' call
|
|
407
|
+
|
|
408
|
+
var tmp2_xor = num;
|
|
409
|
+
var tmp3_xor = _this__u8e3s4[i];
|
|
410
|
+
tmp = toByte(tmp2_xor ^ tmp3_xor);
|
|
411
|
+
break;
|
|
412
|
+
default:
|
|
413
|
+
noWhenBranchMatchedException();
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
num = tmp;
|
|
417
|
+
}
|
|
418
|
+
while (inductionVariable < end);
|
|
419
|
+
return num;
|
|
420
|
+
}
|
|
421
|
+
function addChecksum(_this__u8e3s4, type) {
|
|
422
|
+
type = type === VOID ? ChecksumType_XOR_getInstance() : type;
|
|
423
|
+
// Inline function 'kotlin.collections.plus' call
|
|
424
|
+
var tmp0_plus = getChecksum(_this__u8e3s4, type);
|
|
425
|
+
// Inline function 'kotlin.collections.plus' call
|
|
426
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
427
|
+
var tmp0_plus_0 = new Int8Array([tmp0_plus]);
|
|
428
|
+
return primitiveArrayConcat([_this__u8e3s4, tmp0_plus_0]);
|
|
429
|
+
}
|
|
430
|
+
function ChecksumType_AND_getInstance() {
|
|
431
|
+
ChecksumType_initEntries();
|
|
432
|
+
return ChecksumType_AND_instance;
|
|
433
|
+
}
|
|
434
|
+
function ChecksumType_OR_getInstance() {
|
|
435
|
+
ChecksumType_initEntries();
|
|
436
|
+
return ChecksumType_OR_instance;
|
|
437
|
+
}
|
|
438
|
+
function ChecksumType_XOR_getInstance() {
|
|
439
|
+
ChecksumType_initEntries();
|
|
440
|
+
return ChecksumType_XOR_instance;
|
|
441
|
+
}
|
|
442
|
+
function toStringByDouble(_this__u8e3s4, maxDecimalCount) {
|
|
443
|
+
return keep(_this__u8e3s4.toString(), maxDecimalCount);
|
|
444
|
+
}
|
|
445
|
+
function keep(_this__u8e3s4, maxDecimalCount) {
|
|
446
|
+
var pointIndex = indexOf_0(_this__u8e3s4, '.');
|
|
447
|
+
var tmp;
|
|
448
|
+
if (pointIndex === -1) {
|
|
449
|
+
tmp = _this__u8e3s4;
|
|
450
|
+
} else {
|
|
451
|
+
var decimalCount = (_this__u8e3s4.length - pointIndex | 0) - 1 | 0;
|
|
452
|
+
var tmp_0;
|
|
453
|
+
if (decimalCount > maxDecimalCount) {
|
|
454
|
+
// Inline function 'kotlin.text.substring' call
|
|
455
|
+
var tmp0_substring = (pointIndex + maxDecimalCount | 0) + 1 | 0;
|
|
456
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
457
|
+
tmp_0 = _this__u8e3s4.substring(0, tmp0_substring);
|
|
458
|
+
} else {
|
|
459
|
+
tmp_0 = _this__u8e3s4;
|
|
460
|
+
}
|
|
461
|
+
tmp = tmp_0;
|
|
462
|
+
}
|
|
463
|
+
return tmp;
|
|
464
|
+
}
|
|
465
|
+
function toString_3(_this__u8e3s4, maxDecimalCount) {
|
|
466
|
+
return keep(_this__u8e3s4.toString(), maxDecimalCount);
|
|
467
|
+
}
|
|
468
|
+
function takeHighByte(_this__u8e3s4) {
|
|
469
|
+
return toByte(_this__u8e3s4 >>> 8 | 0);
|
|
470
|
+
}
|
|
471
|
+
function takeLowByte(_this__u8e3s4) {
|
|
472
|
+
return toByte(_this__u8e3s4 & 255);
|
|
473
|
+
}
|
|
474
|
+
function toByteArray_0(_this__u8e3s4) {
|
|
475
|
+
var hex = toString_1(_this__u8e3s4, 16);
|
|
476
|
+
if (!((hex.length % 2 | 0) === 0)) {
|
|
477
|
+
hex = '0' + hex;
|
|
478
|
+
}
|
|
479
|
+
return toByteArrayFromHex(hex);
|
|
480
|
+
}
|
|
481
|
+
function toByteArrayByLong(_this__u8e3s4) {
|
|
482
|
+
var hex = toString_2(_this__u8e3s4, 16);
|
|
483
|
+
if (!((hex.length % 2 | 0) === 0)) {
|
|
484
|
+
hex = '0' + hex;
|
|
485
|
+
}
|
|
486
|
+
return toByteArrayFromHex(hex);
|
|
487
|
+
}
|
|
488
|
+
function toPinYin(_this__u8e3s4, separator) {
|
|
489
|
+
separator = separator === VOID ? '' : separator;
|
|
490
|
+
return toPinYinDo(_this__u8e3s4, separator);
|
|
491
|
+
}
|
|
492
|
+
function get_numberRegex() {
|
|
493
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
494
|
+
return numberRegex;
|
|
495
|
+
}
|
|
496
|
+
var numberRegex;
|
|
497
|
+
function get_letterRegex() {
|
|
498
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
499
|
+
return letterRegex;
|
|
500
|
+
}
|
|
501
|
+
var letterRegex;
|
|
502
|
+
function get_numEnRegex() {
|
|
503
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
504
|
+
return numEnRegex;
|
|
505
|
+
}
|
|
506
|
+
var numEnRegex;
|
|
507
|
+
function get_codeRegex() {
|
|
508
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
509
|
+
return codeRegex;
|
|
510
|
+
}
|
|
511
|
+
var codeRegex;
|
|
512
|
+
function get_chineseRegex() {
|
|
513
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
514
|
+
return chineseRegex;
|
|
515
|
+
}
|
|
516
|
+
var chineseRegex;
|
|
517
|
+
function get_chEnNumRegex() {
|
|
518
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
519
|
+
return chEnNumRegex;
|
|
520
|
+
}
|
|
521
|
+
var chEnNumRegex;
|
|
522
|
+
function get_chSymbolRegex() {
|
|
523
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
524
|
+
return chSymbolRegex;
|
|
525
|
+
}
|
|
526
|
+
var chSymbolRegex;
|
|
527
|
+
function keepByRegexStr(_this__u8e3s4, regStr) {
|
|
528
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
529
|
+
var tmp$ret$0;
|
|
530
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
531
|
+
tmp$ret$0 = Regex_init_$Create$(regStr);
|
|
532
|
+
return keep_0(_this__u8e3s4, tmp$ret$0);
|
|
533
|
+
}
|
|
534
|
+
function filterByRegexStr(_this__u8e3s4, regStr) {
|
|
535
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
536
|
+
var tmp$ret$0;
|
|
537
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
538
|
+
tmp$ret$0 = Regex_init_$Create$(regStr);
|
|
539
|
+
return filter(_this__u8e3s4, tmp$ret$0);
|
|
540
|
+
}
|
|
541
|
+
function isIdCard(_this__u8e3s4) {
|
|
542
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
543
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
544
|
+
return Regex_init_$Create$('(^\\d{15}$)|(^\\d{17}([0-9]|X)$)').a7(_this__u8e3s4);
|
|
545
|
+
}
|
|
546
|
+
function isMobileNumber(_this__u8e3s4) {
|
|
547
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
548
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
549
|
+
return Regex_init_$Create$('^1[1-9]\\d{9}$').a7(_this__u8e3s4);
|
|
550
|
+
}
|
|
551
|
+
function isEmail(_this__u8e3s4) {
|
|
552
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
553
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
554
|
+
return Regex_init_$Create$('^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$').a7(_this__u8e3s4);
|
|
555
|
+
}
|
|
556
|
+
function isOnlyChEnNum(_this__u8e3s4) {
|
|
557
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
558
|
+
return get_chEnNumRegex().a7(_this__u8e3s4);
|
|
559
|
+
}
|
|
560
|
+
function isOnlyEnNum(_this__u8e3s4) {
|
|
561
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
562
|
+
return get_numEnRegex().a7(_this__u8e3s4);
|
|
563
|
+
}
|
|
564
|
+
function isOnlyChinese(_this__u8e3s4) {
|
|
565
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
566
|
+
return get_chineseRegex().a7(_this__u8e3s4);
|
|
567
|
+
}
|
|
568
|
+
function isOnlyLetter(_this__u8e3s4) {
|
|
569
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
570
|
+
return get_letterRegex().a7(_this__u8e3s4);
|
|
571
|
+
}
|
|
572
|
+
function isOnlyNumber(_this__u8e3s4) {
|
|
573
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
574
|
+
return get_numberRegex().a7(_this__u8e3s4);
|
|
575
|
+
}
|
|
576
|
+
function isOnlyCode(_this__u8e3s4) {
|
|
577
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
578
|
+
return get_codeRegex().a7(_this__u8e3s4);
|
|
579
|
+
}
|
|
580
|
+
function isOnlyChSymbol(_this__u8e3s4) {
|
|
581
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
582
|
+
return get_chSymbolRegex().a7(_this__u8e3s4);
|
|
583
|
+
}
|
|
584
|
+
function keep_0(_this__u8e3s4, reg) {
|
|
585
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
586
|
+
var tmp = reg.d7(_this__u8e3s4);
|
|
587
|
+
var ls = map(tmp, keep$lambda);
|
|
588
|
+
var text = new StringBuilder('');
|
|
589
|
+
// Inline function 'kotlin.sequences.forEach' call
|
|
590
|
+
var tmp0_iterator = ls.f();
|
|
591
|
+
while (tmp0_iterator.g()) {
|
|
592
|
+
var element = tmp0_iterator.h();
|
|
593
|
+
// Inline function 'com.d10ng.common.keep.<anonymous>' call
|
|
594
|
+
text.o6(element);
|
|
595
|
+
}
|
|
596
|
+
return text.toString();
|
|
597
|
+
}
|
|
598
|
+
function filter(_this__u8e3s4, reg) {
|
|
599
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
600
|
+
return reg.e7(_this__u8e3s4, '');
|
|
601
|
+
}
|
|
602
|
+
function keep$lambda(it) {
|
|
603
|
+
_init_properties_RegexUtils_kt__b9v9ti();
|
|
604
|
+
return it.y();
|
|
605
|
+
}
|
|
606
|
+
var properties_initialized_RegexUtils_kt_8e1sdo;
|
|
607
|
+
function _init_properties_RegexUtils_kt__b9v9ti() {
|
|
608
|
+
if (!properties_initialized_RegexUtils_kt_8e1sdo) {
|
|
609
|
+
properties_initialized_RegexUtils_kt_8e1sdo = true;
|
|
610
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
611
|
+
numberRegex = Regex_init_$Create$('[0-9]+');
|
|
612
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
613
|
+
letterRegex = Regex_init_$Create$('[a-zA-Z]+');
|
|
614
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
615
|
+
numEnRegex = Regex_init_$Create$('[a-zA-Z0-9]+');
|
|
616
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
617
|
+
codeRegex = Regex_init_$Create$('[a-fA-F0-9]+');
|
|
618
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
619
|
+
chineseRegex = Regex_init_$Create$('[\u4E00-\u9FA5]+');
|
|
620
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
621
|
+
chEnNumRegex = Regex_init_$Create$('[a-zA-Z0-9\u4E00-\u9FA5]+');
|
|
622
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
623
|
+
chSymbolRegex = Regex_init_$Create$('[\u3000-\u301E\u3021-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FA5]+');
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function toByteFromBin(_this__u8e3s4) {
|
|
627
|
+
var value = replace(_this__u8e3s4, ' ', '');
|
|
628
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
629
|
+
var regex = Regex_init_$Create$('[01]+');
|
|
630
|
+
var isMatch = regex.a7(value);
|
|
631
|
+
if (!isMatch)
|
|
632
|
+
return 0;
|
|
633
|
+
var str = fillLength(value, 8);
|
|
634
|
+
return toByte(toInt(str, 2));
|
|
635
|
+
}
|
|
636
|
+
function toByteArrayFromBin(_this__u8e3s4) {
|
|
637
|
+
var value = replace(_this__u8e3s4, ' ', '');
|
|
638
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
639
|
+
var regex = Regex_init_$Create$('[01]+');
|
|
640
|
+
var isMatch = regex.a7(value);
|
|
641
|
+
if (!isMatch) {
|
|
642
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
643
|
+
return new Int8Array([]);
|
|
644
|
+
}
|
|
645
|
+
var str = value;
|
|
646
|
+
if (!((value.length % 8 | 0) === 0)) {
|
|
647
|
+
str = fillLength(value, imul((value.length / 8 | 0) + 1 | 0, 8));
|
|
648
|
+
}
|
|
649
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
650
|
+
var list = ArrayList_init_$Create$();
|
|
651
|
+
var nestedLast = charSequenceLength(str) - 1 | 0;
|
|
652
|
+
var inductionVariable = 0;
|
|
653
|
+
var last = getProgressionLastElement(0, nestedLast, 8);
|
|
654
|
+
if (inductionVariable <= last)
|
|
655
|
+
do {
|
|
656
|
+
var i = inductionVariable;
|
|
657
|
+
inductionVariable = inductionVariable + 8 | 0;
|
|
658
|
+
var tmp$ret$4;
|
|
659
|
+
// Inline function 'kotlin.text.substring' call
|
|
660
|
+
var tmp0_substring = str;
|
|
661
|
+
var tmp1_substring = i + 8 | 0;
|
|
662
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
663
|
+
tmp$ret$4 = tmp0_substring.substring(i, tmp1_substring);
|
|
664
|
+
list.d(toByteFromBin(tmp$ret$4));
|
|
665
|
+
}
|
|
666
|
+
while (!(i === last));
|
|
667
|
+
return toByteArray(list);
|
|
668
|
+
}
|
|
669
|
+
function toByteFromHex(_this__u8e3s4) {
|
|
670
|
+
var value = replace(_this__u8e3s4, ' ', '');
|
|
671
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
672
|
+
var regex = Regex_init_$Create$('[A-Fa-f0-9]+');
|
|
673
|
+
var isMatch = regex.a7(value);
|
|
674
|
+
if (!isMatch)
|
|
675
|
+
return 0;
|
|
676
|
+
var str = fillLength(value, 8);
|
|
677
|
+
return toByte(toInt(str, 16));
|
|
678
|
+
}
|
|
679
|
+
function toByteArrayFromHex(_this__u8e3s4) {
|
|
680
|
+
var value = replace(_this__u8e3s4, ' ', '');
|
|
681
|
+
// Inline function 'kotlin.text.toRegex' call
|
|
682
|
+
var regex = Regex_init_$Create$('[A-Fa-f0-9]+');
|
|
683
|
+
var isMatch = regex.a7(value);
|
|
684
|
+
if (!isMatch) {
|
|
685
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
686
|
+
return new Int8Array([]);
|
|
687
|
+
}
|
|
688
|
+
var str = value;
|
|
689
|
+
if (!((value.length % 2 | 0) === 0)) {
|
|
690
|
+
str = fillLength(value, imul((value.length / 2 | 0) + 1 | 0, 2));
|
|
691
|
+
}
|
|
692
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
693
|
+
var list = ArrayList_init_$Create$();
|
|
694
|
+
var nestedLast = charSequenceLength(str) - 1 | 0;
|
|
695
|
+
var inductionVariable = 0;
|
|
696
|
+
var last = getProgressionLastElement(0, nestedLast, 2);
|
|
697
|
+
if (inductionVariable <= last)
|
|
698
|
+
do {
|
|
699
|
+
var i = inductionVariable;
|
|
700
|
+
inductionVariable = inductionVariable + 2 | 0;
|
|
701
|
+
var tmp$ret$4;
|
|
702
|
+
// Inline function 'kotlin.text.substring' call
|
|
703
|
+
var tmp0_substring = str;
|
|
704
|
+
var tmp1_substring = i + 2 | 0;
|
|
705
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
706
|
+
tmp$ret$4 = tmp0_substring.substring(i, tmp1_substring);
|
|
707
|
+
list.d(toByteFromHex(tmp$ret$4));
|
|
708
|
+
}
|
|
709
|
+
while (!(i === last));
|
|
710
|
+
return toByteArray(list);
|
|
711
|
+
}
|
|
712
|
+
function fillLength(_this__u8e3s4, length, filler, isInStart, isForced) {
|
|
713
|
+
filler = filler === VOID ? _Char___init__impl__6a9atx(48) : filler;
|
|
714
|
+
isInStart = isInStart === VOID ? true : isInStart;
|
|
715
|
+
isForced = isForced === VOID ? true : isForced;
|
|
716
|
+
var result = StringBuilder_init_$Create$();
|
|
717
|
+
if (!isInStart) {
|
|
718
|
+
result.o6(_this__u8e3s4);
|
|
719
|
+
}
|
|
720
|
+
if (_this__u8e3s4.length < length) {
|
|
721
|
+
var inductionVariable = 0;
|
|
722
|
+
var last = length - _this__u8e3s4.length | 0;
|
|
723
|
+
if (inductionVariable < last)
|
|
724
|
+
do {
|
|
725
|
+
var i = inductionVariable;
|
|
726
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
727
|
+
result.q2(filler);
|
|
728
|
+
}
|
|
729
|
+
while (inductionVariable < last);
|
|
730
|
+
}
|
|
731
|
+
if (isInStart) {
|
|
732
|
+
result.o6(_this__u8e3s4);
|
|
733
|
+
}
|
|
734
|
+
var tmp;
|
|
735
|
+
if (isForced) {
|
|
736
|
+
var tmp_0;
|
|
737
|
+
if (isInStart) {
|
|
738
|
+
// Inline function 'kotlin.text.substring' call
|
|
739
|
+
var tmp0_substring = result.toString();
|
|
740
|
+
var tmp1_substring = result.c3() - length | 0;
|
|
741
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
742
|
+
tmp_0 = tmp0_substring.substring(tmp1_substring);
|
|
743
|
+
} else {
|
|
744
|
+
// Inline function 'kotlin.text.substring' call
|
|
745
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
746
|
+
tmp_0 = result.toString().substring(0, length);
|
|
747
|
+
}
|
|
748
|
+
tmp = tmp_0;
|
|
749
|
+
} else {
|
|
750
|
+
tmp = result.toString();
|
|
751
|
+
}
|
|
752
|
+
return tmp;
|
|
753
|
+
}
|
|
754
|
+
function getByteLength(_this__u8e3s4) {
|
|
755
|
+
var length = 0;
|
|
756
|
+
var chars = toCharArray(_this__u8e3s4);
|
|
757
|
+
// Inline function 'kotlin.collections.iterator' call
|
|
758
|
+
var tmp0_iterator = charArrayIterator(chars);
|
|
759
|
+
while (tmp0_iterator.g()) {
|
|
760
|
+
var i = tmp0_iterator.h().p2_1;
|
|
761
|
+
// Inline function 'kotlin.code' call
|
|
762
|
+
var ascii = Char__toInt_impl_vasixd(i);
|
|
763
|
+
if (0 <= ascii ? ascii <= 255 : false) {
|
|
764
|
+
length = length + 1 | 0;
|
|
765
|
+
} else
|
|
766
|
+
length = length + 2 | 0;
|
|
767
|
+
}
|
|
768
|
+
return length;
|
|
769
|
+
}
|
|
770
|
+
function getFirstUpperCase(_this__u8e3s4) {
|
|
771
|
+
var tmp;
|
|
772
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
773
|
+
if (charSequenceLength(_this__u8e3s4) === 0) {
|
|
774
|
+
tmp = '';
|
|
775
|
+
} else {
|
|
776
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
777
|
+
// Inline function 'kotlin.text.substring' call
|
|
778
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
779
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
780
|
+
tmp = _this__u8e3s4.substring(0, 1).toUpperCase();
|
|
781
|
+
}
|
|
782
|
+
return tmp;
|
|
783
|
+
}
|
|
784
|
+
function encodeGBKDo(_this__u8e3s4) {
|
|
785
|
+
return GBKHelper_getInstance().d9(_this__u8e3s4);
|
|
786
|
+
}
|
|
787
|
+
function decodeGBKDo(_this__u8e3s4) {
|
|
788
|
+
return GBKHelper_getInstance().e9(_this__u8e3s4);
|
|
789
|
+
}
|
|
790
|
+
function getCharGBKByteArray($this, char) {
|
|
791
|
+
// Inline function 'kotlin.code' call
|
|
792
|
+
var code = Char__toInt_impl_vasixd(char);
|
|
793
|
+
var tmp;
|
|
794
|
+
if (code < 128) {
|
|
795
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
796
|
+
tmp = new Int8Array([toByte(code)]);
|
|
797
|
+
} else {
|
|
798
|
+
// Inline function 'org.khronos.webgl.get' call
|
|
799
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
800
|
+
var gbk = $this.c9_1[code];
|
|
801
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
802
|
+
tmp = new Int8Array([toByte(gbk & 255), toByte(gbk >> 8)]);
|
|
803
|
+
}
|
|
804
|
+
return tmp;
|
|
805
|
+
}
|
|
806
|
+
function GBKHelper() {
|
|
807
|
+
GBKHelper_instance = this;
|
|
808
|
+
this.c9_1 = new Uint16Array(65536);
|
|
809
|
+
// Inline function 'kotlin.arrayOf' call
|
|
810
|
+
// Inline function 'kotlin.arrayOf' call
|
|
811
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
812
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
813
|
+
var tmp = [161, 169, 161, 254];
|
|
814
|
+
// Inline function 'kotlin.arrayOf' call
|
|
815
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
816
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
817
|
+
var tmp_0 = [176, 247, 161, 254];
|
|
818
|
+
// Inline function 'kotlin.arrayOf' call
|
|
819
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
820
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
821
|
+
var tmp_1 = [129, 160, 64, 254];
|
|
822
|
+
// Inline function 'kotlin.arrayOf' call
|
|
823
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
824
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
825
|
+
var tmp_2 = [170, 254, 64, 160];
|
|
826
|
+
// Inline function 'kotlin.arrayOf' call
|
|
827
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
828
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
829
|
+
var tmp_3 = [168, 169, 64, 160];
|
|
830
|
+
// Inline function 'kotlin.arrayOf' call
|
|
831
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
832
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
833
|
+
var tmp_4 = [170, 175, 161, 254];
|
|
834
|
+
// Inline function 'kotlin.arrayOf' call
|
|
835
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
836
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
837
|
+
var tmp_5 = [248, 254, 161, 254];
|
|
838
|
+
// Inline function 'kotlin.arrayOf' call
|
|
839
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
840
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
841
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
842
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
843
|
+
var ranges = [tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, [161, 167, 64, 160]];
|
|
844
|
+
var codes = new Uint16Array(23940);
|
|
845
|
+
var i = 0;
|
|
846
|
+
var inductionVariable = 0;
|
|
847
|
+
var last = ranges.length;
|
|
848
|
+
while (inductionVariable < last) {
|
|
849
|
+
var arr = ranges[inductionVariable];
|
|
850
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
851
|
+
var inductionVariable_0 = arr[2];
|
|
852
|
+
var last_0 = arr[3];
|
|
853
|
+
if (inductionVariable_0 <= last_0)
|
|
854
|
+
do {
|
|
855
|
+
var b2 = inductionVariable_0;
|
|
856
|
+
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
857
|
+
if (!(b2 === 127)) {
|
|
858
|
+
var inductionVariable_1 = arr[0];
|
|
859
|
+
var last_1 = arr[1];
|
|
860
|
+
if (inductionVariable_1 <= last_1)
|
|
861
|
+
do {
|
|
862
|
+
var b1 = inductionVariable_1;
|
|
863
|
+
inductionVariable_1 = inductionVariable_1 + 1 | 0;
|
|
864
|
+
// Inline function 'org.khronos.webgl.set' call
|
|
865
|
+
var tmp3 = i;
|
|
866
|
+
i = tmp3 + 1 | 0;
|
|
867
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
868
|
+
codes[tmp3] = toShort(b2 << 8 | b1);
|
|
869
|
+
}
|
|
870
|
+
while (!(b1 === last_1));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
while (!(b2 === last_0));
|
|
874
|
+
}
|
|
875
|
+
var decoder = new TextDecoder('gbk');
|
|
876
|
+
var tmp_6 = decoder.decode(codes);
|
|
877
|
+
var str = (!(tmp_6 == null) ? typeof tmp_6 === 'string' : false) ? tmp_6 : THROW_CCE();
|
|
878
|
+
var inductionVariable_2 = 0;
|
|
879
|
+
var last_2 = charSequenceLength(str) - 1 | 0;
|
|
880
|
+
if (inductionVariable_2 <= last_2)
|
|
881
|
+
do {
|
|
882
|
+
var j = inductionVariable_2;
|
|
883
|
+
inductionVariable_2 = inductionVariable_2 + 1 | 0;
|
|
884
|
+
// Inline function 'org.khronos.webgl.set' call
|
|
885
|
+
var tmp4_set = this.c9_1;
|
|
886
|
+
// Inline function 'kotlin.code' call
|
|
887
|
+
var tmp3_get_code_qbni8p = charSequenceGet(str, j);
|
|
888
|
+
// Inline function 'org.khronos.webgl.get' call
|
|
889
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
890
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
891
|
+
tmp4_set[Char__toInt_impl_vasixd(tmp3_get_code_qbni8p)] = codes[j];
|
|
892
|
+
}
|
|
893
|
+
while (inductionVariable_2 <= last_2);
|
|
894
|
+
}
|
|
895
|
+
protoOf(GBKHelper).d9 = function (str) {
|
|
896
|
+
// Inline function 'kotlin.byteArrayOf' call
|
|
897
|
+
var bytes = new Int8Array([]);
|
|
898
|
+
var indexedObject = toCharArray(str);
|
|
899
|
+
var inductionVariable = 0;
|
|
900
|
+
var last = indexedObject.length;
|
|
901
|
+
while (inductionVariable < last) {
|
|
902
|
+
var char = indexedObject[inductionVariable];
|
|
903
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
904
|
+
// Inline function 'kotlin.collections.plus' call
|
|
905
|
+
var tmp0_plus = bytes;
|
|
906
|
+
var tmp1_plus = getCharGBKByteArray(this, char);
|
|
907
|
+
bytes = primitiveArrayConcat([tmp0_plus, tmp1_plus]);
|
|
908
|
+
}
|
|
909
|
+
return bytes;
|
|
910
|
+
};
|
|
911
|
+
protoOf(GBKHelper).e9 = function (byteArray) {
|
|
912
|
+
var decoder = new TextDecoder('gbk');
|
|
913
|
+
var tmp = decoder.decode(new Uint8Array(toTypedArray(byteArray)));
|
|
914
|
+
return (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : THROW_CCE();
|
|
915
|
+
};
|
|
916
|
+
var GBKHelper_instance;
|
|
917
|
+
function GBKHelper_getInstance() {
|
|
918
|
+
if (GBKHelper_instance == null)
|
|
919
|
+
new GBKHelper();
|
|
920
|
+
return GBKHelper_instance;
|
|
921
|
+
}
|
|
922
|
+
function toPinYinDo(_this__u8e3s4, separator) {
|
|
923
|
+
// Inline function 'kotlin.text.uppercase' call
|
|
924
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
925
|
+
return joinToString(PinyinPro.pinyin(_this__u8e3s4, {type: 'array', toneType: 'none'}), separator).toUpperCase();
|
|
926
|
+
}
|
|
927
|
+
//region block: exports
|
|
928
|
+
function $jsExportAll$(_) {
|
|
929
|
+
var $com = _.com || (_.com = {});
|
|
930
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
931
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
932
|
+
$com$d10ng$common.toUnsignedInt = toUnsignedInt;
|
|
933
|
+
$com$d10ng$common.toUnsignedLong = toUnsignedLong;
|
|
934
|
+
$com$d10ng$common.toBinString = toBinString;
|
|
935
|
+
$com$d10ng$common.toHexString = toHexString;
|
|
936
|
+
$com$d10ng$common.indexOf = indexOf_1;
|
|
937
|
+
$com$d10ng$common.fillLengthByByteArray = fillLengthByByteArray;
|
|
938
|
+
var $com = _.com || (_.com = {});
|
|
939
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
940
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
941
|
+
$com$d10ng$common.toBinStringByByte = toBinStringByByte;
|
|
942
|
+
$com$d10ng$common.toHexStringByByte = toHexStringByByte;
|
|
943
|
+
$com$d10ng$common.toUnsignedIntByByte = toUnsignedIntByByte;
|
|
944
|
+
var $com = _.com || (_.com = {});
|
|
945
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
946
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
947
|
+
$com$d10ng$common.toByteArrayByCharArray = toByteArrayByCharArray;
|
|
948
|
+
var $com = _.com || (_.com = {});
|
|
949
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
950
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
951
|
+
$com$d10ng$common.encodeGBK = encodeGBK;
|
|
952
|
+
$com$d10ng$common.decodeGBK = decodeGBK;
|
|
953
|
+
$com$d10ng$common.encodeUTF8 = encodeUTF8;
|
|
954
|
+
$com$d10ng$common.decodeUTF8 = decodeUTF8;
|
|
955
|
+
$com$d10ng$common.encodeUnicode = encodeUnicode;
|
|
956
|
+
$com$d10ng$common.encodeUnicodeString = encodeUnicodeString;
|
|
957
|
+
$com$d10ng$common.decodeUnicodeByByteArray = decodeUnicodeByByteArray;
|
|
958
|
+
$com$d10ng$common.decodeUnicode = decodeUnicode;
|
|
959
|
+
$com$d10ng$common.encodeASCII = encodeASCII;
|
|
960
|
+
$com$d10ng$common.encodeASCIIString = encodeASCIIString;
|
|
961
|
+
$com$d10ng$common.decodeASCII = decodeASCII;
|
|
962
|
+
$com$d10ng$common.decodeASCIIByByteArray = decodeASCIIByByteArray;
|
|
963
|
+
var $com = _.com || (_.com = {});
|
|
964
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
965
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
966
|
+
$com$d10ng$common.ChecksumType = ChecksumType;
|
|
967
|
+
$com$d10ng$common.ChecksumType.values = values;
|
|
968
|
+
$com$d10ng$common.ChecksumType.valueOf = valueOf;
|
|
969
|
+
defineProp($com$d10ng$common.ChecksumType, 'AND', ChecksumType_AND_getInstance, VOID);
|
|
970
|
+
defineProp($com$d10ng$common.ChecksumType, 'OR', ChecksumType_OR_getInstance, VOID);
|
|
971
|
+
defineProp($com$d10ng$common.ChecksumType, 'XOR', ChecksumType_XOR_getInstance, VOID);
|
|
972
|
+
$com$d10ng$common.assertChecksum = assertChecksum;
|
|
973
|
+
$com$d10ng$common.getChecksum = getChecksum;
|
|
974
|
+
$com$d10ng$common.addChecksum = addChecksum;
|
|
975
|
+
var $com = _.com || (_.com = {});
|
|
976
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
977
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
978
|
+
$com$d10ng$common.toStringByDouble = toStringByDouble;
|
|
979
|
+
var $com = _.com || (_.com = {});
|
|
980
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
981
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
982
|
+
$com$d10ng$common.toString = toString_3;
|
|
983
|
+
var $com = _.com || (_.com = {});
|
|
984
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
985
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
986
|
+
$com$d10ng$common.takeHighByte = takeHighByte;
|
|
987
|
+
$com$d10ng$common.takeLowByte = takeLowByte;
|
|
988
|
+
$com$d10ng$common.toByteArray = toByteArray_0;
|
|
989
|
+
var $com = _.com || (_.com = {});
|
|
990
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
991
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
992
|
+
$com$d10ng$common.toByteArrayByLong = toByteArrayByLong;
|
|
993
|
+
var $com = _.com || (_.com = {});
|
|
994
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
995
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
996
|
+
$com$d10ng$common.toPinYin = toPinYin;
|
|
997
|
+
var $com = _.com || (_.com = {});
|
|
998
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
999
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
1000
|
+
$com$d10ng$common.keepByRegexStr = keepByRegexStr;
|
|
1001
|
+
$com$d10ng$common.filterByRegexStr = filterByRegexStr;
|
|
1002
|
+
$com$d10ng$common.isIdCard = isIdCard;
|
|
1003
|
+
$com$d10ng$common.isMobileNumber = isMobileNumber;
|
|
1004
|
+
$com$d10ng$common.isEmail = isEmail;
|
|
1005
|
+
$com$d10ng$common.isOnlyChEnNum = isOnlyChEnNum;
|
|
1006
|
+
$com$d10ng$common.isOnlyEnNum = isOnlyEnNum;
|
|
1007
|
+
$com$d10ng$common.isOnlyChinese = isOnlyChinese;
|
|
1008
|
+
$com$d10ng$common.isOnlyLetter = isOnlyLetter;
|
|
1009
|
+
$com$d10ng$common.isOnlyNumber = isOnlyNumber;
|
|
1010
|
+
$com$d10ng$common.isOnlyCode = isOnlyCode;
|
|
1011
|
+
$com$d10ng$common.isOnlyChSymbol = isOnlyChSymbol;
|
|
1012
|
+
var $com = _.com || (_.com = {});
|
|
1013
|
+
var $com$d10ng = $com.d10ng || ($com.d10ng = {});
|
|
1014
|
+
var $com$d10ng$common = $com$d10ng.common || ($com$d10ng.common = {});
|
|
1015
|
+
$com$d10ng$common.toByteFromBin = toByteFromBin;
|
|
1016
|
+
$com$d10ng$common.toByteArrayFromBin = toByteArrayFromBin;
|
|
1017
|
+
$com$d10ng$common.toByteFromHex = toByteFromHex;
|
|
1018
|
+
$com$d10ng$common.toByteArrayFromHex = toByteArrayFromHex;
|
|
1019
|
+
$com$d10ng$common.fillLength = fillLength;
|
|
1020
|
+
$com$d10ng$common.getByteLength = getByteLength;
|
|
1021
|
+
$com$d10ng$common.getFirstUpperCase = getFirstUpperCase;
|
|
1022
|
+
}
|
|
1023
|
+
$jsExportAll$(_);
|
|
1024
|
+
//endregion
|
|
1025
|
+
return _;
|
|
1026
|
+
}));
|
|
1027
|
+
|
|
1028
|
+
//# sourceMappingURL=dl-common-util.js.map
|