mol_plot_all 1.2.524 → 1.2.526
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/node.d.ts +311 -311
- package/node.deps.json +1 -1
- package/node.js +1767 -1767
- package/node.js.map +1 -1
- package/node.mjs +1767 -1767
- package/node.mjs.map +1 -1
- package/node.test.js +2146 -2146
- package/node.test.js.map +1 -1
- package/package.json +26 -26
- package/web.d.ts +177 -177
- package/web.deps.json +1 -1
- package/web.js +357 -357
- package/web.js.map +1 -1
- package/web.mjs +357 -357
- package/web.mjs.map +1 -1
- package/web.test.js +392 -392
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use strict";
|
|
3
|
+
Error.stackTraceLimit = 50;
|
|
4
|
+
var $;
|
|
5
|
+
(function ($) {
|
|
6
|
+
})($ || ($ = {}));
|
|
7
|
+
module.exports = $;
|
|
8
|
+
//mam.ts
|
|
9
|
+
;
|
|
2
10
|
"use strict"
|
|
3
11
|
|
|
4
12
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -11,14 +19,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
11
19
|
var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
|
|
12
20
|
$.$$ = $
|
|
13
21
|
|
|
14
|
-
;
|
|
15
|
-
"use strict";
|
|
16
|
-
Error.stackTraceLimit = 50;
|
|
17
|
-
var $;
|
|
18
|
-
(function ($) {
|
|
19
|
-
})($ || ($ = {}));
|
|
20
|
-
module.exports = $;
|
|
21
|
-
//mam.ts
|
|
22
22
|
;
|
|
23
23
|
"use strict";
|
|
24
24
|
var $;
|
|
@@ -192,1864 +192,1685 @@ var $;
|
|
|
192
192
|
;
|
|
193
193
|
"use strict";
|
|
194
194
|
var $;
|
|
195
|
-
(function ($) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
task();
|
|
195
|
+
(function ($_1) {
|
|
196
|
+
let $$;
|
|
197
|
+
(function ($$) {
|
|
198
|
+
let $;
|
|
199
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
200
|
+
$_1.$mol_object_field = Symbol('$mol_object_field');
|
|
201
|
+
class $mol_object extends $mol_object2 {
|
|
202
|
+
static make(config) {
|
|
203
|
+
return super.create(obj => {
|
|
204
|
+
for (let key in config)
|
|
205
|
+
obj[key] = config[key];
|
|
207
206
|
});
|
|
208
207
|
}
|
|
209
|
-
destructor() {
|
|
210
|
-
this.cancelled = true;
|
|
211
|
-
}
|
|
212
208
|
}
|
|
213
|
-
|
|
209
|
+
$_1.$mol_object = $mol_object;
|
|
214
210
|
})($ || ($ = {}));
|
|
215
|
-
//mol/
|
|
211
|
+
//mol/object/object.ts
|
|
216
212
|
;
|
|
217
213
|
"use strict";
|
|
218
214
|
var $;
|
|
219
215
|
(function ($) {
|
|
216
|
+
class $mol_window extends $mol_object {
|
|
217
|
+
static size() {
|
|
218
|
+
return {
|
|
219
|
+
width: 1024,
|
|
220
|
+
height: 768,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
$.$mol_window = $mol_window;
|
|
220
225
|
})($ || ($ = {}));
|
|
221
|
-
//mol/
|
|
226
|
+
//mol/window/window.node.ts
|
|
222
227
|
;
|
|
223
228
|
"use strict";
|
|
224
|
-
|
|
229
|
+
var $;
|
|
230
|
+
(function ($) {
|
|
231
|
+
let $mol_wire_cursor;
|
|
232
|
+
(function ($mol_wire_cursor) {
|
|
233
|
+
$mol_wire_cursor[$mol_wire_cursor["stale"] = -1] = "stale";
|
|
234
|
+
$mol_wire_cursor[$mol_wire_cursor["doubt"] = -2] = "doubt";
|
|
235
|
+
$mol_wire_cursor[$mol_wire_cursor["fresh"] = -3] = "fresh";
|
|
236
|
+
$mol_wire_cursor[$mol_wire_cursor["final"] = -4] = "final";
|
|
237
|
+
})($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
|
|
238
|
+
})($ || ($ = {}));
|
|
239
|
+
//mol/wire/cursor/cursor.ts
|
|
225
240
|
;
|
|
226
241
|
"use strict";
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
const suffix = `./node_modules/${name}`;
|
|
240
|
-
const $$ = $;
|
|
241
|
-
while (!fs.existsSync(path.join(dir, suffix))) {
|
|
242
|
-
const parent = path.resolve(dir, '..');
|
|
243
|
-
if (parent === dir) {
|
|
244
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
245
|
-
try {
|
|
246
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
247
|
-
}
|
|
248
|
-
catch { }
|
|
249
|
-
break;
|
|
242
|
+
var $;
|
|
243
|
+
(function ($) {
|
|
244
|
+
class $mol_wire_pub extends Object {
|
|
245
|
+
data = [];
|
|
246
|
+
static get [Symbol.species]() {
|
|
247
|
+
return Array;
|
|
248
|
+
}
|
|
249
|
+
sub_from = 0;
|
|
250
|
+
get sub_list() {
|
|
251
|
+
const res = [];
|
|
252
|
+
for (let i = this.sub_from; i < this.data.length; i += 2) {
|
|
253
|
+
res.push(this.data[i]);
|
|
250
254
|
}
|
|
251
|
-
|
|
252
|
-
|
|
255
|
+
return res;
|
|
256
|
+
}
|
|
257
|
+
get sub_empty() {
|
|
258
|
+
return this.sub_from === this.data.length;
|
|
259
|
+
}
|
|
260
|
+
sub_on(sub, pub_pos) {
|
|
261
|
+
const pos = this.data.length;
|
|
262
|
+
this.data.push(sub, pub_pos);
|
|
263
|
+
return pos;
|
|
264
|
+
}
|
|
265
|
+
sub_off(sub_pos) {
|
|
266
|
+
if (!(sub_pos < this.data.length)) {
|
|
267
|
+
$mol_fail(new Error(`Wrong pos ${sub_pos}`));
|
|
268
|
+
}
|
|
269
|
+
const end = this.data.length - 2;
|
|
270
|
+
if (sub_pos !== end) {
|
|
271
|
+
this.peer_move(end, sub_pos);
|
|
253
272
|
}
|
|
273
|
+
this.data.pop();
|
|
274
|
+
this.data.pop();
|
|
275
|
+
if (this.data.length === this.sub_from)
|
|
276
|
+
this.reap();
|
|
254
277
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
278
|
+
reap() { }
|
|
279
|
+
promote() {
|
|
280
|
+
$mol_wire_auto()?.track_next(this);
|
|
281
|
+
}
|
|
282
|
+
fresh() { }
|
|
283
|
+
complete() { }
|
|
284
|
+
emit(quant = $mol_wire_cursor.stale) {
|
|
285
|
+
for (let i = this.sub_from; i < this.data.length; i += 2) {
|
|
286
|
+
;
|
|
287
|
+
this.data[i].absorb(quant);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
peer_move(from_pos, to_pos) {
|
|
291
|
+
const peer = this.data[from_pos];
|
|
292
|
+
const self_pos = this.data[from_pos + 1];
|
|
293
|
+
this.data[to_pos] = peer;
|
|
294
|
+
this.data[to_pos + 1] = self_pos;
|
|
295
|
+
peer.peer_repos(self_pos, to_pos);
|
|
296
|
+
}
|
|
297
|
+
peer_repos(peer_pos, self_pos) {
|
|
298
|
+
this.data[peer_pos + 1] = self_pos;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
$.$mol_wire_pub = $mol_wire_pub;
|
|
302
|
+
})($ || ($ = {}));
|
|
303
|
+
//mol/wire/pub/pub.ts
|
|
304
|
+
;
|
|
305
|
+
"use strict";
|
|
306
|
+
//mol/wire/sub/sub.ts
|
|
266
307
|
;
|
|
267
308
|
"use strict";
|
|
268
309
|
var $;
|
|
269
310
|
(function ($) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const deep = stack.length;
|
|
274
|
-
let logged = false;
|
|
275
|
-
stack.push(() => {
|
|
276
|
-
logged = true;
|
|
277
|
-
self.$mol_log3_area.call(self, event);
|
|
278
|
-
});
|
|
279
|
-
return () => {
|
|
280
|
-
if (logged)
|
|
281
|
-
self.console.groupEnd();
|
|
282
|
-
if (stack.length > deep)
|
|
283
|
-
stack.length = deep;
|
|
284
|
-
};
|
|
311
|
+
let auto = null;
|
|
312
|
+
function $mol_wire_auto(next = auto) {
|
|
313
|
+
return auto = next;
|
|
285
314
|
}
|
|
286
|
-
$.$
|
|
287
|
-
$.$
|
|
315
|
+
$.$mol_wire_auto = $mol_wire_auto;
|
|
316
|
+
$.$mol_wire_affected = [];
|
|
288
317
|
})($ || ($ = {}));
|
|
289
|
-
//mol/
|
|
318
|
+
//mol/wire/wire.ts
|
|
290
319
|
;
|
|
291
320
|
"use strict";
|
|
292
321
|
var $;
|
|
293
322
|
(function ($) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
this.sub = [...sub, ...(config.sub || [])];
|
|
310
|
-
this.data = config.data || '';
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
this.data = sub[0].data;
|
|
314
|
-
this.sub = config.sub || [];
|
|
315
|
-
}
|
|
323
|
+
$['devtoolsFormatters'] = $['devtoolsFormatters'] || [];
|
|
324
|
+
function $mol_dev_format_register(config) {
|
|
325
|
+
$['devtoolsFormatters'].push(config);
|
|
326
|
+
}
|
|
327
|
+
$.$mol_dev_format_register = $mol_dev_format_register;
|
|
328
|
+
$.$mol_dev_format_head = Symbol('$mol_dev_format_head');
|
|
329
|
+
$.$mol_dev_format_body = Symbol('$mol_dev_format_body');
|
|
330
|
+
$mol_dev_format_register({
|
|
331
|
+
header: (val, config = false) => {
|
|
332
|
+
if (config)
|
|
333
|
+
return null;
|
|
334
|
+
if (!val)
|
|
335
|
+
return null;
|
|
336
|
+
if ($.$mol_dev_format_head in val) {
|
|
337
|
+
return val[$.$mol_dev_format_head]();
|
|
316
338
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
this.sub = config.sub || [];
|
|
339
|
+
if (typeof val === 'function') {
|
|
340
|
+
return $mol_dev_format_native(val);
|
|
320
341
|
}
|
|
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
|
-
make(config) {
|
|
347
|
-
return new $mol_tree({
|
|
348
|
-
baseUri: this.baseUri,
|
|
349
|
-
row: this.row,
|
|
350
|
-
col: this.col,
|
|
351
|
-
length: this.length,
|
|
352
|
-
...config,
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
make_data(value, sub) {
|
|
356
|
-
return this.make({ value, sub });
|
|
342
|
+
return null;
|
|
343
|
+
},
|
|
344
|
+
hasBody: val => val[$.$mol_dev_format_body],
|
|
345
|
+
body: val => val[$.$mol_dev_format_body](),
|
|
346
|
+
});
|
|
347
|
+
function $mol_dev_format_native(obj) {
|
|
348
|
+
if (typeof obj === 'undefined')
|
|
349
|
+
return $.$mol_dev_format_shade('undefined');
|
|
350
|
+
if (typeof obj !== 'object' && typeof obj !== 'function')
|
|
351
|
+
return obj;
|
|
352
|
+
return [
|
|
353
|
+
'object',
|
|
354
|
+
{
|
|
355
|
+
object: obj,
|
|
356
|
+
config: true,
|
|
357
|
+
},
|
|
358
|
+
];
|
|
359
|
+
}
|
|
360
|
+
$.$mol_dev_format_native = $mol_dev_format_native;
|
|
361
|
+
function $mol_dev_format_auto(obj) {
|
|
362
|
+
if (obj == null)
|
|
363
|
+
return $.$mol_dev_format_shade(String(obj));
|
|
364
|
+
if (typeof obj === 'object' && $.$mol_dev_format_head in obj) {
|
|
365
|
+
return obj[$.$mol_dev_format_head]();
|
|
357
366
|
}
|
|
358
|
-
|
|
359
|
-
|
|
367
|
+
return [
|
|
368
|
+
'object',
|
|
369
|
+
{
|
|
370
|
+
object: obj,
|
|
371
|
+
config: false,
|
|
372
|
+
},
|
|
373
|
+
];
|
|
374
|
+
}
|
|
375
|
+
$.$mol_dev_format_auto = $mol_dev_format_auto;
|
|
376
|
+
function $mol_dev_format_element(element, style, ...content) {
|
|
377
|
+
const styles = [];
|
|
378
|
+
for (let key in style)
|
|
379
|
+
styles.push(`${key} : ${style[key]}`);
|
|
380
|
+
return [
|
|
381
|
+
element,
|
|
382
|
+
{
|
|
383
|
+
style: styles.join(' ; '),
|
|
384
|
+
},
|
|
385
|
+
...content,
|
|
386
|
+
];
|
|
387
|
+
}
|
|
388
|
+
$.$mol_dev_format_element = $mol_dev_format_element;
|
|
389
|
+
function $mol_dev_format_span(style, ...content) {
|
|
390
|
+
return $mol_dev_format_element('span', {
|
|
391
|
+
'vertical-align': '8%',
|
|
392
|
+
...style,
|
|
393
|
+
}, ...content);
|
|
394
|
+
}
|
|
395
|
+
$.$mol_dev_format_span = $mol_dev_format_span;
|
|
396
|
+
$.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
|
|
397
|
+
$.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
|
|
398
|
+
$.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
|
|
399
|
+
$.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
|
|
400
|
+
$.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
|
|
401
|
+
$.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
|
|
402
|
+
$.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
|
|
403
|
+
'color': 'magenta',
|
|
404
|
+
});
|
|
405
|
+
$.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
|
|
406
|
+
'font-weight': 'bold',
|
|
407
|
+
});
|
|
408
|
+
$.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
|
|
409
|
+
'color': 'green',
|
|
410
|
+
});
|
|
411
|
+
$.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
|
|
412
|
+
'color': 'gray',
|
|
413
|
+
});
|
|
414
|
+
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
415
|
+
'margin-left': '13px'
|
|
416
|
+
});
|
|
417
|
+
})($ || ($ = {}));
|
|
418
|
+
//mol/dev/format/format.ts
|
|
419
|
+
;
|
|
420
|
+
"use strict";
|
|
421
|
+
var $;
|
|
422
|
+
(function ($) {
|
|
423
|
+
class $mol_wire_pub_sub extends $mol_wire_pub {
|
|
424
|
+
pub_from = 0;
|
|
425
|
+
cursor = $mol_wire_cursor.stale;
|
|
426
|
+
get pub_list() {
|
|
427
|
+
const res = [];
|
|
428
|
+
const max = this.cursor >= 0 ? this.cursor : this.sub_from;
|
|
429
|
+
for (let i = this.pub_from; i < max; i += 2) {
|
|
430
|
+
if (this.data[i])
|
|
431
|
+
res.push(this.data[i]);
|
|
432
|
+
}
|
|
433
|
+
return res;
|
|
360
434
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
var lines = str.replace(new RegExp('^\\t{0,' + prefix.length + '}', 'mg'), '').split('\n');
|
|
367
|
-
lines.forEach(line => {
|
|
368
|
-
++row;
|
|
369
|
-
var chunks = /^(\t*)((?:[^\n\t\\ ]+ *)*)(\\[^\n]*)?(.*?)(?:$|\n)/m.exec(line);
|
|
370
|
-
if (!chunks || chunks[4])
|
|
371
|
-
return this.$.$mol_fail(new Error(`Syntax error at ${baseUri}:${row}\n${line}`));
|
|
372
|
-
var indent = chunks[1];
|
|
373
|
-
var path = chunks[2];
|
|
374
|
-
var data = chunks[3];
|
|
375
|
-
var deep = indent.length;
|
|
376
|
-
var types = path ? path.replace(/ $/, '').split(/ +/) : [];
|
|
377
|
-
if (stack.length <= deep)
|
|
378
|
-
return this.$.$mol_fail(new Error(`Too many tabs at ${baseUri}:${row}\n${line}`));
|
|
379
|
-
stack.length = deep + 1;
|
|
380
|
-
var parent = stack[deep];
|
|
381
|
-
let col = deep;
|
|
382
|
-
types.forEach(type => {
|
|
383
|
-
if (!type)
|
|
384
|
-
return this.$.$mol_fail(new Error(`Unexpected space symbol ${baseUri}:${row}\n${line}`));
|
|
385
|
-
var next = new $mol_tree({ type, baseUri, row, col, length: type.length });
|
|
386
|
-
const parent_sub = parent.sub;
|
|
387
|
-
parent_sub.push(next);
|
|
388
|
-
parent = next;
|
|
389
|
-
col += type.length + 1;
|
|
390
|
-
});
|
|
391
|
-
if (data) {
|
|
392
|
-
var next = new $mol_tree({ data: data.substring(1), baseUri, row, col, length: data.length });
|
|
393
|
-
const parent_sub = parent.sub;
|
|
394
|
-
parent_sub.push(next);
|
|
395
|
-
parent = next;
|
|
396
|
-
}
|
|
397
|
-
stack.push(parent);
|
|
398
|
-
});
|
|
399
|
-
return root;
|
|
435
|
+
track_on() {
|
|
436
|
+
this.cursor = this.pub_from;
|
|
437
|
+
const sub = $mol_wire_auto();
|
|
438
|
+
$mol_wire_auto(this);
|
|
439
|
+
return sub;
|
|
400
440
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
case typeof json === 'number':
|
|
405
|
-
case json === null:
|
|
406
|
-
return new $mol_tree({
|
|
407
|
-
type: String(json),
|
|
408
|
-
baseUri: baseUri
|
|
409
|
-
});
|
|
410
|
-
case typeof json === 'string':
|
|
411
|
-
return new $mol_tree({
|
|
412
|
-
value: json,
|
|
413
|
-
baseUri: baseUri
|
|
414
|
-
});
|
|
415
|
-
case Array.isArray(json):
|
|
416
|
-
return new $mol_tree({
|
|
417
|
-
type: "/",
|
|
418
|
-
sub: json.map(json => $mol_tree.fromJSON(json, baseUri))
|
|
419
|
-
});
|
|
420
|
-
case json instanceof Date:
|
|
421
|
-
return new $mol_tree({
|
|
422
|
-
value: json.toISOString(),
|
|
423
|
-
baseUri: baseUri
|
|
424
|
-
});
|
|
425
|
-
default:
|
|
426
|
-
if (typeof json[$.$mol_tree_convert] === 'function') {
|
|
427
|
-
return json[$.$mol_tree_convert]();
|
|
428
|
-
}
|
|
429
|
-
if (typeof json.toJSON === 'function') {
|
|
430
|
-
return $mol_tree.fromJSON(json.toJSON());
|
|
431
|
-
}
|
|
432
|
-
if (json instanceof Error) {
|
|
433
|
-
const { name, message, stack } = json;
|
|
434
|
-
json = { ...json, name, message, stack };
|
|
435
|
-
}
|
|
436
|
-
var sub = [];
|
|
437
|
-
for (var key in json) {
|
|
438
|
-
if (json[key] === undefined)
|
|
439
|
-
continue;
|
|
440
|
-
const subsub = $mol_tree.fromJSON(json[key], baseUri);
|
|
441
|
-
if (/^[^\n\t\\ ]+$/.test(key)) {
|
|
442
|
-
var child = new $mol_tree({
|
|
443
|
-
type: key,
|
|
444
|
-
baseUri: baseUri,
|
|
445
|
-
sub: [subsub],
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
else {
|
|
449
|
-
var child = new $mol_tree({
|
|
450
|
-
value: key,
|
|
451
|
-
baseUri: baseUri,
|
|
452
|
-
sub: [subsub],
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
sub.push(child);
|
|
456
|
-
}
|
|
457
|
-
return new $mol_tree({
|
|
458
|
-
type: "*",
|
|
459
|
-
sub: sub,
|
|
460
|
-
baseUri: baseUri
|
|
461
|
-
});
|
|
441
|
+
promote() {
|
|
442
|
+
if (this.cursor >= this.pub_from) {
|
|
443
|
+
$mol_fail(new Error('Circular subscription'));
|
|
462
444
|
}
|
|
445
|
+
super.promote();
|
|
463
446
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
447
|
+
track_next(pub) {
|
|
448
|
+
if (this.cursor < 0)
|
|
449
|
+
$mol_fail(new Error('Promo to non begun sub'));
|
|
450
|
+
if (this.cursor < this.sub_from) {
|
|
451
|
+
const next = this.data[this.cursor];
|
|
452
|
+
if (pub === undefined)
|
|
453
|
+
return next ?? null;
|
|
454
|
+
if (next === pub) {
|
|
455
|
+
this.cursor += 2;
|
|
456
|
+
return next;
|
|
472
457
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
458
|
+
if (next) {
|
|
459
|
+
if (this.sub_from < this.data.length) {
|
|
460
|
+
this.peer_move(this.sub_from, this.data.length);
|
|
461
|
+
}
|
|
462
|
+
this.peer_move(this.cursor, this.sub_from);
|
|
463
|
+
this.sub_from += 2;
|
|
476
464
|
}
|
|
477
|
-
output += "\n";
|
|
478
|
-
}
|
|
479
|
-
else if (this.data.length || prefix.length) {
|
|
480
|
-
output += "\\" + this.data + "\n";
|
|
481
|
-
}
|
|
482
|
-
for (var child of this.sub) {
|
|
483
|
-
output += prefix;
|
|
484
|
-
output += child.toString(prefix + "\t");
|
|
485
465
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
if (this.type === 'true')
|
|
492
|
-
return true;
|
|
493
|
-
if (this.type === 'false')
|
|
494
|
-
return false;
|
|
495
|
-
if (this.type === 'null')
|
|
496
|
-
return null;
|
|
497
|
-
if (this.type === '*') {
|
|
498
|
-
var obj = {};
|
|
499
|
-
for (var child of this.sub) {
|
|
500
|
-
if (child.type === '-')
|
|
501
|
-
continue;
|
|
502
|
-
var key = child.type || child.clone({ sub: child.sub.slice(0, child.sub.length - 1) }).value;
|
|
503
|
-
var val = child.sub[child.sub.length - 1].toJSON();
|
|
504
|
-
if (val !== undefined)
|
|
505
|
-
obj[key] = val;
|
|
466
|
+
else {
|
|
467
|
+
if (pub === undefined)
|
|
468
|
+
return null;
|
|
469
|
+
if (this.sub_from < this.data.length) {
|
|
470
|
+
this.peer_move(this.sub_from, this.data.length);
|
|
506
471
|
}
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
if (this.type === '/') {
|
|
510
|
-
var res = [];
|
|
511
|
-
this.sub.forEach(child => {
|
|
512
|
-
if (child.type === '-')
|
|
513
|
-
return;
|
|
514
|
-
var val = child.toJSON();
|
|
515
|
-
if (val !== undefined)
|
|
516
|
-
res.push(val);
|
|
517
|
-
});
|
|
518
|
-
return res;
|
|
519
|
-
}
|
|
520
|
-
if (this.type === 'time') {
|
|
521
|
-
return new Date(this.value);
|
|
522
|
-
}
|
|
523
|
-
const numb = Number(this.type);
|
|
524
|
-
if (!Number.isNaN(numb) || this.type === 'NaN')
|
|
525
|
-
return numb;
|
|
526
|
-
throw new Error(`Unknown type (${this.type}) at ${this.uri}`);
|
|
527
|
-
}
|
|
528
|
-
get value() {
|
|
529
|
-
var values = [];
|
|
530
|
-
for (var child of this.sub) {
|
|
531
|
-
if (child.type)
|
|
532
|
-
continue;
|
|
533
|
-
values.push(child.value);
|
|
472
|
+
this.sub_from += 2;
|
|
534
473
|
}
|
|
535
|
-
|
|
474
|
+
this.data[this.cursor] = pub;
|
|
475
|
+
this.data[this.cursor + 1] = pub.sub_on(this, this.cursor);
|
|
476
|
+
this.cursor += 2;
|
|
477
|
+
return pub;
|
|
536
478
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
if (typeof type === 'string') {
|
|
542
|
-
let replaced = false;
|
|
543
|
-
const sub = this.sub.map((item, index) => {
|
|
544
|
-
if (item.type !== type)
|
|
545
|
-
return item;
|
|
546
|
-
replaced = true;
|
|
547
|
-
return item.insert(value, ...path.slice(1));
|
|
548
|
-
});
|
|
549
|
-
if (!replaced)
|
|
550
|
-
sub.push(new $mol_tree({ type }).insert(value, ...path.slice(1)));
|
|
551
|
-
return this.clone({ sub });
|
|
552
|
-
}
|
|
553
|
-
else if (typeof type === 'number') {
|
|
554
|
-
const sub = this.sub.slice();
|
|
555
|
-
sub[type] = (sub[type] || new $mol_tree).insert(value, ...path.slice(1));
|
|
556
|
-
return this.clone({ sub });
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
return this.clone({ sub: ((this.sub.length === 0) ? [new $mol_tree()] : this.sub).map(item => item.insert(value, ...path.slice(1))) });
|
|
479
|
+
track_off(sub) {
|
|
480
|
+
$mol_wire_auto(sub);
|
|
481
|
+
if (this.cursor < 0) {
|
|
482
|
+
$mol_fail(new Error('End of non begun sub'));
|
|
560
483
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
for (var type of path) {
|
|
565
|
-
if (!next.length)
|
|
566
|
-
break;
|
|
567
|
-
var prev = next;
|
|
568
|
-
next = [];
|
|
569
|
-
for (var item of prev) {
|
|
570
|
-
switch (typeof (type)) {
|
|
571
|
-
case 'string':
|
|
572
|
-
for (var child of item.sub) {
|
|
573
|
-
if (!type || (child.type == type)) {
|
|
574
|
-
next.push(child);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
break;
|
|
578
|
-
case 'number':
|
|
579
|
-
if (type < item.sub.length)
|
|
580
|
-
next.push(item.sub[type]);
|
|
581
|
-
break;
|
|
582
|
-
default: next.push(...item.sub);
|
|
583
|
-
}
|
|
584
|
-
}
|
|
484
|
+
for (let cursor = this.pub_from; cursor < this.cursor; cursor += 2) {
|
|
485
|
+
const pub = this.data[cursor];
|
|
486
|
+
pub.fresh();
|
|
585
487
|
}
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
filter(path, value) {
|
|
589
|
-
var sub = this.sub.filter(function (item) {
|
|
590
|
-
var found = item.select(...path);
|
|
591
|
-
if (value == null) {
|
|
592
|
-
return Boolean(found.sub.length);
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
return found.sub.some(child => child.value == value);
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
return new $mol_tree({ sub: sub });
|
|
599
|
-
}
|
|
600
|
-
transform(visit, stack = []) {
|
|
601
|
-
const sub_stack = [this, ...stack];
|
|
602
|
-
return visit(sub_stack, () => this.sub.map(node => node.transform(visit, sub_stack)).filter(n => n));
|
|
488
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
603
489
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
if (!handle)
|
|
608
|
-
$mol_fail(child.error('Handler not defined'));
|
|
609
|
-
return handle(child, context);
|
|
610
|
-
}));
|
|
611
|
-
return this.clone({ sub });
|
|
490
|
+
pub_off(sub_pos) {
|
|
491
|
+
this.data[sub_pos] = undefined;
|
|
492
|
+
this.data[sub_pos + 1] = undefined;
|
|
612
493
|
}
|
|
613
|
-
|
|
614
|
-
|
|
494
|
+
destructor() {
|
|
495
|
+
for (let cursor = this.data.length - 2; cursor >= this.sub_from; cursor -= 2) {
|
|
496
|
+
const sub = this.data[cursor];
|
|
497
|
+
const pos = this.data[cursor + 1];
|
|
498
|
+
sub.pub_off(pos);
|
|
499
|
+
this.data.pop();
|
|
500
|
+
this.data.pop();
|
|
501
|
+
}
|
|
502
|
+
this.cursor = this.pub_from;
|
|
503
|
+
this.track_cut();
|
|
504
|
+
this.cursor = $mol_wire_cursor.final;
|
|
615
505
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
;
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
(
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
};
|
|
506
|
+
track_cut() {
|
|
507
|
+
if (this.cursor < this.pub_from) {
|
|
508
|
+
$mol_fail(new Error('Cut of non begun sub'));
|
|
509
|
+
}
|
|
510
|
+
let tail = 0;
|
|
511
|
+
for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
|
|
512
|
+
const pub = this.data[cursor];
|
|
513
|
+
pub?.sub_off(this.data[cursor + 1]);
|
|
514
|
+
if (this.sub_from < this.data.length) {
|
|
515
|
+
this.peer_move(this.data.length - 2, cursor);
|
|
516
|
+
this.data.pop();
|
|
517
|
+
this.data.pop();
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
++tail;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
for (; tail; --tail) {
|
|
524
|
+
this.data.pop();
|
|
525
|
+
this.data.pop();
|
|
526
|
+
}
|
|
527
|
+
this.sub_from = this.cursor;
|
|
528
|
+
}
|
|
529
|
+
complete() { }
|
|
530
|
+
complete_pubs() {
|
|
531
|
+
const limit = this.cursor < 0 ? this.sub_from : this.cursor;
|
|
532
|
+
for (let cursor = this.pub_from; cursor < limit; cursor += 2) {
|
|
533
|
+
const pub = this.data[cursor];
|
|
534
|
+
pub?.complete();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
absorb(quant = $mol_wire_cursor.stale) {
|
|
538
|
+
if (this.cursor === $mol_wire_cursor.final)
|
|
539
|
+
return;
|
|
540
|
+
if (this.cursor >= quant)
|
|
541
|
+
return;
|
|
542
|
+
this.cursor = quant;
|
|
543
|
+
this.emit($mol_wire_cursor.doubt);
|
|
544
|
+
}
|
|
545
|
+
[$mol_dev_format_head]() {
|
|
546
|
+
return $mol_dev_format_native(this);
|
|
547
|
+
}
|
|
548
|
+
get pub_empty() {
|
|
549
|
+
return this.sub_from === this.pub_from;
|
|
661
550
|
}
|
|
662
551
|
}
|
|
663
|
-
$.$
|
|
664
|
-
})($ || ($ = {}));
|
|
665
|
-
//mol/term/color/color.ts
|
|
666
|
-
;
|
|
667
|
-
"use strict";
|
|
668
|
-
var $;
|
|
669
|
-
(function ($) {
|
|
670
|
-
function $mol_log3_node_make(level, output, type, color) {
|
|
671
|
-
return function $mol_log3_logger(event) {
|
|
672
|
-
if (!event.time)
|
|
673
|
-
event = { time: new Date().toISOString(), ...event };
|
|
674
|
-
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
675
|
-
let str = color(tree.toString());
|
|
676
|
-
this.console[level](str);
|
|
677
|
-
const self = this;
|
|
678
|
-
return () => self.console.groupEnd();
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
682
|
-
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
683
|
-
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
684
|
-
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
685
|
-
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
686
|
-
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
687
|
-
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
688
|
-
})($ || ($ = {}));
|
|
689
|
-
//mol/log3/log3.node.ts
|
|
690
|
-
;
|
|
691
|
-
"use strict";
|
|
692
|
-
var $;
|
|
693
|
-
(function ($) {
|
|
694
|
-
function $mol_env() {
|
|
695
|
-
return {};
|
|
696
|
-
}
|
|
697
|
-
$.$mol_env = $mol_env;
|
|
698
|
-
})($ || ($ = {}));
|
|
699
|
-
//mol/env/env.ts
|
|
700
|
-
;
|
|
701
|
-
"use strict";
|
|
702
|
-
var $;
|
|
703
|
-
(function ($) {
|
|
704
|
-
$.$mol_env = function $mol_env() {
|
|
705
|
-
return this.process.env;
|
|
706
|
-
};
|
|
552
|
+
$.$mol_wire_pub_sub = $mol_wire_pub_sub;
|
|
707
553
|
})($ || ($ = {}));
|
|
708
|
-
//mol/
|
|
554
|
+
//mol/wire/pub/sub/sub.ts
|
|
709
555
|
;
|
|
710
556
|
"use strict";
|
|
711
557
|
var $;
|
|
712
558
|
(function ($) {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
});
|
|
727
|
-
if (res.status || res.error)
|
|
728
|
-
return $mol_fail(res.error || new Error(res.stderr.toString()));
|
|
729
|
-
if (!res.stdout)
|
|
730
|
-
res.stdout = Buffer.from([]);
|
|
731
|
-
return res;
|
|
559
|
+
class $mol_after_timeout extends $mol_object2 {
|
|
560
|
+
delay;
|
|
561
|
+
task;
|
|
562
|
+
id;
|
|
563
|
+
constructor(delay, task) {
|
|
564
|
+
super();
|
|
565
|
+
this.delay = delay;
|
|
566
|
+
this.task = task;
|
|
567
|
+
this.id = setTimeout(task, delay);
|
|
568
|
+
}
|
|
569
|
+
destructor() {
|
|
570
|
+
clearTimeout(this.id);
|
|
571
|
+
}
|
|
732
572
|
}
|
|
733
|
-
$.$
|
|
734
|
-
})($ || ($ = {}));
|
|
735
|
-
//mol/exec/exec.node.ts
|
|
736
|
-
;
|
|
737
|
-
"use strict";
|
|
738
|
-
var $;
|
|
739
|
-
(function ($) {
|
|
740
|
-
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
|
|
573
|
+
$.$mol_after_timeout = $mol_after_timeout;
|
|
741
574
|
})($ || ($ = {}));
|
|
742
|
-
//mol/
|
|
575
|
+
//mol/after/timeout/timeout.ts
|
|
743
576
|
;
|
|
744
577
|
"use strict";
|
|
745
578
|
var $;
|
|
746
579
|
(function ($) {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
return el;
|
|
754
|
-
const doc = $mol_dom_context.document;
|
|
755
|
-
if (!doc)
|
|
756
|
-
return null;
|
|
757
|
-
el = doc.createElement('style');
|
|
758
|
-
el.id = `$mol_style_attach`;
|
|
759
|
-
doc.head.appendChild(el);
|
|
760
|
-
timer = new $mol_after_tick(() => {
|
|
761
|
-
el.innerHTML = '\n' + all.join('\n\n');
|
|
762
|
-
all = [];
|
|
763
|
-
el = null;
|
|
764
|
-
timer = null;
|
|
765
|
-
});
|
|
766
|
-
return el;
|
|
580
|
+
class $mol_after_frame extends $mol_after_timeout {
|
|
581
|
+
task;
|
|
582
|
+
constructor(task) {
|
|
583
|
+
super(16, task);
|
|
584
|
+
this.task = task;
|
|
585
|
+
}
|
|
767
586
|
}
|
|
768
|
-
$.$
|
|
587
|
+
$.$mol_after_frame = $mol_after_frame;
|
|
769
588
|
})($ || ($ = {}));
|
|
770
|
-
//mol/
|
|
589
|
+
//mol/after/frame/frame.node.ts
|
|
771
590
|
;
|
|
772
591
|
"use strict";
|
|
773
592
|
var $;
|
|
774
593
|
(function ($) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
594
|
+
const handled = new WeakSet();
|
|
595
|
+
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
596
|
+
task;
|
|
597
|
+
host;
|
|
598
|
+
static warm = true;
|
|
599
|
+
static planning = new Set();
|
|
600
|
+
static reaping = new Set();
|
|
601
|
+
static plan_task = null;
|
|
602
|
+
static plan() {
|
|
603
|
+
if (this.plan_task)
|
|
604
|
+
return;
|
|
605
|
+
this.plan_task = new $mol_after_frame(() => {
|
|
606
|
+
try {
|
|
607
|
+
this.sync();
|
|
608
|
+
}
|
|
609
|
+
finally {
|
|
610
|
+
$mol_wire_fiber.plan_task = null;
|
|
611
|
+
}
|
|
612
|
+
});
|
|
779
613
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
614
|
+
static sync() {
|
|
615
|
+
while (this.planning.size) {
|
|
616
|
+
for (const fiber of this.planning) {
|
|
617
|
+
this.planning.delete(fiber);
|
|
618
|
+
if (fiber.cursor >= 0)
|
|
619
|
+
continue;
|
|
620
|
+
if (fiber.cursor === $mol_wire_cursor.final)
|
|
621
|
+
continue;
|
|
622
|
+
fiber.fresh();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
while (this.reaping.size) {
|
|
626
|
+
const fibers = this.reaping;
|
|
627
|
+
this.reaping = new Set;
|
|
628
|
+
for (const fiber of fibers) {
|
|
629
|
+
if (!fiber.sub_empty)
|
|
630
|
+
continue;
|
|
631
|
+
fiber.destructor();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
785
634
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
//mol/decor/decor.ts
|
|
790
|
-
;
|
|
791
|
-
"use strict";
|
|
792
|
-
var $;
|
|
793
|
-
(function ($) {
|
|
794
|
-
class $mol_style_unit extends $mol_decor {
|
|
795
|
-
literal;
|
|
796
|
-
constructor(value, literal) {
|
|
797
|
-
super(value);
|
|
798
|
-
this.literal = literal;
|
|
635
|
+
cache = undefined;
|
|
636
|
+
get args() {
|
|
637
|
+
return this.data.slice(0, this.pub_from);
|
|
799
638
|
}
|
|
800
|
-
|
|
801
|
-
|
|
639
|
+
result() {
|
|
640
|
+
if (this.cache instanceof Promise)
|
|
641
|
+
return;
|
|
642
|
+
if (this.cache instanceof Error)
|
|
643
|
+
return;
|
|
644
|
+
return this.cache;
|
|
645
|
+
}
|
|
646
|
+
field() {
|
|
647
|
+
return this.task.name + '()';
|
|
648
|
+
}
|
|
649
|
+
constructor(id, task, host, args) {
|
|
650
|
+
super();
|
|
651
|
+
this.task = task;
|
|
652
|
+
this.host = host;
|
|
653
|
+
if (args)
|
|
654
|
+
this.data.push(...args);
|
|
655
|
+
this.pub_from = this.sub_from = args?.length ?? 0;
|
|
656
|
+
this[Symbol.toStringTag] = id;
|
|
657
|
+
}
|
|
658
|
+
plan() {
|
|
659
|
+
$mol_wire_fiber.planning.add(this);
|
|
660
|
+
$mol_wire_fiber.plan();
|
|
661
|
+
}
|
|
662
|
+
reap() {
|
|
663
|
+
$mol_wire_fiber.reaping.add(this);
|
|
664
|
+
$mol_wire_fiber.plan();
|
|
665
|
+
}
|
|
666
|
+
toString() {
|
|
667
|
+
return this[Symbol.toStringTag];
|
|
802
668
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
static mm(value) { return new $mol_style_unit(value, 'mm'); }
|
|
806
|
-
static cm(value) { return new $mol_style_unit(value, 'cm'); }
|
|
807
|
-
static Q(value) { return new $mol_style_unit(value, 'Q'); }
|
|
808
|
-
static in(value) { return new $mol_style_unit(value, 'in'); }
|
|
809
|
-
static pc(value) { return new $mol_style_unit(value, 'pc'); }
|
|
810
|
-
static pt(value) { return new $mol_style_unit(value, 'pt'); }
|
|
811
|
-
static cap(value) { return new $mol_style_unit(value, 'cap'); }
|
|
812
|
-
static ch(value) { return new $mol_style_unit(value, 'ch'); }
|
|
813
|
-
static em(value) { return new $mol_style_unit(value, 'em'); }
|
|
814
|
-
static rem(value) { return new $mol_style_unit(value, 'rem'); }
|
|
815
|
-
static ex(value) { return new $mol_style_unit(value, 'ex'); }
|
|
816
|
-
static ic(value) { return new $mol_style_unit(value, 'ic'); }
|
|
817
|
-
static lh(value) { return new $mol_style_unit(value, 'lh'); }
|
|
818
|
-
static rlh(value) { return new $mol_style_unit(value, 'rlh'); }
|
|
819
|
-
static vh(value) { return new $mol_style_unit(value, 'vh'); }
|
|
820
|
-
static vw(value) { return new $mol_style_unit(value, 'vw'); }
|
|
821
|
-
static vi(value) { return new $mol_style_unit(value, 'vi'); }
|
|
822
|
-
static vb(value) { return new $mol_style_unit(value, 'vb'); }
|
|
823
|
-
static vmin(value) { return new $mol_style_unit(value, 'vmin'); }
|
|
824
|
-
static vmax(value) { return new $mol_style_unit(value, 'vmax'); }
|
|
825
|
-
static deg(value) { return new $mol_style_unit(value, 'deg'); }
|
|
826
|
-
static rad(value) { return new $mol_style_unit(value, 'rad'); }
|
|
827
|
-
static grad(value) { return new $mol_style_unit(value, 'grad'); }
|
|
828
|
-
static turn(value) { return new $mol_style_unit(value, 'turn'); }
|
|
829
|
-
static s(value) { return new $mol_style_unit(value, 's'); }
|
|
830
|
-
static ms(value) { return new $mol_style_unit(value, 'ms'); }
|
|
831
|
-
}
|
|
832
|
-
$.$mol_style_unit = $mol_style_unit;
|
|
833
|
-
})($ || ($ = {}));
|
|
834
|
-
//mol/style/unit/unit.ts
|
|
835
|
-
;
|
|
836
|
-
"use strict";
|
|
837
|
-
var $;
|
|
838
|
-
(function ($) {
|
|
839
|
-
const { per } = $mol_style_unit;
|
|
840
|
-
class $mol_style_func extends $mol_decor {
|
|
841
|
-
name;
|
|
842
|
-
constructor(name, value) {
|
|
843
|
-
super(value);
|
|
844
|
-
this.name = name;
|
|
669
|
+
toJSON() {
|
|
670
|
+
return this[Symbol.toStringTag];
|
|
845
671
|
}
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
672
|
+
[$mol_dev_format_head]() {
|
|
673
|
+
const cursor = {
|
|
674
|
+
[$mol_wire_cursor.stale]: '🔴',
|
|
675
|
+
[$mol_wire_cursor.doubt]: '🟡',
|
|
676
|
+
[$mol_wire_cursor.fresh]: '🟢',
|
|
677
|
+
[$mol_wire_cursor.final]: '🔵',
|
|
678
|
+
}[this.cursor] ?? this.cursor.toString();
|
|
679
|
+
return $mol_dev_format_div({}, $mol_dev_format_native(this), $mol_dev_format_shade(cursor + ' '), $mol_dev_format_auto(this.cache));
|
|
850
680
|
}
|
|
851
|
-
|
|
852
|
-
return
|
|
681
|
+
get $() {
|
|
682
|
+
return (this.host ?? this.task)['$'];
|
|
853
683
|
}
|
|
854
|
-
|
|
855
|
-
|
|
684
|
+
emit(quant = $mol_wire_cursor.stale) {
|
|
685
|
+
if (this.sub_empty)
|
|
686
|
+
this.plan();
|
|
687
|
+
else
|
|
688
|
+
super.emit(quant);
|
|
856
689
|
}
|
|
857
|
-
|
|
858
|
-
|
|
690
|
+
fresh() {
|
|
691
|
+
if (this.cursor === $mol_wire_cursor.fresh)
|
|
692
|
+
return;
|
|
693
|
+
if (this.cursor === $mol_wire_cursor.final)
|
|
694
|
+
return;
|
|
695
|
+
check: if (this.cursor === $mol_wire_cursor.doubt) {
|
|
696
|
+
for (let i = this.pub_from; i < this.sub_from; i += 2) {
|
|
697
|
+
;
|
|
698
|
+
this.data[i]?.fresh();
|
|
699
|
+
if (this.cursor !== $mol_wire_cursor.doubt)
|
|
700
|
+
break check;
|
|
701
|
+
}
|
|
702
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
const bu = this.track_on();
|
|
706
|
+
let result;
|
|
707
|
+
try {
|
|
708
|
+
switch (this.pub_from) {
|
|
709
|
+
case 0:
|
|
710
|
+
result = this.task.call(this.host);
|
|
711
|
+
break;
|
|
712
|
+
case 1:
|
|
713
|
+
result = this.task.call(this.host, this.data[0]);
|
|
714
|
+
break;
|
|
715
|
+
default:
|
|
716
|
+
result = this.task.call(this.host, ...this.args);
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
if (result instanceof Promise) {
|
|
720
|
+
const put = (res) => {
|
|
721
|
+
if (this.cache === result)
|
|
722
|
+
this.put(res);
|
|
723
|
+
return res;
|
|
724
|
+
};
|
|
725
|
+
result = Object.assign(result.then(put, put), {
|
|
726
|
+
destructor: result['destructor'] ?? (() => { })
|
|
727
|
+
});
|
|
728
|
+
handled.add(result);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
catch (error) {
|
|
732
|
+
if (error instanceof Error || error instanceof Promise) {
|
|
733
|
+
result = error;
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
result = new Error(String(error), { cause: error });
|
|
737
|
+
}
|
|
738
|
+
if (result instanceof Promise && !handled.has(result)) {
|
|
739
|
+
result = Object.assign(result.finally(() => {
|
|
740
|
+
if (this.cache === result)
|
|
741
|
+
this.absorb();
|
|
742
|
+
}), {
|
|
743
|
+
destructor: result['destructor'] ?? (() => { })
|
|
744
|
+
});
|
|
745
|
+
handled.add(result);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
if (!(result instanceof Promise)) {
|
|
749
|
+
this.track_cut();
|
|
750
|
+
}
|
|
751
|
+
this.track_off(bu);
|
|
752
|
+
this.put(result);
|
|
859
753
|
}
|
|
860
|
-
|
|
861
|
-
|
|
754
|
+
refresh() {
|
|
755
|
+
this.cursor = $mol_wire_cursor.stale;
|
|
756
|
+
this.fresh();
|
|
862
757
|
}
|
|
863
|
-
|
|
864
|
-
|
|
758
|
+
sync() {
|
|
759
|
+
if (!$mol_wire_fiber.warm) {
|
|
760
|
+
return this.result();
|
|
761
|
+
}
|
|
762
|
+
this.promote();
|
|
763
|
+
this.fresh();
|
|
764
|
+
if (this.cache instanceof Error) {
|
|
765
|
+
return $mol_fail_hidden(this.cache);
|
|
766
|
+
}
|
|
767
|
+
if (this.cache instanceof Promise) {
|
|
768
|
+
return $mol_fail_hidden(this.cache);
|
|
769
|
+
}
|
|
770
|
+
return this.cache;
|
|
865
771
|
}
|
|
866
|
-
|
|
867
|
-
|
|
772
|
+
async async() {
|
|
773
|
+
while (true) {
|
|
774
|
+
this.fresh();
|
|
775
|
+
if (this.cache instanceof Error) {
|
|
776
|
+
$mol_fail_hidden(this.cache);
|
|
777
|
+
}
|
|
778
|
+
if (!(this.cache instanceof Promise))
|
|
779
|
+
return this.cache;
|
|
780
|
+
await this.cache;
|
|
781
|
+
if (this.cursor === $mol_wire_cursor.final) {
|
|
782
|
+
await new Promise(() => { });
|
|
783
|
+
}
|
|
784
|
+
}
|
|
868
785
|
}
|
|
869
786
|
}
|
|
870
|
-
$.$
|
|
871
|
-
})($ || ($ = {}));
|
|
872
|
-
//mol/style/func/func.ts
|
|
873
|
-
;
|
|
874
|
-
"use strict";
|
|
875
|
-
var $;
|
|
876
|
-
(function ($) {
|
|
877
|
-
$mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 210deg;\n\t--mol_theme_luma: -1;\n\t--mol_theme_satur: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme] {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n}\n:where([mol_theme]) {\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme] {\n\t--mol_theme_back: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 20% ), calc( 55% + 45% * var(--mol_theme_luma) ) );\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, calc( 40% - 40% * var(--mol_theme_luma) ) );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 54% + 46% * var(--mol_theme_luma) ), .25 );\n\t\n\t--mol_theme_card: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .2 );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 50%, 1 );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, calc( 55% - 10% * var(--mol_theme_luma) ) );\n\t\n}\n\n[mol_theme=\"$mol_theme_light\"] {\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme=\"$mol_theme_dark\"] {\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n}\n\n[mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 50%, 40% );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 60%, 30% );\n\t--mol_theme_current: hsl( var(--mol_theme_hue), 100%, 20% );\n}\n\n[mol_theme=\"$mol_theme_current\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% + 30% * var(--mol_theme_luma) ) );\n}\n\n[mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_card: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n}\n\n[mol_theme=\"$mol_theme_accent\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) + 180deg ), 90%, 50% );\n\t--mol_theme_hover: hsl( calc( var(--mol_theme_hue) + 180deg ), 80%, 35% );\n}\n\n[mol_theme=\"$mol_theme_accent\"] [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: black;\n}\n");
|
|
878
|
-
})($ || ($ = {}));
|
|
879
|
-
//mol/theme/-css/theme.css.ts
|
|
880
|
-
;
|
|
881
|
-
"use strict";
|
|
882
|
-
var $;
|
|
883
|
-
(function ($) {
|
|
884
|
-
const { vary } = $mol_style_func;
|
|
885
|
-
$.$mol_theme = {
|
|
886
|
-
back: vary('--mol_theme_back'),
|
|
887
|
-
hover: vary('--mol_theme_hover'),
|
|
888
|
-
card: vary('--mol_theme_card'),
|
|
889
|
-
current: vary('--mol_theme_current'),
|
|
890
|
-
special: vary('--mol_theme_special'),
|
|
891
|
-
text: vary('--mol_theme_text'),
|
|
892
|
-
control: vary('--mol_theme_control'),
|
|
893
|
-
shade: vary('--mol_theme_shade'),
|
|
894
|
-
line: vary('--mol_theme_line'),
|
|
895
|
-
focus: vary('--mol_theme_focus'),
|
|
896
|
-
field: vary('--mol_theme_field'),
|
|
897
|
-
image: vary('--mol_theme_image'),
|
|
898
|
-
};
|
|
899
|
-
})($ || ($ = {}));
|
|
900
|
-
//mol/theme/theme.ts
|
|
901
|
-
;
|
|
902
|
-
"use strict";
|
|
903
|
-
var $;
|
|
904
|
-
(function ($) {
|
|
905
|
-
$mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
|
|
787
|
+
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
906
788
|
})($ || ($ = {}));
|
|
907
|
-
//mol/
|
|
789
|
+
//mol/wire/fiber/fiber.ts
|
|
908
790
|
;
|
|
909
791
|
"use strict";
|
|
910
792
|
var $;
|
|
911
793
|
(function ($) {
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
;
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
let $;
|
|
929
|
-
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
930
|
-
$_1.$mol_object_field = Symbol('$mol_object_field');
|
|
931
|
-
class $mol_object extends $mol_object2 {
|
|
932
|
-
static make(config) {
|
|
933
|
-
return super.create(obj => {
|
|
934
|
-
for (let key in config)
|
|
935
|
-
obj[key] = config[key];
|
|
936
|
-
});
|
|
794
|
+
const named = new WeakSet();
|
|
795
|
+
function $mol_func_name(func) {
|
|
796
|
+
let name = func.name;
|
|
797
|
+
if (name?.length > 1)
|
|
798
|
+
return name;
|
|
799
|
+
if (named.has(func))
|
|
800
|
+
return name;
|
|
801
|
+
for (let key in this) {
|
|
802
|
+
try {
|
|
803
|
+
if (this[key] !== func)
|
|
804
|
+
continue;
|
|
805
|
+
name = key;
|
|
806
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
807
|
+
break;
|
|
808
|
+
}
|
|
809
|
+
catch { }
|
|
937
810
|
}
|
|
811
|
+
named.add(func);
|
|
812
|
+
return name;
|
|
938
813
|
}
|
|
939
|
-
|
|
814
|
+
$.$mol_func_name = $mol_func_name;
|
|
815
|
+
function $mol_func_name_from(target, source) {
|
|
816
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
817
|
+
return target;
|
|
818
|
+
}
|
|
819
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
940
820
|
})($ || ($ = {}));
|
|
941
|
-
//mol/
|
|
821
|
+
//mol/func/name/name.ts
|
|
942
822
|
;
|
|
943
823
|
"use strict";
|
|
944
824
|
var $;
|
|
945
825
|
(function ($) {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
826
|
+
function $mol_guid(length = 8, exists = () => false) {
|
|
827
|
+
for (;;) {
|
|
828
|
+
let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
|
|
829
|
+
if (exists(id))
|
|
830
|
+
continue;
|
|
831
|
+
return id;
|
|
952
832
|
}
|
|
953
833
|
}
|
|
954
|
-
$.$
|
|
834
|
+
$.$mol_guid = $mol_guid;
|
|
955
835
|
})($ || ($ = {}));
|
|
956
|
-
//mol/
|
|
836
|
+
//mol/guid/guid.ts
|
|
957
837
|
;
|
|
958
838
|
"use strict";
|
|
959
839
|
var $;
|
|
960
840
|
(function ($) {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
841
|
+
$.$mol_key_store = new WeakMap();
|
|
842
|
+
function $mol_key(value) {
|
|
843
|
+
if (!value)
|
|
844
|
+
return JSON.stringify(value);
|
|
845
|
+
if (typeof value !== 'object' && typeof value !== 'function')
|
|
846
|
+
return JSON.stringify(value);
|
|
847
|
+
return JSON.stringify(value, (field, value) => {
|
|
848
|
+
if (!value)
|
|
849
|
+
return value;
|
|
850
|
+
if (typeof value !== 'object' && typeof value !== 'function')
|
|
851
|
+
return value;
|
|
852
|
+
if (Array.isArray(value))
|
|
853
|
+
return value;
|
|
854
|
+
const proto = Reflect.getPrototypeOf(value);
|
|
855
|
+
if (!proto)
|
|
856
|
+
return value;
|
|
857
|
+
if (Reflect.getPrototypeOf(proto) === null)
|
|
858
|
+
return value;
|
|
859
|
+
if ('toJSON' in value)
|
|
860
|
+
return value;
|
|
861
|
+
if (value instanceof RegExp)
|
|
862
|
+
return value.toString();
|
|
863
|
+
let key = $.$mol_key_store.get(value);
|
|
864
|
+
if (key)
|
|
865
|
+
return key;
|
|
866
|
+
key = $mol_guid();
|
|
867
|
+
$.$mol_key_store.set(value, key);
|
|
868
|
+
return key;
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
$.$mol_key = $mol_key;
|
|
968
872
|
})($ || ($ = {}));
|
|
969
|
-
//mol/
|
|
873
|
+
//mol/key/key.ts
|
|
970
874
|
;
|
|
971
875
|
"use strict";
|
|
972
876
|
var $;
|
|
973
877
|
(function ($) {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
return
|
|
878
|
+
$.$mol_compare_deep_cache = new WeakMap();
|
|
879
|
+
function $mol_compare_deep(left, right) {
|
|
880
|
+
if (Object.is(left, right))
|
|
881
|
+
return true;
|
|
882
|
+
if (left === null)
|
|
883
|
+
return false;
|
|
884
|
+
if (right === null)
|
|
885
|
+
return false;
|
|
886
|
+
if (typeof left !== 'object')
|
|
887
|
+
return false;
|
|
888
|
+
if (typeof right !== 'object')
|
|
889
|
+
return false;
|
|
890
|
+
const left_proto = Reflect.getPrototypeOf(left);
|
|
891
|
+
const right_proto = Reflect.getPrototypeOf(right);
|
|
892
|
+
if (left_proto !== right_proto)
|
|
893
|
+
return false;
|
|
894
|
+
if (left instanceof Boolean)
|
|
895
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
896
|
+
if (left instanceof Number)
|
|
897
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
898
|
+
if (left instanceof String)
|
|
899
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
900
|
+
if (left instanceof Date)
|
|
901
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
902
|
+
if (left instanceof RegExp)
|
|
903
|
+
return left.source === right['source'] && left.flags === right['flags'];
|
|
904
|
+
if (left instanceof Error)
|
|
905
|
+
return left.message === right['message'] && left.stack === right['stack'];
|
|
906
|
+
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
907
|
+
if (left_cache) {
|
|
908
|
+
const right_cache = left_cache.get(right);
|
|
909
|
+
if (typeof right_cache === 'boolean')
|
|
910
|
+
return right_cache;
|
|
978
911
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
for (let i = this.sub_from; i < this.data.length; i += 2) {
|
|
983
|
-
res.push(this.data[i]);
|
|
984
|
-
}
|
|
985
|
-
return res;
|
|
912
|
+
else {
|
|
913
|
+
left_cache = new WeakMap([[right, true]]);
|
|
914
|
+
$.$mol_compare_deep_cache.set(left, left_cache);
|
|
986
915
|
}
|
|
987
|
-
|
|
988
|
-
|
|
916
|
+
let result;
|
|
917
|
+
try {
|
|
918
|
+
if (left_proto && !Reflect.getPrototypeOf(left_proto))
|
|
919
|
+
result = compare_pojo(left, right);
|
|
920
|
+
else if (Array.isArray(left))
|
|
921
|
+
result = compare_array(left, right);
|
|
922
|
+
else if (left instanceof Set)
|
|
923
|
+
result = compare_set(left, right);
|
|
924
|
+
else if (left instanceof Map)
|
|
925
|
+
result = compare_map(left, right);
|
|
926
|
+
else if (ArrayBuffer.isView(left))
|
|
927
|
+
result = compare_buffer(left, right);
|
|
928
|
+
else if (Symbol.toPrimitive in left)
|
|
929
|
+
result = compare_primitive(left, right);
|
|
930
|
+
else
|
|
931
|
+
result = false;
|
|
989
932
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
this.data.push(sub, pub_pos);
|
|
993
|
-
return pos;
|
|
933
|
+
finally {
|
|
934
|
+
left_cache.set(right, result);
|
|
994
935
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (this.data.length === this.sub_from)
|
|
1006
|
-
this.reap();
|
|
936
|
+
return result;
|
|
937
|
+
}
|
|
938
|
+
$.$mol_compare_deep = $mol_compare_deep;
|
|
939
|
+
function compare_array(left, right) {
|
|
940
|
+
const len = left.length;
|
|
941
|
+
if (len !== right.length)
|
|
942
|
+
return false;
|
|
943
|
+
for (let i = 0; i < len; ++i) {
|
|
944
|
+
if (!$mol_compare_deep(left[i], right[i]))
|
|
945
|
+
return false;
|
|
1007
946
|
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
947
|
+
return true;
|
|
948
|
+
}
|
|
949
|
+
function compare_buffer(left, right) {
|
|
950
|
+
const len = left.byteLength;
|
|
951
|
+
if (len !== right.byteLength)
|
|
952
|
+
return false;
|
|
953
|
+
for (let i = 0; i < len; ++i) {
|
|
954
|
+
if (left[i] !== right[i])
|
|
955
|
+
return false;
|
|
1011
956
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
957
|
+
return true;
|
|
958
|
+
}
|
|
959
|
+
function compare_iterator(left, right) {
|
|
960
|
+
while (true) {
|
|
961
|
+
const left_next = left.next();
|
|
962
|
+
const right_next = right.next();
|
|
963
|
+
if (left_next.done !== right_next.done)
|
|
964
|
+
return false;
|
|
965
|
+
if (left_next.done)
|
|
966
|
+
break;
|
|
967
|
+
if (!$mol_compare_deep(left_next.value, right_next.value))
|
|
968
|
+
return false;
|
|
1019
969
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
970
|
+
return true;
|
|
971
|
+
}
|
|
972
|
+
function compare_set(left, right) {
|
|
973
|
+
if (left.size !== right.size)
|
|
974
|
+
return false;
|
|
975
|
+
return compare_iterator(left.values(), right.values());
|
|
976
|
+
}
|
|
977
|
+
function compare_map(left, right) {
|
|
978
|
+
if (left.size !== right.size)
|
|
979
|
+
return false;
|
|
980
|
+
return compare_iterator(left.keys(), right.keys())
|
|
981
|
+
&& compare_iterator(left.values(), right.values());
|
|
982
|
+
}
|
|
983
|
+
function compare_pojo(left, right) {
|
|
984
|
+
const left_keys = Object.getOwnPropertyNames(left);
|
|
985
|
+
const right_keys = Object.getOwnPropertyNames(right);
|
|
986
|
+
if (left_keys.length !== right_keys.length)
|
|
987
|
+
return false;
|
|
988
|
+
for (let key of left_keys) {
|
|
989
|
+
if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
return true;
|
|
993
|
+
}
|
|
994
|
+
function compare_primitive(left, right) {
|
|
995
|
+
return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
|
|
996
|
+
}
|
|
997
|
+
})($ || ($ = {}));
|
|
998
|
+
//mol/compare/deep/deep.ts
|
|
999
|
+
;
|
|
1000
|
+
"use strict";
|
|
1001
|
+
var $;
|
|
1002
|
+
(function ($) {
|
|
1003
|
+
class $mol_wire_task extends $mol_wire_fiber {
|
|
1004
|
+
static getter(task) {
|
|
1005
|
+
return function $mol_wire_task_get(host, args) {
|
|
1006
|
+
const sub = $mol_wire_auto();
|
|
1007
|
+
const existen = sub?.track_next();
|
|
1008
|
+
reuse: if (existen) {
|
|
1009
|
+
if (!(existen instanceof $mol_wire_task))
|
|
1010
|
+
break reuse;
|
|
1011
|
+
if (existen.host !== host)
|
|
1012
|
+
break reuse;
|
|
1013
|
+
if (existen.task !== task)
|
|
1014
|
+
break reuse;
|
|
1015
|
+
if (!$mol_compare_deep(existen.args, args))
|
|
1016
|
+
break reuse;
|
|
1017
|
+
return existen;
|
|
1018
|
+
}
|
|
1019
|
+
return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
complete() {
|
|
1023
|
+
if (this.cache instanceof Promise)
|
|
1024
|
+
return;
|
|
1025
|
+
this.destructor();
|
|
1026
|
+
}
|
|
1027
|
+
put(next) {
|
|
1028
|
+
const prev = this.cache;
|
|
1029
|
+
this.cache = next;
|
|
1030
|
+
if (next instanceof Promise) {
|
|
1031
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
1032
|
+
if (next !== prev)
|
|
1033
|
+
this.emit();
|
|
1034
|
+
return next;
|
|
1035
|
+
}
|
|
1036
|
+
this.cursor = $mol_wire_cursor.final;
|
|
1037
|
+
if (this.sub_empty)
|
|
1038
|
+
this.destructor();
|
|
1039
|
+
else if (next !== prev)
|
|
1040
|
+
this.emit();
|
|
1041
|
+
return next;
|
|
1026
1042
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1043
|
+
}
|
|
1044
|
+
$.$mol_wire_task = $mol_wire_task;
|
|
1045
|
+
})($ || ($ = {}));
|
|
1046
|
+
//mol/wire/task/task.ts
|
|
1047
|
+
;
|
|
1048
|
+
"use strict";
|
|
1049
|
+
var $;
|
|
1050
|
+
(function ($) {
|
|
1051
|
+
function $mol_wire_method(host, field, descr) {
|
|
1052
|
+
if (!descr)
|
|
1053
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1054
|
+
const orig = descr?.value ?? host[field];
|
|
1055
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1056
|
+
if (typeof sup[field] === 'function') {
|
|
1057
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1029
1058
|
}
|
|
1059
|
+
const temp = $mol_wire_task.getter(orig);
|
|
1060
|
+
const value = function (...args) {
|
|
1061
|
+
const fiber = temp(this ?? null, args);
|
|
1062
|
+
return fiber.sync();
|
|
1063
|
+
};
|
|
1064
|
+
Object.defineProperty(value, 'name', { value: orig.name + ' ' });
|
|
1065
|
+
Object.assign(value, { orig });
|
|
1066
|
+
const descr2 = { ...descr, value };
|
|
1067
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1068
|
+
return descr2;
|
|
1030
1069
|
}
|
|
1031
|
-
$.$
|
|
1070
|
+
$.$mol_wire_method = $mol_wire_method;
|
|
1032
1071
|
})($ || ($ = {}));
|
|
1033
|
-
//mol/wire/
|
|
1072
|
+
//mol/wire/method/method.ts
|
|
1034
1073
|
;
|
|
1035
1074
|
"use strict";
|
|
1036
|
-
//mol/
|
|
1075
|
+
//mol/type/tail/tail.ts
|
|
1076
|
+
;
|
|
1077
|
+
"use strict";
|
|
1078
|
+
//mol/type/foot/foot.ts
|
|
1037
1079
|
;
|
|
1038
1080
|
"use strict";
|
|
1039
1081
|
var $;
|
|
1040
1082
|
(function ($) {
|
|
1041
|
-
|
|
1042
|
-
function $
|
|
1043
|
-
|
|
1083
|
+
const catched = new WeakMap();
|
|
1084
|
+
function $mol_fail_catch(error) {
|
|
1085
|
+
if (typeof error !== 'object')
|
|
1086
|
+
return false;
|
|
1087
|
+
if (error instanceof Promise)
|
|
1088
|
+
$mol_fail_hidden(error);
|
|
1089
|
+
if (catched.get(error))
|
|
1090
|
+
return false;
|
|
1091
|
+
catched.set(error, true);
|
|
1092
|
+
return true;
|
|
1044
1093
|
}
|
|
1045
|
-
$.$
|
|
1046
|
-
$.$mol_wire_affected = [];
|
|
1094
|
+
$.$mol_fail_catch = $mol_fail_catch;
|
|
1047
1095
|
})($ || ($ = {}));
|
|
1048
|
-
//mol/
|
|
1096
|
+
//mol/fail/catch/catch.ts
|
|
1049
1097
|
;
|
|
1050
1098
|
"use strict";
|
|
1051
1099
|
var $;
|
|
1052
1100
|
(function ($) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
$mol_dev_format_register({
|
|
1061
|
-
header: (val, config = false) => {
|
|
1062
|
-
if (config)
|
|
1063
|
-
return null;
|
|
1064
|
-
if (!val)
|
|
1065
|
-
return null;
|
|
1066
|
-
if ($.$mol_dev_format_head in val) {
|
|
1067
|
-
return val[$.$mol_dev_format_head]();
|
|
1068
|
-
}
|
|
1069
|
-
if (typeof val === 'function') {
|
|
1070
|
-
return $mol_dev_format_native(val);
|
|
1071
|
-
}
|
|
1072
|
-
return null;
|
|
1073
|
-
},
|
|
1074
|
-
hasBody: val => val[$.$mol_dev_format_body],
|
|
1075
|
-
body: val => val[$.$mol_dev_format_body](),
|
|
1076
|
-
});
|
|
1077
|
-
function $mol_dev_format_native(obj) {
|
|
1078
|
-
if (typeof obj === 'undefined')
|
|
1079
|
-
return $.$mol_dev_format_shade('undefined');
|
|
1080
|
-
if (typeof obj !== 'object' && typeof obj !== 'function')
|
|
1081
|
-
return obj;
|
|
1082
|
-
return [
|
|
1083
|
-
'object',
|
|
1084
|
-
{
|
|
1085
|
-
object: obj,
|
|
1086
|
-
config: true,
|
|
1087
|
-
},
|
|
1088
|
-
];
|
|
1089
|
-
}
|
|
1090
|
-
$.$mol_dev_format_native = $mol_dev_format_native;
|
|
1091
|
-
function $mol_dev_format_auto(obj) {
|
|
1092
|
-
if (obj == null)
|
|
1093
|
-
return $.$mol_dev_format_shade(String(obj));
|
|
1094
|
-
if (typeof obj === 'object' && $.$mol_dev_format_head in obj) {
|
|
1095
|
-
return obj[$.$mol_dev_format_head]();
|
|
1096
|
-
}
|
|
1097
|
-
return [
|
|
1098
|
-
'object',
|
|
1099
|
-
{
|
|
1100
|
-
object: obj,
|
|
1101
|
-
config: false,
|
|
1102
|
-
},
|
|
1103
|
-
];
|
|
1104
|
-
}
|
|
1105
|
-
$.$mol_dev_format_auto = $mol_dev_format_auto;
|
|
1106
|
-
function $mol_dev_format_element(element, style, ...content) {
|
|
1107
|
-
const styles = [];
|
|
1108
|
-
for (let key in style)
|
|
1109
|
-
styles.push(`${key} : ${style[key]}`);
|
|
1110
|
-
return [
|
|
1111
|
-
element,
|
|
1112
|
-
{
|
|
1113
|
-
style: styles.join(' ; '),
|
|
1114
|
-
},
|
|
1115
|
-
...content,
|
|
1116
|
-
];
|
|
1117
|
-
}
|
|
1118
|
-
$.$mol_dev_format_element = $mol_dev_format_element;
|
|
1119
|
-
function $mol_dev_format_span(style, ...content) {
|
|
1120
|
-
return $mol_dev_format_element('span', {
|
|
1121
|
-
'vertical-align': '8%',
|
|
1122
|
-
...style,
|
|
1123
|
-
}, ...content);
|
|
1101
|
+
function $mol_fail_log(error) {
|
|
1102
|
+
if (error instanceof Promise)
|
|
1103
|
+
return false;
|
|
1104
|
+
if (!$mol_fail_catch(error))
|
|
1105
|
+
return false;
|
|
1106
|
+
console.error(error);
|
|
1107
|
+
return true;
|
|
1124
1108
|
}
|
|
1125
|
-
$.$
|
|
1126
|
-
$.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
|
|
1127
|
-
$.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
|
|
1128
|
-
$.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
|
|
1129
|
-
$.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
|
|
1130
|
-
$.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
|
|
1131
|
-
$.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
|
|
1132
|
-
$.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
|
|
1133
|
-
'color': 'magenta',
|
|
1134
|
-
});
|
|
1135
|
-
$.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
|
|
1136
|
-
'font-weight': 'bold',
|
|
1137
|
-
});
|
|
1138
|
-
$.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
|
|
1139
|
-
'color': 'green',
|
|
1140
|
-
});
|
|
1141
|
-
$.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
|
|
1142
|
-
'color': 'gray',
|
|
1143
|
-
});
|
|
1144
|
-
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
1145
|
-
'margin-left': '13px'
|
|
1146
|
-
});
|
|
1109
|
+
$.$mol_fail_log = $mol_fail_log;
|
|
1147
1110
|
})($ || ($ = {}));
|
|
1148
|
-
//mol/
|
|
1111
|
+
//mol/fail/log/log.ts
|
|
1149
1112
|
;
|
|
1150
1113
|
"use strict";
|
|
1151
1114
|
var $;
|
|
1152
1115
|
(function ($) {
|
|
1153
|
-
class $
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
return
|
|
1164
|
-
}
|
|
1165
|
-
track_on() {
|
|
1166
|
-
this.cursor = this.pub_from;
|
|
1167
|
-
const sub = $mol_wire_auto();
|
|
1168
|
-
$mol_wire_auto(this);
|
|
1169
|
-
return sub;
|
|
1116
|
+
class $mol_wire_atom extends $mol_wire_fiber {
|
|
1117
|
+
static solo(host, task) {
|
|
1118
|
+
const field = task.name + '()';
|
|
1119
|
+
const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1120
|
+
if (existen)
|
|
1121
|
+
return existen;
|
|
1122
|
+
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1123
|
+
const key = `${prefix}.${field}`;
|
|
1124
|
+
const fiber = new $mol_wire_atom(key, task, host, []);
|
|
1125
|
+
(host ?? task)[field] = fiber;
|
|
1126
|
+
return fiber;
|
|
1170
1127
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1128
|
+
static plex(host, task, key) {
|
|
1129
|
+
const field = task.name + '()';
|
|
1130
|
+
let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1131
|
+
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1132
|
+
const id = `${prefix}.${task.name}(${$mol_key(key)})`;
|
|
1133
|
+
if (dict) {
|
|
1134
|
+
const existen = dict.get(id);
|
|
1135
|
+
if (existen)
|
|
1136
|
+
return existen;
|
|
1174
1137
|
}
|
|
1175
|
-
|
|
1138
|
+
else {
|
|
1139
|
+
dict = (host ?? task)[field] = new Map();
|
|
1140
|
+
}
|
|
1141
|
+
const fiber = new $mol_wire_atom(id, task, host, [key]);
|
|
1142
|
+
dict.set(id, fiber);
|
|
1143
|
+
return fiber;
|
|
1176
1144
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1184
|
-
if (next === pub) {
|
|
1185
|
-
this.cursor += 2;
|
|
1186
|
-
return next;
|
|
1187
|
-
}
|
|
1188
|
-
if (next) {
|
|
1189
|
-
if (this.sub_from < this.data.length) {
|
|
1190
|
-
this.peer_move(this.sub_from, this.data.length);
|
|
1191
|
-
}
|
|
1192
|
-
this.peer_move(this.cursor, this.sub_from);
|
|
1193
|
-
this.sub_from += 2;
|
|
1145
|
+
static watching = new Set();
|
|
1146
|
+
static watcher = null;
|
|
1147
|
+
static watch() {
|
|
1148
|
+
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1149
|
+
for (const atom of $mol_wire_atom.watching) {
|
|
1150
|
+
if (atom.cursor === $mol_wire_cursor.final) {
|
|
1151
|
+
$mol_wire_atom.watching.delete(atom);
|
|
1194
1152
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
return null;
|
|
1199
|
-
if (this.sub_from < this.data.length) {
|
|
1200
|
-
this.peer_move(this.sub_from, this.data.length);
|
|
1153
|
+
else {
|
|
1154
|
+
atom.cursor = $mol_wire_cursor.stale;
|
|
1155
|
+
atom.fresh();
|
|
1201
1156
|
}
|
|
1202
|
-
this.sub_from += 2;
|
|
1203
1157
|
}
|
|
1204
|
-
this.data[this.cursor] = pub;
|
|
1205
|
-
this.data[this.cursor + 1] = pub.sub_on(this, this.cursor);
|
|
1206
|
-
this.cursor += 2;
|
|
1207
|
-
return pub;
|
|
1208
1158
|
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
$mol_fail(new Error('End of non begun sub'));
|
|
1213
|
-
}
|
|
1214
|
-
for (let cursor = this.pub_from; cursor < this.cursor; cursor += 2) {
|
|
1215
|
-
const pub = this.data[cursor];
|
|
1216
|
-
pub.fresh();
|
|
1159
|
+
watch() {
|
|
1160
|
+
if (!$mol_wire_atom.watcher) {
|
|
1161
|
+
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1217
1162
|
}
|
|
1218
|
-
|
|
1163
|
+
$mol_wire_atom.watching.add(this);
|
|
1219
1164
|
}
|
|
1220
|
-
|
|
1221
|
-
this.
|
|
1222
|
-
this.data[sub_pos + 1] = undefined;
|
|
1165
|
+
resync(args) {
|
|
1166
|
+
return this.put(this.task.call(this.host, ...args));
|
|
1223
1167
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
const sub = this.data[cursor];
|
|
1227
|
-
const pos = this.data[cursor + 1];
|
|
1228
|
-
sub.pub_off(pos);
|
|
1229
|
-
this.data.pop();
|
|
1230
|
-
this.data.pop();
|
|
1231
|
-
}
|
|
1232
|
-
this.cursor = this.pub_from;
|
|
1233
|
-
this.track_cut();
|
|
1234
|
-
this.cursor = $mol_wire_cursor.final;
|
|
1168
|
+
once() {
|
|
1169
|
+
return this.sync();
|
|
1235
1170
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
if (this.sub_from < this.data.length) {
|
|
1245
|
-
this.peer_move(this.data.length - 2, cursor);
|
|
1246
|
-
this.data.pop();
|
|
1247
|
-
this.data.pop();
|
|
1171
|
+
channel() {
|
|
1172
|
+
return Object.assign((next) => {
|
|
1173
|
+
if (next !== undefined)
|
|
1174
|
+
return this.resync([...this.args, next]);
|
|
1175
|
+
if (!$mol_wire_fiber.warm)
|
|
1176
|
+
return this.result();
|
|
1177
|
+
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
1178
|
+
return this.once();
|
|
1248
1179
|
}
|
|
1249
1180
|
else {
|
|
1250
|
-
|
|
1181
|
+
return this.sync();
|
|
1251
1182
|
}
|
|
1183
|
+
}, { atom: this });
|
|
1184
|
+
}
|
|
1185
|
+
destructor() {
|
|
1186
|
+
super.destructor();
|
|
1187
|
+
const prev = this.cache;
|
|
1188
|
+
if ($mol_owning_check(this, prev)) {
|
|
1189
|
+
prev.destructor();
|
|
1252
1190
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
this.
|
|
1191
|
+
if (this.pub_from === 0) {
|
|
1192
|
+
;
|
|
1193
|
+
(this.host ?? this.task)[this.field()] = null;
|
|
1256
1194
|
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
complete_pubs() {
|
|
1261
|
-
const limit = this.cursor < 0 ? this.sub_from : this.cursor;
|
|
1262
|
-
for (let cursor = this.pub_from; cursor < limit; cursor += 2) {
|
|
1263
|
-
const pub = this.data[cursor];
|
|
1264
|
-
pub?.complete();
|
|
1195
|
+
else {
|
|
1196
|
+
;
|
|
1197
|
+
(this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
|
|
1265
1198
|
}
|
|
1266
1199
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1200
|
+
put(next) {
|
|
1201
|
+
const prev = this.cache;
|
|
1202
|
+
update: if (next !== prev) {
|
|
1203
|
+
try {
|
|
1204
|
+
if ($mol_compare_deep(prev, next))
|
|
1205
|
+
break update;
|
|
1206
|
+
}
|
|
1207
|
+
catch (error) {
|
|
1208
|
+
$mol_fail_log(error);
|
|
1209
|
+
}
|
|
1210
|
+
if ($mol_owning_check(this, prev)) {
|
|
1211
|
+
prev.destructor();
|
|
1212
|
+
}
|
|
1213
|
+
if ($mol_owning_catch(this, next)) {
|
|
1214
|
+
try {
|
|
1215
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1216
|
+
}
|
|
1217
|
+
catch {
|
|
1218
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
if (!this.sub_empty)
|
|
1222
|
+
this.emit();
|
|
1223
|
+
}
|
|
1224
|
+
this.cache = next;
|
|
1225
|
+
this.cursor = $mol_wire_cursor.fresh;
|
|
1226
|
+
if (next instanceof Promise)
|
|
1227
|
+
return next;
|
|
1228
|
+
this.complete_pubs();
|
|
1229
|
+
return next;
|
|
1280
1230
|
}
|
|
1281
1231
|
}
|
|
1282
|
-
|
|
1232
|
+
__decorate([
|
|
1233
|
+
$mol_wire_method
|
|
1234
|
+
], $mol_wire_atom.prototype, "resync", null);
|
|
1235
|
+
__decorate([
|
|
1236
|
+
$mol_wire_method
|
|
1237
|
+
], $mol_wire_atom.prototype, "once", null);
|
|
1238
|
+
$.$mol_wire_atom = $mol_wire_atom;
|
|
1283
1239
|
})($ || ($ = {}));
|
|
1284
|
-
//mol/wire/
|
|
1240
|
+
//mol/wire/atom/atom.ts
|
|
1285
1241
|
;
|
|
1286
1242
|
"use strict";
|
|
1287
1243
|
var $;
|
|
1288
1244
|
(function ($) {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
this.task = task;
|
|
1297
|
-
this.id = setTimeout(task, delay);
|
|
1245
|
+
function $mol_wire_solo(host, field, descr) {
|
|
1246
|
+
if (!descr)
|
|
1247
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1248
|
+
const orig = descr?.value ?? host[field];
|
|
1249
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1250
|
+
if (typeof sup[field] === 'function') {
|
|
1251
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1298
1252
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1253
|
+
const descr2 = {
|
|
1254
|
+
...descr,
|
|
1255
|
+
value: function (...args) {
|
|
1256
|
+
let atom = $mol_wire_atom.solo(this, orig);
|
|
1257
|
+
if ((args.length === 0) || (args[0] === undefined)) {
|
|
1258
|
+
if (!$mol_wire_fiber.warm)
|
|
1259
|
+
return atom.result();
|
|
1260
|
+
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
1261
|
+
return atom.once();
|
|
1262
|
+
}
|
|
1263
|
+
else {
|
|
1264
|
+
return atom.sync();
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
return atom.resync(args);
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1271
|
+
Object.assign(descr2.value, { orig });
|
|
1272
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1273
|
+
return descr2;
|
|
1274
|
+
}
|
|
1275
|
+
$.$mol_wire_solo = $mol_wire_solo;
|
|
1276
|
+
})($ || ($ = {}));
|
|
1277
|
+
//mol/wire/solo/solo.ts
|
|
1278
|
+
;
|
|
1279
|
+
"use strict";
|
|
1280
|
+
var $;
|
|
1281
|
+
(function ($) {
|
|
1282
|
+
function $mol_wire_plex(host, field, descr) {
|
|
1283
|
+
if (!descr)
|
|
1284
|
+
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
1285
|
+
const orig = descr?.value ?? host[field];
|
|
1286
|
+
const sup = Reflect.getPrototypeOf(host);
|
|
1287
|
+
if (typeof sup[field] === 'function') {
|
|
1288
|
+
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
1301
1289
|
}
|
|
1290
|
+
const descr2 = {
|
|
1291
|
+
...descr,
|
|
1292
|
+
value: function (...args) {
|
|
1293
|
+
let atom = $mol_wire_atom.plex(this, orig, args[0]);
|
|
1294
|
+
if ((args.length === 1) || (args[1] === undefined)) {
|
|
1295
|
+
if (!$mol_wire_fiber.warm)
|
|
1296
|
+
return atom.result();
|
|
1297
|
+
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
1298
|
+
return atom.once();
|
|
1299
|
+
}
|
|
1300
|
+
else {
|
|
1301
|
+
return atom.sync();
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
return atom.resync(args);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
1308
|
+
Object.assign(descr2.value, { orig });
|
|
1309
|
+
Reflect.defineProperty(host, field, descr2);
|
|
1310
|
+
return descr2;
|
|
1302
1311
|
}
|
|
1303
|
-
$.$
|
|
1312
|
+
$.$mol_wire_plex = $mol_wire_plex;
|
|
1304
1313
|
})($ || ($ = {}));
|
|
1305
|
-
//mol/
|
|
1314
|
+
//mol/wire/plex/plex.ts
|
|
1306
1315
|
;
|
|
1307
1316
|
"use strict";
|
|
1308
1317
|
var $;
|
|
1309
1318
|
(function ($) {
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1319
|
+
$.$mol_mem = $mol_wire_solo;
|
|
1320
|
+
$.$mol_mem_key = $mol_wire_plex;
|
|
1321
|
+
})($ || ($ = {}));
|
|
1322
|
+
//mol/mem/mem.ts
|
|
1323
|
+
;
|
|
1324
|
+
"use strict";
|
|
1325
|
+
var $;
|
|
1326
|
+
(function ($) {
|
|
1327
|
+
})($ || ($ = {}));
|
|
1328
|
+
//mol/dom/context/context.ts
|
|
1329
|
+
;
|
|
1330
|
+
"use strict";
|
|
1331
|
+
//node/node.ts
|
|
1332
|
+
;
|
|
1333
|
+
"use strict";
|
|
1334
|
+
var $node = new Proxy({ require }, {
|
|
1335
|
+
get(target, name, wrapper) {
|
|
1336
|
+
if (target[name])
|
|
1337
|
+
return target[name];
|
|
1338
|
+
const mod = target.require('module');
|
|
1339
|
+
if (mod.builtinModules.indexOf(name) >= 0)
|
|
1340
|
+
return target.require(name);
|
|
1341
|
+
if (name[0] === '.')
|
|
1342
|
+
return target.require(name);
|
|
1343
|
+
const path = target.require('path');
|
|
1344
|
+
const fs = target.require('fs');
|
|
1345
|
+
let dir = path.resolve('.');
|
|
1346
|
+
const suffix = `./node_modules/${name}`;
|
|
1347
|
+
const $$ = $;
|
|
1348
|
+
while (!fs.existsSync(path.join(dir, suffix))) {
|
|
1349
|
+
const parent = path.resolve(dir, '..');
|
|
1350
|
+
if (parent === dir) {
|
|
1351
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
1352
|
+
try {
|
|
1353
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
1354
|
+
}
|
|
1355
|
+
catch { }
|
|
1356
|
+
break;
|
|
1357
|
+
}
|
|
1358
|
+
else {
|
|
1359
|
+
dir = parent;
|
|
1360
|
+
}
|
|
1315
1361
|
}
|
|
1362
|
+
return target.require(name);
|
|
1363
|
+
},
|
|
1364
|
+
set(target, name, value) {
|
|
1365
|
+
target[name] = value;
|
|
1366
|
+
return true;
|
|
1367
|
+
},
|
|
1368
|
+
});
|
|
1369
|
+
require = (req => Object.assign(function require(name) {
|
|
1370
|
+
return $node[name];
|
|
1371
|
+
}, req))(require);
|
|
1372
|
+
//node/node.node.ts
|
|
1373
|
+
;
|
|
1374
|
+
"use strict";
|
|
1375
|
+
var $;
|
|
1376
|
+
(function ($) {
|
|
1377
|
+
function $mol_log3_area_lazy(event) {
|
|
1378
|
+
const self = this;
|
|
1379
|
+
const stack = self.$mol_log3_stack;
|
|
1380
|
+
const deep = stack.length;
|
|
1381
|
+
let logged = false;
|
|
1382
|
+
stack.push(() => {
|
|
1383
|
+
logged = true;
|
|
1384
|
+
self.$mol_log3_area.call(self, event);
|
|
1385
|
+
});
|
|
1386
|
+
return () => {
|
|
1387
|
+
if (logged)
|
|
1388
|
+
self.console.groupEnd();
|
|
1389
|
+
if (stack.length > deep)
|
|
1390
|
+
stack.length = deep;
|
|
1391
|
+
};
|
|
1316
1392
|
}
|
|
1317
|
-
$.$
|
|
1393
|
+
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
1394
|
+
$.$mol_log3_stack = [];
|
|
1318
1395
|
})($ || ($ = {}));
|
|
1319
|
-
//mol/
|
|
1396
|
+
//mol/log3/log3.ts
|
|
1320
1397
|
;
|
|
1321
1398
|
"use strict";
|
|
1322
1399
|
var $;
|
|
1323
1400
|
(function ($) {
|
|
1324
|
-
|
|
1325
|
-
class $
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
this.
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1401
|
+
$.$mol_tree_convert = Symbol('$mol_tree_convert');
|
|
1402
|
+
class $mol_tree extends $mol_object2 {
|
|
1403
|
+
type;
|
|
1404
|
+
data;
|
|
1405
|
+
sub;
|
|
1406
|
+
baseUri;
|
|
1407
|
+
row;
|
|
1408
|
+
col;
|
|
1409
|
+
length;
|
|
1410
|
+
constructor(config = {}) {
|
|
1411
|
+
super();
|
|
1412
|
+
this.type = config.type || '';
|
|
1413
|
+
if (config.value !== undefined) {
|
|
1414
|
+
var sub = $mol_tree.values(config.value);
|
|
1415
|
+
if (config.type || sub.length > 1) {
|
|
1416
|
+
this.sub = [...sub, ...(config.sub || [])];
|
|
1417
|
+
this.data = config.data || '';
|
|
1341
1418
|
}
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
while (this.planning.size) {
|
|
1346
|
-
for (const fiber of this.planning) {
|
|
1347
|
-
this.planning.delete(fiber);
|
|
1348
|
-
if (fiber.cursor >= 0)
|
|
1349
|
-
continue;
|
|
1350
|
-
if (fiber.cursor === $mol_wire_cursor.final)
|
|
1351
|
-
continue;
|
|
1352
|
-
fiber.fresh();
|
|
1419
|
+
else {
|
|
1420
|
+
this.data = sub[0].data;
|
|
1421
|
+
this.sub = config.sub || [];
|
|
1353
1422
|
}
|
|
1354
1423
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
this.
|
|
1358
|
-
for (const fiber of fibers) {
|
|
1359
|
-
if (!fiber.sub_empty)
|
|
1360
|
-
continue;
|
|
1361
|
-
fiber.destructor();
|
|
1362
|
-
}
|
|
1424
|
+
else {
|
|
1425
|
+
this.data = config.data || '';
|
|
1426
|
+
this.sub = config.sub || [];
|
|
1363
1427
|
}
|
|
1428
|
+
this.baseUri = config.baseUri || '';
|
|
1429
|
+
this.row = config.row || 0;
|
|
1430
|
+
this.col = config.col || 0;
|
|
1431
|
+
this.length = config.length || 0;
|
|
1364
1432
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
if (this.cache instanceof Error)
|
|
1373
|
-
return;
|
|
1374
|
-
return this.cache;
|
|
1375
|
-
}
|
|
1376
|
-
field() {
|
|
1377
|
-
return this.task.name + '()';
|
|
1378
|
-
}
|
|
1379
|
-
constructor(id, task, host, args) {
|
|
1380
|
-
super();
|
|
1381
|
-
this.task = task;
|
|
1382
|
-
this.host = host;
|
|
1383
|
-
if (args)
|
|
1384
|
-
this.data.push(...args);
|
|
1385
|
-
this.pub_from = this.sub_from = args?.length ?? 0;
|
|
1386
|
-
this[Symbol.toStringTag] = id;
|
|
1387
|
-
}
|
|
1388
|
-
plan() {
|
|
1389
|
-
$mol_wire_fiber.planning.add(this);
|
|
1390
|
-
$mol_wire_fiber.plan();
|
|
1391
|
-
}
|
|
1392
|
-
reap() {
|
|
1393
|
-
$mol_wire_fiber.reaping.add(this);
|
|
1394
|
-
$mol_wire_fiber.plan();
|
|
1395
|
-
}
|
|
1396
|
-
toString() {
|
|
1397
|
-
return this[Symbol.toStringTag];
|
|
1433
|
+
static values(str, baseUri) {
|
|
1434
|
+
return str.split('\n').map((data, index) => new $mol_tree({
|
|
1435
|
+
data: data,
|
|
1436
|
+
baseUri: baseUri,
|
|
1437
|
+
row: index + 1,
|
|
1438
|
+
length: data.length,
|
|
1439
|
+
}));
|
|
1398
1440
|
}
|
|
1399
|
-
|
|
1400
|
-
return
|
|
1441
|
+
clone(config = {}) {
|
|
1442
|
+
return new $mol_tree({
|
|
1443
|
+
type: ('type' in config) ? config.type : this.type,
|
|
1444
|
+
data: ('data' in config) ? config.data : this.data,
|
|
1445
|
+
sub: ('sub' in config) ? config.sub : this.sub,
|
|
1446
|
+
baseUri: ('baseUri' in config) ? config.baseUri : this.baseUri,
|
|
1447
|
+
row: ('row' in config) ? config.row : this.row,
|
|
1448
|
+
col: ('col' in config) ? config.col : this.col,
|
|
1449
|
+
length: ('length' in config) ? config.length : this.length,
|
|
1450
|
+
value: config.value
|
|
1451
|
+
});
|
|
1401
1452
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1453
|
+
make(config) {
|
|
1454
|
+
return new $mol_tree({
|
|
1455
|
+
baseUri: this.baseUri,
|
|
1456
|
+
row: this.row,
|
|
1457
|
+
col: this.col,
|
|
1458
|
+
length: this.length,
|
|
1459
|
+
...config,
|
|
1460
|
+
});
|
|
1410
1461
|
}
|
|
1411
|
-
|
|
1412
|
-
return
|
|
1462
|
+
make_data(value, sub) {
|
|
1463
|
+
return this.make({ value, sub });
|
|
1413
1464
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
this.plan();
|
|
1417
|
-
else
|
|
1418
|
-
super.emit(quant);
|
|
1465
|
+
make_struct(type, sub) {
|
|
1466
|
+
return this.make({ type, sub });
|
|
1419
1467
|
}
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1468
|
+
static fromString(str, baseUri) {
|
|
1469
|
+
var root = new $mol_tree({ baseUri: baseUri });
|
|
1470
|
+
var stack = [root];
|
|
1471
|
+
var row = 0;
|
|
1472
|
+
var prefix = str.replace(/^\n?(\t*)[\s\S]*/, '$1');
|
|
1473
|
+
var lines = str.replace(new RegExp('^\\t{0,' + prefix.length + '}', 'mg'), '').split('\n');
|
|
1474
|
+
lines.forEach(line => {
|
|
1475
|
+
++row;
|
|
1476
|
+
var chunks = /^(\t*)((?:[^\n\t\\ ]+ *)*)(\\[^\n]*)?(.*?)(?:$|\n)/m.exec(line);
|
|
1477
|
+
if (!chunks || chunks[4])
|
|
1478
|
+
return this.$.$mol_fail(new Error(`Syntax error at ${baseUri}:${row}\n${line}`));
|
|
1479
|
+
var indent = chunks[1];
|
|
1480
|
+
var path = chunks[2];
|
|
1481
|
+
var data = chunks[3];
|
|
1482
|
+
var deep = indent.length;
|
|
1483
|
+
var types = path ? path.replace(/ $/, '').split(/ +/) : [];
|
|
1484
|
+
if (stack.length <= deep)
|
|
1485
|
+
return this.$.$mol_fail(new Error(`Too many tabs at ${baseUri}:${row}\n${line}`));
|
|
1486
|
+
stack.length = deep + 1;
|
|
1487
|
+
var parent = stack[deep];
|
|
1488
|
+
let col = deep;
|
|
1489
|
+
types.forEach(type => {
|
|
1490
|
+
if (!type)
|
|
1491
|
+
return this.$.$mol_fail(new Error(`Unexpected space symbol ${baseUri}:${row}\n${line}`));
|
|
1492
|
+
var next = new $mol_tree({ type, baseUri, row, col, length: type.length });
|
|
1493
|
+
const parent_sub = parent.sub;
|
|
1494
|
+
parent_sub.push(next);
|
|
1495
|
+
parent = next;
|
|
1496
|
+
col += type.length + 1;
|
|
1497
|
+
});
|
|
1498
|
+
if (data) {
|
|
1499
|
+
var next = new $mol_tree({ data: data.substring(1), baseUri, row, col, length: data.length });
|
|
1500
|
+
const parent_sub = parent.sub;
|
|
1501
|
+
parent_sub.push(next);
|
|
1502
|
+
parent = next;
|
|
1448
1503
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1504
|
+
stack.push(parent);
|
|
1505
|
+
});
|
|
1506
|
+
return root;
|
|
1507
|
+
}
|
|
1508
|
+
static fromJSON(json, baseUri = '') {
|
|
1509
|
+
switch (true) {
|
|
1510
|
+
case typeof json === 'boolean':
|
|
1511
|
+
case typeof json === 'number':
|
|
1512
|
+
case json === null:
|
|
1513
|
+
return new $mol_tree({
|
|
1514
|
+
type: String(json),
|
|
1515
|
+
baseUri: baseUri
|
|
1516
|
+
});
|
|
1517
|
+
case typeof json === 'string':
|
|
1518
|
+
return new $mol_tree({
|
|
1519
|
+
value: json,
|
|
1520
|
+
baseUri: baseUri
|
|
1457
1521
|
});
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1522
|
+
case Array.isArray(json):
|
|
1523
|
+
return new $mol_tree({
|
|
1524
|
+
type: "/",
|
|
1525
|
+
sub: json.map(json => $mol_tree.fromJSON(json, baseUri))
|
|
1526
|
+
});
|
|
1527
|
+
case json instanceof Date:
|
|
1528
|
+
return new $mol_tree({
|
|
1529
|
+
value: json.toISOString(),
|
|
1530
|
+
baseUri: baseUri
|
|
1531
|
+
});
|
|
1532
|
+
default:
|
|
1533
|
+
if (typeof json[$.$mol_tree_convert] === 'function') {
|
|
1534
|
+
return json[$.$mol_tree_convert]();
|
|
1535
|
+
}
|
|
1536
|
+
if (typeof json.toJSON === 'function') {
|
|
1537
|
+
return $mol_tree.fromJSON(json.toJSON());
|
|
1538
|
+
}
|
|
1539
|
+
if (json instanceof Error) {
|
|
1540
|
+
const { name, message, stack } = json;
|
|
1541
|
+
json = { ...json, name, message, stack };
|
|
1542
|
+
}
|
|
1543
|
+
var sub = [];
|
|
1544
|
+
for (var key in json) {
|
|
1545
|
+
if (json[key] === undefined)
|
|
1546
|
+
continue;
|
|
1547
|
+
const subsub = $mol_tree.fromJSON(json[key], baseUri);
|
|
1548
|
+
if (/^[^\n\t\\ ]+$/.test(key)) {
|
|
1549
|
+
var child = new $mol_tree({
|
|
1550
|
+
type: key,
|
|
1551
|
+
baseUri: baseUri,
|
|
1552
|
+
sub: [subsub],
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
else {
|
|
1556
|
+
var child = new $mol_tree({
|
|
1557
|
+
value: key,
|
|
1558
|
+
baseUri: baseUri,
|
|
1559
|
+
sub: [subsub],
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
sub.push(child);
|
|
1563
|
+
}
|
|
1564
|
+
return new $mol_tree({
|
|
1565
|
+
type: "*",
|
|
1566
|
+
sub: sub,
|
|
1567
|
+
baseUri: baseUri
|
|
1474
1568
|
});
|
|
1475
|
-
handled.add(result);
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
if (!(result instanceof Promise)) {
|
|
1479
|
-
this.track_cut();
|
|
1480
1569
|
}
|
|
1481
|
-
this.track_off(bu);
|
|
1482
|
-
this.put(result);
|
|
1483
|
-
}
|
|
1484
|
-
refresh() {
|
|
1485
|
-
this.cursor = $mol_wire_cursor.stale;
|
|
1486
|
-
this.fresh();
|
|
1487
1570
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
return this.result();
|
|
1491
|
-
}
|
|
1492
|
-
this.promote();
|
|
1493
|
-
this.fresh();
|
|
1494
|
-
if (this.cache instanceof Error) {
|
|
1495
|
-
return $mol_fail_hidden(this.cache);
|
|
1496
|
-
}
|
|
1497
|
-
if (this.cache instanceof Promise) {
|
|
1498
|
-
return $mol_fail_hidden(this.cache);
|
|
1499
|
-
}
|
|
1500
|
-
return this.cache;
|
|
1571
|
+
get uri() {
|
|
1572
|
+
return this.baseUri + '#' + this.row + ':' + this.col;
|
|
1501
1573
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
1574
|
+
toString(prefix = '') {
|
|
1575
|
+
var output = '';
|
|
1576
|
+
if (this.type.length) {
|
|
1577
|
+
if (!prefix.length) {
|
|
1578
|
+
prefix = "\t";
|
|
1507
1579
|
}
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
if (this.cursor === $mol_wire_cursor.final) {
|
|
1512
|
-
await new Promise(() => { });
|
|
1580
|
+
output += this.type;
|
|
1581
|
+
if (this.sub.length == 1) {
|
|
1582
|
+
return output + ' ' + this.sub[0].toString(prefix);
|
|
1513
1583
|
}
|
|
1584
|
+
output += "\n";
|
|
1514
1585
|
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
1518
|
-
})($ || ($ = {}));
|
|
1519
|
-
//mol/wire/fiber/fiber.ts
|
|
1520
|
-
;
|
|
1521
|
-
"use strict";
|
|
1522
|
-
var $;
|
|
1523
|
-
(function ($) {
|
|
1524
|
-
const named = new WeakSet();
|
|
1525
|
-
function $mol_func_name(func) {
|
|
1526
|
-
let name = func.name;
|
|
1527
|
-
if (name?.length > 1)
|
|
1528
|
-
return name;
|
|
1529
|
-
if (named.has(func))
|
|
1530
|
-
return name;
|
|
1531
|
-
for (let key in this) {
|
|
1532
|
-
try {
|
|
1533
|
-
if (this[key] !== func)
|
|
1534
|
-
continue;
|
|
1535
|
-
name = key;
|
|
1536
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
1537
|
-
break;
|
|
1586
|
+
else if (this.data.length || prefix.length) {
|
|
1587
|
+
output += "\\" + this.data + "\n";
|
|
1538
1588
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
$.$mol_func_name = $mol_func_name;
|
|
1545
|
-
function $mol_func_name_from(target, source) {
|
|
1546
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
1547
|
-
return target;
|
|
1548
|
-
}
|
|
1549
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
1550
|
-
})($ || ($ = {}));
|
|
1551
|
-
//mol/func/name/name.ts
|
|
1552
|
-
;
|
|
1553
|
-
"use strict";
|
|
1554
|
-
var $;
|
|
1555
|
-
(function ($) {
|
|
1556
|
-
function $mol_guid(length = 8, exists = () => false) {
|
|
1557
|
-
for (;;) {
|
|
1558
|
-
let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
|
|
1559
|
-
if (exists(id))
|
|
1560
|
-
continue;
|
|
1561
|
-
return id;
|
|
1589
|
+
for (var child of this.sub) {
|
|
1590
|
+
output += prefix;
|
|
1591
|
+
output += child.toString(prefix + "\t");
|
|
1592
|
+
}
|
|
1593
|
+
return output;
|
|
1562
1594
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
;
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
(
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
})($ || ($ = {}));
|
|
1603
|
-
//mol/key/key.ts
|
|
1604
|
-
;
|
|
1605
|
-
"use strict";
|
|
1606
|
-
var $;
|
|
1607
|
-
(function ($) {
|
|
1608
|
-
$.$mol_compare_deep_cache = new WeakMap();
|
|
1609
|
-
function $mol_compare_deep(left, right) {
|
|
1610
|
-
if (Object.is(left, right))
|
|
1611
|
-
return true;
|
|
1612
|
-
if (left === null)
|
|
1613
|
-
return false;
|
|
1614
|
-
if (right === null)
|
|
1615
|
-
return false;
|
|
1616
|
-
if (typeof left !== 'object')
|
|
1617
|
-
return false;
|
|
1618
|
-
if (typeof right !== 'object')
|
|
1619
|
-
return false;
|
|
1620
|
-
const left_proto = Reflect.getPrototypeOf(left);
|
|
1621
|
-
const right_proto = Reflect.getPrototypeOf(right);
|
|
1622
|
-
if (left_proto !== right_proto)
|
|
1623
|
-
return false;
|
|
1624
|
-
if (left instanceof Boolean)
|
|
1625
|
-
return Object.is(left.valueOf(), right['valueOf']());
|
|
1626
|
-
if (left instanceof Number)
|
|
1627
|
-
return Object.is(left.valueOf(), right['valueOf']());
|
|
1628
|
-
if (left instanceof String)
|
|
1629
|
-
return Object.is(left.valueOf(), right['valueOf']());
|
|
1630
|
-
if (left instanceof Date)
|
|
1631
|
-
return Object.is(left.valueOf(), right['valueOf']());
|
|
1632
|
-
if (left instanceof RegExp)
|
|
1633
|
-
return left.source === right['source'] && left.flags === right['flags'];
|
|
1634
|
-
if (left instanceof Error)
|
|
1635
|
-
return left.message === right['message'] && left.stack === right['stack'];
|
|
1636
|
-
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
1637
|
-
if (left_cache) {
|
|
1638
|
-
const right_cache = left_cache.get(right);
|
|
1639
|
-
if (typeof right_cache === 'boolean')
|
|
1640
|
-
return right_cache;
|
|
1595
|
+
toJSON() {
|
|
1596
|
+
if (!this.type)
|
|
1597
|
+
return this.value;
|
|
1598
|
+
if (this.type === 'true')
|
|
1599
|
+
return true;
|
|
1600
|
+
if (this.type === 'false')
|
|
1601
|
+
return false;
|
|
1602
|
+
if (this.type === 'null')
|
|
1603
|
+
return null;
|
|
1604
|
+
if (this.type === '*') {
|
|
1605
|
+
var obj = {};
|
|
1606
|
+
for (var child of this.sub) {
|
|
1607
|
+
if (child.type === '-')
|
|
1608
|
+
continue;
|
|
1609
|
+
var key = child.type || child.clone({ sub: child.sub.slice(0, child.sub.length - 1) }).value;
|
|
1610
|
+
var val = child.sub[child.sub.length - 1].toJSON();
|
|
1611
|
+
if (val !== undefined)
|
|
1612
|
+
obj[key] = val;
|
|
1613
|
+
}
|
|
1614
|
+
return obj;
|
|
1615
|
+
}
|
|
1616
|
+
if (this.type === '/') {
|
|
1617
|
+
var res = [];
|
|
1618
|
+
this.sub.forEach(child => {
|
|
1619
|
+
if (child.type === '-')
|
|
1620
|
+
return;
|
|
1621
|
+
var val = child.toJSON();
|
|
1622
|
+
if (val !== undefined)
|
|
1623
|
+
res.push(val);
|
|
1624
|
+
});
|
|
1625
|
+
return res;
|
|
1626
|
+
}
|
|
1627
|
+
if (this.type === 'time') {
|
|
1628
|
+
return new Date(this.value);
|
|
1629
|
+
}
|
|
1630
|
+
const numb = Number(this.type);
|
|
1631
|
+
if (!Number.isNaN(numb) || this.type === 'NaN')
|
|
1632
|
+
return numb;
|
|
1633
|
+
throw new Error(`Unknown type (${this.type}) at ${this.uri}`);
|
|
1641
1634
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1635
|
+
get value() {
|
|
1636
|
+
var values = [];
|
|
1637
|
+
for (var child of this.sub) {
|
|
1638
|
+
if (child.type)
|
|
1639
|
+
continue;
|
|
1640
|
+
values.push(child.value);
|
|
1641
|
+
}
|
|
1642
|
+
return this.data + values.join("\n");
|
|
1645
1643
|
}
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1644
|
+
insert(value, ...path) {
|
|
1645
|
+
if (path.length === 0)
|
|
1646
|
+
return value;
|
|
1647
|
+
const type = path[0];
|
|
1648
|
+
if (typeof type === 'string') {
|
|
1649
|
+
let replaced = false;
|
|
1650
|
+
const sub = this.sub.map((item, index) => {
|
|
1651
|
+
if (item.type !== type)
|
|
1652
|
+
return item;
|
|
1653
|
+
replaced = true;
|
|
1654
|
+
return item.insert(value, ...path.slice(1));
|
|
1655
|
+
});
|
|
1656
|
+
if (!replaced)
|
|
1657
|
+
sub.push(new $mol_tree({ type }).insert(value, ...path.slice(1)));
|
|
1658
|
+
return this.clone({ sub });
|
|
1659
|
+
}
|
|
1660
|
+
else if (typeof type === 'number') {
|
|
1661
|
+
const sub = this.sub.slice();
|
|
1662
|
+
sub[type] = (sub[type] || new $mol_tree).insert(value, ...path.slice(1));
|
|
1663
|
+
return this.clone({ sub });
|
|
1664
|
+
}
|
|
1665
|
+
else {
|
|
1666
|
+
return this.clone({ sub: ((this.sub.length === 0) ? [new $mol_tree()] : this.sub).map(item => item.insert(value, ...path.slice(1))) });
|
|
1667
|
+
}
|
|
1662
1668
|
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1669
|
+
select(...path) {
|
|
1670
|
+
var next = [this];
|
|
1671
|
+
for (var type of path) {
|
|
1672
|
+
if (!next.length)
|
|
1673
|
+
break;
|
|
1674
|
+
var prev = next;
|
|
1675
|
+
next = [];
|
|
1676
|
+
for (var item of prev) {
|
|
1677
|
+
switch (typeof (type)) {
|
|
1678
|
+
case 'string':
|
|
1679
|
+
for (var child of item.sub) {
|
|
1680
|
+
if (!type || (child.type == type)) {
|
|
1681
|
+
next.push(child);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
break;
|
|
1685
|
+
case 'number':
|
|
1686
|
+
if (type < item.sub.length)
|
|
1687
|
+
next.push(item.sub[type]);
|
|
1688
|
+
break;
|
|
1689
|
+
default: next.push(...item.sub);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
return new $mol_tree({ sub: next });
|
|
1665
1694
|
}
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1695
|
+
filter(path, value) {
|
|
1696
|
+
var sub = this.sub.filter(function (item) {
|
|
1697
|
+
var found = item.select(...path);
|
|
1698
|
+
if (value == null) {
|
|
1699
|
+
return Boolean(found.sub.length);
|
|
1700
|
+
}
|
|
1701
|
+
else {
|
|
1702
|
+
return found.sub.some(child => child.value == value);
|
|
1703
|
+
}
|
|
1704
|
+
});
|
|
1705
|
+
return new $mol_tree({ sub: sub });
|
|
1676
1706
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
const len = left.byteLength;
|
|
1681
|
-
if (len !== right.byteLength)
|
|
1682
|
-
return false;
|
|
1683
|
-
for (let i = 0; i < len; ++i) {
|
|
1684
|
-
if (left[i] !== right[i])
|
|
1685
|
-
return false;
|
|
1707
|
+
transform(visit, stack = []) {
|
|
1708
|
+
const sub_stack = [this, ...stack];
|
|
1709
|
+
return visit(sub_stack, () => this.sub.map(node => node.transform(visit, sub_stack)).filter(n => n));
|
|
1686
1710
|
}
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
if (left_next.done)
|
|
1696
|
-
break;
|
|
1697
|
-
if (!$mol_compare_deep(left_next.value, right_next.value))
|
|
1698
|
-
return false;
|
|
1711
|
+
hack(context) {
|
|
1712
|
+
const sub = [].concat(...this.sub.map(child => {
|
|
1713
|
+
const handle = context[child.type] || context[''];
|
|
1714
|
+
if (!handle)
|
|
1715
|
+
$mol_fail(child.error('Handler not defined'));
|
|
1716
|
+
return handle(child, context);
|
|
1717
|
+
}));
|
|
1718
|
+
return this.clone({ sub });
|
|
1699
1719
|
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
function compare_set(left, right) {
|
|
1703
|
-
if (left.size !== right.size)
|
|
1704
|
-
return false;
|
|
1705
|
-
return compare_iterator(left.values(), right.values());
|
|
1706
|
-
}
|
|
1707
|
-
function compare_map(left, right) {
|
|
1708
|
-
if (left.size !== right.size)
|
|
1709
|
-
return false;
|
|
1710
|
-
return compare_iterator(left.keys(), right.keys())
|
|
1711
|
-
&& compare_iterator(left.values(), right.values());
|
|
1712
|
-
}
|
|
1713
|
-
function compare_pojo(left, right) {
|
|
1714
|
-
const left_keys = Object.getOwnPropertyNames(left);
|
|
1715
|
-
const right_keys = Object.getOwnPropertyNames(right);
|
|
1716
|
-
if (left_keys.length !== right_keys.length)
|
|
1717
|
-
return false;
|
|
1718
|
-
for (let key of left_keys) {
|
|
1719
|
-
if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
|
|
1720
|
-
return false;
|
|
1720
|
+
error(message) {
|
|
1721
|
+
return new Error(`${message}:\n${this} ${this.baseUri}:${this.row}:${this.col}`);
|
|
1721
1722
|
}
|
|
1722
|
-
return true;
|
|
1723
|
-
}
|
|
1724
|
-
function compare_primitive(left, right) {
|
|
1725
|
-
return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
|
|
1726
1723
|
}
|
|
1724
|
+
$.$mol_tree = $mol_tree;
|
|
1727
1725
|
})($ || ($ = {}));
|
|
1728
|
-
//mol/
|
|
1726
|
+
//mol/tree/tree.ts
|
|
1729
1727
|
;
|
|
1730
1728
|
"use strict";
|
|
1731
1729
|
var $;
|
|
1732
1730
|
(function ($) {
|
|
1733
|
-
class $
|
|
1734
|
-
static
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
this.emit();
|
|
1771
|
-
return next;
|
|
1731
|
+
class $mol_term_color {
|
|
1732
|
+
static reset = this.ansi(0, 0);
|
|
1733
|
+
static bold = this.ansi(1, 22);
|
|
1734
|
+
static italic = this.ansi(3, 23);
|
|
1735
|
+
static underline = this.ansi(4, 24);
|
|
1736
|
+
static inverse = this.ansi(7, 27);
|
|
1737
|
+
static hidden = this.ansi(8, 28);
|
|
1738
|
+
static strike = this.ansi(9, 29);
|
|
1739
|
+
static gray = this.ansi(90, 39);
|
|
1740
|
+
static red = this.ansi(91, 39);
|
|
1741
|
+
static green = this.ansi(92, 39);
|
|
1742
|
+
static yellow = this.ansi(93, 39);
|
|
1743
|
+
static blue = this.ansi(94, 39);
|
|
1744
|
+
static magenta = this.ansi(95, 39);
|
|
1745
|
+
static cyan = this.ansi(96, 39);
|
|
1746
|
+
static Gray = (str) => this.inverse(this.gray(str));
|
|
1747
|
+
static Red = (str) => this.inverse(this.red(str));
|
|
1748
|
+
static Green = (str) => this.inverse(this.green(str));
|
|
1749
|
+
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
1750
|
+
static Blue = (str) => this.inverse(this.blue(str));
|
|
1751
|
+
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
1752
|
+
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
1753
|
+
static ansi(open, close) {
|
|
1754
|
+
if (typeof process === 'undefined')
|
|
1755
|
+
return String;
|
|
1756
|
+
if (!process.stdout.isTTY)
|
|
1757
|
+
return String;
|
|
1758
|
+
const prefix = `\x1b[${open}m`;
|
|
1759
|
+
const postfix = `\x1b[${close}m`;
|
|
1760
|
+
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
1761
|
+
return function colorer(str) {
|
|
1762
|
+
str = String(str);
|
|
1763
|
+
if (str === '')
|
|
1764
|
+
return str;
|
|
1765
|
+
const suffix = str.replace(suffix_regexp, prefix);
|
|
1766
|
+
return prefix + suffix + postfix;
|
|
1767
|
+
};
|
|
1772
1768
|
}
|
|
1773
1769
|
}
|
|
1774
|
-
$.$
|
|
1770
|
+
$.$mol_term_color = $mol_term_color;
|
|
1775
1771
|
})($ || ($ = {}));
|
|
1776
|
-
//mol/
|
|
1772
|
+
//mol/term/color/color.ts
|
|
1777
1773
|
;
|
|
1778
1774
|
"use strict";
|
|
1779
1775
|
var $;
|
|
1780
1776
|
(function ($) {
|
|
1781
|
-
function $
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
const value = function (...args) {
|
|
1791
|
-
const fiber = temp(this ?? null, args);
|
|
1792
|
-
return fiber.sync();
|
|
1777
|
+
function $mol_log3_node_make(level, output, type, color) {
|
|
1778
|
+
return function $mol_log3_logger(event) {
|
|
1779
|
+
if (!event.time)
|
|
1780
|
+
event = { time: new Date().toISOString(), ...event };
|
|
1781
|
+
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
1782
|
+
let str = color(tree.toString());
|
|
1783
|
+
this.console[level](str);
|
|
1784
|
+
const self = this;
|
|
1785
|
+
return () => self.console.groupEnd();
|
|
1793
1786
|
};
|
|
1794
|
-
Object.defineProperty(value, 'name', { value: orig.name + ' ' });
|
|
1795
|
-
Object.assign(value, { orig });
|
|
1796
|
-
const descr2 = { ...descr, value };
|
|
1797
|
-
Reflect.defineProperty(host, field, descr2);
|
|
1798
|
-
return descr2;
|
|
1799
1787
|
}
|
|
1800
|
-
$.$
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
;
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
;
|
|
1807
|
-
"use strict";
|
|
1808
|
-
//mol/type/foot/foot.ts
|
|
1809
|
-
;
|
|
1810
|
-
"use strict";
|
|
1811
|
-
var $;
|
|
1812
|
-
(function ($) {
|
|
1813
|
-
const catched = new WeakMap();
|
|
1814
|
-
function $mol_fail_catch(error) {
|
|
1815
|
-
if (typeof error !== 'object')
|
|
1816
|
-
return false;
|
|
1817
|
-
if (error instanceof Promise)
|
|
1818
|
-
$mol_fail_hidden(error);
|
|
1819
|
-
if (catched.get(error))
|
|
1820
|
-
return false;
|
|
1821
|
-
catched.set(error, true);
|
|
1822
|
-
return true;
|
|
1823
|
-
}
|
|
1824
|
-
$.$mol_fail_catch = $mol_fail_catch;
|
|
1788
|
+
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
1789
|
+
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
1790
|
+
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
1791
|
+
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
1792
|
+
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
1793
|
+
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
1794
|
+
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
1825
1795
|
})($ || ($ = {}));
|
|
1826
|
-
//mol/
|
|
1796
|
+
//mol/log3/log3.node.ts
|
|
1827
1797
|
;
|
|
1828
1798
|
"use strict";
|
|
1829
1799
|
var $;
|
|
1830
1800
|
(function ($) {
|
|
1831
|
-
function $
|
|
1832
|
-
|
|
1833
|
-
return false;
|
|
1834
|
-
if (!$mol_fail_catch(error))
|
|
1835
|
-
return false;
|
|
1836
|
-
console.error(error);
|
|
1837
|
-
return true;
|
|
1801
|
+
function $mol_env() {
|
|
1802
|
+
return {};
|
|
1838
1803
|
}
|
|
1839
|
-
$.$
|
|
1804
|
+
$.$mol_env = $mol_env;
|
|
1840
1805
|
})($ || ($ = {}));
|
|
1841
|
-
//mol/
|
|
1806
|
+
//mol/env/env.ts
|
|
1842
1807
|
;
|
|
1843
1808
|
"use strict";
|
|
1844
1809
|
var $;
|
|
1845
1810
|
(function ($) {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1850
|
-
if (existen)
|
|
1851
|
-
return existen;
|
|
1852
|
-
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1853
|
-
const key = `${prefix}.${field}`;
|
|
1854
|
-
const fiber = new $mol_wire_atom(key, task, host, []);
|
|
1855
|
-
(host ?? task)[field] = fiber;
|
|
1856
|
-
return fiber;
|
|
1857
|
-
}
|
|
1858
|
-
static plex(host, task, key) {
|
|
1859
|
-
const field = task.name + '()';
|
|
1860
|
-
let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
|
|
1861
|
-
const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
|
|
1862
|
-
const id = `${prefix}.${task.name}(${$mol_key(key)})`;
|
|
1863
|
-
if (dict) {
|
|
1864
|
-
const existen = dict.get(id);
|
|
1865
|
-
if (existen)
|
|
1866
|
-
return existen;
|
|
1867
|
-
}
|
|
1868
|
-
else {
|
|
1869
|
-
dict = (host ?? task)[field] = new Map();
|
|
1870
|
-
}
|
|
1871
|
-
const fiber = new $mol_wire_atom(id, task, host, [key]);
|
|
1872
|
-
dict.set(id, fiber);
|
|
1873
|
-
return fiber;
|
|
1874
|
-
}
|
|
1875
|
-
static watching = new Set();
|
|
1876
|
-
static watcher = null;
|
|
1877
|
-
static watch() {
|
|
1878
|
-
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1879
|
-
for (const atom of $mol_wire_atom.watching) {
|
|
1880
|
-
if (atom.cursor === $mol_wire_cursor.final) {
|
|
1881
|
-
$mol_wire_atom.watching.delete(atom);
|
|
1882
|
-
}
|
|
1883
|
-
else {
|
|
1884
|
-
atom.cursor = $mol_wire_cursor.stale;
|
|
1885
|
-
atom.fresh();
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
watch() {
|
|
1890
|
-
if (!$mol_wire_atom.watcher) {
|
|
1891
|
-
$mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
|
|
1892
|
-
}
|
|
1893
|
-
$mol_wire_atom.watching.add(this);
|
|
1894
|
-
}
|
|
1895
|
-
resync(args) {
|
|
1896
|
-
return this.put(this.task.call(this.host, ...args));
|
|
1897
|
-
}
|
|
1898
|
-
once() {
|
|
1899
|
-
return this.sync();
|
|
1900
|
-
}
|
|
1901
|
-
channel() {
|
|
1902
|
-
return Object.assign((next) => {
|
|
1903
|
-
if (next !== undefined)
|
|
1904
|
-
return this.resync([...this.args, next]);
|
|
1905
|
-
if (!$mol_wire_fiber.warm)
|
|
1906
|
-
return this.result();
|
|
1907
|
-
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
1908
|
-
return this.once();
|
|
1909
|
-
}
|
|
1910
|
-
else {
|
|
1911
|
-
return this.sync();
|
|
1912
|
-
}
|
|
1913
|
-
}, { atom: this });
|
|
1914
|
-
}
|
|
1915
|
-
destructor() {
|
|
1916
|
-
super.destructor();
|
|
1917
|
-
const prev = this.cache;
|
|
1918
|
-
if ($mol_owning_check(this, prev)) {
|
|
1919
|
-
prev.destructor();
|
|
1920
|
-
}
|
|
1921
|
-
if (this.pub_from === 0) {
|
|
1922
|
-
;
|
|
1923
|
-
(this.host ?? this.task)[this.field()] = null;
|
|
1924
|
-
}
|
|
1925
|
-
else {
|
|
1926
|
-
;
|
|
1927
|
-
(this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
put(next) {
|
|
1931
|
-
const prev = this.cache;
|
|
1932
|
-
update: if (next !== prev) {
|
|
1933
|
-
try {
|
|
1934
|
-
if ($mol_compare_deep(prev, next))
|
|
1935
|
-
break update;
|
|
1936
|
-
}
|
|
1937
|
-
catch (error) {
|
|
1938
|
-
$mol_fail_log(error);
|
|
1939
|
-
}
|
|
1940
|
-
if ($mol_owning_check(this, prev)) {
|
|
1941
|
-
prev.destructor();
|
|
1942
|
-
}
|
|
1943
|
-
if ($mol_owning_catch(this, next)) {
|
|
1944
|
-
try {
|
|
1945
|
-
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1946
|
-
}
|
|
1947
|
-
catch {
|
|
1948
|
-
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
if (!this.sub_empty)
|
|
1952
|
-
this.emit();
|
|
1953
|
-
}
|
|
1954
|
-
this.cache = next;
|
|
1955
|
-
this.cursor = $mol_wire_cursor.fresh;
|
|
1956
|
-
if (next instanceof Promise)
|
|
1957
|
-
return next;
|
|
1958
|
-
this.complete_pubs();
|
|
1959
|
-
return next;
|
|
1960
|
-
}
|
|
1961
|
-
}
|
|
1962
|
-
__decorate([
|
|
1963
|
-
$mol_wire_method
|
|
1964
|
-
], $mol_wire_atom.prototype, "resync", null);
|
|
1965
|
-
__decorate([
|
|
1966
|
-
$mol_wire_method
|
|
1967
|
-
], $mol_wire_atom.prototype, "once", null);
|
|
1968
|
-
$.$mol_wire_atom = $mol_wire_atom;
|
|
1811
|
+
$.$mol_env = function $mol_env() {
|
|
1812
|
+
return this.process.env;
|
|
1813
|
+
};
|
|
1969
1814
|
})($ || ($ = {}));
|
|
1970
|
-
//mol/
|
|
1815
|
+
//mol/env/env.node.ts
|
|
1971
1816
|
;
|
|
1972
1817
|
"use strict";
|
|
1973
1818
|
var $;
|
|
1974
1819
|
(function ($) {
|
|
1975
|
-
function $
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
return atom.sync();
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
return atom.resync(args);
|
|
1998
|
-
}
|
|
1999
|
-
};
|
|
2000
|
-
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
2001
|
-
Object.assign(descr2.value, { orig });
|
|
2002
|
-
Reflect.defineProperty(host, field, descr2);
|
|
2003
|
-
return descr2;
|
|
1820
|
+
function $mol_exec(dir, command, ...args) {
|
|
1821
|
+
let [app, ...args0] = command.split(' ');
|
|
1822
|
+
args = [...args0, ...args];
|
|
1823
|
+
this.$mol_log3_come({
|
|
1824
|
+
place: '$mol_exec',
|
|
1825
|
+
dir: $node.path.relative('', dir),
|
|
1826
|
+
message: 'Run',
|
|
1827
|
+
command: `${app} ${args.join(' ')}`,
|
|
1828
|
+
});
|
|
1829
|
+
var res = $node['child_process'].spawnSync(app, args, {
|
|
1830
|
+
cwd: $node.path.resolve(dir),
|
|
1831
|
+
shell: true,
|
|
1832
|
+
env: this.$mol_env(),
|
|
1833
|
+
});
|
|
1834
|
+
if (res.status || res.error)
|
|
1835
|
+
return $mol_fail(res.error || new Error(res.stderr.toString()));
|
|
1836
|
+
if (!res.stdout)
|
|
1837
|
+
res.stdout = Buffer.from([]);
|
|
1838
|
+
return res;
|
|
2004
1839
|
}
|
|
2005
|
-
$.$
|
|
1840
|
+
$.$mol_exec = $mol_exec;
|
|
2006
1841
|
})($ || ($ = {}));
|
|
2007
|
-
//mol/
|
|
1842
|
+
//mol/exec/exec.node.ts
|
|
2008
1843
|
;
|
|
2009
1844
|
"use strict";
|
|
2010
1845
|
var $;
|
|
2011
1846
|
(function ($) {
|
|
2012
|
-
|
|
2013
|
-
if (!descr)
|
|
2014
|
-
descr = Reflect.getOwnPropertyDescriptor(host, field);
|
|
2015
|
-
const orig = descr?.value ?? host[field];
|
|
2016
|
-
const sup = Reflect.getPrototypeOf(host);
|
|
2017
|
-
if (typeof sup[field] === 'function') {
|
|
2018
|
-
Object.defineProperty(orig, 'name', { value: sup[field].name });
|
|
2019
|
-
}
|
|
2020
|
-
const descr2 = {
|
|
2021
|
-
...descr,
|
|
2022
|
-
value: function (...args) {
|
|
2023
|
-
let atom = $mol_wire_atom.plex(this, orig, args[0]);
|
|
2024
|
-
if ((args.length === 1) || (args[1] === undefined)) {
|
|
2025
|
-
if (!$mol_wire_fiber.warm)
|
|
2026
|
-
return atom.result();
|
|
2027
|
-
if ($mol_wire_auto() instanceof $mol_wire_task) {
|
|
2028
|
-
return atom.once();
|
|
2029
|
-
}
|
|
2030
|
-
else {
|
|
2031
|
-
return atom.sync();
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
return atom.resync(args);
|
|
2035
|
-
}
|
|
2036
|
-
};
|
|
2037
|
-
Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
|
|
2038
|
-
Object.assign(descr2.value, { orig });
|
|
2039
|
-
Reflect.defineProperty(host, field, descr2);
|
|
2040
|
-
return descr2;
|
|
2041
|
-
}
|
|
2042
|
-
$.$mol_wire_plex = $mol_wire_plex;
|
|
1847
|
+
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
|
|
2043
1848
|
})($ || ($ = {}));
|
|
2044
|
-
//mol/
|
|
1849
|
+
//mol/dom/context/context.node.ts
|
|
2045
1850
|
;
|
|
2046
1851
|
"use strict";
|
|
2047
1852
|
var $;
|
|
2048
1853
|
(function ($) {
|
|
2049
|
-
|
|
2050
|
-
|
|
1854
|
+
class $mol_after_tick extends $mol_object2 {
|
|
1855
|
+
task;
|
|
1856
|
+
promise;
|
|
1857
|
+
cancelled = false;
|
|
1858
|
+
constructor(task) {
|
|
1859
|
+
super();
|
|
1860
|
+
this.task = task;
|
|
1861
|
+
this.promise = Promise.resolve().then(() => {
|
|
1862
|
+
if (this.cancelled)
|
|
1863
|
+
return;
|
|
1864
|
+
task();
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
destructor() {
|
|
1868
|
+
this.cancelled = true;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
$.$mol_after_tick = $mol_after_tick;
|
|
2051
1872
|
})($ || ($ = {}));
|
|
2052
|
-
//mol/
|
|
1873
|
+
//mol/after/tick/tick.ts
|
|
2053
1874
|
;
|
|
2054
1875
|
"use strict";
|
|
2055
1876
|
var $;
|
|
@@ -2290,92 +2111,264 @@ var $;
|
|
|
2290
2111
|
}
|
|
2291
2112
|
}
|
|
2292
2113
|
}
|
|
2293
|
-
$.$mol_dom_render_styles = $mol_dom_render_styles;
|
|
2114
|
+
$.$mol_dom_render_styles = $mol_dom_render_styles;
|
|
2115
|
+
})($ || ($ = {}));
|
|
2116
|
+
//mol/dom/render/styles/styles.ts
|
|
2117
|
+
;
|
|
2118
|
+
"use strict";
|
|
2119
|
+
var $;
|
|
2120
|
+
(function ($) {
|
|
2121
|
+
function $mol_dom_render_children(el, childNodes) {
|
|
2122
|
+
const node_set = new Set(childNodes);
|
|
2123
|
+
let nextNode = el.firstChild;
|
|
2124
|
+
for (let view of childNodes) {
|
|
2125
|
+
if (view == null)
|
|
2126
|
+
continue;
|
|
2127
|
+
if (view instanceof $mol_dom_context.Node) {
|
|
2128
|
+
while (true) {
|
|
2129
|
+
if (!nextNode) {
|
|
2130
|
+
el.appendChild(view);
|
|
2131
|
+
break;
|
|
2132
|
+
}
|
|
2133
|
+
if (nextNode == view) {
|
|
2134
|
+
nextNode = nextNode.nextSibling;
|
|
2135
|
+
break;
|
|
2136
|
+
}
|
|
2137
|
+
else {
|
|
2138
|
+
if (node_set.has(nextNode)) {
|
|
2139
|
+
el.insertBefore(view, nextNode);
|
|
2140
|
+
break;
|
|
2141
|
+
}
|
|
2142
|
+
else {
|
|
2143
|
+
const nn = nextNode.nextSibling;
|
|
2144
|
+
el.removeChild(nextNode);
|
|
2145
|
+
nextNode = nn;
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
else {
|
|
2151
|
+
if (nextNode && nextNode.nodeName === '#text') {
|
|
2152
|
+
const str = String(view);
|
|
2153
|
+
if (nextNode.nodeValue !== str)
|
|
2154
|
+
nextNode.nodeValue = str;
|
|
2155
|
+
nextNode = nextNode.nextSibling;
|
|
2156
|
+
}
|
|
2157
|
+
else {
|
|
2158
|
+
const textNode = $mol_dom_context.document.createTextNode(String(view));
|
|
2159
|
+
el.insertBefore(textNode, nextNode);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
while (nextNode) {
|
|
2164
|
+
const currNode = nextNode;
|
|
2165
|
+
nextNode = currNode.nextSibling;
|
|
2166
|
+
el.removeChild(currNode);
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
$.$mol_dom_render_children = $mol_dom_render_children;
|
|
2170
|
+
})($ || ($ = {}));
|
|
2171
|
+
//mol/dom/render/children/children.ts
|
|
2172
|
+
;
|
|
2173
|
+
"use strict";
|
|
2174
|
+
var $;
|
|
2175
|
+
(function ($) {
|
|
2176
|
+
function $mol_dom_render_fields(el, fields) {
|
|
2177
|
+
for (let key in fields) {
|
|
2178
|
+
const val = fields[key];
|
|
2179
|
+
if (val === undefined)
|
|
2180
|
+
continue;
|
|
2181
|
+
el[key] = val;
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
$.$mol_dom_render_fields = $mol_dom_render_fields;
|
|
2185
|
+
})($ || ($ = {}));
|
|
2186
|
+
//mol/dom/render/fields/fields.ts
|
|
2187
|
+
;
|
|
2188
|
+
"use strict";
|
|
2189
|
+
//mol/type/keys/extract/extract.ts
|
|
2190
|
+
;
|
|
2191
|
+
"use strict";
|
|
2192
|
+
//mol/type/pick/pick.ts
|
|
2193
|
+
;
|
|
2194
|
+
"use strict";
|
|
2195
|
+
var $;
|
|
2196
|
+
(function ($) {
|
|
2197
|
+
let all = [];
|
|
2198
|
+
let el = null;
|
|
2199
|
+
let timer = null;
|
|
2200
|
+
function $mol_style_attach(id, text) {
|
|
2201
|
+
all.push(`/* ${id} */\n\n${text}`);
|
|
2202
|
+
if (timer)
|
|
2203
|
+
return el;
|
|
2204
|
+
const doc = $mol_dom_context.document;
|
|
2205
|
+
if (!doc)
|
|
2206
|
+
return null;
|
|
2207
|
+
el = doc.createElement('style');
|
|
2208
|
+
el.id = `$mol_style_attach`;
|
|
2209
|
+
doc.head.appendChild(el);
|
|
2210
|
+
timer = new $mol_after_tick(() => {
|
|
2211
|
+
el.innerHTML = '\n' + all.join('\n\n');
|
|
2212
|
+
all = [];
|
|
2213
|
+
el = null;
|
|
2214
|
+
timer = null;
|
|
2215
|
+
});
|
|
2216
|
+
return el;
|
|
2217
|
+
}
|
|
2218
|
+
$.$mol_style_attach = $mol_style_attach;
|
|
2219
|
+
})($ || ($ = {}));
|
|
2220
|
+
//mol/style/attach/attach.ts
|
|
2221
|
+
;
|
|
2222
|
+
"use strict";
|
|
2223
|
+
var $;
|
|
2224
|
+
(function ($) {
|
|
2225
|
+
class $mol_decor {
|
|
2226
|
+
value;
|
|
2227
|
+
constructor(value) {
|
|
2228
|
+
this.value = value;
|
|
2229
|
+
}
|
|
2230
|
+
prefix() { return ''; }
|
|
2231
|
+
valueOf() { return this.value; }
|
|
2232
|
+
postfix() { return ''; }
|
|
2233
|
+
toString() {
|
|
2234
|
+
return `${this.prefix()}${this.valueOf()}${this.postfix()}`;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
$.$mol_decor = $mol_decor;
|
|
2238
|
+
})($ || ($ = {}));
|
|
2239
|
+
//mol/decor/decor.ts
|
|
2240
|
+
;
|
|
2241
|
+
"use strict";
|
|
2242
|
+
var $;
|
|
2243
|
+
(function ($) {
|
|
2244
|
+
class $mol_style_unit extends $mol_decor {
|
|
2245
|
+
literal;
|
|
2246
|
+
constructor(value, literal) {
|
|
2247
|
+
super(value);
|
|
2248
|
+
this.literal = literal;
|
|
2249
|
+
}
|
|
2250
|
+
postfix() {
|
|
2251
|
+
return this.literal;
|
|
2252
|
+
}
|
|
2253
|
+
static per(value) { return new $mol_style_unit(value, '%'); }
|
|
2254
|
+
static px(value) { return new $mol_style_unit(value, 'px'); }
|
|
2255
|
+
static mm(value) { return new $mol_style_unit(value, 'mm'); }
|
|
2256
|
+
static cm(value) { return new $mol_style_unit(value, 'cm'); }
|
|
2257
|
+
static Q(value) { return new $mol_style_unit(value, 'Q'); }
|
|
2258
|
+
static in(value) { return new $mol_style_unit(value, 'in'); }
|
|
2259
|
+
static pc(value) { return new $mol_style_unit(value, 'pc'); }
|
|
2260
|
+
static pt(value) { return new $mol_style_unit(value, 'pt'); }
|
|
2261
|
+
static cap(value) { return new $mol_style_unit(value, 'cap'); }
|
|
2262
|
+
static ch(value) { return new $mol_style_unit(value, 'ch'); }
|
|
2263
|
+
static em(value) { return new $mol_style_unit(value, 'em'); }
|
|
2264
|
+
static rem(value) { return new $mol_style_unit(value, 'rem'); }
|
|
2265
|
+
static ex(value) { return new $mol_style_unit(value, 'ex'); }
|
|
2266
|
+
static ic(value) { return new $mol_style_unit(value, 'ic'); }
|
|
2267
|
+
static lh(value) { return new $mol_style_unit(value, 'lh'); }
|
|
2268
|
+
static rlh(value) { return new $mol_style_unit(value, 'rlh'); }
|
|
2269
|
+
static vh(value) { return new $mol_style_unit(value, 'vh'); }
|
|
2270
|
+
static vw(value) { return new $mol_style_unit(value, 'vw'); }
|
|
2271
|
+
static vi(value) { return new $mol_style_unit(value, 'vi'); }
|
|
2272
|
+
static vb(value) { return new $mol_style_unit(value, 'vb'); }
|
|
2273
|
+
static vmin(value) { return new $mol_style_unit(value, 'vmin'); }
|
|
2274
|
+
static vmax(value) { return new $mol_style_unit(value, 'vmax'); }
|
|
2275
|
+
static deg(value) { return new $mol_style_unit(value, 'deg'); }
|
|
2276
|
+
static rad(value) { return new $mol_style_unit(value, 'rad'); }
|
|
2277
|
+
static grad(value) { return new $mol_style_unit(value, 'grad'); }
|
|
2278
|
+
static turn(value) { return new $mol_style_unit(value, 'turn'); }
|
|
2279
|
+
static s(value) { return new $mol_style_unit(value, 's'); }
|
|
2280
|
+
static ms(value) { return new $mol_style_unit(value, 'ms'); }
|
|
2281
|
+
}
|
|
2282
|
+
$.$mol_style_unit = $mol_style_unit;
|
|
2283
|
+
})($ || ($ = {}));
|
|
2284
|
+
//mol/style/unit/unit.ts
|
|
2285
|
+
;
|
|
2286
|
+
"use strict";
|
|
2287
|
+
var $;
|
|
2288
|
+
(function ($) {
|
|
2289
|
+
const { per } = $mol_style_unit;
|
|
2290
|
+
class $mol_style_func extends $mol_decor {
|
|
2291
|
+
name;
|
|
2292
|
+
constructor(name, value) {
|
|
2293
|
+
super(value);
|
|
2294
|
+
this.name = name;
|
|
2295
|
+
}
|
|
2296
|
+
prefix() { return this.name + '('; }
|
|
2297
|
+
postfix() { return ')'; }
|
|
2298
|
+
static calc(value) {
|
|
2299
|
+
return new $mol_style_func('calc', value);
|
|
2300
|
+
}
|
|
2301
|
+
static vary(name) {
|
|
2302
|
+
return new $mol_style_func('var', name);
|
|
2303
|
+
}
|
|
2304
|
+
static url(href) {
|
|
2305
|
+
return new $mol_style_func('url', JSON.stringify(href));
|
|
2306
|
+
}
|
|
2307
|
+
static hsla(hue, saturation, lightness, alpha) {
|
|
2308
|
+
return new $mol_style_func('hsla', [hue, per(saturation), per(lightness), alpha]);
|
|
2309
|
+
}
|
|
2310
|
+
static clamp(min, mid, max) {
|
|
2311
|
+
return new $mol_style_func('clamp', [min, mid, max]);
|
|
2312
|
+
}
|
|
2313
|
+
static rgba(red, green, blue, alpha) {
|
|
2314
|
+
return new $mol_style_func('rgba', [red, green, blue, alpha]);
|
|
2315
|
+
}
|
|
2316
|
+
static scale(zoom) {
|
|
2317
|
+
return new $mol_style_func('scale', [zoom]);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
$.$mol_style_func = $mol_style_func;
|
|
2294
2321
|
})($ || ($ = {}));
|
|
2295
|
-
//mol/
|
|
2322
|
+
//mol/style/func/func.ts
|
|
2296
2323
|
;
|
|
2297
2324
|
"use strict";
|
|
2298
2325
|
var $;
|
|
2299
2326
|
(function ($) {
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
}
|
|
2316
|
-
else {
|
|
2317
|
-
if (node_set.has(nextNode)) {
|
|
2318
|
-
el.insertBefore(view, nextNode);
|
|
2319
|
-
break;
|
|
2320
|
-
}
|
|
2321
|
-
else {
|
|
2322
|
-
const nn = nextNode.nextSibling;
|
|
2323
|
-
el.removeChild(nextNode);
|
|
2324
|
-
nextNode = nn;
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
else {
|
|
2330
|
-
if (nextNode && nextNode.nodeName === '#text') {
|
|
2331
|
-
const str = String(view);
|
|
2332
|
-
if (nextNode.nodeValue !== str)
|
|
2333
|
-
nextNode.nodeValue = str;
|
|
2334
|
-
nextNode = nextNode.nextSibling;
|
|
2335
|
-
}
|
|
2336
|
-
else {
|
|
2337
|
-
const textNode = $mol_dom_context.document.createTextNode(String(view));
|
|
2338
|
-
el.insertBefore(textNode, nextNode);
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
while (nextNode) {
|
|
2343
|
-
const currNode = nextNode;
|
|
2344
|
-
nextNode = currNode.nextSibling;
|
|
2345
|
-
el.removeChild(currNode);
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
$.$mol_dom_render_children = $mol_dom_render_children;
|
|
2327
|
+
const { vary } = $mol_style_func;
|
|
2328
|
+
$.$mol_theme = {
|
|
2329
|
+
back: vary('--mol_theme_back'),
|
|
2330
|
+
hover: vary('--mol_theme_hover'),
|
|
2331
|
+
card: vary('--mol_theme_card'),
|
|
2332
|
+
current: vary('--mol_theme_current'),
|
|
2333
|
+
special: vary('--mol_theme_special'),
|
|
2334
|
+
text: vary('--mol_theme_text'),
|
|
2335
|
+
control: vary('--mol_theme_control'),
|
|
2336
|
+
shade: vary('--mol_theme_shade'),
|
|
2337
|
+
line: vary('--mol_theme_line'),
|
|
2338
|
+
focus: vary('--mol_theme_focus'),
|
|
2339
|
+
field: vary('--mol_theme_field'),
|
|
2340
|
+
image: vary('--mol_theme_image'),
|
|
2341
|
+
};
|
|
2349
2342
|
})($ || ($ = {}));
|
|
2350
|
-
//mol/
|
|
2343
|
+
//mol/theme/theme.ts
|
|
2351
2344
|
;
|
|
2352
2345
|
"use strict";
|
|
2353
2346
|
var $;
|
|
2354
2347
|
(function ($) {
|
|
2355
|
-
|
|
2356
|
-
for (let key in fields) {
|
|
2357
|
-
const val = fields[key];
|
|
2358
|
-
if (val === undefined)
|
|
2359
|
-
continue;
|
|
2360
|
-
el[key] = val;
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
$.$mol_dom_render_fields = $mol_dom_render_fields;
|
|
2348
|
+
$mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 210deg;\n\t--mol_theme_luma: -1;\n\t--mol_theme_satur: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme] {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n}\n:where([mol_theme]) {\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme] {\n\t--mol_theme_back: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 20% ), calc( 55% + 45% * var(--mol_theme_luma) ) );\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, calc( 40% - 40% * var(--mol_theme_luma) ) );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 54% + 46% * var(--mol_theme_luma) ), .25 );\n\t\n\t--mol_theme_card: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .2 );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 50%, 1 );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, calc( 55% - 10% * var(--mol_theme_luma) ) );\n\t\n}\n\n[mol_theme=\"$mol_theme_light\"] {\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme=\"$mol_theme_dark\"] {\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n}\n\n[mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 50%, 40% );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 60%, 30% );\n\t--mol_theme_current: hsl( var(--mol_theme_hue), 100%, 20% );\n}\n\n[mol_theme=\"$mol_theme_current\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% + 30% * var(--mol_theme_luma) ) );\n}\n\n[mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_card: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n}\n\n[mol_theme=\"$mol_theme_accent\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) + 180deg ), 90%, 50% );\n\t--mol_theme_hover: hsl( calc( var(--mol_theme_hue) + 180deg ), 80%, 35% );\n}\n\n[mol_theme=\"$mol_theme_accent\"] [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: black;\n}\n");
|
|
2364
2349
|
})($ || ($ = {}));
|
|
2365
|
-
//mol/
|
|
2366
|
-
;
|
|
2367
|
-
"use strict";
|
|
2368
|
-
//mol/type/keys/extract/extract.ts
|
|
2350
|
+
//mol/theme/-css/theme.css.ts
|
|
2369
2351
|
;
|
|
2370
2352
|
"use strict";
|
|
2371
|
-
|
|
2353
|
+
var $;
|
|
2354
|
+
(function ($) {
|
|
2355
|
+
const { vary } = $mol_style_func;
|
|
2356
|
+
$.$mol_gap = {
|
|
2357
|
+
block: vary('--mol_gap_block'),
|
|
2358
|
+
text: vary('--mol_gap_text'),
|
|
2359
|
+
round: vary('--mol_gap_round'),
|
|
2360
|
+
space: vary('--mol_gap_space'),
|
|
2361
|
+
blur: vary('--mol_gap_blur'),
|
|
2362
|
+
};
|
|
2363
|
+
})($ || ($ = {}));
|
|
2364
|
+
//mol/gap/gap.ts
|
|
2372
2365
|
;
|
|
2373
2366
|
"use strict";
|
|
2374
2367
|
var $;
|
|
2375
2368
|
(function ($) {
|
|
2376
|
-
$mol_style_attach("mol/
|
|
2369
|
+
$mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
|
|
2377
2370
|
})($ || ($ = {}));
|
|
2378
|
-
//mol/
|
|
2371
|
+
//mol/gap/-css/gap.css.ts
|
|
2379
2372
|
;
|
|
2380
2373
|
"use strict";
|
|
2381
2374
|
var $;
|
|
@@ -2774,6 +2767,43 @@ var $;
|
|
|
2774
2767
|
;
|
|
2775
2768
|
"use strict";
|
|
2776
2769
|
var $;
|
|
2770
|
+
(function ($) {
|
|
2771
|
+
$mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n}\n\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n justify-content: center;\n}\n\n@keyframes mol_view_wait_move {\n\tfrom {\n\t\tbackground-position: 0 0;\n\t}\n\tto {\n\t\tbackground-position: 200vmax 0;\n\t}\n}\n\n@keyframes mol_view_wait_show {\n\tto {\n\t\tbackground-image: repeating-linear-gradient(\n\t\t\t45deg,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 0% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 5% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 45% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 50% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 55% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 95% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 100%\n\t\t);\n\t\tbackground-size: 200vmax 200vmax;\n\t}\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait_show .5s .5s linear forwards , mol_view_wait_move 1s linear infinite;\n\topacity: .75;\n}\n");
|
|
2772
|
+
})($ || ($ = {}));
|
|
2773
|
+
//mol/view/view/-css/view.css.ts
|
|
2774
|
+
;
|
|
2775
|
+
"use strict";
|
|
2776
|
+
var $;
|
|
2777
|
+
(function ($) {
|
|
2778
|
+
class $mol_plugin extends $mol_view {
|
|
2779
|
+
dom_node(next) {
|
|
2780
|
+
const node = next || $mol_owning_get(this).host.dom_node();
|
|
2781
|
+
$mol_dom_render_attributes(node, this.attr_static());
|
|
2782
|
+
const events = $mol_wire_async(this.event());
|
|
2783
|
+
for (let event_name in events) {
|
|
2784
|
+
node.addEventListener(event_name, events[event_name], { passive: false });
|
|
2785
|
+
}
|
|
2786
|
+
return node;
|
|
2787
|
+
}
|
|
2788
|
+
attr_static() {
|
|
2789
|
+
return {};
|
|
2790
|
+
}
|
|
2791
|
+
event() {
|
|
2792
|
+
return {};
|
|
2793
|
+
}
|
|
2794
|
+
render() {
|
|
2795
|
+
this.dom_node_actual();
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
__decorate([
|
|
2799
|
+
$mol_mem
|
|
2800
|
+
], $mol_plugin.prototype, "dom_node", null);
|
|
2801
|
+
$.$mol_plugin = $mol_plugin;
|
|
2802
|
+
})($ || ($ = {}));
|
|
2803
|
+
//mol/plugin/plugin.ts
|
|
2804
|
+
;
|
|
2805
|
+
"use strict";
|
|
2806
|
+
var $;
|
|
2777
2807
|
(function ($) {
|
|
2778
2808
|
class $mol_svg extends $mol_view {
|
|
2779
2809
|
dom_name() {
|
|
@@ -2825,36 +2855,6 @@ var $;
|
|
|
2825
2855
|
;
|
|
2826
2856
|
"use strict";
|
|
2827
2857
|
var $;
|
|
2828
|
-
(function ($) {
|
|
2829
|
-
class $mol_plugin extends $mol_view {
|
|
2830
|
-
dom_node(next) {
|
|
2831
|
-
const node = next || $mol_owning_get(this).host.dom_node();
|
|
2832
|
-
$mol_dom_render_attributes(node, this.attr_static());
|
|
2833
|
-
const events = $mol_wire_async(this.event());
|
|
2834
|
-
for (let event_name in events) {
|
|
2835
|
-
node.addEventListener(event_name, events[event_name], { passive: false });
|
|
2836
|
-
}
|
|
2837
|
-
return node;
|
|
2838
|
-
}
|
|
2839
|
-
attr_static() {
|
|
2840
|
-
return {};
|
|
2841
|
-
}
|
|
2842
|
-
event() {
|
|
2843
|
-
return {};
|
|
2844
|
-
}
|
|
2845
|
-
render() {
|
|
2846
|
-
this.dom_node_actual();
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
__decorate([
|
|
2850
|
-
$mol_mem
|
|
2851
|
-
], $mol_plugin.prototype, "dom_node", null);
|
|
2852
|
-
$.$mol_plugin = $mol_plugin;
|
|
2853
|
-
})($ || ($ = {}));
|
|
2854
|
-
//mol/plugin/plugin.ts
|
|
2855
|
-
;
|
|
2856
|
-
"use strict";
|
|
2857
|
-
var $;
|
|
2858
2858
|
(function ($) {
|
|
2859
2859
|
var $$;
|
|
2860
2860
|
(function ($$) {
|
|
@@ -3268,13 +3268,6 @@ var $;
|
|
|
3268
3268
|
;
|
|
3269
3269
|
"use strict";
|
|
3270
3270
|
var $;
|
|
3271
|
-
(function ($) {
|
|
3272
|
-
$mol_style_attach("mol/plot/graph/graph.view.css", "[mol_plot_graph] {\n\tstroke: currentColor;\n}\n\n[mol_plot_graph_sample] {\n\tborder-width: 0;\n\tborder-style: solid;\n}\n\n[mol_plot_graph_type=\"dashed\"] {\n\tstroke-dasharray: 4 4;\n\tborder-style: dashed;\n}\n");
|
|
3273
|
-
})($ || ($ = {}));
|
|
3274
|
-
//mol/plot/graph/-css/graph.view.css.ts
|
|
3275
|
-
;
|
|
3276
|
-
"use strict";
|
|
3277
|
-
var $;
|
|
3278
3271
|
(function ($) {
|
|
3279
3272
|
var $$;
|
|
3280
3273
|
(function ($$) {
|
|
@@ -3348,6 +3341,13 @@ var $;
|
|
|
3348
3341
|
;
|
|
3349
3342
|
"use strict";
|
|
3350
3343
|
var $;
|
|
3344
|
+
(function ($) {
|
|
3345
|
+
$mol_style_attach("mol/plot/graph/graph.view.css", "[mol_plot_graph] {\n\tstroke: currentColor;\n}\n\n[mol_plot_graph_sample] {\n\tborder-width: 0;\n\tborder-style: solid;\n}\n\n[mol_plot_graph_type=\"dashed\"] {\n\tstroke-dasharray: 4 4;\n\tborder-style: dashed;\n}\n");
|
|
3346
|
+
})($ || ($ = {}));
|
|
3347
|
+
//mol/plot/graph/-css/graph.view.css.ts
|
|
3348
|
+
;
|
|
3349
|
+
"use strict";
|
|
3350
|
+
var $;
|
|
3351
3351
|
(function ($) {
|
|
3352
3352
|
class $mol_touch extends $mol_plugin {
|
|
3353
3353
|
start_zoom(val) {
|
|
@@ -4177,13 +4177,6 @@ var $;
|
|
|
4177
4177
|
;
|
|
4178
4178
|
"use strict";
|
|
4179
4179
|
var $;
|
|
4180
|
-
(function ($) {
|
|
4181
|
-
$mol_style_attach("mol/plot/pane/pane.view.css", "[mol_plot_pane] {\n\tcolor: var(--mol_theme_control);\n\tflex: 1 1 auto;\n\talign-self: stretch;\n\tstroke-width: 2px;\n\tuser-select: none;\n}\n");
|
|
4182
|
-
})($ || ($ = {}));
|
|
4183
|
-
//mol/plot/pane/-css/pane.view.css.ts
|
|
4184
|
-
;
|
|
4185
|
-
"use strict";
|
|
4186
|
-
var $;
|
|
4187
4180
|
(function ($) {
|
|
4188
4181
|
var $$;
|
|
4189
4182
|
(function ($$) {
|
|
@@ -4386,6 +4379,13 @@ var $;
|
|
|
4386
4379
|
;
|
|
4387
4380
|
"use strict";
|
|
4388
4381
|
var $;
|
|
4382
|
+
(function ($) {
|
|
4383
|
+
$mol_style_attach("mol/plot/pane/pane.view.css", "[mol_plot_pane] {\n\tcolor: var(--mol_theme_control);\n\tflex: 1 1 auto;\n\talign-self: stretch;\n\tstroke-width: 2px;\n\tuser-select: none;\n}\n");
|
|
4384
|
+
})($ || ($ = {}));
|
|
4385
|
+
//mol/plot/pane/-css/pane.view.css.ts
|
|
4386
|
+
;
|
|
4387
|
+
"use strict";
|
|
4388
|
+
var $;
|
|
4389
4389
|
(function ($) {
|
|
4390
4390
|
class $mol_plot_line extends $mol_plot_graph {
|
|
4391
4391
|
threshold() {
|
|
@@ -4430,13 +4430,6 @@ var $;
|
|
|
4430
4430
|
;
|
|
4431
4431
|
"use strict";
|
|
4432
4432
|
var $;
|
|
4433
|
-
(function ($) {
|
|
4434
|
-
$mol_style_attach("mol/plot/line/line.view.css", "[mol_plot_line] {\n\tfill: none;\n\tstroke-linejoin: round;\n}\n\n[mol_plot_line_sample] {\n\theight: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tborder-width: 2px 0 0;\n\tposition: absolute;\n\ttop: .75em;\n\ttransform: translateY(-50%);\n}\n");
|
|
4435
|
-
})($ || ($ = {}));
|
|
4436
|
-
//mol/plot/line/-css/line.view.css.ts
|
|
4437
|
-
;
|
|
4438
|
-
"use strict";
|
|
4439
|
-
var $;
|
|
4440
4433
|
(function ($) {
|
|
4441
4434
|
var $$;
|
|
4442
4435
|
(function ($$) {
|
|
@@ -4496,6 +4489,13 @@ var $;
|
|
|
4496
4489
|
;
|
|
4497
4490
|
"use strict";
|
|
4498
4491
|
var $;
|
|
4492
|
+
(function ($) {
|
|
4493
|
+
$mol_style_attach("mol/plot/line/line.view.css", "[mol_plot_line] {\n\tfill: none;\n\tstroke-linejoin: round;\n}\n\n[mol_plot_line_sample] {\n\theight: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tborder-width: 2px 0 0;\n\tposition: absolute;\n\ttop: .75em;\n\ttransform: translateY(-50%);\n}\n");
|
|
4494
|
+
})($ || ($ = {}));
|
|
4495
|
+
//mol/plot/line/-css/line.view.css.ts
|
|
4496
|
+
;
|
|
4497
|
+
"use strict";
|
|
4498
|
+
var $;
|
|
4499
4499
|
(function ($) {
|
|
4500
4500
|
class $mol_plot_group extends $mol_plot_graph {
|
|
4501
4501
|
sub() {
|
|
@@ -4679,13 +4679,6 @@ var $;
|
|
|
4679
4679
|
;
|
|
4680
4680
|
"use strict";
|
|
4681
4681
|
var $;
|
|
4682
|
-
(function ($) {
|
|
4683
|
-
$mol_style_attach("mol/plot/dot/dot.view.css", "[mol_plot_dot] {\n\tstroke-linecap: round;\n\tfill: none;\n}\n\n[mol_plot_dot_sample] {\n\twidth: .5rem;\n\theight: .5rem;\n\tborder-radius: 1rem;\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop: .75em;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n");
|
|
4684
|
-
})($ || ($ = {}));
|
|
4685
|
-
//mol/plot/dot/-css/dot.view.css.ts
|
|
4686
|
-
;
|
|
4687
|
-
"use strict";
|
|
4688
|
-
var $;
|
|
4689
4682
|
(function ($) {
|
|
4690
4683
|
var $$;
|
|
4691
4684
|
(function ($$) {
|
|
@@ -4771,6 +4764,13 @@ var $;
|
|
|
4771
4764
|
;
|
|
4772
4765
|
"use strict";
|
|
4773
4766
|
var $;
|
|
4767
|
+
(function ($) {
|
|
4768
|
+
$mol_style_attach("mol/plot/dot/dot.view.css", "[mol_plot_dot] {\n\tstroke-linecap: round;\n\tfill: none;\n}\n\n[mol_plot_dot_sample] {\n\twidth: .5rem;\n\theight: .5rem;\n\tborder-radius: 1rem;\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop: .75em;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n");
|
|
4769
|
+
})($ || ($ = {}));
|
|
4770
|
+
//mol/plot/dot/-css/dot.view.css.ts
|
|
4771
|
+
;
|
|
4772
|
+
"use strict";
|
|
4773
|
+
var $;
|
|
4774
4774
|
(function ($) {
|
|
4775
4775
|
class $mol_plot_map_heat extends $mol_plot_group {
|
|
4776
4776
|
series_z() {
|
|
@@ -4836,13 +4836,6 @@ var $;
|
|
|
4836
4836
|
;
|
|
4837
4837
|
"use strict";
|
|
4838
4838
|
var $;
|
|
4839
|
-
(function ($) {
|
|
4840
|
-
$mol_style_attach("mol/plot/map/heat/heat.view.css", "[mol_plot_map_heat_level_curve] {\n\tstroke-linecap: square;\n\tfill: none;\n}\n");
|
|
4841
|
-
})($ || ($ = {}));
|
|
4842
|
-
//mol/plot/map/heat/-css/heat.view.css.ts
|
|
4843
|
-
;
|
|
4844
|
-
"use strict";
|
|
4845
|
-
var $;
|
|
4846
4839
|
(function ($) {
|
|
4847
4840
|
var $$;
|
|
4848
4841
|
(function ($$) {
|
|
@@ -4906,6 +4899,13 @@ var $;
|
|
|
4906
4899
|
;
|
|
4907
4900
|
"use strict";
|
|
4908
4901
|
var $;
|
|
4902
|
+
(function ($) {
|
|
4903
|
+
$mol_style_attach("mol/plot/map/heat/heat.view.css", "[mol_plot_map_heat_level_curve] {\n\tstroke-linecap: square;\n\tfill: none;\n}\n");
|
|
4904
|
+
})($ || ($ = {}));
|
|
4905
|
+
//mol/plot/map/heat/-css/heat.view.css.ts
|
|
4906
|
+
;
|
|
4907
|
+
"use strict";
|
|
4908
|
+
var $;
|
|
4909
4909
|
(function ($) {
|
|
4910
4910
|
class $mol_plot_bar extends $mol_plot_graph {
|
|
4911
4911
|
style() {
|
|
@@ -4943,16 +4943,9 @@ var $;
|
|
|
4943
4943
|
__decorate([
|
|
4944
4944
|
$mol_mem
|
|
4945
4945
|
], $mol_plot_bar.prototype, "Curve", null);
|
|
4946
|
-
$.$mol_plot_bar = $mol_plot_bar;
|
|
4947
|
-
})($ || ($ = {}));
|
|
4948
|
-
//mol/plot/bar/-view.tree/bar.view.tree.ts
|
|
4949
|
-
;
|
|
4950
|
-
"use strict";
|
|
4951
|
-
var $;
|
|
4952
|
-
(function ($) {
|
|
4953
|
-
$mol_style_attach("mol/plot/bar/bar.view.css", "[mol_plot_bar] {\n\tstroke-linecap: butt;\n\tstroke-width: 1rem;\n}\n\n[mol_plot_bar_sample] {\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop:0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n}\n");
|
|
4946
|
+
$.$mol_plot_bar = $mol_plot_bar;
|
|
4954
4947
|
})($ || ($ = {}));
|
|
4955
|
-
//mol/plot/bar/-
|
|
4948
|
+
//mol/plot/bar/-view.tree/bar.view.tree.ts
|
|
4956
4949
|
;
|
|
4957
4950
|
"use strict";
|
|
4958
4951
|
var $;
|
|
@@ -5038,6 +5031,13 @@ var $;
|
|
|
5038
5031
|
;
|
|
5039
5032
|
"use strict";
|
|
5040
5033
|
var $;
|
|
5034
|
+
(function ($) {
|
|
5035
|
+
$mol_style_attach("mol/plot/bar/bar.view.css", "[mol_plot_bar] {\n\tstroke-linecap: butt;\n\tstroke-width: 1rem;\n}\n\n[mol_plot_bar_sample] {\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop:0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n}\n");
|
|
5036
|
+
})($ || ($ = {}));
|
|
5037
|
+
//mol/plot/bar/-css/bar.view.css.ts
|
|
5038
|
+
;
|
|
5039
|
+
"use strict";
|
|
5040
|
+
var $;
|
|
5041
5041
|
(function ($) {
|
|
5042
5042
|
class $mol_plot_fill extends $mol_plot_line {
|
|
5043
5043
|
threshold() {
|
|
@@ -5050,13 +5050,6 @@ var $;
|
|
|
5050
5050
|
;
|
|
5051
5051
|
"use strict";
|
|
5052
5052
|
var $;
|
|
5053
|
-
(function ($) {
|
|
5054
|
-
$mol_style_attach("mol/plot/fill/fill.view.css", "[mol_plot_fill] {\n\tstroke: none;\n\tstroke-width: 0;\n\topacity: .1;\n\tfill: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_fill_sample] {\n\topacity: .1;\n\tbackground: currentColor;\n\tposition: absolute;\n\tbottom: 0;\n\ttop: .75em;\n\tleft: 0;\n\tright: 0;\n}\n");
|
|
5055
|
-
})($ || ($ = {}));
|
|
5056
|
-
//mol/plot/fill/-css/fill.view.css.ts
|
|
5057
|
-
;
|
|
5058
|
-
"use strict";
|
|
5059
|
-
var $;
|
|
5060
5053
|
(function ($) {
|
|
5061
5054
|
var $$;
|
|
5062
5055
|
(function ($$) {
|
|
@@ -5083,6 +5076,13 @@ var $;
|
|
|
5083
5076
|
;
|
|
5084
5077
|
"use strict";
|
|
5085
5078
|
var $;
|
|
5079
|
+
(function ($) {
|
|
5080
|
+
$mol_style_attach("mol/plot/fill/fill.view.css", "[mol_plot_fill] {\n\tstroke: none;\n\tstroke-width: 0;\n\topacity: .1;\n\tfill: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_fill_sample] {\n\topacity: .1;\n\tbackground: currentColor;\n\tposition: absolute;\n\tbottom: 0;\n\ttop: .75em;\n\tleft: 0;\n\tright: 0;\n}\n");
|
|
5081
|
+
})($ || ($ = {}));
|
|
5082
|
+
//mol/plot/fill/-css/fill.view.css.ts
|
|
5083
|
+
;
|
|
5084
|
+
"use strict";
|
|
5085
|
+
var $;
|
|
5086
5086
|
(function ($) {
|
|
5087
5087
|
class $mol_svg_text extends $mol_svg {
|
|
5088
5088
|
dom_name() {
|
|
@@ -5123,13 +5123,6 @@ var $;
|
|
|
5123
5123
|
;
|
|
5124
5124
|
"use strict";
|
|
5125
5125
|
var $;
|
|
5126
|
-
(function ($) {
|
|
5127
|
-
$mol_style_attach("mol/svg/text/text.view.css", "[mol_svg_text] {\n\tfill: currentColor;\n\tstroke: none;\n}\n");
|
|
5128
|
-
})($ || ($ = {}));
|
|
5129
|
-
//mol/svg/text/-css/text.view.css.ts
|
|
5130
|
-
;
|
|
5131
|
-
"use strict";
|
|
5132
|
-
var $;
|
|
5133
5126
|
(function ($) {
|
|
5134
5127
|
var $$;
|
|
5135
5128
|
(function ($$) {
|
|
@@ -5148,6 +5141,13 @@ var $;
|
|
|
5148
5141
|
;
|
|
5149
5142
|
"use strict";
|
|
5150
5143
|
var $;
|
|
5144
|
+
(function ($) {
|
|
5145
|
+
$mol_style_attach("mol/svg/text/text.view.css", "[mol_svg_text] {\n\tfill: currentColor;\n\tstroke: none;\n}\n");
|
|
5146
|
+
})($ || ($ = {}));
|
|
5147
|
+
//mol/svg/text/-css/text.view.css.ts
|
|
5148
|
+
;
|
|
5149
|
+
"use strict";
|
|
5150
|
+
var $;
|
|
5151
5151
|
(function ($) {
|
|
5152
5152
|
class $mol_svg_rect extends $mol_svg {
|
|
5153
5153
|
dom_name() {
|
|
@@ -5300,13 +5300,6 @@ var $;
|
|
|
5300
5300
|
;
|
|
5301
5301
|
"use strict";
|
|
5302
5302
|
var $;
|
|
5303
|
-
(function ($) {
|
|
5304
|
-
$mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
|
|
5305
|
-
})($ || ($ = {}));
|
|
5306
|
-
//mol/svg/text/box/-css/box.view.css.ts
|
|
5307
|
-
;
|
|
5308
|
-
"use strict";
|
|
5309
|
-
var $;
|
|
5310
5303
|
(function ($) {
|
|
5311
5304
|
var $$;
|
|
5312
5305
|
(function ($$) {
|
|
@@ -5339,6 +5332,13 @@ var $;
|
|
|
5339
5332
|
;
|
|
5340
5333
|
"use strict";
|
|
5341
5334
|
var $;
|
|
5335
|
+
(function ($) {
|
|
5336
|
+
$mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
|
|
5337
|
+
})($ || ($ = {}));
|
|
5338
|
+
//mol/svg/text/box/-css/box.view.css.ts
|
|
5339
|
+
;
|
|
5340
|
+
"use strict";
|
|
5341
|
+
var $;
|
|
5342
5342
|
(function ($) {
|
|
5343
5343
|
class $mol_plot_ruler extends $mol_plot_graph {
|
|
5344
5344
|
step() {
|
|
@@ -5498,13 +5498,6 @@ var $;
|
|
|
5498
5498
|
;
|
|
5499
5499
|
"use strict";
|
|
5500
5500
|
var $;
|
|
5501
|
-
(function ($) {
|
|
5502
|
-
$mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
|
|
5503
|
-
})($ || ($ = {}));
|
|
5504
|
-
//mol/plot/ruler/-css/ruler.view.css.ts
|
|
5505
|
-
;
|
|
5506
|
-
"use strict";
|
|
5507
|
-
var $;
|
|
5508
5501
|
(function ($) {
|
|
5509
5502
|
var $$;
|
|
5510
5503
|
(function ($$) {
|
|
@@ -5589,6 +5582,13 @@ var $;
|
|
|
5589
5582
|
;
|
|
5590
5583
|
"use strict";
|
|
5591
5584
|
var $;
|
|
5585
|
+
(function ($) {
|
|
5586
|
+
$mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
|
|
5587
|
+
})($ || ($ = {}));
|
|
5588
|
+
//mol/plot/ruler/-css/ruler.view.css.ts
|
|
5589
|
+
;
|
|
5590
|
+
"use strict";
|
|
5591
|
+
var $;
|
|
5592
5592
|
(function ($) {
|
|
5593
5593
|
class $mol_plot_ruler_vert extends $mol_plot_ruler {
|
|
5594
5594
|
title_align() {
|
|
@@ -5616,13 +5616,6 @@ var $;
|
|
|
5616
5616
|
;
|
|
5617
5617
|
"use strict";
|
|
5618
5618
|
var $;
|
|
5619
|
-
(function ($) {
|
|
5620
|
-
$mol_style_attach("mol/plot/ruler/vert/vert.view.css", "[mol_plot_ruler_vert_label] {\n\ttransform: translateY( 4px );\n}\n");
|
|
5621
|
-
})($ || ($ = {}));
|
|
5622
|
-
//mol/plot/ruler/vert/-css/vert.view.css.ts
|
|
5623
|
-
;
|
|
5624
|
-
"use strict";
|
|
5625
|
-
var $;
|
|
5626
5619
|
(function ($) {
|
|
5627
5620
|
var $$;
|
|
5628
5621
|
(function ($$) {
|
|
@@ -5665,6 +5658,13 @@ var $;
|
|
|
5665
5658
|
;
|
|
5666
5659
|
"use strict";
|
|
5667
5660
|
var $;
|
|
5661
|
+
(function ($) {
|
|
5662
|
+
$mol_style_attach("mol/plot/ruler/vert/vert.view.css", "[mol_plot_ruler_vert_label] {\n\ttransform: translateY( 4px );\n}\n");
|
|
5663
|
+
})($ || ($ = {}));
|
|
5664
|
+
//mol/plot/ruler/vert/-css/vert.view.css.ts
|
|
5665
|
+
;
|
|
5666
|
+
"use strict";
|
|
5667
|
+
var $;
|
|
5668
5668
|
(function ($) {
|
|
5669
5669
|
class $mol_plot_ruler_hor extends $mol_plot_ruler {
|
|
5670
5670
|
title_align() {
|
|
@@ -5692,13 +5692,6 @@ var $;
|
|
|
5692
5692
|
;
|
|
5693
5693
|
"use strict";
|
|
5694
5694
|
var $;
|
|
5695
|
-
(function ($) {
|
|
5696
|
-
$mol_style_attach("mol/plot/ruler/hor/hor.view.css", "[mol_plot_ruler_hor_label] {\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_ruler_hor_title] {\n\ttransform: translateY( -4px );\n}\n");
|
|
5697
|
-
})($ || ($ = {}));
|
|
5698
|
-
//mol/plot/ruler/hor/-css/hor.view.css.ts
|
|
5699
|
-
;
|
|
5700
|
-
"use strict";
|
|
5701
|
-
var $;
|
|
5702
5695
|
(function ($) {
|
|
5703
5696
|
var $$;
|
|
5704
5697
|
(function ($$) {
|
|
@@ -5747,6 +5740,13 @@ var $;
|
|
|
5747
5740
|
;
|
|
5748
5741
|
"use strict";
|
|
5749
5742
|
var $;
|
|
5743
|
+
(function ($) {
|
|
5744
|
+
$mol_style_attach("mol/plot/ruler/hor/hor.view.css", "[mol_plot_ruler_hor_label] {\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_ruler_hor_title] {\n\ttransform: translateY( -4px );\n}\n");
|
|
5745
|
+
})($ || ($ = {}));
|
|
5746
|
+
//mol/plot/ruler/hor/-css/hor.view.css.ts
|
|
5747
|
+
;
|
|
5748
|
+
"use strict";
|
|
5749
|
+
var $;
|
|
5750
5750
|
(function ($) {
|
|
5751
5751
|
class $mol_plot_mark_cross extends $mol_plot_graph {
|
|
5752
5752
|
labels() {
|
|
@@ -5845,13 +5845,6 @@ var $;
|
|
|
5845
5845
|
;
|
|
5846
5846
|
"use strict";
|
|
5847
5847
|
var $;
|
|
5848
|
-
(function ($) {
|
|
5849
|
-
$mol_style_attach("mol/plot/mark/cross/cross.view.css", "[mol_plot_mark_cross_curve] {\n\tcolor: var(--mol_theme_focus);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_x], [mol_plot_mark_cross_label_y] {\n\tcolor: var(--mol_theme_focus);\n\tfont-weight: bold;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_y] {\n\ttransform: translateY( 4px );\n}\n");
|
|
5850
|
-
})($ || ($ = {}));
|
|
5851
|
-
//mol/plot/mark/cross/-css/cross.view.css.ts
|
|
5852
|
-
;
|
|
5853
|
-
"use strict";
|
|
5854
|
-
var $;
|
|
5855
5848
|
(function ($) {
|
|
5856
5849
|
var $$;
|
|
5857
5850
|
(function ($$) {
|
|
@@ -5939,6 +5932,13 @@ var $;
|
|
|
5939
5932
|
;
|
|
5940
5933
|
"use strict";
|
|
5941
5934
|
var $;
|
|
5935
|
+
(function ($) {
|
|
5936
|
+
$mol_style_attach("mol/plot/mark/cross/cross.view.css", "[mol_plot_mark_cross_curve] {\n\tcolor: var(--mol_theme_focus);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_x], [mol_plot_mark_cross_label_y] {\n\tcolor: var(--mol_theme_focus);\n\tfont-weight: bold;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_y] {\n\ttransform: translateY( 4px );\n}\n");
|
|
5937
|
+
})($ || ($ = {}));
|
|
5938
|
+
//mol/plot/mark/cross/-css/cross.view.css.ts
|
|
5939
|
+
;
|
|
5940
|
+
"use strict";
|
|
5941
|
+
var $;
|
|
5942
5942
|
(function ($) {
|
|
5943
5943
|
class $mol_plot_mark_hor extends $mol_plot_ruler_hor {
|
|
5944
5944
|
labels() {
|
|
@@ -5951,13 +5951,6 @@ var $;
|
|
|
5951
5951
|
;
|
|
5952
5952
|
"use strict";
|
|
5953
5953
|
var $;
|
|
5954
|
-
(function ($) {
|
|
5955
|
-
$mol_style_attach("mol/plot/mark/hor/hor.view.css", "[mol_plot_mark_hor_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: .1%;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_hor_label] {\n\tcolor: var(--mol_theme_text);\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_mark_hor_title] {\n\tcolor: var(--mol_theme_shade);\n\ttransform: translateY( -4px );\n}\n");
|
|
5956
|
-
})($ || ($ = {}));
|
|
5957
|
-
//mol/plot/mark/hor/-css/hor.view.css.ts
|
|
5958
|
-
;
|
|
5959
|
-
"use strict";
|
|
5960
|
-
var $;
|
|
5961
5954
|
(function ($) {
|
|
5962
5955
|
var $$;
|
|
5963
5956
|
(function ($$) {
|
|
@@ -6051,12 +6044,9 @@ var $;
|
|
|
6051
6044
|
"use strict";
|
|
6052
6045
|
var $;
|
|
6053
6046
|
(function ($) {
|
|
6054
|
-
|
|
6055
|
-
process.exit(0);
|
|
6056
|
-
}
|
|
6057
|
-
$.$mol_test_complete = $mol_test_complete;
|
|
6047
|
+
$mol_style_attach("mol/plot/mark/hor/hor.view.css", "[mol_plot_mark_hor_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: .1%;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_hor_label] {\n\tcolor: var(--mol_theme_text);\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_mark_hor_title] {\n\tcolor: var(--mol_theme_shade);\n\ttransform: translateY( -4px );\n}\n");
|
|
6058
6048
|
})($ || ($ = {}));
|
|
6059
|
-
//mol/
|
|
6049
|
+
//mol/plot/mark/hor/-css/hor.view.css.ts
|
|
6060
6050
|
;
|
|
6061
6051
|
"use strict";
|
|
6062
6052
|
var $;
|
|
@@ -6131,144 +6121,64 @@ var $;
|
|
|
6131
6121
|
}
|
|
6132
6122
|
catch (error) {
|
|
6133
6123
|
console.assert(error.message === 'XMLHttpRequest is forbidden in tests');
|
|
6134
|
-
}
|
|
6135
|
-
},
|
|
6136
|
-
'forbidden fetch'($) {
|
|
6137
|
-
try {
|
|
6138
|
-
console.assert(void $.fetch(''));
|
|
6139
|
-
}
|
|
6140
|
-
catch (error) {
|
|
6141
|
-
console.assert(error.message === 'fetch is forbidden in tests');
|
|
6142
|
-
}
|
|
6143
|
-
},
|
|
6144
|
-
});
|
|
6145
|
-
})($ || ($ = {}));
|
|
6146
|
-
//mol/test/test.test.ts
|
|
6147
|
-
;
|
|
6148
|
-
"use strict";
|
|
6149
|
-
var $;
|
|
6150
|
-
(function ($_1) {
|
|
6151
|
-
$mol_test_mocks.push($ => {
|
|
6152
|
-
$.$mol_log3_come = () => { };
|
|
6153
|
-
$.$mol_log3_done = () => { };
|
|
6154
|
-
$.$mol_log3_fail = () => { };
|
|
6155
|
-
$.$mol_log3_warn = () => { };
|
|
6156
|
-
$.$mol_log3_rise = () => { };
|
|
6157
|
-
$.$mol_log3_area = () => () => { };
|
|
6158
|
-
});
|
|
6159
|
-
})($ || ($ = {}));
|
|
6160
|
-
//mol/log3/log3.test.ts
|
|
6161
|
-
;
|
|
6162
|
-
"use strict";
|
|
6163
|
-
//mol/type/partial/deep/deep.ts
|
|
6164
|
-
;
|
|
6165
|
-
"use strict";
|
|
6166
|
-
//mol/type/error/error.ts
|
|
6167
|
-
;
|
|
6168
|
-
"use strict";
|
|
6169
|
-
//mol/type/assert/assert.ts
|
|
6170
|
-
;
|
|
6171
|
-
"use strict";
|
|
6172
|
-
//mol/type/assert/assert.test.ts
|
|
6173
|
-
;
|
|
6174
|
-
"use strict";
|
|
6175
|
-
//mol/type/equals/equals.ts
|
|
6176
|
-
;
|
|
6177
|
-
"use strict";
|
|
6178
|
-
//mol/type/equals/equals.test.ts
|
|
6179
|
-
;
|
|
6180
|
-
"use strict";
|
|
6181
|
-
//mol/type/partial/deep/deep.test.ts
|
|
6182
|
-
;
|
|
6183
|
-
"use strict";
|
|
6184
|
-
var $;
|
|
6185
|
-
(function ($) {
|
|
6186
|
-
$mol_test({
|
|
6187
|
-
'Make empty div'() {
|
|
6188
|
-
$mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
|
|
6189
|
-
},
|
|
6190
|
-
'Define native field'() {
|
|
6191
|
-
const dom = $mol_jsx("input", { value: '123' });
|
|
6192
|
-
$mol_assert_equal(dom.outerHTML, '<input value="123">');
|
|
6193
|
-
$mol_assert_equal(dom.value, '123');
|
|
6194
|
-
},
|
|
6195
|
-
'Define classes'() {
|
|
6196
|
-
const dom = $mol_jsx("div", { class: 'foo bar' });
|
|
6197
|
-
$mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
|
|
6198
|
-
},
|
|
6199
|
-
'Define styles'() {
|
|
6200
|
-
const dom = $mol_jsx("div", { style: { color: 'red' } });
|
|
6201
|
-
$mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
|
|
6202
|
-
},
|
|
6203
|
-
'Define dataset'() {
|
|
6204
|
-
const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
|
|
6205
|
-
$mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
|
|
6206
|
-
},
|
|
6207
|
-
'Define attributes'() {
|
|
6208
|
-
const dom = $mol_jsx("div", { lang: "ru", hidden: true });
|
|
6209
|
-
$mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
|
|
6210
|
-
},
|
|
6211
|
-
'Define child nodes'() {
|
|
6212
|
-
const dom = $mol_jsx("div", null,
|
|
6213
|
-
"hello",
|
|
6214
|
-
$mol_jsx("strong", null, "world"),
|
|
6215
|
-
"!");
|
|
6216
|
-
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
6217
|
-
},
|
|
6218
|
-
'Function as component'() {
|
|
6219
|
-
const Button = (props, target) => {
|
|
6220
|
-
return $mol_jsx("button", { title: props.hint }, target());
|
|
6221
|
-
};
|
|
6222
|
-
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
6223
|
-
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
6224
|
-
},
|
|
6225
|
-
'Nested guid generation'() {
|
|
6226
|
-
const Foo = () => {
|
|
6227
|
-
return $mol_jsx("div", null,
|
|
6228
|
-
$mol_jsx(Bar, { id: "bar" },
|
|
6229
|
-
$mol_jsx("img", { id: "icon" })));
|
|
6230
|
-
};
|
|
6231
|
-
const Bar = (props, icon) => {
|
|
6232
|
-
return $mol_jsx("span", null,
|
|
6233
|
-
icon,
|
|
6234
|
-
$mol_jsx("i", { id: "label" }));
|
|
6235
|
-
};
|
|
6236
|
-
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
6237
|
-
$mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"><i id="foo/bar/label" class="Foo_bar_label Bar_label"></i></span></div>');
|
|
6238
|
-
},
|
|
6239
|
-
'Fail on non unique ids'() {
|
|
6240
|
-
const App = () => {
|
|
6241
|
-
return $mol_jsx("div", null,
|
|
6242
|
-
$mol_jsx("span", { id: "bar" }),
|
|
6243
|
-
$mol_jsx("span", { id: "bar" }));
|
|
6244
|
-
};
|
|
6245
|
-
$mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
|
|
6246
|
-
},
|
|
6247
|
-
'Owner based guid generationn'() {
|
|
6248
|
-
const Foo = () => {
|
|
6249
|
-
return $mol_jsx("div", null,
|
|
6250
|
-
$mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
6251
|
-
};
|
|
6252
|
-
const Bar = (props) => {
|
|
6253
|
-
return $mol_jsx("span", null, props.icon());
|
|
6254
|
-
};
|
|
6255
|
-
const dom = $mol_jsx(Foo, { id: "app" });
|
|
6256
|
-
$mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
|
|
6257
|
-
},
|
|
6258
|
-
'Fail on same ids from different caller'() {
|
|
6259
|
-
const Foo = () => {
|
|
6260
|
-
return $mol_jsx("div", null,
|
|
6261
|
-
$mol_jsx("img", { id: "icon" }),
|
|
6262
|
-
$mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
6263
|
-
};
|
|
6264
|
-
const Bar = (props) => {
|
|
6265
|
-
return $mol_jsx("span", null, props.icon());
|
|
6266
|
-
};
|
|
6267
|
-
$mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
|
|
6124
|
+
}
|
|
6125
|
+
},
|
|
6126
|
+
'forbidden fetch'($) {
|
|
6127
|
+
try {
|
|
6128
|
+
console.assert(void $.fetch(''));
|
|
6129
|
+
}
|
|
6130
|
+
catch (error) {
|
|
6131
|
+
console.assert(error.message === 'fetch is forbidden in tests');
|
|
6132
|
+
}
|
|
6268
6133
|
},
|
|
6269
6134
|
});
|
|
6270
6135
|
})($ || ($ = {}));
|
|
6271
|
-
//mol/
|
|
6136
|
+
//mol/test/test.test.ts
|
|
6137
|
+
;
|
|
6138
|
+
"use strict";
|
|
6139
|
+
var $;
|
|
6140
|
+
(function ($) {
|
|
6141
|
+
function $mol_test_complete() {
|
|
6142
|
+
process.exit(0);
|
|
6143
|
+
}
|
|
6144
|
+
$.$mol_test_complete = $mol_test_complete;
|
|
6145
|
+
})($ || ($ = {}));
|
|
6146
|
+
//mol/test/test.node.test.ts
|
|
6147
|
+
;
|
|
6148
|
+
"use strict";
|
|
6149
|
+
var $;
|
|
6150
|
+
(function ($_1) {
|
|
6151
|
+
$mol_test_mocks.push($ => {
|
|
6152
|
+
$.$mol_log3_come = () => { };
|
|
6153
|
+
$.$mol_log3_done = () => { };
|
|
6154
|
+
$.$mol_log3_fail = () => { };
|
|
6155
|
+
$.$mol_log3_warn = () => { };
|
|
6156
|
+
$.$mol_log3_rise = () => { };
|
|
6157
|
+
$.$mol_log3_area = () => () => { };
|
|
6158
|
+
});
|
|
6159
|
+
})($ || ($ = {}));
|
|
6160
|
+
//mol/log3/log3.test.ts
|
|
6161
|
+
;
|
|
6162
|
+
"use strict";
|
|
6163
|
+
//mol/type/error/error.ts
|
|
6164
|
+
;
|
|
6165
|
+
"use strict";
|
|
6166
|
+
//mol/type/assert/assert.ts
|
|
6167
|
+
;
|
|
6168
|
+
"use strict";
|
|
6169
|
+
//mol/type/assert/assert.test.ts
|
|
6170
|
+
;
|
|
6171
|
+
"use strict";
|
|
6172
|
+
//mol/type/equals/equals.ts
|
|
6173
|
+
;
|
|
6174
|
+
"use strict";
|
|
6175
|
+
//mol/type/equals/equals.test.ts
|
|
6176
|
+
;
|
|
6177
|
+
"use strict";
|
|
6178
|
+
//mol/type/partial/deep/deep.ts
|
|
6179
|
+
;
|
|
6180
|
+
"use strict";
|
|
6181
|
+
//mol/type/partial/deep/deep.test.ts
|
|
6272
6182
|
;
|
|
6273
6183
|
"use strict";
|
|
6274
6184
|
var $;
|
|
@@ -6393,6 +6303,96 @@ var $;
|
|
|
6393
6303
|
;
|
|
6394
6304
|
"use strict";
|
|
6395
6305
|
var $;
|
|
6306
|
+
(function ($) {
|
|
6307
|
+
$mol_test({
|
|
6308
|
+
'Make empty div'() {
|
|
6309
|
+
$mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
|
|
6310
|
+
},
|
|
6311
|
+
'Define native field'() {
|
|
6312
|
+
const dom = $mol_jsx("input", { value: '123' });
|
|
6313
|
+
$mol_assert_equal(dom.outerHTML, '<input value="123">');
|
|
6314
|
+
$mol_assert_equal(dom.value, '123');
|
|
6315
|
+
},
|
|
6316
|
+
'Define classes'() {
|
|
6317
|
+
const dom = $mol_jsx("div", { class: 'foo bar' });
|
|
6318
|
+
$mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
|
|
6319
|
+
},
|
|
6320
|
+
'Define styles'() {
|
|
6321
|
+
const dom = $mol_jsx("div", { style: { color: 'red' } });
|
|
6322
|
+
$mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
|
|
6323
|
+
},
|
|
6324
|
+
'Define dataset'() {
|
|
6325
|
+
const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
|
|
6326
|
+
$mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
|
|
6327
|
+
},
|
|
6328
|
+
'Define attributes'() {
|
|
6329
|
+
const dom = $mol_jsx("div", { lang: "ru", hidden: true });
|
|
6330
|
+
$mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
|
|
6331
|
+
},
|
|
6332
|
+
'Define child nodes'() {
|
|
6333
|
+
const dom = $mol_jsx("div", null,
|
|
6334
|
+
"hello",
|
|
6335
|
+
$mol_jsx("strong", null, "world"),
|
|
6336
|
+
"!");
|
|
6337
|
+
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
6338
|
+
},
|
|
6339
|
+
'Function as component'() {
|
|
6340
|
+
const Button = (props, target) => {
|
|
6341
|
+
return $mol_jsx("button", { title: props.hint }, target());
|
|
6342
|
+
};
|
|
6343
|
+
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
6344
|
+
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
6345
|
+
},
|
|
6346
|
+
'Nested guid generation'() {
|
|
6347
|
+
const Foo = () => {
|
|
6348
|
+
return $mol_jsx("div", null,
|
|
6349
|
+
$mol_jsx(Bar, { id: "bar" },
|
|
6350
|
+
$mol_jsx("img", { id: "icon" })));
|
|
6351
|
+
};
|
|
6352
|
+
const Bar = (props, icon) => {
|
|
6353
|
+
return $mol_jsx("span", null,
|
|
6354
|
+
icon,
|
|
6355
|
+
$mol_jsx("i", { id: "label" }));
|
|
6356
|
+
};
|
|
6357
|
+
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
6358
|
+
$mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"><i id="foo/bar/label" class="Foo_bar_label Bar_label"></i></span></div>');
|
|
6359
|
+
},
|
|
6360
|
+
'Fail on non unique ids'() {
|
|
6361
|
+
const App = () => {
|
|
6362
|
+
return $mol_jsx("div", null,
|
|
6363
|
+
$mol_jsx("span", { id: "bar" }),
|
|
6364
|
+
$mol_jsx("span", { id: "bar" }));
|
|
6365
|
+
};
|
|
6366
|
+
$mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
|
|
6367
|
+
},
|
|
6368
|
+
'Owner based guid generationn'() {
|
|
6369
|
+
const Foo = () => {
|
|
6370
|
+
return $mol_jsx("div", null,
|
|
6371
|
+
$mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
6372
|
+
};
|
|
6373
|
+
const Bar = (props) => {
|
|
6374
|
+
return $mol_jsx("span", null, props.icon());
|
|
6375
|
+
};
|
|
6376
|
+
const dom = $mol_jsx(Foo, { id: "app" });
|
|
6377
|
+
$mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
|
|
6378
|
+
},
|
|
6379
|
+
'Fail on same ids from different caller'() {
|
|
6380
|
+
const Foo = () => {
|
|
6381
|
+
return $mol_jsx("div", null,
|
|
6382
|
+
$mol_jsx("img", { id: "icon" }),
|
|
6383
|
+
$mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
6384
|
+
};
|
|
6385
|
+
const Bar = (props) => {
|
|
6386
|
+
return $mol_jsx("span", null, props.icon());
|
|
6387
|
+
};
|
|
6388
|
+
$mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
|
|
6389
|
+
},
|
|
6390
|
+
});
|
|
6391
|
+
})($ || ($ = {}));
|
|
6392
|
+
//mol/jsx/jsx.test.tsx
|
|
6393
|
+
;
|
|
6394
|
+
"use strict";
|
|
6395
|
+
var $;
|
|
6396
6396
|
(function ($) {
|
|
6397
6397
|
$mol_test({
|
|
6398
6398
|
'nulls & undefineds'() {
|
|
@@ -6706,113 +6706,6 @@ var $;
|
|
|
6706
6706
|
;
|
|
6707
6707
|
"use strict";
|
|
6708
6708
|
var $;
|
|
6709
|
-
(function ($_1) {
|
|
6710
|
-
$mol_test({
|
|
6711
|
-
'tree parsing'() {
|
|
6712
|
-
$mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
|
|
6713
|
-
$mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
|
|
6714
|
-
$mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
|
|
6715
|
-
$mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
|
|
6716
|
-
$mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
|
|
6717
|
-
$mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
|
|
6718
|
-
$mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
|
|
6719
|
-
$mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
|
|
6720
|
-
},
|
|
6721
|
-
'inserting'() {
|
|
6722
|
-
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
|
|
6723
|
-
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
|
|
6724
|
-
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
|
|
6725
|
-
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
|
|
6726
|
-
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
|
|
6727
|
-
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
|
|
6728
|
-
},
|
|
6729
|
-
'fromJSON'() {
|
|
6730
|
-
$mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
|
|
6731
|
-
$mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
|
|
6732
|
-
$mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
|
|
6733
|
-
$mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
|
|
6734
|
-
$mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
|
|
6735
|
-
},
|
|
6736
|
-
'toJSON'() {
|
|
6737
|
-
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
|
|
6738
|
-
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
|
|
6739
|
-
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
|
|
6740
|
-
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
|
|
6741
|
-
$mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
|
|
6742
|
-
},
|
|
6743
|
-
'hack'() {
|
|
6744
|
-
const res = $mol_tree.fromString(`foo bar xxx`).hack({
|
|
6745
|
-
'': (tree, context) => [tree.hack(context)],
|
|
6746
|
-
'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
|
|
6747
|
-
});
|
|
6748
|
-
$mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
|
|
6749
|
-
},
|
|
6750
|
-
'errors handling'($) {
|
|
6751
|
-
const errors = [];
|
|
6752
|
-
class Tree extends $mol_tree {
|
|
6753
|
-
static $ = $.$mol_ambient({
|
|
6754
|
-
$mol_fail: error => errors.push(error.message)
|
|
6755
|
-
});
|
|
6756
|
-
}
|
|
6757
|
-
Tree.fromString(`
|
|
6758
|
-
\t \tfoo
|
|
6759
|
-
bar \\data
|
|
6760
|
-
`, 'test');
|
|
6761
|
-
$mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
|
|
6762
|
-
},
|
|
6763
|
-
});
|
|
6764
|
-
})($ || ($ = {}));
|
|
6765
|
-
//mol/tree/tree.test.ts
|
|
6766
|
-
;
|
|
6767
|
-
"use strict";
|
|
6768
|
-
var $;
|
|
6769
|
-
(function ($) {
|
|
6770
|
-
$.$mol_after_mock_queue = [];
|
|
6771
|
-
function $mol_after_mock_warp() {
|
|
6772
|
-
const queue = $.$mol_after_mock_queue.splice(0);
|
|
6773
|
-
for (const task of queue)
|
|
6774
|
-
task();
|
|
6775
|
-
}
|
|
6776
|
-
$.$mol_after_mock_warp = $mol_after_mock_warp;
|
|
6777
|
-
class $mol_after_mock_commmon extends $mol_object2 {
|
|
6778
|
-
task;
|
|
6779
|
-
promise = Promise.resolve();
|
|
6780
|
-
cancelled = false;
|
|
6781
|
-
id;
|
|
6782
|
-
constructor(task) {
|
|
6783
|
-
super();
|
|
6784
|
-
this.task = task;
|
|
6785
|
-
$.$mol_after_mock_queue.push(task);
|
|
6786
|
-
}
|
|
6787
|
-
destructor() {
|
|
6788
|
-
const index = $.$mol_after_mock_queue.indexOf(this.task);
|
|
6789
|
-
if (index >= 0)
|
|
6790
|
-
$.$mol_after_mock_queue.splice(index, 1);
|
|
6791
|
-
}
|
|
6792
|
-
}
|
|
6793
|
-
$.$mol_after_mock_commmon = $mol_after_mock_commmon;
|
|
6794
|
-
class $mol_after_mock_timeout extends $mol_after_mock_commmon {
|
|
6795
|
-
delay;
|
|
6796
|
-
constructor(delay, task) {
|
|
6797
|
-
super(task);
|
|
6798
|
-
this.delay = delay;
|
|
6799
|
-
}
|
|
6800
|
-
}
|
|
6801
|
-
$.$mol_after_mock_timeout = $mol_after_mock_timeout;
|
|
6802
|
-
})($ || ($ = {}));
|
|
6803
|
-
//mol/after/mock/mock.test.ts
|
|
6804
|
-
;
|
|
6805
|
-
"use strict";
|
|
6806
|
-
var $;
|
|
6807
|
-
(function ($_1) {
|
|
6808
|
-
$mol_test_mocks.push($ => {
|
|
6809
|
-
$.$mol_after_tick = $mol_after_mock_commmon;
|
|
6810
|
-
});
|
|
6811
|
-
})($ || ($ = {}));
|
|
6812
|
-
//mol/after/tick/tick.test.ts
|
|
6813
|
-
;
|
|
6814
|
-
"use strict";
|
|
6815
|
-
var $;
|
|
6816
6709
|
(function ($) {
|
|
6817
6710
|
$mol_test({
|
|
6818
6711
|
'init with overload'() {
|
|
@@ -6886,7 +6779,45 @@ var $;
|
|
|
6886
6779
|
},
|
|
6887
6780
|
});
|
|
6888
6781
|
})($ || ($ = {}));
|
|
6889
|
-
//mol/wire/pub/sub/sub.test.ts
|
|
6782
|
+
//mol/wire/pub/sub/sub.test.ts
|
|
6783
|
+
;
|
|
6784
|
+
"use strict";
|
|
6785
|
+
var $;
|
|
6786
|
+
(function ($) {
|
|
6787
|
+
$.$mol_after_mock_queue = [];
|
|
6788
|
+
function $mol_after_mock_warp() {
|
|
6789
|
+
const queue = $.$mol_after_mock_queue.splice(0);
|
|
6790
|
+
for (const task of queue)
|
|
6791
|
+
task();
|
|
6792
|
+
}
|
|
6793
|
+
$.$mol_after_mock_warp = $mol_after_mock_warp;
|
|
6794
|
+
class $mol_after_mock_commmon extends $mol_object2 {
|
|
6795
|
+
task;
|
|
6796
|
+
promise = Promise.resolve();
|
|
6797
|
+
cancelled = false;
|
|
6798
|
+
id;
|
|
6799
|
+
constructor(task) {
|
|
6800
|
+
super();
|
|
6801
|
+
this.task = task;
|
|
6802
|
+
$.$mol_after_mock_queue.push(task);
|
|
6803
|
+
}
|
|
6804
|
+
destructor() {
|
|
6805
|
+
const index = $.$mol_after_mock_queue.indexOf(this.task);
|
|
6806
|
+
if (index >= 0)
|
|
6807
|
+
$.$mol_after_mock_queue.splice(index, 1);
|
|
6808
|
+
}
|
|
6809
|
+
}
|
|
6810
|
+
$.$mol_after_mock_commmon = $mol_after_mock_commmon;
|
|
6811
|
+
class $mol_after_mock_timeout extends $mol_after_mock_commmon {
|
|
6812
|
+
delay;
|
|
6813
|
+
constructor(delay, task) {
|
|
6814
|
+
super(task);
|
|
6815
|
+
this.delay = delay;
|
|
6816
|
+
}
|
|
6817
|
+
}
|
|
6818
|
+
$.$mol_after_mock_timeout = $mol_after_mock_timeout;
|
|
6819
|
+
})($ || ($ = {}));
|
|
6820
|
+
//mol/after/mock/mock.test.ts
|
|
6890
6821
|
;
|
|
6891
6822
|
"use strict";
|
|
6892
6823
|
var $;
|
|
@@ -7688,6 +7619,15 @@ var $;
|
|
|
7688
7619
|
;
|
|
7689
7620
|
"use strict";
|
|
7690
7621
|
var $;
|
|
7622
|
+
(function ($_1) {
|
|
7623
|
+
$mol_test_mocks.push($ => {
|
|
7624
|
+
$.$mol_after_tick = $mol_after_mock_commmon;
|
|
7625
|
+
});
|
|
7626
|
+
})($ || ($ = {}));
|
|
7627
|
+
//mol/after/tick/tick.test.ts
|
|
7628
|
+
;
|
|
7629
|
+
"use strict";
|
|
7630
|
+
var $;
|
|
7691
7631
|
(function ($) {
|
|
7692
7632
|
$mol_test({
|
|
7693
7633
|
'run callback'() {
|
|
@@ -8087,26 +8027,26 @@ var $;
|
|
|
8087
8027
|
"use strict";
|
|
8088
8028
|
var $;
|
|
8089
8029
|
(function ($) {
|
|
8090
|
-
class $
|
|
8030
|
+
class $mol_view_tree_test_simple extends $mol_view {
|
|
8091
8031
|
some() {
|
|
8092
|
-
return
|
|
8093
|
-
a: 0,
|
|
8094
|
-
b: 2
|
|
8095
|
-
};
|
|
8032
|
+
return 1;
|
|
8096
8033
|
}
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
return
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8034
|
+
bool() {
|
|
8035
|
+
return true;
|
|
8036
|
+
}
|
|
8037
|
+
str() {
|
|
8038
|
+
return "test";
|
|
8039
|
+
}
|
|
8040
|
+
arr() {
|
|
8041
|
+
return [];
|
|
8042
|
+
}
|
|
8043
|
+
arr_string() {
|
|
8044
|
+
return [];
|
|
8105
8045
|
}
|
|
8106
8046
|
}
|
|
8107
|
-
$.$
|
|
8047
|
+
$.$mol_view_tree_test_simple = $mol_view_tree_test_simple;
|
|
8108
8048
|
})($ || ($ = {}));
|
|
8109
|
-
//mol/view/tree/test/-view.tree/
|
|
8049
|
+
//mol/view/tree/test/-view.tree/simple.test.view.tree.ts
|
|
8110
8050
|
;
|
|
8111
8051
|
"use strict";
|
|
8112
8052
|
var $;
|
|
@@ -8137,56 +8077,26 @@ var $;
|
|
|
8137
8077
|
"use strict";
|
|
8138
8078
|
var $;
|
|
8139
8079
|
(function ($) {
|
|
8140
|
-
class $
|
|
8141
|
-
|
|
8142
|
-
return
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
return obj;
|
|
8147
|
-
}
|
|
8148
|
-
}
|
|
8149
|
-
__decorate([
|
|
8150
|
-
$mol_mem
|
|
8151
|
-
], $mol_view_tree_test_binding_right.prototype, "Test", null);
|
|
8152
|
-
$.$mol_view_tree_test_binding_right = $mol_view_tree_test_binding_right;
|
|
8153
|
-
class $mol_view_tree_test_binding_right_test extends $mol_view {
|
|
8154
|
-
width(val) {
|
|
8155
|
-
if (val !== undefined)
|
|
8156
|
-
return val;
|
|
8157
|
-
return 0;
|
|
8080
|
+
class $mol_view_tree_test_attributes_super extends $mol_view {
|
|
8081
|
+
some() {
|
|
8082
|
+
return {
|
|
8083
|
+
a: 0,
|
|
8084
|
+
b: 2
|
|
8085
|
+
};
|
|
8158
8086
|
}
|
|
8159
8087
|
}
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
], $mol_view_tree_test_binding_right_test.prototype, "width", null);
|
|
8163
|
-
$.$mol_view_tree_test_binding_right_test = $mol_view_tree_test_binding_right_test;
|
|
8164
|
-
})($ || ($ = {}));
|
|
8165
|
-
//mol/view/tree/test/-view.tree/binding_right.test.view.tree.ts
|
|
8166
|
-
;
|
|
8167
|
-
"use strict";
|
|
8168
|
-
var $;
|
|
8169
|
-
(function ($) {
|
|
8170
|
-
class $mol_view_tree_test_simple extends $mol_view {
|
|
8088
|
+
$.$mol_view_tree_test_attributes_super = $mol_view_tree_test_attributes_super;
|
|
8089
|
+
class $mol_view_tree_test_attributes extends $mol_view_tree_test_attributes_super {
|
|
8171
8090
|
some() {
|
|
8172
|
-
return
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
}
|
|
8177
|
-
str() {
|
|
8178
|
-
return "test";
|
|
8179
|
-
}
|
|
8180
|
-
arr() {
|
|
8181
|
-
return [];
|
|
8182
|
-
}
|
|
8183
|
-
arr_string() {
|
|
8184
|
-
return [];
|
|
8091
|
+
return {
|
|
8092
|
+
...super.some(),
|
|
8093
|
+
a: 1
|
|
8094
|
+
};
|
|
8185
8095
|
}
|
|
8186
8096
|
}
|
|
8187
|
-
$.$
|
|
8097
|
+
$.$mol_view_tree_test_attributes = $mol_view_tree_test_attributes;
|
|
8188
8098
|
})($ || ($ = {}));
|
|
8189
|
-
//mol/view/tree/test/-view.tree/
|
|
8099
|
+
//mol/view/tree/test/-view.tree/attributes.test.view.tree.ts
|
|
8190
8100
|
;
|
|
8191
8101
|
"use strict";
|
|
8192
8102
|
var $;
|
|
@@ -8216,6 +8126,36 @@ var $;
|
|
|
8216
8126
|
;
|
|
8217
8127
|
"use strict";
|
|
8218
8128
|
var $;
|
|
8129
|
+
(function ($) {
|
|
8130
|
+
class $mol_view_tree_test_binding_right extends $mol_view {
|
|
8131
|
+
outer_width(v) {
|
|
8132
|
+
return this.Test().width(v);
|
|
8133
|
+
}
|
|
8134
|
+
Test() {
|
|
8135
|
+
const obj = new this.$.$mol_view_tree_test_binding_right_test();
|
|
8136
|
+
return obj;
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
__decorate([
|
|
8140
|
+
$mol_mem
|
|
8141
|
+
], $mol_view_tree_test_binding_right.prototype, "Test", null);
|
|
8142
|
+
$.$mol_view_tree_test_binding_right = $mol_view_tree_test_binding_right;
|
|
8143
|
+
class $mol_view_tree_test_binding_right_test extends $mol_view {
|
|
8144
|
+
width(val) {
|
|
8145
|
+
if (val !== undefined)
|
|
8146
|
+
return val;
|
|
8147
|
+
return 0;
|
|
8148
|
+
}
|
|
8149
|
+
}
|
|
8150
|
+
__decorate([
|
|
8151
|
+
$mol_mem
|
|
8152
|
+
], $mol_view_tree_test_binding_right_test.prototype, "width", null);
|
|
8153
|
+
$.$mol_view_tree_test_binding_right_test = $mol_view_tree_test_binding_right_test;
|
|
8154
|
+
})($ || ($ = {}));
|
|
8155
|
+
//mol/view/tree/test/-view.tree/binding_right.test.view.tree.ts
|
|
8156
|
+
;
|
|
8157
|
+
"use strict";
|
|
8158
|
+
var $;
|
|
8219
8159
|
(function ($_1) {
|
|
8220
8160
|
var $$;
|
|
8221
8161
|
(function ($$) {
|
|
@@ -8282,6 +8222,66 @@ var $;
|
|
|
8282
8222
|
;
|
|
8283
8223
|
"use strict";
|
|
8284
8224
|
var $;
|
|
8225
|
+
(function ($_1) {
|
|
8226
|
+
$mol_test({
|
|
8227
|
+
'tree parsing'() {
|
|
8228
|
+
$mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
|
|
8229
|
+
$mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
|
|
8230
|
+
$mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
|
|
8231
|
+
$mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
|
|
8232
|
+
$mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
|
|
8233
|
+
$mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
|
|
8234
|
+
$mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
|
|
8235
|
+
$mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
|
|
8236
|
+
},
|
|
8237
|
+
'inserting'() {
|
|
8238
|
+
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
|
|
8239
|
+
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
|
|
8240
|
+
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
|
|
8241
|
+
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
|
|
8242
|
+
$mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
|
|
8243
|
+
$mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
|
|
8244
|
+
},
|
|
8245
|
+
'fromJSON'() {
|
|
8246
|
+
$mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
|
|
8247
|
+
$mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
|
|
8248
|
+
$mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
|
|
8249
|
+
$mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
|
|
8250
|
+
$mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
|
|
8251
|
+
},
|
|
8252
|
+
'toJSON'() {
|
|
8253
|
+
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
|
|
8254
|
+
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
|
|
8255
|
+
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
|
|
8256
|
+
$mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
|
|
8257
|
+
$mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
|
|
8258
|
+
},
|
|
8259
|
+
'hack'() {
|
|
8260
|
+
const res = $mol_tree.fromString(`foo bar xxx`).hack({
|
|
8261
|
+
'': (tree, context) => [tree.hack(context)],
|
|
8262
|
+
'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
|
|
8263
|
+
});
|
|
8264
|
+
$mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
|
|
8265
|
+
},
|
|
8266
|
+
'errors handling'($) {
|
|
8267
|
+
const errors = [];
|
|
8268
|
+
class Tree extends $mol_tree {
|
|
8269
|
+
static $ = $.$mol_ambient({
|
|
8270
|
+
$mol_fail: error => errors.push(error.message)
|
|
8271
|
+
});
|
|
8272
|
+
}
|
|
8273
|
+
Tree.fromString(`
|
|
8274
|
+
\t \tfoo
|
|
8275
|
+
bar \\data
|
|
8276
|
+
`, 'test');
|
|
8277
|
+
$mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
|
|
8278
|
+
},
|
|
8279
|
+
});
|
|
8280
|
+
})($ || ($ = {}));
|
|
8281
|
+
//mol/tree/tree.test.ts
|
|
8282
|
+
;
|
|
8283
|
+
"use strict";
|
|
8284
|
+
var $;
|
|
8285
8285
|
(function ($) {
|
|
8286
8286
|
class $mol_state_local extends $mol_object {
|
|
8287
8287
|
static 'native()';
|
|
@@ -8339,6 +8339,22 @@ var $;
|
|
|
8339
8339
|
;
|
|
8340
8340
|
"use strict";
|
|
8341
8341
|
var $;
|
|
8342
|
+
(function ($) {
|
|
8343
|
+
$mol_test({
|
|
8344
|
+
'local get set delete'() {
|
|
8345
|
+
var key = '$mol_state_local_test:' + Math.random();
|
|
8346
|
+
$mol_assert_equal($mol_state_local.value(key), null);
|
|
8347
|
+
$mol_state_local.value(key, 123);
|
|
8348
|
+
$mol_assert_equal($mol_state_local.value(key), 123);
|
|
8349
|
+
$mol_state_local.value(key, null);
|
|
8350
|
+
$mol_assert_equal($mol_state_local.value(key), null);
|
|
8351
|
+
},
|
|
8352
|
+
});
|
|
8353
|
+
})($ || ($ = {}));
|
|
8354
|
+
//mol/state/local/local.test.ts
|
|
8355
|
+
;
|
|
8356
|
+
"use strict";
|
|
8357
|
+
var $;
|
|
8342
8358
|
(function ($) {
|
|
8343
8359
|
$mol_test_mocks.push(context => {
|
|
8344
8360
|
class $mol_state_local_mock extends $mol_state_local {
|
|
@@ -8356,22 +8372,6 @@ var $;
|
|
|
8356
8372
|
//mol/state/local/local.mock.test.ts
|
|
8357
8373
|
;
|
|
8358
8374
|
"use strict";
|
|
8359
|
-
var $;
|
|
8360
|
-
(function ($) {
|
|
8361
|
-
$mol_test({
|
|
8362
|
-
'local get set delete'() {
|
|
8363
|
-
var key = '$mol_state_local_test:' + Math.random();
|
|
8364
|
-
$mol_assert_equal($mol_state_local.value(key), null);
|
|
8365
|
-
$mol_state_local.value(key, 123);
|
|
8366
|
-
$mol_assert_equal($mol_state_local.value(key), 123);
|
|
8367
|
-
$mol_state_local.value(key, null);
|
|
8368
|
-
$mol_assert_equal($mol_state_local.value(key), null);
|
|
8369
|
-
},
|
|
8370
|
-
});
|
|
8371
|
-
})($ || ($ = {}));
|
|
8372
|
-
//mol/state/local/local.test.ts
|
|
8373
|
-
;
|
|
8374
|
-
"use strict";
|
|
8375
8375
|
//mol/charset/encoding/encoding.ts
|
|
8376
8376
|
;
|
|
8377
8377
|
"use strict";
|