@ozdemirburak/morse-code-translator 6.0.0 → 7.0.0
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/README.md +1 -1
- package/dist/audio.d.ts.map +1 -1
- package/dist/characters.d.ts +2 -1
- package/dist/characters.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/morse-code-translator.es.js +615 -608
- package/dist/morse-code-translator.es.js.map +1 -1
- package/dist/morse-code-translator.umd.js +2 -2
- package/dist/morse-code-translator.umd.js.map +1 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -7
|
@@ -1,609 +1,616 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
1
|
+
//#region src/characters.ts
|
|
2
|
+
var e = {
|
|
3
|
+
1: {
|
|
4
|
+
A: "01",
|
|
5
|
+
B: "1000",
|
|
6
|
+
C: "1010",
|
|
7
|
+
D: "100",
|
|
8
|
+
E: "0",
|
|
9
|
+
F: "0010",
|
|
10
|
+
G: "110",
|
|
11
|
+
H: "0000",
|
|
12
|
+
I: "00",
|
|
13
|
+
J: "0111",
|
|
14
|
+
K: "101",
|
|
15
|
+
L: "0100",
|
|
16
|
+
M: "11",
|
|
17
|
+
N: "10",
|
|
18
|
+
O: "111",
|
|
19
|
+
P: "0110",
|
|
20
|
+
Q: "1101",
|
|
21
|
+
R: "010",
|
|
22
|
+
S: "000",
|
|
23
|
+
T: "1",
|
|
24
|
+
U: "001",
|
|
25
|
+
V: "0001",
|
|
26
|
+
W: "011",
|
|
27
|
+
X: "1001",
|
|
28
|
+
Y: "1011",
|
|
29
|
+
Z: "1100"
|
|
30
|
+
},
|
|
31
|
+
2: {
|
|
32
|
+
0: "11111",
|
|
33
|
+
1: "01111",
|
|
34
|
+
2: "00111",
|
|
35
|
+
3: "00011",
|
|
36
|
+
4: "00001",
|
|
37
|
+
5: "00000",
|
|
38
|
+
6: "10000",
|
|
39
|
+
7: "11000",
|
|
40
|
+
8: "11100",
|
|
41
|
+
9: "11110"
|
|
42
|
+
},
|
|
43
|
+
3: {
|
|
44
|
+
".": "010101",
|
|
45
|
+
",": "110011",
|
|
46
|
+
"?": "001100",
|
|
47
|
+
"'": "011110",
|
|
48
|
+
"!": "101011",
|
|
49
|
+
"/": "10010",
|
|
50
|
+
"(": "10110",
|
|
51
|
+
")": "101101",
|
|
52
|
+
"&": "01000",
|
|
53
|
+
":": "111000",
|
|
54
|
+
";": "101010",
|
|
55
|
+
"=": "10001",
|
|
56
|
+
"+": "01010",
|
|
57
|
+
"-": "100001",
|
|
58
|
+
_: "001101",
|
|
59
|
+
"\"": "010010",
|
|
60
|
+
$: "0001001",
|
|
61
|
+
"@": "011010",
|
|
62
|
+
"¿": "00101",
|
|
63
|
+
"¡": "110001"
|
|
64
|
+
},
|
|
65
|
+
4: {
|
|
66
|
+
Ã: "01101",
|
|
67
|
+
Á: "01101",
|
|
68
|
+
Å: "01101",
|
|
69
|
+
À: "01101",
|
|
70
|
+
Â: "01101",
|
|
71
|
+
Ä: "0101",
|
|
72
|
+
Ą: "0101",
|
|
73
|
+
Æ: "0101",
|
|
74
|
+
Ç: "10100",
|
|
75
|
+
Ć: "10100",
|
|
76
|
+
Ĉ: "10100",
|
|
77
|
+
Č: "110",
|
|
78
|
+
Ð: "00110",
|
|
79
|
+
È: "01001",
|
|
80
|
+
Ę: "00100",
|
|
81
|
+
Ë: "00100",
|
|
82
|
+
É: "00100",
|
|
83
|
+
Ê: "10010",
|
|
84
|
+
Ğ: "11010",
|
|
85
|
+
Ĝ: "11010",
|
|
86
|
+
Ĥ: "1111",
|
|
87
|
+
İ: "01001",
|
|
88
|
+
Ï: "10011",
|
|
89
|
+
Ì: "01110",
|
|
90
|
+
Ĵ: "01110",
|
|
91
|
+
Ł: "01001",
|
|
92
|
+
Ń: "11011",
|
|
93
|
+
Ñ: "11011",
|
|
94
|
+
Ó: "1110",
|
|
95
|
+
Ò: "1110",
|
|
96
|
+
Ö: "1110",
|
|
97
|
+
Ô: "1110",
|
|
98
|
+
Ø: "1110",
|
|
99
|
+
Ś: "0001000",
|
|
100
|
+
Ş: "01100",
|
|
101
|
+
Ș: "1111",
|
|
102
|
+
Š: "1111",
|
|
103
|
+
Ŝ: "00010",
|
|
104
|
+
Þ: "01100",
|
|
105
|
+
Ü: "0011",
|
|
106
|
+
Ù: "0011",
|
|
107
|
+
Ŭ: "0011",
|
|
108
|
+
Ž: "11001",
|
|
109
|
+
Ź: "110010",
|
|
110
|
+
Ż: "11001"
|
|
111
|
+
},
|
|
112
|
+
5: {
|
|
113
|
+
А: "01",
|
|
114
|
+
Б: "1000",
|
|
115
|
+
В: "011",
|
|
116
|
+
Г: "110",
|
|
117
|
+
Д: "100",
|
|
118
|
+
Е: "0",
|
|
119
|
+
Ж: "0001",
|
|
120
|
+
З: "1100",
|
|
121
|
+
И: "00",
|
|
122
|
+
Й: "0111",
|
|
123
|
+
К: "101",
|
|
124
|
+
Л: "0100",
|
|
125
|
+
М: "11",
|
|
126
|
+
Н: "10",
|
|
127
|
+
О: "111",
|
|
128
|
+
П: "0110",
|
|
129
|
+
Р: "010",
|
|
130
|
+
С: "000",
|
|
131
|
+
Т: "1",
|
|
132
|
+
У: "001",
|
|
133
|
+
Ф: "0010",
|
|
134
|
+
Х: "0000",
|
|
135
|
+
Ц: "1010",
|
|
136
|
+
Ч: "1110",
|
|
137
|
+
Ш: "1111",
|
|
138
|
+
Щ: "1101",
|
|
139
|
+
Ъ: "11011",
|
|
140
|
+
Ы: "1011",
|
|
141
|
+
Ь: "1001",
|
|
142
|
+
Э: "00100",
|
|
143
|
+
Ю: "0011",
|
|
144
|
+
Я: "0101",
|
|
145
|
+
Ї: "01110",
|
|
146
|
+
Є: "00100",
|
|
147
|
+
І: "00",
|
|
148
|
+
Ґ: "110"
|
|
149
|
+
},
|
|
150
|
+
6: {
|
|
151
|
+
Α: "01",
|
|
152
|
+
Β: "1000",
|
|
153
|
+
Γ: "110",
|
|
154
|
+
Δ: "100",
|
|
155
|
+
Ε: "0",
|
|
156
|
+
Ζ: "1100",
|
|
157
|
+
Η: "0000",
|
|
158
|
+
Θ: "1010",
|
|
159
|
+
Ι: "00",
|
|
160
|
+
Κ: "101",
|
|
161
|
+
Λ: "0100",
|
|
162
|
+
Μ: "11",
|
|
163
|
+
Ν: "10",
|
|
164
|
+
Ξ: "1001",
|
|
165
|
+
Ο: "111",
|
|
166
|
+
Π: "0110",
|
|
167
|
+
Ρ: "010",
|
|
168
|
+
Σ: "000",
|
|
169
|
+
Τ: "1",
|
|
170
|
+
Υ: "1011",
|
|
171
|
+
Φ: "0010",
|
|
172
|
+
Χ: "1111",
|
|
173
|
+
Ψ: "1101",
|
|
174
|
+
Ω: "011"
|
|
175
|
+
},
|
|
176
|
+
7: {
|
|
177
|
+
א: "01",
|
|
178
|
+
ב: "1000",
|
|
179
|
+
ג: "110",
|
|
180
|
+
ד: "100",
|
|
181
|
+
ה: "111",
|
|
182
|
+
ו: "0",
|
|
183
|
+
ז: "1100",
|
|
184
|
+
ח: "0000",
|
|
185
|
+
ט: "001",
|
|
186
|
+
י: "00",
|
|
187
|
+
כ: "101",
|
|
188
|
+
ל: "0100",
|
|
189
|
+
מ: "11",
|
|
190
|
+
נ: "10",
|
|
191
|
+
ס: "1010",
|
|
192
|
+
ע: "0111",
|
|
193
|
+
פ: "0110",
|
|
194
|
+
צ: "011",
|
|
195
|
+
ק: "1101",
|
|
196
|
+
ר: "010",
|
|
197
|
+
ש: "000",
|
|
198
|
+
ת: "1"
|
|
199
|
+
},
|
|
200
|
+
8: {
|
|
201
|
+
ا: "01",
|
|
202
|
+
ب: "1000",
|
|
203
|
+
ت: "1",
|
|
204
|
+
ث: "1010",
|
|
205
|
+
ج: "0111",
|
|
206
|
+
ح: "0000",
|
|
207
|
+
خ: "111",
|
|
208
|
+
د: "100",
|
|
209
|
+
ذ: "1100",
|
|
210
|
+
ر: "010",
|
|
211
|
+
ز: "1110",
|
|
212
|
+
س: "000",
|
|
213
|
+
ش: "1111",
|
|
214
|
+
ص: "1001",
|
|
215
|
+
ض: "0001",
|
|
216
|
+
ط: "001",
|
|
217
|
+
ظ: "1011",
|
|
218
|
+
ع: "0101",
|
|
219
|
+
غ: "110",
|
|
220
|
+
ف: "0010",
|
|
221
|
+
ق: "1101",
|
|
222
|
+
ك: "101",
|
|
223
|
+
ل: "0100",
|
|
224
|
+
م: "11",
|
|
225
|
+
ن: "10",
|
|
226
|
+
ه: "00100",
|
|
227
|
+
و: "011",
|
|
228
|
+
ي: "00",
|
|
229
|
+
ﺀ: "0"
|
|
230
|
+
},
|
|
231
|
+
9: {
|
|
232
|
+
ا: "01",
|
|
233
|
+
ب: "1000",
|
|
234
|
+
پ: "0110",
|
|
235
|
+
ت: "1",
|
|
236
|
+
ث: "1010",
|
|
237
|
+
ج: "0111",
|
|
238
|
+
چ: "1110",
|
|
239
|
+
ح: "0000",
|
|
240
|
+
خ: "1001",
|
|
241
|
+
د: "100",
|
|
242
|
+
ذ: "0001",
|
|
243
|
+
ر: "010",
|
|
244
|
+
ز: "1100",
|
|
245
|
+
ژ: "110",
|
|
246
|
+
س: "000",
|
|
247
|
+
ش: "1111",
|
|
248
|
+
ص: "0101",
|
|
249
|
+
ض: "00100",
|
|
250
|
+
ط: "001",
|
|
251
|
+
ظ: "1011",
|
|
252
|
+
ع: "111",
|
|
253
|
+
غ: "0011",
|
|
254
|
+
ف: "0010",
|
|
255
|
+
ق: "111000",
|
|
256
|
+
ک: "101",
|
|
257
|
+
گ: "1101",
|
|
258
|
+
ل: "0100",
|
|
259
|
+
م: "11",
|
|
260
|
+
ن: "10",
|
|
261
|
+
و: "011",
|
|
262
|
+
ه: "0",
|
|
263
|
+
ی: "00"
|
|
264
|
+
},
|
|
265
|
+
10: {
|
|
266
|
+
ア: "11011",
|
|
267
|
+
カ: "0100",
|
|
268
|
+
サ: "10101",
|
|
269
|
+
タ: "10",
|
|
270
|
+
ナ: "010",
|
|
271
|
+
ハ: "1000",
|
|
272
|
+
マ: "1001",
|
|
273
|
+
ヤ: "011",
|
|
274
|
+
ラ: "000",
|
|
275
|
+
ワ: "101",
|
|
276
|
+
イ: "01",
|
|
277
|
+
キ: "10100",
|
|
278
|
+
シ: "11010",
|
|
279
|
+
チ: "0010",
|
|
280
|
+
ニ: "1010",
|
|
281
|
+
ヒ: "11001",
|
|
282
|
+
ミ: "00101",
|
|
283
|
+
リ: "110",
|
|
284
|
+
ヰ: "01001",
|
|
285
|
+
ウ: "001",
|
|
286
|
+
ク: "0001",
|
|
287
|
+
ス: "11101",
|
|
288
|
+
ツ: "0110",
|
|
289
|
+
ヌ: "0000",
|
|
290
|
+
フ: "1100",
|
|
291
|
+
ム: "1",
|
|
292
|
+
ユ: "10011",
|
|
293
|
+
ル: "10110",
|
|
294
|
+
ン: "01010",
|
|
295
|
+
エ: "10111",
|
|
296
|
+
ケ: "1011",
|
|
297
|
+
セ: "01110",
|
|
298
|
+
テ: "01011",
|
|
299
|
+
ネ: "1101",
|
|
300
|
+
ヘ: "0",
|
|
301
|
+
メ: "10001",
|
|
302
|
+
レ: "111",
|
|
303
|
+
ヱ: "01100",
|
|
304
|
+
オ: "01000",
|
|
305
|
+
コ: "1111",
|
|
306
|
+
ソ: "1110",
|
|
307
|
+
ト: "00100",
|
|
308
|
+
ノ: "0011",
|
|
309
|
+
ホ: "100",
|
|
310
|
+
モ: "10010",
|
|
311
|
+
ヨ: "11",
|
|
312
|
+
ロ: "0101",
|
|
313
|
+
ヲ: "0111",
|
|
314
|
+
゛: "00",
|
|
315
|
+
゜: "00110",
|
|
316
|
+
"。": "010100",
|
|
317
|
+
ー: "01101",
|
|
318
|
+
"、": "010101",
|
|
319
|
+
"(": "101101",
|
|
320
|
+
")": "010010"
|
|
321
|
+
},
|
|
322
|
+
11: {
|
|
323
|
+
ㄱ: "0100",
|
|
324
|
+
ㄴ: "0010",
|
|
325
|
+
ㄷ: "1000",
|
|
326
|
+
ㄹ: "0001",
|
|
327
|
+
ㅁ: "11",
|
|
328
|
+
ㅂ: "011",
|
|
329
|
+
ㅅ: "110",
|
|
330
|
+
ㅇ: "101",
|
|
331
|
+
ㅈ: "0110",
|
|
332
|
+
ㅊ: "1010",
|
|
333
|
+
ㅋ: "1001",
|
|
334
|
+
ㅌ: "1100",
|
|
335
|
+
ㅍ: "111",
|
|
336
|
+
ㅎ: "0111",
|
|
337
|
+
ㅏ: "0",
|
|
338
|
+
ㅑ: "00",
|
|
339
|
+
ㅓ: "1",
|
|
340
|
+
ㅕ: "000",
|
|
341
|
+
ㅗ: "01",
|
|
342
|
+
ㅛ: "10",
|
|
343
|
+
ㅜ: "0000",
|
|
344
|
+
ㅠ: "010",
|
|
345
|
+
ㅡ: "100",
|
|
346
|
+
ㅣ: "001",
|
|
347
|
+
ㅐ: "1101",
|
|
348
|
+
ㅔ: "1011"
|
|
349
|
+
},
|
|
350
|
+
12: {
|
|
351
|
+
ก: "110",
|
|
352
|
+
ข: "1010",
|
|
353
|
+
ค: "101",
|
|
354
|
+
ง: "10110",
|
|
355
|
+
จ: "10010",
|
|
356
|
+
ฉ: "1111",
|
|
357
|
+
ช: "1001",
|
|
358
|
+
ซ: "1100",
|
|
359
|
+
ญ: "0111",
|
|
360
|
+
ด: "100",
|
|
361
|
+
ต: "1",
|
|
362
|
+
ถ: "10100",
|
|
363
|
+
ท: "10011",
|
|
364
|
+
น: "10",
|
|
365
|
+
บ: "1000",
|
|
366
|
+
ป: "0110",
|
|
367
|
+
ผ: "1101",
|
|
368
|
+
ฝ: "10101",
|
|
369
|
+
พ: "01100",
|
|
370
|
+
ฟ: "0010",
|
|
371
|
+
ม: "11",
|
|
372
|
+
ย: "1011",
|
|
373
|
+
ร: "010",
|
|
374
|
+
ล: "0100",
|
|
375
|
+
ว: "011",
|
|
376
|
+
ส: "000",
|
|
377
|
+
ห: "0000",
|
|
378
|
+
อ: "10001",
|
|
379
|
+
ฮ: "11011",
|
|
380
|
+
ฤ: "01011",
|
|
381
|
+
ะ: "01000",
|
|
382
|
+
า: "01",
|
|
383
|
+
"ิ": "00100",
|
|
384
|
+
"ี": "00",
|
|
385
|
+
"ึ": "00110",
|
|
386
|
+
"ื": "0011",
|
|
387
|
+
"ุ": "00101",
|
|
388
|
+
"ู": "1110",
|
|
389
|
+
เ: "0",
|
|
390
|
+
แ: "0101",
|
|
391
|
+
ไ: "01001",
|
|
392
|
+
โ: "111",
|
|
393
|
+
ำ: "00010",
|
|
394
|
+
"่": "001",
|
|
395
|
+
"้": "0001",
|
|
396
|
+
"๊": "11000",
|
|
397
|
+
"๋": "01010",
|
|
398
|
+
"ั": "01101",
|
|
399
|
+
"็": "11100",
|
|
400
|
+
"์": "11001",
|
|
401
|
+
ๆ: "10111",
|
|
402
|
+
ฯ: "11010"
|
|
403
|
+
}
|
|
404
|
+
}, t = (t) => ({
|
|
405
|
+
...e,
|
|
406
|
+
0: e[t.priority],
|
|
407
|
+
1: {
|
|
408
|
+
...e[1],
|
|
409
|
+
[t.separator]: t.space
|
|
410
|
+
}
|
|
411
|
+
}), n = (e, n) => {
|
|
412
|
+
let r = {}, i = t(e);
|
|
413
|
+
for (let t in i) {
|
|
414
|
+
r[t] = {};
|
|
415
|
+
let n = i[t];
|
|
416
|
+
if (n) for (let i in n) r[t][i] = n[i].replace(/[01]/g, (t) => t === "0" ? e.dot : e.dash);
|
|
417
|
+
}
|
|
418
|
+
return n || delete r[0], r;
|
|
419
|
+
}, r = (e) => {
|
|
420
|
+
let t = Object.create(null), r = n(e, !0);
|
|
421
|
+
for (let e in r) for (let n in r[e]) {
|
|
422
|
+
let i = r[e][n];
|
|
423
|
+
t[i] === void 0 && (t[i] = n);
|
|
424
|
+
}
|
|
425
|
+
return (t[e.space] === void 0 || t[e.space] === e.separator) && (t[e.space] = " "), t;
|
|
426
|
+
}, i = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, a = (t) => Object.values(e).some((e) => Object.prototype.hasOwnProperty.call(e, t)), o = (e, t, n) => {
|
|
427
|
+
if (e === "") return !1;
|
|
428
|
+
let r = 0;
|
|
429
|
+
for (; r < e.length;) if (e.startsWith(t, r)) r += t.length;
|
|
430
|
+
else if (e.startsWith(n, r)) r += n.length;
|
|
431
|
+
else return !1;
|
|
432
|
+
return !0;
|
|
433
|
+
}, s = (e) => {
|
|
434
|
+
if (e.dot === e.dash) throw Error("morse-code-translator: \"dot\" and \"dash\" symbols must be different.");
|
|
435
|
+
if (e.separator === e.space) throw Error("morse-code-translator: \"separator\" and \"space\" symbols must be different.");
|
|
436
|
+
for (let [t, n] of [["separator", e.separator], ["space", e.space]]) {
|
|
437
|
+
if ([...n].length !== 1) throw Error(`morse-code-translator: "${t}" must be a single character.`);
|
|
438
|
+
if (n === e.dot || n === e.dash) throw Error(`morse-code-translator: "${t}" must differ from the "dot" and "dash" symbols.`);
|
|
439
|
+
if (o(n, e.dot, e.dash)) throw Error(`morse-code-translator: "${t}" must not be composed solely of "dot"/"dash" symbols.`);
|
|
440
|
+
if (t === "space" && /\s/.test(n)) throw Error("morse-code-translator: \"space\" must not be a whitespace character.");
|
|
441
|
+
}
|
|
442
|
+
for (let [t, n] of [["dot", e.dot], ["dash", e.dash]]) if (n.includes(e.space) || n.includes(e.separator)) throw Error(`morse-code-translator: "${t}" must not contain the "space" or "separator" symbol.`);
|
|
443
|
+
if (a(e.separator)) throw Error("morse-code-translator: \"separator\" must not be an encodable character.");
|
|
444
|
+
if (e.invalid !== "" && o(e.invalid, e.dot, e.dash)) throw Error("morse-code-translator: \"invalid\" must not be composed solely of \"dot\"/\"dash\" symbols.");
|
|
445
|
+
for (let [t, n] of [["space", e.space], ["invalid", e.invalid]]) if (/[01]/.test(n)) throw Error(`morse-code-translator: "${t}" must not contain the reserved characters "0" or "1".`);
|
|
446
|
+
}, c = (e = {}) => {
|
|
447
|
+
let t = i(e.unit) ? e.unit : .08, n = i(e.fwUnit) ? e.fwUnit : t, r = i(e.wpm) ? e.wpm : void 0, a = i(e.oscillator?.frequency) ? e.oscillator.frequency : 500, o = typeof e.volume == "number" && Number.isFinite(e.volume) ? e.volume : 100, c = Number.isInteger(e.priority) && e.priority >= 1 && e.priority <= 12 ? e.priority : 1, l = e.oscillator?.type, u = l === "sine" || l === "square" || l === "sawtooth" || l === "triangle" ? l : "sine", d = {
|
|
448
|
+
...e,
|
|
449
|
+
dash: e.dash || "-",
|
|
450
|
+
dot: e.dot || ".",
|
|
451
|
+
space: e.space || "/",
|
|
452
|
+
separator: e.separator || " ",
|
|
453
|
+
invalid: e.invalid ?? "#",
|
|
454
|
+
priority: c,
|
|
455
|
+
wpm: r,
|
|
456
|
+
unit: t,
|
|
457
|
+
fwUnit: n,
|
|
458
|
+
volume: o,
|
|
459
|
+
oscillator: {
|
|
460
|
+
...e.oscillator,
|
|
461
|
+
type: u,
|
|
462
|
+
frequency: a,
|
|
463
|
+
onended: e.oscillator?.onended || null
|
|
464
|
+
},
|
|
465
|
+
events: e.events ? { ...e.events } : e.events
|
|
466
|
+
};
|
|
467
|
+
return s(d), d;
|
|
468
|
+
}, l = 44100, u = 1, d = 16, f = 1, p = 3, m = 1, h = 3, g = 7, _ = 50, v = 3600, y = (e, t, n = 0) => {
|
|
469
|
+
let r = [], { unit: i, fwUnit: a } = t, o = 0;
|
|
470
|
+
t.wpm && (i = a = 60 / (t.wpm * _)), r.push([0, o]);
|
|
471
|
+
let s = (e, t, s = !0) => {
|
|
472
|
+
r.push([e, n + o]), o += t * (s ? i : a);
|
|
473
|
+
}, c = (e) => s(t.volume / 100, e), l = (e) => s(0, e), u = (e) => s(0, e, !1), d = t.dot.length >= t.dash.length ? [[t.dot, f], [t.dash, p]] : [[t.dash, p], [t.dot, f]];
|
|
474
|
+
return e.split(t.space).map((e) => e.split(t.separator).filter((e) => e !== "")).filter((e) => e.length > 0).forEach((e, t) => {
|
|
475
|
+
t > 0 && u(g), e.forEach((e, t) => {
|
|
476
|
+
t > 0 && u(h);
|
|
477
|
+
let n = 0, r = !1;
|
|
478
|
+
for (; n < e.length;) {
|
|
479
|
+
let t = d.find(([t]) => t && e.startsWith(t, n));
|
|
480
|
+
t ? (r && l(m), c(t[1]), r = !0, n += t[0].length) : n += 1;
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
}), [r, Math.min(o, v)];
|
|
484
|
+
}, b = (e, t) => {
|
|
485
|
+
let n = d / 8, r = u * n, i = e * r, a = t.length * n, o = 44 + a, s = new ArrayBuffer(o), c = new DataView(s), l = (e, t) => {
|
|
486
|
+
for (let n = 0; n < t.length; n++) c.setUint8(e + n, t.charCodeAt(n));
|
|
487
|
+
};
|
|
488
|
+
return l(0, "RIFF"), c.setUint32(4, o - 8, !0), l(8, "WAVE"), l(12, "fmt "), c.setUint32(16, 16, !0), c.setUint16(20, 1, !0), c.setUint16(22, u, !0), c.setUint32(24, e, !0), c.setUint32(28, i, !0), c.setUint16(32, r, !0), c.setUint16(34, d, !0), l(36, "data"), c.setUint32(40, a, !0), ((e, t) => {
|
|
489
|
+
for (let r = 0; r < t.length; r++, e += n) {
|
|
490
|
+
let n = Math.max(-1, Math.min(1, t[r])), i = n < 0 ? n * 32768 : n * 32767;
|
|
491
|
+
c.setInt16(e, i, !0);
|
|
492
|
+
}
|
|
493
|
+
})(44, t), c;
|
|
494
|
+
}, x = (e, t) => {
|
|
495
|
+
let n = window.AudioContext || window.webkitAudioContext, r = window.OfflineAudioContext || window.webkitOfflineAudioContext;
|
|
496
|
+
if (!n || !r) throw Error("Web Audio API is not supported in this browser. Please use a modern browser with Web Audio API support.");
|
|
497
|
+
let [i, a] = y(e, t), o = new r(u, Math.max(1, Math.ceil(l * a)), l), s = o.createOscillator(), c = o.createGain();
|
|
498
|
+
s.type = t.oscillator.type, s.frequency.value = t.oscillator.frequency ?? 500, i.forEach(([e, t]) => {
|
|
499
|
+
c.gain.setValueAtTime(e, t);
|
|
500
|
+
}), s.connect(c), c.connect(o.destination);
|
|
501
|
+
let d = null, f = null, p = null, m = "ready", h = 0, g = 0, _ = null, v = !1, x = 0, S = () => (!d && m !== "disposed" && (d = new n()), d), C = t.events || {};
|
|
502
|
+
t.oscillator.onended && !C.onended && (C.onended = t.oscillator.onended);
|
|
503
|
+
let w = new Promise((e, t) => {
|
|
504
|
+
s.start(0), o.startRendering(), o.oncomplete = (n) => {
|
|
505
|
+
try {
|
|
506
|
+
m !== "disposed" && (p = n.renderedBuffer, C.onready?.()), e();
|
|
507
|
+
} catch (e) {
|
|
508
|
+
t(e);
|
|
509
|
+
}
|
|
510
|
+
}, o.addEventListener("error", (e) => {
|
|
511
|
+
t(e);
|
|
512
|
+
});
|
|
513
|
+
}), T = () => {
|
|
514
|
+
_ !== null && (clearTimeout(_), _ = null);
|
|
515
|
+
}, E = () => {
|
|
516
|
+
if (f) {
|
|
517
|
+
try {
|
|
518
|
+
f.stop(0);
|
|
519
|
+
} catch {}
|
|
520
|
+
f = null;
|
|
521
|
+
}
|
|
522
|
+
}, D = () => {
|
|
523
|
+
let e = S(), t = e.createBufferSource();
|
|
524
|
+
return t.buffer = p, t.connect(e.destination), t;
|
|
525
|
+
}, O = async () => {
|
|
526
|
+
if (m === "playing" || m === "disposed") return;
|
|
527
|
+
let e = ++x;
|
|
528
|
+
v = !0;
|
|
529
|
+
let t = () => x !== e || F() === "disposed";
|
|
530
|
+
try {
|
|
531
|
+
if (await w, t()) return;
|
|
532
|
+
let e = S();
|
|
533
|
+
if (e.state === "suspended" && await e.resume(), t()) return;
|
|
534
|
+
f ||= D(), f.start(e.currentTime, h), g = e.currentTime - h, m = "playing", C.onstarted?.(), T();
|
|
535
|
+
let n = (a - h) * 1e3;
|
|
536
|
+
_ = window.setTimeout(() => {
|
|
537
|
+
m === "playing" && (T(), E(), m = "stopped", h = 0, g = 0, C.onended?.());
|
|
538
|
+
}, n);
|
|
539
|
+
} finally {
|
|
540
|
+
x === e && (v = !1);
|
|
541
|
+
}
|
|
542
|
+
}, k = () => {
|
|
543
|
+
if (m !== "disposed") {
|
|
544
|
+
if (m === "playing") {
|
|
545
|
+
T(), h = Math.min(S().currentTime - g, a), E(), m = "paused", C.onpaused?.();
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
v && (x++, v = !1, T(), E(), m = "paused", C.onpaused?.());
|
|
549
|
+
}
|
|
550
|
+
}, A = (e = !1) => {
|
|
551
|
+
if (m === "disposed") return;
|
|
552
|
+
x++, T(), E();
|
|
553
|
+
let t = m === "playing" || v;
|
|
554
|
+
v = !1, m = "stopped", h = 0, g = 0, t && C.onstopped?.(), e && (p = null);
|
|
555
|
+
}, j = async (e) => {
|
|
556
|
+
if (m === "disposed") return;
|
|
557
|
+
let t = m === "playing" || v, n = Math.max(0, Math.min(Number.isNaN(e) ? 0 : e, a));
|
|
558
|
+
x++, T(), E(), h = n, C.onseeked?.(n), t && (m = "paused", await O());
|
|
559
|
+
}, M = () => {
|
|
560
|
+
A(!0), m = "disposed", d && d.state !== "closed" && d.close();
|
|
561
|
+
}, N = () => m === "playing" ? Math.min(S().currentTime - g, a) : h, P = () => a, F = () => m, I = async () => {
|
|
562
|
+
if (await w, !p) throw Error("Audio buffer not available");
|
|
563
|
+
let e = b(o.sampleRate, p.getChannelData(0)), t = new Uint8Array(e.byteLength);
|
|
564
|
+
for (let n = 0; n < e.byteLength; n++) t[n] = e.getUint8(n);
|
|
565
|
+
return new Blob([t], { type: "audio/wav" });
|
|
566
|
+
}, L = async () => {
|
|
567
|
+
let e = await I();
|
|
568
|
+
return URL.createObjectURL(e);
|
|
569
|
+
}, R = {
|
|
570
|
+
play: O,
|
|
571
|
+
pause: k,
|
|
572
|
+
stop: A,
|
|
573
|
+
seek: j,
|
|
574
|
+
dispose: M,
|
|
575
|
+
getCurrentTime: N,
|
|
576
|
+
getTotalTime: P,
|
|
577
|
+
getState: F,
|
|
578
|
+
getWaveBlob: I,
|
|
579
|
+
getWaveUrl: L,
|
|
580
|
+
exportWave: async (e = "morse.wav") => {
|
|
581
|
+
let t = await L(), n = document.createElement("a");
|
|
582
|
+
n.href = t, n.target = "_blank", n.download = e, n.click(), setTimeout(() => URL.revokeObjectURL(t), 1e3);
|
|
583
|
+
},
|
|
584
|
+
oscillator: s,
|
|
585
|
+
gainNode: c
|
|
586
|
+
};
|
|
587
|
+
return Object.defineProperty(R, "context", {
|
|
588
|
+
get: S,
|
|
589
|
+
enumerable: !1,
|
|
590
|
+
configurable: !0
|
|
591
|
+
}), R;
|
|
592
|
+
}, S = /[゠-ヿ]/, C = /[ヽヾ]/, w = (e) => [...e.normalize("NFC")].map((e) => S.test(e) && !C.test(e) ? e.normalize("NFD").replace(/゙/g, "゛").replace(/゚/g, "゜") : e).join(""), T = (e, n) => {
|
|
593
|
+
let r = c(n), i = t(r), a = [...w(e.trim().replace(/\s+/g, r.separator).toUpperCase())].map((e) => {
|
|
594
|
+
for (let t in i) {
|
|
595
|
+
let n = i[t];
|
|
596
|
+
if (n && n[e]) return n[e];
|
|
597
|
+
}
|
|
598
|
+
return r.invalid;
|
|
599
|
+
}).map((e) => e.replace(/[01]/g, (e) => e === "0" ? r.dot : r.dash)).filter((e) => e !== "");
|
|
600
|
+
return r.invalid === "" && (a = a.filter((e, t) => e !== r.space || a[t - 1] !== void 0 && a[t - 1] !== r.space && a[t + 1] !== void 0 && a[t + 1] !== r.space)), a.join(r.separator);
|
|
601
|
+
}, E = (e, t) => {
|
|
602
|
+
let n = c(t), i = r(n), a = e.trim().replace(/\s+/g, n.separator);
|
|
603
|
+
return a === "" ? "" : a.split(n.separator).map((e) => Object.prototype.hasOwnProperty.call(i, e) ? i[e] : n.invalid).join("");
|
|
604
|
+
}, D = (e, t = !1) => n(c(e), t), O = (e, t, n) => {
|
|
605
|
+
let r = c(t);
|
|
606
|
+
return x(n || T(e, t), r);
|
|
607
|
+
}, k = {
|
|
608
|
+
encode: T,
|
|
609
|
+
decode: E,
|
|
610
|
+
characters: D,
|
|
611
|
+
audio: O
|
|
601
612
|
};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
n0 as default,
|
|
607
|
-
B as encode
|
|
608
|
-
};
|
|
609
|
-
//# sourceMappingURL=morse-code-translator.es.js.map
|
|
613
|
+
//#endregion
|
|
614
|
+
export { O as audio, D as characters, E as decode, k as default, T as encode };
|
|
615
|
+
|
|
616
|
+
//# sourceMappingURL=morse-code-translator.es.js.map
|