mol_charset_ucf 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/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "mol_charset_ucf",
3
+ "version": "0.0.1",
4
+ "exports": {
5
+ "node": {
6
+ "import": "./node.mjs",
7
+ "default": "./node.js"
8
+ },
9
+ "types": "./web.d.ts",
10
+ "import": "./web.mjs",
11
+ "default": "./web.js"
12
+ },
13
+ "main": "./web.js",
14
+ "module": "./web.mjs",
15
+ "browser": "./web.js",
16
+ "types": "./web.d.ts",
17
+ "keywords": [
18
+ "$mol_charset_ucf",
19
+ "$mol_charset",
20
+ "$mol",
21
+ "$mol_charset_buffer"
22
+ ],
23
+ "dependencies": {}
24
+ }
package/test.html ADDED
@@ -0,0 +1,11 @@
1
+ <!doctype html><meta charset="utf-8" /><html mol_view_root><body mol_view_root="$mol_charset_ucf"><script src="web.js" charset="utf-8"></script>
2
+ <script src="/mol/build/client/client.js" charset="utf-8"></script>
3
+ <script src="web.test.js" charset="utf-8"></script>
4
+ <script>
5
+ addEventListener( 'load', ()=> setTimeout( ()=> {
6
+ const audit = document.createElement( 'script' )
7
+ audit.src = 'web.audit.js'
8
+ document.head.appendChild( audit )
9
+ }, 500 ) )
10
+ </script>
11
+
package/web.audit.js ADDED
@@ -0,0 +1,2 @@
1
+ console.info( `%cplace: $mol_build
2
+ message: Audit passed`, 'color:forestgreen; font-weight:bolder' )
package/web.css ADDED
@@ -0,0 +1 @@
1
+ /* CSS compiles into js bundle now! */
package/web.css.map ADDED
@@ -0,0 +1 @@
1
+ "/* CSS compiles into js bundle now! */"
package/web.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ declare let _$_: {
2
+ new (): {};
3
+ } & typeof globalThis;
4
+ declare class $ extends _$_ {
5
+ }
6
+ declare namespace $ {
7
+ export type $ = typeof $$;
8
+ export class $$ extends $ {
9
+ static $: $;
10
+ }
11
+ namespace $$ {
12
+ type $$ = $;
13
+ }
14
+ export {};
15
+ }
16
+
17
+ declare namespace $ {
18
+ function $mol_charset_buffer(size: number): Uint8Array<ArrayBuffer>;
19
+ }
20
+
21
+ declare namespace $ {
22
+ function $mol_charset_ucf_encode(str: string): Uint8Array<ArrayBuffer>;
23
+ function $mol_charset_ucf_encode_to(str: string, buf: Uint8Array<ArrayBuffer>, from?: number): number;
24
+ function $mol_charset_ucf_decode(buffer: Uint8Array<ArrayBuffer>, mode?: number): string;
25
+ }
26
+
27
+ export = $;
28
+ //# sourceMappingURL=web.d.ts.map
package/web.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../mam.d.ts","../../buffer/buffer.d.ts","../ucf.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;AACA","sourcesContent":[null,null,null]}
package/web.deps.json ADDED
@@ -0,0 +1 @@
1
+ {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/charset/buffer/buffer.ts","mol/charset/ucf/ucf.ts","mol/charset/ucf/readme.md"],"mods":{},"deps_in":{"mol/charset":{"mol/charset/ucf":-999,"mol/charset/buffer":-999},"mol":{"mol/charset":-999},"":{"mol":-999},"mol/charset/buffer":{"mol/charset/ucf":-2}},"deps_out":{"mol/charset/ucf":{"mol/charset":-999,"mol/charset/buffer":-2},"mol/charset":{"mol":-999},"mol":{"":-999},"mol/charset/buffer":{"mol/charset":-999}},"sloc":{"ts":129,"LICENSE":113,"md":489,"js":9,"json":82,"tree":41,"CNAME":1},"deps":{"mol/charset/ucf":{"..":-999,"/mol/charset/ucf/encode":-1,"/mol/charset/buffer":-2,"/mol/charset/ucf/encode/to":-1,"/mol/charset/ucf/decode":-1},"mol/charset":{"..":-999},"mol":{"..":-999},"":{},"mol/charset/buffer":{"..":-999,"/mol/charset/buffer":-1}}}
package/web.js ADDED
@@ -0,0 +1,180 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ function require( path ){ return $node[ path ] };
4
+
5
+ var $node = $node || {}
6
+ void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
7
+ ;
8
+ "use strict";
9
+ Error.stackTraceLimit = 50;
10
+ var $;
11
+ (function ($) {
12
+ })($ || ($ = {}));
13
+ module.exports = $;
14
+
15
+ ;
16
+
17
+ $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
18
+ ;
19
+ "use strict"
20
+
21
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
22
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24
+ else for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
26
+ };
27
+
28
+ var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
29
+ $.$$ = $
30
+
31
+ ;
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ let buf = new Uint8Array(2 ** 12);
36
+ function $mol_charset_buffer(size) {
37
+ if (buf.byteLength < size)
38
+ buf = new Uint8Array(size);
39
+ return buf;
40
+ }
41
+ $.$mol_charset_buffer = $mol_charset_buffer;
42
+ })($ || ($ = {}));
43
+
44
+ ;
45
+ "use strict";
46
+ var $;
47
+ (function ($) {
48
+ const ascii_set = [...`0123456789.,:;()'"- \n`].map(c => c.charCodeAt(0));
49
+ const ascii_map = new Array(0x80).fill(0);
50
+ for (let i = 0; i < ascii_set.length; ++i)
51
+ ascii_map[ascii_set[i]] = i | 0x80;
52
+ const diacr_set = [
53
+ 0x00, 0x01, 0x0F, 0x0B, 0x07, 0x08, 0x12, 0x13,
54
+ 0x02, 0x0C, 0x06, 0x11, 0x03, 0x09, 0x0A, 0x04,
55
+ 0x28, 0x31, 0x27, 0x26, 0x23,
56
+ ];
57
+ const diacr_map = new Array(0x80).fill(0);
58
+ for (let i = 0; i < diacr_set.length; ++i)
59
+ diacr_map[diacr_set[i]] = i | 0x80;
60
+ const wide_offset = 0x0E_00;
61
+ const wide_limit = 128 * 128 * 8 + wide_offset;
62
+ const tine_limit = 128 * 98;
63
+ const full_mode = 0x95;
64
+ const wide_mode = 0x96;
65
+ const tiny_mode = 0x9E;
66
+ function $mol_charset_ucf_encode(str) {
67
+ const buf = $mol_charset_buffer(str.length * 3);
68
+ return buf.slice(0, $mol_charset_ucf_encode_to(str, buf));
69
+ }
70
+ $.$mol_charset_ucf_encode = $mol_charset_ucf_encode;
71
+ function $mol_charset_ucf_encode_to(str, buf, from = 0) {
72
+ let pos = from;
73
+ let mode = tiny_mode;
74
+ let high_last = mode;
75
+ const write_high = (code) => {
76
+ buf[pos++] = ((code + 128 - high_last) & 0x7F) | 0x80;
77
+ high_last = code;
78
+ };
79
+ const write_remap = (code) => {
80
+ const fast = ascii_map[code];
81
+ if (fast)
82
+ write_high(fast);
83
+ else
84
+ buf[pos++] = code;
85
+ };
86
+ for (let i = 0; i < str.length; i++) {
87
+ let code = str.charCodeAt(i);
88
+ if (code >= 0xd800 && code < 0xe000)
89
+ code = ((code - 0xd800) << 10) + str.charCodeAt(++i) + 0x2400;
90
+ if (code < 0x80) {
91
+ if (mode !== tiny_mode) {
92
+ const fast = ascii_map[code];
93
+ if (!fast)
94
+ write_high(mode = tiny_mode);
95
+ }
96
+ buf[pos++] = code;
97
+ }
98
+ else if (code < tine_limit) {
99
+ const page = (code >> 7) + tiny_mode;
100
+ code &= 0x7F;
101
+ if (page === 164) {
102
+ const fast = diacr_map[code];
103
+ if (fast) {
104
+ if (mode !== tiny_mode)
105
+ write_high(mode = tiny_mode);
106
+ write_high(fast);
107
+ continue;
108
+ }
109
+ }
110
+ if (mode !== page)
111
+ write_high(mode = page);
112
+ write_remap(code);
113
+ }
114
+ else if (code < wide_limit) {
115
+ code -= wide_offset;
116
+ const page = (code >> 14) + wide_mode;
117
+ if (mode !== page)
118
+ write_high(mode = page);
119
+ write_remap(code & 0x7F);
120
+ buf[pos++] = (code >> 7) & 0x7F;
121
+ }
122
+ else {
123
+ if (mode !== full_mode)
124
+ write_high(mode = full_mode);
125
+ write_remap(code & 0x7F);
126
+ buf[pos++] = (code >> 7) & 0x7F;
127
+ buf[pos++] = code >> 14;
128
+ }
129
+ }
130
+ if (mode !== tiny_mode)
131
+ write_high(tiny_mode);
132
+ return pos - from;
133
+ }
134
+ $.$mol_charset_ucf_encode_to = $mol_charset_ucf_encode_to;
135
+ function $mol_charset_ucf_decode(buffer, mode = tiny_mode) {
136
+ let text = '';
137
+ let pos = 0;
138
+ let page_offset = 0;
139
+ let ext_last = mode;
140
+ while (pos < buffer.length) {
141
+ let code = buffer[pos++];
142
+ if (code > 0x80)
143
+ code = ext_last = ((ext_last + code) & 0x7F) | 0x80;
144
+ if (code < full_mode) {
145
+ if (mode === tiny_mode) {
146
+ if (code > 0x80) {
147
+ code = diacr_set[code - 0x080] | (6 << 7);
148
+ }
149
+ }
150
+ else if (!ascii_map[code]) {
151
+ if (code >= 0x80)
152
+ code = ascii_set[code - 0x80];
153
+ if (mode < tiny_mode)
154
+ code |= buffer[pos++] << 7;
155
+ if (mode === full_mode)
156
+ code |= buffer[pos++] << 14;
157
+ code += page_offset;
158
+ }
159
+ text += String.fromCodePoint(code);
160
+ }
161
+ else if (code >= tiny_mode) {
162
+ mode = code;
163
+ page_offset = (mode - tiny_mode) << 7;
164
+ }
165
+ else if (code === full_mode) {
166
+ mode = code;
167
+ page_offset = 0;
168
+ }
169
+ else {
170
+ mode = code;
171
+ page_offset = ((mode - wide_mode) << 14) + wide_offset;
172
+ }
173
+ }
174
+ return text;
175
+ }
176
+ $.$mol_charset_ucf_decode = $mol_charset_ucf_decode;
177
+ })($ || ($ = {}));
178
+
179
+
180
+ //# sourceMappingURL=web.js.map
package/web.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["-","../../../../mam.ts","../../../../mol/charset/buffer/buffer.ts","../../../../mol/charset/ucf/ucf.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAQV;AARD,WAAU,CAAC;AAQX,CAAC,EARS,CAAC,KAAD,CAAC,QAQV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADflB;AACA;AACA;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAUV;AAVD,WAAU,CAAC;IAEV,IAAI,GAAG,GAAG,IAAI,UAAU,CAAE,CAAC,IAAE,EAAE,CAAE,CAAA;IAGjC,SAAgB,mBAAmB,CAAE,IAAY;QAChD,IAAI,GAAG,CAAC,UAAU,GAAG,IAAI;YAAG,GAAG,GAAG,IAAI,UAAU,CAAE,IAAI,CAAE,CAAA;QACxD,OAAO,GAAG,CAAA;IACX,CAAC;IAHe,qBAAmB,sBAGlC,CAAA;AAEF,CAAC,EAVS,CAAC,KAAD,CAAC,QAUV;;;;ACVD,IAAU,CAAC,CAsJV;AAtJD,WAAU,CAAC;IAEV,MAAM,SAAS,GAAI,CAAE,GAAI,wBAAwB,CAAG,CAAC,GAAG,CAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,CAAA;IAChF,MAAM,SAAS,GAAG,IAAI,KAAK,CAAY,IAAI,CAAE,CAAC,IAAI,CAAE,CAAC,CAAE,CAAA;IACvD,KAAK,IAAI,CAAC,GAA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;wBAAG,IAAI,IAAI,MAAM,CAAE,GAAG,EAAG,CAAE,IAAI,EAAE,CAAA;oBACvD,IAAI,IAAI,WAAW,CAAA;gBACpB,CAAC;gBAED,IAAI,IAAI,MAAM,CAAC,aAAa,CAAE,IAAI,CAAE,CAAA;YAErC,CAAC;iBAAM,IAAI,IAAI,IAAI,SAAS,EAAG,CAAC;gBAE/B,IAAI,GAAG,IAAI,CAAA;gBACX,WAAW,GAAG,CAAE,IAAI,GAAG,SAAS,CAAE,IAAI,CAAC,CAAA;YAExC,CAAC;iBAAM,IAAI,IAAI,KAAK,SAAS,EAAG,CAAC;gBAEhC,IAAI,GAAG,IAAI,CAAA;gBACX,WAAW,GAAG,CAAC,CAAA;YAEhB,CAAC;iBAAM,CAAC;gBAEP,IAAI,GAAG,IAAI,CAAA;gBACX,WAAW,GAAG,CAAE,CAAE,IAAI,GAAG,SAAS,CAAE,IAAI,EAAE,CAAE,GAAG,WAAW,CAAA;YAE3D,CAAC;QAEF,CAAC;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;IAhDe,yBAAuB,0BAgDtC,CAAA;AAEF,CAAC,EAtJS,CAAC,KAAD,CAAC,QAsJV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {\n\t\tstatic $: $\n\t}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\tlet buf = new Uint8Array( 2**12 ) // 4KB Mem Page\n\t\n\t/** Temporary buffer. Recursive usage isn't supported. */\n\texport function $mol_charset_buffer( size: number ) {\n\t\tif( buf.byteLength < size ) buf = new Uint8Array( size )\n\t\treturn buf\n\t}\n\t\n}\n","namespace $ {\n\t\n\tconst ascii_set = [ ... `0123456789.,:;()'\"- \\n` ].map( c => c.charCodeAt(0) )\n\tconst ascii_map = new Array< number >( 0x80 ).fill( 0 )\n\tfor( let i = 0; i < ascii_set.length; ++i ) ascii_map[ ascii_set[ i ] ] = i | 0x80\n\t\n\tconst diacr_set = [\n\t\t0x00, 0x01, 0x0F, 0x0B, 0x07, 0x08, 0x12, 0x13, // up\n\t\t0x02, 0x0C, 0x06, 0x11, 0x03, 0x09, 0x0A, 0x04, // up\n\t\t0x28, 0x31, 0x27, 0x26, 0x23, // down\n\t]\n\tconst diacr_map = new Array< number >( 0x80 ).fill( 0 )\n\tfor( let i = 0; i < diacr_set.length; ++i ) diacr_map[ diacr_set[ i ] ] = i | 0x80\n\t\n\tconst wide_offset = 0x0E_00\n\tconst wide_limit = 128 * 128 * 8 + wide_offset\n\tconst tine_limit = 128 * 98\n\t\n\tconst full_mode = 0x95\n\tconst wide_mode = 0x96\n\tconst tiny_mode = 0x9E\n\t\n\t/** Encode text to Unicode Compact Format. */\n\texport function $mol_charset_ucf_encode( str: string ) {\n\t\tconst buf = $mol_charset_buffer( str.length * 3 )\n\t\treturn buf.slice( 0, $mol_charset_ucf_encode_to( str, buf ) )\n\t}\t\n\t\n\texport function $mol_charset_ucf_encode_to( str: string, buf: Uint8Array< ArrayBuffer >, from = 0 ) {\n\n\t\tlet pos = from\n\t\tlet mode = tiny_mode\n\t\tlet high_last = mode\n\t\t\n\t\tconst write_high = ( code: number )=> {\n\t\t\tbuf[ pos ++ ] = ( ( code + 128 - high_last ) & 0x7F ) | 0x80\n\t\t\thigh_last = code\n\t\t}\n\t\t\n\t\tconst write_remap = ( code: number )=> {\n\t\t\tconst fast = ascii_map[ code ]\n\t\t\tif( fast ) write_high( fast )\n\t\t\telse buf[ pos ++ ] = code\n\t\t}\n\t\t\n\t\tfor( let i = 0; i < str.length; i++ ) {\n\t\t\t\n\t\t\tlet code = str.charCodeAt( i )\n\t\t\tif( code >= 0xd800 && code < 0xe000 ) code = ( ( code - 0xd800 ) << 10 ) + str.charCodeAt( ++ i ) + 0x2400\n\t\t\t\n\t\t\tif( code < 0x80 ) { // ASCII\n\t\t\t\t\n\t\t\t\tif( mode !== tiny_mode ) {\n\t\t\t\t\tconst fast = ascii_map[ code ]\n\t\t\t\t\tif( !fast ) write_high( mode = tiny_mode )\n\t\t\t\t}\n\t\t\t\tbuf[ pos ++ ] = code\n\t\t\t\t\n\t\t\t} else if( code < tine_limit ) { // Tiny\n\t\t\t\t\n\t\t\t\tconst page = ( code >> 7 ) + tiny_mode\n\t\t\t\tcode &= 0x7F\n\t\t\t\t\n\t\t\t\tif( page === 164 ) { // diacritics\n\t\t\t\t\tconst fast = diacr_map[ code ]\n\t\t\t\t\tif( fast ) {\n\t\t\t\t\t\tif( mode !== tiny_mode ) write_high( mode = tiny_mode )\n\t\t\t\t\t\twrite_high( fast )\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( mode !== page ) write_high( mode = page )\n\t\t\t\twrite_remap( code )\n\t\t\t\t\n\t\t\t} else if( code < wide_limit ) { // Wide\n\t\t\t\t\n\t\t\t\tcode -= wide_offset\n\t\t\t\tconst page = ( code >> 14 ) + wide_mode\n\t\t\t\tif( mode !== page ) write_high( mode = page )\n\t\t\t\twrite_remap( code & 0x7F )\n\t\t\t\tbuf[ pos ++ ] = ( code >> 7 ) & 0x7F\n\t\t\t\t\n\t\t\t} else { // Full\n\t\t\t\t\n\t\t\t\tif( mode !== full_mode ) write_high( mode = full_mode )\n\t\t\t\t write_remap( code & 0x7F )\n\t\t\t\tbuf[ pos ++ ] = ( code >> 7 ) & 0x7F\n\t\t\t\tbuf[ pos ++ ] = code >> 14\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif( mode !== tiny_mode ) write_high( tiny_mode )\n\n\t\treturn pos - from\n\t}\n\t\n\t/** Decode text from Unicode Compact Format. */\n\texport function $mol_charset_ucf_decode( buffer: Uint8Array< ArrayBuffer >, mode = tiny_mode ) {\n\t\t\n\t\tlet text = ''\n\t\tlet pos = 0\n\t\tlet page_offset = 0\n\t\tlet ext_last = mode\n\t\t\n\t\twhile( pos < buffer.length ) {\n\t\t\t\n\t\t\tlet code = buffer[ pos ++ ]\n\t\t\t\n\t\t\tif( code > 0x80 ) code = ext_last = ( ( ext_last + code ) & 0x7F ) | 0x80\n\t\t\t\n\t\t\tif( code < full_mode ) { // Char Code\n\t\t\t\t\n\t\t\t\tif( mode === tiny_mode ) {\n\t\t\t\t\tif( code > 0x80 ) {\n\t\t\t\t\t\tcode = diacr_set[ code - 0x080 ] | ( 6 << 7 )\n\t\t\t\t\t}\n\t\t\t\t} else if( !ascii_map[ code ] ) {\n\t\t\t\t\tif( code >= 0x80 ) code = ascii_set[ code - 0x80 ]\n\t\t\t\t\tif( mode < tiny_mode ) code |= buffer[ pos ++ ] << 7\n\t\t\t\t\tif( mode === full_mode ) code |= buffer[ pos ++ ] << 14\n\t\t\t\t\tcode += page_offset\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttext += String.fromCodePoint( code )\n\t\t\t\t\n\t\t\t} else if( code >= tiny_mode ) { // Tiny Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = ( mode - tiny_mode ) << 7\n\t\t\t\t\n\t\t\t} else if( code === full_mode ) { // Full Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = 0\n\t\t\t\t\n\t\t\t} else { // Wide Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = ( ( mode - wide_mode ) << 14 ) + wide_offset\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn text\n\t}\n\n}\n"]}
package/web.meta.tree ADDED
@@ -0,0 +1,21 @@
1
+ \/
2
+ pack bun git \https://github.com/spleekz/mam_bun.git
3
+ pack giper git \https://github.com/giper-dev/gd.git
4
+ pack hyoo git \https://github.com/hyoo-ru/mam_hyoo.git
5
+ pack iva git \https://github.com/thenesterov/mam_iva.git
6
+ pack jin git \https://github.com/nin-jin/mam_jin.git
7
+ pack lib git \https://github.com/hyoo-ru/mam_lib.git
8
+ pack mol git \https://github.com/hyoo-ru/mam_mol.git
9
+ pack milis git \https://github.com/Lyumih/milis.git
10
+ pack mpds git \https://github.com/mpds-io/mam_mpds.git
11
+ pack node git \https://github.com/hyoo-ru/mam_node.git
12
+ pack optimade git \https://github.com/mpds-io/mam_optimade.git
13
+ pack piterjs git \https://github.com/piterjs/piterjs.git
14
+ pack psb git \https://github.com/MolDevHack/psb.git
15
+ pack rise git \https://github.com/stan-donarise/mam_rise.git
16
+ pack yuf git \https://github.com/zerkalica/yuf.git
17
+ pack apxu git \https://github.com/ApxuTechTop/apxu
18
+ pack bog git \https://github.com/best-online-games/bog.git
19
+ pack mws git \https://github.com/reatailret/milkywaystd_mol.git
20
+ \/mol
21
+ pack icon git \https://github.com/nin-jin/mol_icon.git
package/web.mjs ADDED
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ function require( path ){ return $node[ path ] };
4
+
5
+ var $node = $node || {}
6
+ void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
7
+ ;
8
+ "use strict";
9
+ Error.stackTraceLimit = 50;
10
+ var $;
11
+ (function ($) {
12
+ })($ || ($ = {}));
13
+ module.exports = $;
14
+
15
+ ;
16
+
17
+ $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
18
+ ;
19
+ "use strict"
20
+
21
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
22
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24
+ else for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
26
+ };
27
+
28
+ var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
29
+ $.$$ = $
30
+
31
+ ;
32
+ "use strict";
33
+ var $;
34
+ (function ($) {
35
+ let buf = new Uint8Array(2 ** 12);
36
+ function $mol_charset_buffer(size) {
37
+ if (buf.byteLength < size)
38
+ buf = new Uint8Array(size);
39
+ return buf;
40
+ }
41
+ $.$mol_charset_buffer = $mol_charset_buffer;
42
+ })($ || ($ = {}));
43
+
44
+ ;
45
+ "use strict";
46
+ var $;
47
+ (function ($) {
48
+ const ascii_set = [...`0123456789.,:;()'"- \n`].map(c => c.charCodeAt(0));
49
+ const ascii_map = new Array(0x80).fill(0);
50
+ for (let i = 0; i < ascii_set.length; ++i)
51
+ ascii_map[ascii_set[i]] = i | 0x80;
52
+ const diacr_set = [
53
+ 0x00, 0x01, 0x0F, 0x0B, 0x07, 0x08, 0x12, 0x13,
54
+ 0x02, 0x0C, 0x06, 0x11, 0x03, 0x09, 0x0A, 0x04,
55
+ 0x28, 0x31, 0x27, 0x26, 0x23,
56
+ ];
57
+ const diacr_map = new Array(0x80).fill(0);
58
+ for (let i = 0; i < diacr_set.length; ++i)
59
+ diacr_map[diacr_set[i]] = i | 0x80;
60
+ const wide_offset = 0x0E_00;
61
+ const wide_limit = 128 * 128 * 8 + wide_offset;
62
+ const tine_limit = 128 * 98;
63
+ const full_mode = 0x95;
64
+ const wide_mode = 0x96;
65
+ const tiny_mode = 0x9E;
66
+ function $mol_charset_ucf_encode(str) {
67
+ const buf = $mol_charset_buffer(str.length * 3);
68
+ return buf.slice(0, $mol_charset_ucf_encode_to(str, buf));
69
+ }
70
+ $.$mol_charset_ucf_encode = $mol_charset_ucf_encode;
71
+ function $mol_charset_ucf_encode_to(str, buf, from = 0) {
72
+ let pos = from;
73
+ let mode = tiny_mode;
74
+ let high_last = mode;
75
+ const write_high = (code) => {
76
+ buf[pos++] = ((code + 128 - high_last) & 0x7F) | 0x80;
77
+ high_last = code;
78
+ };
79
+ const write_remap = (code) => {
80
+ const fast = ascii_map[code];
81
+ if (fast)
82
+ write_high(fast);
83
+ else
84
+ buf[pos++] = code;
85
+ };
86
+ for (let i = 0; i < str.length; i++) {
87
+ let code = str.charCodeAt(i);
88
+ if (code >= 0xd800 && code < 0xe000)
89
+ code = ((code - 0xd800) << 10) + str.charCodeAt(++i) + 0x2400;
90
+ if (code < 0x80) {
91
+ if (mode !== tiny_mode) {
92
+ const fast = ascii_map[code];
93
+ if (!fast)
94
+ write_high(mode = tiny_mode);
95
+ }
96
+ buf[pos++] = code;
97
+ }
98
+ else if (code < tine_limit) {
99
+ const page = (code >> 7) + tiny_mode;
100
+ code &= 0x7F;
101
+ if (page === 164) {
102
+ const fast = diacr_map[code];
103
+ if (fast) {
104
+ if (mode !== tiny_mode)
105
+ write_high(mode = tiny_mode);
106
+ write_high(fast);
107
+ continue;
108
+ }
109
+ }
110
+ if (mode !== page)
111
+ write_high(mode = page);
112
+ write_remap(code);
113
+ }
114
+ else if (code < wide_limit) {
115
+ code -= wide_offset;
116
+ const page = (code >> 14) + wide_mode;
117
+ if (mode !== page)
118
+ write_high(mode = page);
119
+ write_remap(code & 0x7F);
120
+ buf[pos++] = (code >> 7) & 0x7F;
121
+ }
122
+ else {
123
+ if (mode !== full_mode)
124
+ write_high(mode = full_mode);
125
+ write_remap(code & 0x7F);
126
+ buf[pos++] = (code >> 7) & 0x7F;
127
+ buf[pos++] = code >> 14;
128
+ }
129
+ }
130
+ if (mode !== tiny_mode)
131
+ write_high(tiny_mode);
132
+ return pos - from;
133
+ }
134
+ $.$mol_charset_ucf_encode_to = $mol_charset_ucf_encode_to;
135
+ function $mol_charset_ucf_decode(buffer, mode = tiny_mode) {
136
+ let text = '';
137
+ let pos = 0;
138
+ let page_offset = 0;
139
+ let ext_last = mode;
140
+ while (pos < buffer.length) {
141
+ let code = buffer[pos++];
142
+ if (code > 0x80)
143
+ code = ext_last = ((ext_last + code) & 0x7F) | 0x80;
144
+ if (code < full_mode) {
145
+ if (mode === tiny_mode) {
146
+ if (code > 0x80) {
147
+ code = diacr_set[code - 0x080] | (6 << 7);
148
+ }
149
+ }
150
+ else if (!ascii_map[code]) {
151
+ if (code >= 0x80)
152
+ code = ascii_set[code - 0x80];
153
+ if (mode < tiny_mode)
154
+ code |= buffer[pos++] << 7;
155
+ if (mode === full_mode)
156
+ code |= buffer[pos++] << 14;
157
+ code += page_offset;
158
+ }
159
+ text += String.fromCodePoint(code);
160
+ }
161
+ else if (code >= tiny_mode) {
162
+ mode = code;
163
+ page_offset = (mode - tiny_mode) << 7;
164
+ }
165
+ else if (code === full_mode) {
166
+ mode = code;
167
+ page_offset = 0;
168
+ }
169
+ else {
170
+ mode = code;
171
+ page_offset = ((mode - wide_mode) << 14) + wide_offset;
172
+ }
173
+ }
174
+ return text;
175
+ }
176
+ $.$mol_charset_ucf_decode = $mol_charset_ucf_decode;
177
+ })($ || ($ = {}));
178
+
179
+
180
+ export default $
181
+ //# sourceMappingURL=web.js.map