squint-cljs 0.14.199 → 0.14.201
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/lib/cli.js +113 -113
- package/lib/cljs.pprint.js +258 -258
- package/lib/compiler.js +1318 -1279
- package/lib/compiler.node.js +45 -40
- package/lib/compiler.sci.js +1267 -1263
- package/lib/node.nrepl_server.js +29 -29
- package/lib/squint.core.umd.js +3 -3
- package/package.json +1 -1
- package/src/squint/core.js +415 -120
- package/src/squint/multi.js +63 -8
- package/src/squint/string.js +22 -5
package/lib/node.nrepl_server.js
CHANGED
|
@@ -4,32 +4,32 @@ import "./node.js";
|
|
|
4
4
|
import "./compiler.node.js";
|
|
5
5
|
const shadow_esm_import = function(x) { return import(x) };
|
|
6
6
|
import*as esm_import$fs from"fs";import*as esm_import$net from"net";
|
|
7
|
-
var m7=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},n7=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},o7=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},p7=function(a){return console.debug($APP.
|
|
8
|
-
|
|
9
|
-
$APP.
|
|
10
|
-
$APP.
|
|
11
|
-
$APP.
|
|
12
|
-
"\n;return [undefined];";return $APP.
|
|
13
|
-
k=$APP.m(k)?"Open "+$APP.I.g(k)+" in a browser tab.":"Open the dev server URL in a browser tab.";k=Error("No response from the browser within "+$APP.I.g(8E3)+"ms. "+$APP.I.g(k)+" The REPL evaluates in the page.");return d.g?d.g(k):d.call(null,k)}return null},8E3);var f=$APP.Gb(x7);if($APP.m(f)){var h={op:"eval",code:a,id:e,session:q7.g(b)};return f.g?f.g(h):f.call(null,h)}$APP.
|
|
14
|
-
new Set;;)if(a!=null){for(var c=$APP.
|
|
15
|
-
Array.from(a));if(c==null)return[];var d="js/"+$APP.I.g(a.length>0?""+$APP.I.g(a.join("."))+".":null);return $APP.
|
|
16
|
-
setTimeout(function(){if($APP.m($APP.
|
|
17
|
-
b){var c=$APP
|
|
18
|
-
b.h(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"status",new $APP.
|
|
19
|
-
e:""+$APP.I.g(v7()));var f=$APP.m($APP.m(a)?a.indexOf("/")==-1:a)?$APP.
|
|
20
|
-
p)},k),$APP.A(["type",$APP.m(k)?"function":"variable"],0));return $APP.m(l)?$APP.
|
|
21
|
-
"done"],null)}a=new $APP.H(null,1,["status",a],null);return b.h?b.h(c,a):b.call(null,c,a)},
|
|
22
|
-
0));b.setNoDelay(!0);var c=
|
|
23
|
-
n),c(k,d),n+=1;else if(f=$APP.
|
|
24
|
-
"lookup","lookup",1225356838),
|
|
25
|
-
"print","nrepl.middleware.print/print",-1616742548),
|
|
26
|
-
$APP.I.g(o7(d,1)),"e"))return new $APP.
|
|
27
|
-
e+=1;else break;return J7.l(arguments[0],1<c.length?new $APP.Nc(c.slice(1),0,null):null)};J7.l=function(a,b){try{return K7(a,b)}catch(c){if(c instanceof Error)return new $APP.
|
|
28
|
-
var I7=function I7(a){for(;;){if(typeof a==="string")return""+$APP.I.g(Buffer.from(a).length)+":"+$APP.I.g(a);if(a instanceof $APP.C||a instanceof $APP.t)a=""+$APP.I.g(function(){var c=$APP.
|
|
29
|
-
c=$APP.z.j(c,1,null);return""+$APP.I.g(I7.g?I7.g(d):I7.call(null,d))+$APP.I.g(I7.g?I7.g(c):I7.call(null,c))}}(a),$APP.
|
|
30
|
-
var x7=$APP.
|
|
31
|
-
null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.H(null,4,["versions",new $APP.H(null,2,["nbb-nrepl",s7("TODO"),"node",s7(process.version)],null),"aux",$APP.
|
|
32
|
-
a=$APP.
|
|
33
|
-
Array.from(f)))));f=new $APP.H(null,2,["completions",f,"status",new $APP.
|
|
34
|
-
$APP.
|
|
35
|
-
export const handleBrowserMessage=function(a){a=typeof a==="string"?JSON.parse(a):a;var b=a.id,c=$APP.
|
|
7
|
+
var m7=function(a,b){a=a.indexOf(b);if(a<0)throw Error("out of input");return a},n7=function(a,b){if(a.length<b)throw Error("out of input");return a.slice(b)},o7=function(a,b){if(b>a.length)throw Error("out of input");return a.slice(0,b)},p7=function(a){return console.debug($APP.Go.h(" ",a))},hsa=function(a){return function(b,c){b=$APP.Ye(b);var d=$APP.Xd.h(b,$APP.dr),e=$APP.Xd.h(b,q7);c=$APP.Bh.j(c,"id",d);c=$APP.m(e)?$APP.Bh.j(c,"session",e):c;return a.h?a.h(b,c):a.call(null,b,c)}},jsa=function(){var a=
|
|
8
|
+
isa;return function(b,c){b=$APP.sm.j(b,r7,$APP.hi);return a.h?a.h(b,c):a.call(null,b,c)}},lsa=function(){var a=ksa();return function(b,c){p7($APP.A(["request",b],0));return a.h?a.h(b,c):a.call(null,b,c)}},msa=function(a){return function(b,c){p7($APP.A(["response",c],0));return a.h?a.h(b,c):a.call(null,b,c)}},ksa=function(){var a=jsa();return function(b,c){return a.h?a.h(b,c):a.call(null,b,c)}},s7=function(a){return $APP.Bh.j($APP.Mh(new $APP.D(null,3,5,$APP.G,["major","minor","incremental"],null),
|
|
9
|
+
$APP.Ps.g(a.split("."))),"version-string",a)},v7=function(){var a=function(){var b=$APP.Gb(t7);b=b==null?null:$APP.Em.g(b);b=b==null?null:$APP.Gb(b);return b==null?null:$APP.Uk.g(b)}();if($APP.m(a))return a;a=function(){var b=$APP.Gb(u7);b=b==null?null:$APP.Gb(b);return b==null?null:$APP.Uk.g(b)}();return $APP.m(a)?a:$APP.bp},nsa=function(a,b,c){if($APP.m(a)){var d=w7.g?w7.g(a):w7.call(null,a);if($APP.m(d)){var e=$APP.Ye(b);a=$APP.Xd.h(e,$APP.V6);b=$APP.Xd.h(e,$APP.P6);e=$APP.Xd.h(e,$APP.X6);var f=
|
|
10
|
+
$APP.Zh,h=$APP.Xh,k=$APP.o2;$APP.Zh=b;$APP.Xh=e;$APP.o2=a;try{return Promise.resolve(function(){var l=new $APP.Ba,n=$APP.Ca,r=$APP.Ea;$APP.Ca=!0;$APP.Ea=function(q){return l.append(q)};try{d.g?d.g(c):d.call(null,c)}finally{$APP.Ea=r,$APP.Ca=n}return""+$APP.I.g(l)}())}finally{$APP.o2=k,$APP.Xh=h,$APP.Zh=f}}else return p7($APP.A(["Pretty-Printing is only supported for cider.nrepl.pprint/pprint"],0)),$APP.vG(c)}else return $APP.vG(c)},osa=function(a,b){var c=function(){var f=$APP.OF();f=f==null?null:
|
|
11
|
+
$APP.Gp.g(f);return f==null?null:$APP.Bh.j(f,$APP.Ms,!0)}(),d=$APP.m(b)?$APP.oi.g(b):null;b=function(){var f=new $APP.H(null,5,[$APP.Ho,$APP.Gs,$APP.Ls,!0,$APP.sq,!0,$APP.Po,!0,$APP.fq,$APP.m($APP.Gb(x7))?null:$APP.qG],null);f=$APP.m(c)?$APP.Bh.j(f,$APP.Gp,c):f;f=$APP.m($APP.Gb(u7))?$APP.Bh.j(f,$APP.Em,$APP.Gb(u7)):f;f=$APP.m(d)?$APP.Bh.j(f,$APP.V,d):f;var h=$APP.Gb(t7);return $APP.Js?$APP.Js(a,f,h):$APP.LF.call(null,a,f,h)}();b=$APP.Ye(b);var e=$APP.Xd.h(b,$APP.Os);$APP.xf(t7,b);b=""+$APP.I.g(e)+
|
|
12
|
+
"\n;return [undefined];";return $APP.lp("(async function () {\n%s\n}) ()","%s",b)},y7=function(a,b){return Promise.resolve(eval(a)).then(function(c){c=c[0];return nsa(psa.g(b),qsa.g(b),c)})},rsa=function(a,b){return new Promise(function(c,d){var e=$APP.dr.g(b);$APP.Di.A(z7,$APP.Bh,e,{resolve:function(k){k=k.value;return c.g?c.g(k):c.call(null,k)},reject:d});setTimeout(function(){if($APP.m($APP.Xd.h($APP.Gb(z7),e))){$APP.Di.j(z7,$APP.Ck,e);var k=$APP.Gb(A7);k=$APP.m(k)?k.o?k.o():k.call(null):null;
|
|
13
|
+
k=$APP.m(k)?"Open "+$APP.I.g(k)+" in a browser tab.":"Open the dev server URL in a browser tab.";k=Error("No response from the browser within "+$APP.I.g(8E3)+"ms. "+$APP.I.g(k)+" The REPL evaluates in the page.");return d.g?d.g(k):d.call(null,k)}return null},8E3);var f=$APP.Gb(x7);if($APP.m(f)){var h={op:"eval",code:a,id:e,session:q7.g(b)};return f.g?f.g(h):f.call(null,h)}$APP.Di.j(z7,$APP.Ck,e);f=Error("No browser transport connected");return d.g?d.g(f):d.call(null,f)})},ssa=function(a){for(var b=
|
|
14
|
+
new Set;;)if(a!=null){for(var c=$APP.u(Object.getOwnPropertyNames(a)),d=null,e=0,f=0;;)if(f<e){var h=d.da(null,f);b.add(h);f+=1}else if(c=$APP.u(c))d=c,$APP.Od(d)?(c=$APP.jc(d),f=$APP.lc(d),d=c,e=$APP.od(c),c=f):(c=$APP.w(d),b.add(c),c=$APP.x(d),d=null,e=0),f=0;else break;a=Object.getPrototypeOf(a)}else break;return Array.from(b)},tsa=function(a){if($APP.la(a,"js/")){a=$APP.Vh.h(a,3).split(".");var b=a[a.length-1];a=a.slice(0,a.length-1);var c=$APP.fe.j(function(e,f){return e!=null?e[f]:null},globalThis,
|
|
15
|
+
Array.from(a));if(c==null)return[];var d="js/"+$APP.I.g(a.length>0?""+$APP.I.g(a.join("."))+".":null);return $APP.Ws.g($APP.Pj.h(function(e){return""+$APP.I.g(d)+$APP.I.g(e)},$APP.Bf.h(100,$APP.wG.g($APP.Ek.h(function(e){return $APP.la(e,b)},ssa(c))))))}return[]},usa=function(a,b){return new Promise(function(c){var d=$APP.dr.g(b);$APP.Di.A(z7,$APP.Bh,d,{resolve:function(h){h=h.completions;h=$APP.m(h)?h:[];return c.g?c.g(h):c.call(null,h)},reject:function(){var h=[];return c.g?c.g(h):c.call(null,h)}});
|
|
16
|
+
setTimeout(function(){if($APP.m($APP.Xd.h($APP.Gb(z7),d))){$APP.Di.j(z7,$APP.Ck,d);var h=[];return c.g?c.g(h):c.call(null,h)}return null},8E3);var e=$APP.Gb(x7);if($APP.m(e)){var f={op:"complete-js",prefix:a,id:d,session:q7.g(b)};return e.g?e.g(f):e.call(null,f)}$APP.Di.j(z7,$APP.Ck,d);e=[];return c.g?c.g(e):c.call(null,e)})},C7=function(a,b){return Promise.resolve(a).then(function(c){return osa(c,$APP.V.g(b))}).then(function(c){var d=$APP.Gb(B7);return d.h?d.h(c,b):d.call(null,c,b)})},E7=function(a,
|
|
17
|
+
b){var c=$APP.Ye(a);$APP.Xd.h(c,$APP.V);a=$APP.Xd.h(c,D7);$APP.Xd.h(c,$APP.O);$APP.Xd.h(c,vsa);$APP.Xd.h(c,wsa);return C7(a,c).then(function(d){d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"value",d],null);return b.h?b.h(c,d):b.call(null,c,d)}).catch(function(d){console.error(d);var e=$APP.fs.g($APP.cj(d));e=$APP.m(e)?e:d.message;$APP.m(e)&&(e=new $APP.H(null,1,["err",""+$APP.I.g(e)+"\n"],null),b.h?b.h(c,e):b.call(null,c,e));d=new $APP.H(null,2,["ex",""+$APP.I.g(d),"ns",""+$APP.I.g(v7())],null);return b.h?
|
|
18
|
+
b.h(c,d):b.call(null,c,d)}).finally(function(){var d=new $APP.H(null,2,["ns",""+$APP.I.g(v7()),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,d):b.call(null,c,d)})},F7=function(){var a=$APP.Gb(t7);a=a==null?null:$APP.Em.g(a);a=a==null?null:$APP.Gb(a);if($APP.m(a))return a;a=$APP.Gb(u7);return a==null?null:$APP.Gb(a)},G7=function(a,b){var c=$APP.Ye(a),d=$APP.Xd.h(c,r7),e=$APP.Xd.h(c,$APP.V);a=function(){var v=$APP.yha.g(c);return $APP.m(v)?v:$APP.Yl.g(c)}();e=$APP.oi.g($APP.m(e)?
|
|
19
|
+
e:""+$APP.I.g(v7()));var f=$APP.m($APP.m(a)?a.indexOf("/")==-1:a)?$APP.go.h(F7(),new $APP.D(null,2,5,$APP.G,[e,$APP.oi.g(a)],null)):null,h=$APP.Ye(f),k=$APP.Xd.h(h,$APP.zp),l=$APP.Xd.h(h,$APP.K),n=$APP.Xd.h(h,$APP.S),r=$APP.Xd.h(h,$APP.O);if($APP.m(f)){var q=new $APP.H(null,3,["ns",""+$APP.I.g(e),"name",""+$APP.I.g(a),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);a=function(){switch(d instanceof $APP.C?d.$:null){case "eldoc":var v=$APP.Bh.l(q,"eldoc",$APP.Pr.h(function(p){return $APP.Pr.h($APP.I,
|
|
20
|
+
p)},k),$APP.A(["type",$APP.m(k)?"function":"variable"],0));return $APP.m(l)?$APP.Bh.j(v,"docstring",l):v;default:return v=$APP.m(k)?$APP.Bh.j(q,"arglists-str",$APP.Go.h("\n",$APP.Pj.h($APP.yi,k))):q,v=$APP.m(l)?$APP.Bh.j(v,"doc",l):v,v=$APP.m(r)?$APP.Bh.j(v,"file",r):v,$APP.m(n)?$APP.Bh.j(v,"line",n):v}}();return b.h?b.h(c,a):b.call(null,c,a)}a:switch(d instanceof $APP.C?d.$:null){case "eldoc":a=new $APP.D(null,2,5,$APP.G,["no-eldoc","done"],null);break a;default:a=new $APP.D(null,2,5,$APP.G,["no-info",
|
|
21
|
+
"done"],null)}a=new $APP.H(null,1,["status",a],null);return b.h?b.h(c,a):b.call(null,c,a)},isa=function(a,b){a=$APP.Ye(a);var c=$APP.Xd.h(a,r7),d=$APP.Xd.h(H7,c);if($APP.m(d))return d.h?d.h(a,b):d.call(null,a,b);console.warn($APP.Go.h(" ",$APP.A(["Unhandled operation",c],0)));c=new $APP.H(null,1,["status",new $APP.D(null,3,5,$APP.G,["error","unknown-op","done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},xsa=function(a){return function(b,c){return a.write(I7(c))}},ysa=function(a,b){p7($APP.A(["Connection accepted"],
|
|
22
|
+
0));b.setNoDelay(!0);var c=lsa(),d=hsa(msa(xsa(b))),e=$APP.Ci.g(null);b.on("data",function(f){var h=$APP.Gb(e);if($APP.m(h)){f=""+$APP.I.g(h)+$APP.I.g(f);$APP.xf(e,null);var k=f}else k=f;a:{f=$APP.A([$APP.Qs,!0],0);for(h=$APP.Zf;;){var l=$APP.uf.j(J7,k,f);k=$APP.z.j(l,0,null);l=$APP.z.j(l,1,null);if(k==null){h=new $APP.D(null,2,5,$APP.G,[h,l],null);break a}h=$APP.ve.h(h,k);k=l}h=void 0}f=$APP.z.j(h,0,null);h=$APP.z.j(h,1,null);$APP.Sj(h)||$APP.xf(e,h);f=$APP.u(f);h=null;for(var n=l=0;;)if(n<l)k=h.da(null,
|
|
23
|
+
n),c(k,d),n+=1;else if(f=$APP.u(f))h=f,$APP.Od(h)?(f=$APP.jc(h),l=$APP.lc(h),h=f,k=$APP.od(f),f=l,l=k):(k=$APP.w(h),c(k,d),f=$APP.x(h),h=null,l=0),n=0;else return null});return b.on("close",function(f){return $APP.m(f)?p7($APP.A(["Connection lost"],0)):p7($APP.A(["Connection closed"],0))})},wsa=new $APP.C(null,"_line","_line",232847719),qsa=new $APP.C("nrepl.middleware.print","options","nrepl.middleware.print/options",868480159),q7=new $APP.C(null,"session","session",1008279103),zsa=new $APP.C(null,
|
|
24
|
+
"lookup","lookup",1225356838),Asa=new $APP.C(null,"browser-transport","browser-transport",-653558483),Bsa=new $APP.C(null,"load-file","load-file",-424586670),vsa=new $APP.C(null,"_load-file?","_load-file?",-1198848711),r7=new $APP.C(null,"op","op",-1882987955),Csa=new $APP.C(null,"describe","describe",1369790582),D7=new $APP.C(null,"code","code",1586293142),Dsa=new $APP.C(null,"eldoc","eldoc",-1321421900),Esa=new $APP.C(null,"log_level","log_level",-1756736313),psa=new $APP.C("nrepl.middleware.print",
|
|
25
|
+
"print","nrepl.middleware.print/print",-1616742548),Fsa=new $APP.C(null,"clone","clone",711747572),Gsa=new $APP.C(null,"close","close",1835149582),Hsa=new $APP.C(null,"info","info",-317069002),Isa=new $APP.C(null,"load-file?","load-file?",1892536169);var K7=function K7(a,b){switch(""+$APP.I.g(o7(a,1))){case "i":return a=n7(a,1),b=m7(a,"e"),new $APP.D(null,2,5,$APP.G,[parseInt(o7(a,b)),n7(a,b+1)],null);case "l":var d=a=n7(a,1);for(a=$APP.cc($APP.Zf);;){if($APP.y.h(""+$APP.I.g(o7(d,1)),"e"))return new $APP.D(null,2,5,$APP.G,[$APP.ec(a),n7(d,1)],null);var e=K7.h?K7.h(d,b):K7.call(null,d,b),f=$APP.z.j(e,0,null),h=$APP.z.j(e,1,null);e=h;a=$APP.Uf.h(a,f);d=e}break;case "d":a=n7(a,1);f=$APP.Ye(b);f=$APP.Xd.h(f,$APP.Qs);d=a;for(e=$APP.cc($APP.Xe);;){if($APP.y.h(""+
|
|
26
|
+
$APP.I.g(o7(d,1)),"e"))return new $APP.D(null,2,5,$APP.G,[$APP.ec(e),n7(d,1)],null);a=K7.h?K7.h(d,b):K7.call(null,d,b);d=$APP.z.j(a,0,null);h=$APP.z.j(a,1,null);h=K7.h?K7.h(h,b):K7.call(null,h,b);a=$APP.z.j(h,0,null);h=$APP.z.j(h,1,null);d=$APP.m(f)?$APP.hi.g(d):d;a=$APP.Hg.j(e,d,a);d=h;e=a}break;default:return b=m7(a,":"),f=parseInt(o7(a,b)),a=n7(a,b+1),new $APP.D(null,2,5,$APP.G,[""+$APP.I.g(o7(a,f)),n7(a,f)],null)}},J7=function J7(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),
|
|
27
|
+
e+=1;else break;return J7.l(arguments[0],1<c.length?new $APP.Nc(c.slice(1),0,null):null)};J7.l=function(a,b){try{return K7(a,b)}catch(c){if(c instanceof Error)return new $APP.D(null,2,5,$APP.G,[null,a],null);throw c;}};J7.m=1;J7.v=function(a){var b=$APP.w(a);a=$APP.x(a);return this.l(b,a)};
|
|
28
|
+
var I7=function I7(a){for(;;){if(typeof a==="string")return""+$APP.I.g(Buffer.from(a).length)+":"+$APP.I.g(a);if(a instanceof $APP.C||a instanceof $APP.t)a=""+$APP.I.g(function(){var c=$APP.Be(a);return $APP.m(c)?""+$APP.I.g(c)+"/":null}())+$APP.I.g($APP.Lh(a));else return typeof a==="number"?"i"+$APP.I.g(a)+"e":$APP.Jd(a)||$APP.Nd(a)||a==null?"l"+$APP.I.g($APP.uf.h($APP.I,$APP.Pj.h(I7,a)))+"e":$APP.Ld(a)?"d"+$APP.I.g($APP.uf.h($APP.I,$APP.Pj.h(function(){return function(c){var d=$APP.z.j(c,0,null);
|
|
29
|
+
c=$APP.z.j(c,1,null);return""+$APP.I.g(I7.g?I7.g(d):I7.call(null,d))+$APP.I.g(I7.g?I7.g(c):I7.call(null,c))}}(a),$APP.xG.h($APP.w,a))))+"e":null}};var t7=$APP.Ci.g(null),u7=$APP.Ci.g(null),w7=new $APP.H(null,1,["cider.nrepl.pprint/pprint",$APP.d7],null);$APP.Ci.g(!1);
|
|
30
|
+
var x7=$APP.Ci.g(null),A7=$APP.Ci.g(null),z7=$APP.Ci.g($APP.Xe),B7=$APP.Ci.g(y7),H7=$APP.ih([zsa,Gsa,Bsa,Dsa,Fsa,Csa,Hsa,$APP.FG,$APP.yja],[G7,function(a,b){var c=new $APP.H(null,1,["status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){a=$APP.Ye(a);var c=$APP.Xd.h(a,$APP.O);return E7($APP.Bh.l(a,D7,c,$APP.A([Isa,!0],0)),b)},G7,function(a,b){var c=new $APP.H(null,2,["new-session",""+$APP.I.g($APP.BF()),"status",new $APP.D(null,1,5,$APP.G,["done"],
|
|
31
|
+
null)],null);return b.h?b.h(a,c):b.call(null,a,c)},function(a,b){var c=new $APP.H(null,4,["versions",new $APP.H(null,2,["nbb-nrepl",s7("TODO"),"node",s7(process.version)],null),"aux",$APP.Xe,"ops",$APP.Mh($APP.Pj.h($APP.Lh,$APP.wh(H7)),$APP.Gk.g($APP.Xe)),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(a,c):b.call(null,a,c)},G7,function(a,b){var c=$APP.Ye(a);a=$APP.Xd.h(c,$APP.V);var d=function(){var f=$APP.Q6.g(c);if($APP.m(f))return f;f=$APP.Yl.g(c);return $APP.m(f)?f:""}();
|
|
32
|
+
a=$APP.oi.g($APP.m(a)?a:""+$APP.I.g(v7()));a=$APP.Xd.h(F7(),a);a=$APP.J.l($APP.Ek.h($APP.Ic,$APP.wh(a)),$APP.wh($APP.Fq.g(a)),$APP.A([$APP.wh($APP.Vk.g(a))],0));var e=$APP.Ek.h(function(f){return $APP.la(f,d)},$APP.Hq.h(function(f){return f.indexOf("_DOT_")!=-1},$APP.Pj.h($APP.I,a)));return($APP.la(d,"js/")?$APP.m($APP.Gb(x7))?usa(d,c):Promise.resolve(tsa(d)):Promise.resolve([])).then(function(f){f=$APP.Pr.h(function(h){return new $APP.H(null,1,["candidate",h],null)},$APP.wG.g($APP.SF.g($APP.J.h(e,
|
|
33
|
+
Array.from(f)))));f=new $APP.H(null,2,["completions",f,"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,f):b.call(null,c,f)}).catch(function(){var f=new $APP.H(null,2,["completions",$APP.Pr.h(function(h){return new $APP.H(null,1,["candidate",h],null)},$APP.wG.g(e)),"status",new $APP.D(null,1,5,$APP.G,["done"],null)],null);return b.h?b.h(c,f):b.call(null,c,f)})},function(a,b){a=$APP.Ye(a);var c=$APP.Xd.h(a,$APP.V);return E7($APP.Bh.j(a,$APP.V,$APP.m(c)?c:v7()),b)}]),Jsa=$APP.Ci.g(null);export const startServer=function(a){return Promise.resolve(null).then(function(){var b=function(){var h=$APP.Ma(a)?a.port:$APP.AG.g(a);return $APP.m(h)?h:0}(),c=function(){var h=$APP.Ma(a)?a.host:$APP.EG.g(a);return $APP.m(h)?h:"127.0.0.1"}();(function(){var h=$APP.Ma(a)?a.log_level:Esa.g(a);return $APP.m(h)?h:"info"})();var d=function(){var h=Asa.g(a);return $APP.m(h)?h:$APP.Ma(a)?a.browserTransport:null}(),e=function(){var h=$APP.Em.g(a);return $APP.m(h)?h:$APP.Ma(a)?a.nsState:null}(),f=esm_import$net.createServer($APP.al.h(ysa,
|
|
34
|
+
$APP.Xe));$APP.m(e)&&$APP.xf(u7,e);$APP.m(d)?($APP.xf(x7,d.send),$APP.xf(A7,d.url),$APP.xf(B7,rsa)):$APP.xf(B7,y7);f.listen(b,c,function(){var h=f.address(),k=h.port;h=h.address;$APP.zG.l($APP.A(["nREPL server started on port "+$APP.I.g(k)+" on host "+$APP.I.g(h)+" - nrepl://"+$APP.I.g(h)+":"+$APP.I.g(k)],0));try{return esm_import$fs.writeFileSync(".nrepl-port",""+$APP.I.g(k))}catch(l){return console.warn($APP.Go.h(" ",$APP.A(["Could not write .nrepl-port",l],0)))}});return $APP.xf(Jsa,f)})};
|
|
35
|
+
export const handleBrowserMessage=function(a){a=typeof a==="string"?JSON.parse(a):a;var b=a.id,c=$APP.Xd.h($APP.Gb(z7),b);if($APP.m(c)){$APP.Di.j(z7,$APP.Ck,b);b=a.ex;if(b==null)return c=c.resolve,c.g?c.g(a):c.call(null,a);a=Error(""+$APP.I.g(b));c=c.reject;return c.g?c.g(a):c.call(null,a)}return null};export const evalString=function(a){return C7(a,new $APP.H(null,2,[$APP.dr,""+$APP.I.g($APP.BF()),q7,"http"],null)).then(function(b){return{value:b,ns:""+$APP.I.g(v7())}})};
|
package/lib/squint.core.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var squint;(squint||={}).core=(()=>{var vt=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var cn=Object.prototype.hasOwnProperty;var fn=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},ln=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of sn(e))!cn.call(t,u)&&u!==n&&vt(t,u,{get:()=>e[u],enumerable:!(r=on(e,u))||r.enumerable});return t};var an=t=>ln(vt({},"__esModule",{value:!0}),t);var ri={};fn(ri,{Atom:()=>me,Cons:()=>ye,Delay:()=>un,IIterable:()=>he,IIterable__iterator:()=>Gn,LazySeq:()=>fu,NaN_QMARK_:()=>Cu,PROTOCOL_SENTINEL:()=>er,UUID:()=>Mt,_:()=>mn,_EQ_:()=>Z,_GT_:()=>Jt,_GT__EQ_:()=>Zt,_LT_:()=>dn,_LT__EQ_:()=>xn,_PLUS_:()=>yn,_STAR_:()=>gn,_STAR_print_err_fn_STAR_:()=>jn,_STAR_print_fn_STAR_:()=>P,_STAR_print_newline_STAR_:()=>Nt,__protocol_satisfies:()=>An,__toFn:()=>l,_iterator:()=>_e,abs:()=>Oo,aclone:()=>Su,add_watch:()=>Ru,alength:()=>bu,any_QMARK_:()=>Gu,apply:()=>we,array:()=>pr,array_QMARK_:()=>zt,array_map:()=>vn,aset:()=>Mu,assoc:()=>D,assoc_BANG_:()=>T,assoc_in:()=>ne,assoc_in_BANG_:()=>re,atom:()=>nr,boolean$:()=>yu,boolean_QMARK_:()=>_o,bounded_count:()=>xo,butlast:()=>lu,cat:()=>en,clj__GT_js:()=>Ho,coll_QMARK_:()=>no,comp:()=>ue,compare:()=>Q,compare_and_set_BANG_:()=>ir,complement:()=>nt,concat:()=>mr,conj:()=>Rn,conj_BANG_:()=>W,cons:()=>Fn,constantly:()=>yr,contains_QMARK_:()=>se,count:()=>it,counted_QMARK_:()=>Fe,cycle:()=>Br,dec:()=>Kn,dedupe:()=>Fr,deref:()=>Y,disj:()=>En,disj_BANG_:()=>ie,dissoc:()=>Nn,dissoc_BANG_:()=>Qn,distinct:()=>Dr,distinct_QMARK_:()=>Bu,doall:()=>ku,dorun:()=>vu,double$:()=>Go,double_QMARK_:()=>co,drop:()=>wt,drop_last:()=>au,drop_while:()=>Ie,empty:()=>gt,empty_QMARK_:()=>nu,ensure_reduced:()=>je,es6_iterator:()=>b,even_QMARK_:()=>be,every_QMARK_:()=>Te,every_pred:()=>Nu,ex_cause:()=>io,ex_data:()=>uo,ex_info:()=>so,ex_message:()=>oo,false_QMARK_:()=>du,ffirst:()=>qn,filter:()=>ht,filterv:()=>Yn,find:()=>yo,first:()=>O,flatten:()=>ko,float$:()=>$o,fn_QMARK_:()=>Pt,fnil:()=>qt,frequencies:()=>cu,get:()=>S,get_in:()=>Bt,group_by:()=>su,hash_map:()=>te,identical_QMARK_:()=>jr,identity:()=>ve,ifn_QMARK_:()=>$u,inc:()=>ce,inst_QMARK_:()=>Vo,int_QMARK_:()=>V,integer_QMARK_:()=>fo,interleave:()=>ke,interpose:()=>br,into:()=>Ke,into_array:()=>Be,iterable:()=>a,iterate:()=>ju,js_keys:()=>Lu,js_obj:()=>wu,juxt:()=>Iu,keep:()=>Hr,keep_indexed:()=>Zn,key:()=>Qe,keys:()=>Le,keyword:()=>Wu,keyword_QMARK_:()=>Ju,last:()=>Cn,lazy:()=>g,list:()=>Me,list_QMARK_:()=>Ot,list_STAR_:()=>gr,long$:()=>zo,map:()=>F,map_QMARK_:()=>Ge,map_entry_QMARK_:()=>$n,map_indexed:()=>Wn,mapcat:()=>Ar,mapv:()=>dt,max:()=>$e,max_key:()=>Ao,memoize:()=>Co,merge:()=>Qr,merge_with:()=>Nr,meta:()=>De,min:()=>Qu,min_key:()=>mo,mod:()=>go,name:()=>Xn,namespace:()=>Vu,nat_int_QMARK_:()=>ao,neg_QMARK_:()=>mu,neg_int_QMARK_:()=>po,next:()=>st,nil_QMARK_:()=>tr,nnext:()=>Tu,not:()=>Tt,not_EQ_:()=>Zo,not_any_QMARK_:()=>tu,not_empty:()=>vo,not_every_QMARK_:()=>Vr,nth:()=>le,number_QMARK_:()=>Ce,object_QMARK_:()=>ee,odd_QMARK_:()=>xr,parse_double:()=>bo,parse_long:()=>wo,partial:()=>Gr,partition:()=>Re,partition_all:()=>Se,partition_by:()=>Er,partitionv:()=>kr,partitionv_all:()=>Sr,peek:()=>Lo,persistent_BANG_:()=>Ro,pop:()=>Do,pos_QMARK_:()=>Au,pos_int_QMARK_:()=>lo,pr:()=>Tn,pr_str:()=>Ut,print:()=>fe,println:()=>In,prn:()=>ni,qualified_keyword_QMARK_:()=>eo,quot:()=>Ve,rand:()=>ru,rand_int:()=>ze,rand_nth:()=>uu,random_uuid:()=>Fo,range:()=>sr,re_find:()=>fr,re_matches:()=>cr,re_pattern:()=>lr,re_seq:()=>qu,realized_QMARK_:()=>Wo,reduce:()=>B,reduce_kv:()=>Dt,reduced:()=>at,reduced_QMARK_:()=>q,reductions:()=>Dn,regexp_QMARK_:()=>ro,rem:()=>nn,remove:()=>Un,remove_watch:()=>Eu,repeat:()=>Gt,repeatedly:()=>iu,replace:()=>eu,reset_BANG_:()=>Ae,reset_vals_BANG_:()=>or,rest:()=>H,reverse:()=>Jr,run_BANG_:()=>Jo,satisfies_QMARK_:()=>wn,second:()=>Bn,select_keys:()=>Mr,seq:()=>R,seq_QMARK_:()=>On,seqable_QMARK_:()=>zn,sequential_QMARK_:()=>Rt,set:()=>_r,set_QMARK_:()=>dr,shuffle:()=>Xr,simple_keyword_QMARK_:()=>to,some:()=>Oe,some_QMARK_:()=>xu,some_fn:()=>Ku,sort:()=>ot,sort_by:()=>Zr,sorted_map:()=>No,sorted_map_by:()=>Ko,sorted_set:()=>Eo,sorted_set_by:()=>Qo,split_at:()=>pu,split_with:()=>hu,str:()=>It,string_QMARK_:()=>bt,subs:()=>qe,subseq:()=>To,subvec:()=>ar,swap_BANG_:()=>rr,swap_vals_BANG_:()=>ur,symbol:()=>Hu,symbol_QMARK_:()=>Zu,system_time:()=>Kr,t:()=>zu,take:()=>mt,take_last:()=>Tr,take_nth:()=>$r,take_while:()=>At,to_array:()=>Ou,trampoline:()=>We,transduce:()=>Yt,transient$:()=>So,tree_seq:()=>He,true_QMARK_:()=>_u,truth_:()=>x,type:()=>Bo,unchecked_add_int:()=>Uu,unchecked_dec_int:()=>Yu,unchecked_inc_int:()=>Fu,unchecked_int:()=>Pu,unreduced:()=>$t,update:()=>Yr,update_BANG_:()=>Lt,update_in:()=>Ur,update_keys:()=>Po,update_vals:()=>rn,uuid:()=>Yo,uuid_QMARK_:()=>Uo,val:()=>Ne,vals:()=>Du,var_QMARK_:()=>Xu,vary_meta:()=>ho,vec:()=>U,vector:()=>_t,vector_QMARK_:()=>hr,volatile_BANG_:()=>ti,vreset_BANG_:()=>ei,warn_on_lazy_reusage_BANG_:()=>Pn,with_meta:()=>Pe,zero_QMARK_:()=>gu,zipmap:()=>Mo});function l(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>S(n,t,r):e==="object"?(n,r)=>S(t,n,r):t}var St=Object.prototype.hasOwnProperty;function Vt(t,e,n){for(n of t.keys())if(j(n,e))return n}function Wt(t){return t!=null&&t[ct]===!0&&t[_]===h}function pn(t){return t!=null&&typeof t=="object"&&(t.constructor===Object||t instanceof Map||t[_]===h)}function hn(t,e){return t instanceof Map||t[_]===h?t.has(e):St.call(t,e)}function _n(t,e){return t instanceof Map||t[_]===h?t.get(e):t[e]}function Ht(t){return t instanceof Map||t[_]===h?t.size:Object.keys(t).length}function j(t,e){if(t===e)return!0;if(t==null)return e==null;var n,r,u;const o=Wt(t);if(o||Wt(e)){const i=o?t:e,s=i===t?e:t;if(!pn(s)||Ht(i)!==Ht(s))return!1;for(const c of i.keys())if(!hn(s,c)||!j(i.get(c),_n(s,c)))return!1;return!0}if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===Array){if((r=t.length)===e.length)for(;r--&&j(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(const i of t)if(u=i,u&&typeof u=="object"&&(u=Vt(e,u),!u)||!e.has(u))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(const i of t)if(u=i[0],u&&typeof u=="object"&&(u=Vt(e,u),!u)||!j(i[1],e.get(u)))return!1;return!0}if((!n||typeof t=="object")&&t[_]!==k){r=0;for(const i in t)if(St.call(t,i)&&++r&&!St.call(e,i)||!(i in e)||!j(t[i],e[i]))return!1;return Object.keys(e).length===r}}if(t&&e&&(Array.isArray(t)||t[_]===k)&&(Array.isArray(e)||e[_]===k)){const i=t[Symbol.iterator](),s=e[Symbol.iterator]();for(;;){const c=i.next(),f=s.next();if(c.done||f.done)return!!(c.done&&f.done);if(!j(c.value,f.value))return!1}}return!1}function J(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function Z(...t){return J(t,(e,n)=>j(e,n))}function Jt(...t){return J(t,(e,n)=>e>n)}function Zt(...t){return J(t,(e,n)=>e>=n)}function dn(...t){return J(t,(e,n)=>e<n)}function xn(...t){return J(t,(e,n)=>e<=n)}function yn(...t){return t.reduce((e,n)=>e+n,0)}function gn(...t){return t.reduce((e,n)=>e*n,1)}function mn(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const An={};function wn(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function bn(t,e,n){return t.set(e,n),t}function Mn(t,e,n){return t[e]=n,t}function Xt(t){switch(d(t)){case h:return bn;case w:case M:return Mn}}function T(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(d(t)){case h:t.set(e,n);for(let u=0;u<r.length;u+=2)t.set(r[u],r[u+1]);break;case w:case M:t[e]=n;for(let u=0;u<r.length;u+=2)t[r[u]]=r[u+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}const L=Symbol("meta");function A(t,e){const n=t?.[L];return n!==void 0&&(e[L]=n),e}function I(t){switch(d(t)){case h:return A(t,new t.constructor(t));case m:return A(t,new t.constructor(t));case w:return A(t,[...t]);case M:return A(t,{...t});case E:return A(t,new et(...t));default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function D(t,e,n,...r){t||(t={});const u=I(t);return T(u,e,n,...r),u}function te(...t){return t.length===0?{}:D({},...t)}const vn=te,h=1,w=2,M=3,E=4,m=5,k=6,_=Symbol("squint.lang.type"),ct=Symbol("squint.lang.sorted");function kn(t,e){return t.squint$lang$variadic=e,t}function ft(t){switch(t){case h:return new Map;case w:return[];case M:return{};case E:return new et;case m:return new Set;case k:return g(function*(){})}}function lt(t){return t.constructor===Object}function X(t){return Array.isArray(t)&&t[_]!==E}function ee(t){return t!=null&<(t)}function d(t){if(t==null)return;if(lt(t))return M;if(t instanceof Map)return h;if(t instanceof Set)return m;const e=t[_];if(e!==void 0)return e;if(X(t))return w}function Sn(t,e,n,r,u){r=U(r),n=n||{};const o=d(n);if(o!==h&&o!==w&&o!==M)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let s=n;for(let c=0;c<r.length-1;c+=1){const f=r[c];let p;s instanceof Map?p=s.get(f):p=s[f],p||(p=ft(o)),i.push(p),s=p}i.push(u);for(let c=i.length-2;c>=0;c-=1)i[c]=t(i[c],r[c],i[c+1]);return i[0]}function ne(t,e,n){return Sn(D,"assoc-in",t,e,n)}function re(t,e,n){e=U(e);var r=t;const u=d(t);for(const o of e.splice(0,e.length-1)){let i=S(r,o);i===void 0&&(i=ft(u),T(r,o,i)),r=i}return T(r,e[e.length-1],n),t}function ue(...t){if(t=t.map(l),t.length===0)return ve;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let u=e(...r);for(const o of n)u=o(u);return u}}function oe(t,e){for(const n of e)t.add(n);return t}function W(...t){const e=t.length;if(e===0)return _t();let n=t[0];if(n==null&&(n=[]),e===2)switch(d(n)){case w:return n.push(t[1]),n;case m:return n.add(t[1]),n}const r=t.slice(1);switch(d(n)){case m:oe(n,r);break;case E:n.unshift(...r.reverse());break;case w:n.push(...r);break;case h:for(const u of r)Array.isArray(u)?n.set(u[0],u[1]):a(u).forEach(o=>{n.set(o[0],o[1])});break;case M:for(const u of r)Array.isArray(u)?n[u[0]]=u[1]:Object.assign(n,u);break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return n}function Rn(...t){if(t.length===0)return _t();const[e,...n]=t;if(n.length===0)return e;let r=e;r==null&&(r=Me());let u,o;switch(d(r)){case m:return r[ct]?A(r,oe(new r.constructor(r),n)):A(r,new r.constructor([...r,...n]));case E:return A(r,new et(...n.reverse(),...r));case w:return A(r,[...r,...n]);case h:u=new Map(r);for(const i of n)Array.isArray(i)?u.set(i[0],i[1]):a(i).forEach(s=>{u.set(s[0],s[1])});return A(r,u);case k:return g(function*(){yield*n,yield*r});case M:o={...r};for(const i of n)Array.isArray(i)?o[i[0]]=i[1]:Object.assign(o,i);return A(r,o);default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function ie(t,...e){for(const n of e)t.delete(n);return t}function En(t,...e){if(t==null)return t;const n=new t.constructor(t);return ie(n,...e)}function se(t,e){if(typeof t=="string")return V(e)&&e>=0&&e<t.length;switch(d(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function Qn(t,...e){for(const n of e)delete t[n];return t}function Nn(t,...e){if(!t)return;if(e.length===0)return t;if(d(t)===h){let u=!1;for(const i of e)if(t.has(i)){u=!0;break}if(!u)return t;const o=I(t);for(const i of e)o.delete(i);return o}let n=!1;for(const u of e)if(u in t){n=!0;break}if(!n)return t;const r=I(t);for(const u of e)delete r[u];return r}function ce(t){return t+1}function Kn(t){return t-1}const Nt={val:!1},P={val:t=>console.log(t)},jn={val:t=>console.error(t)};function fe(...t){P.val(t.map(e=>K(e,void 0,!1)).join(" "))}function In(...t){fe(...t),Nt.val&&P.val(`
|
|
2
|
-
`)}function Tn(...t){P.val(Ut(...t))}function le(t,e,n){const r=arguments.length>2;if(t==null)return r?n:null;if(Array.isArray(t)){if(e>=0&&e<t.length)return t[e]}else if(e>=0){const u=$(t);let o=0,i;for(;(i=u())!==null;){if(e<o+i.length)return i[e-o];o+=i.length}}if(r)return n;throw new Error("Index out of bounds: "+e)}function S(t,e,n=void 0){if(t==null)return n;let r;if(lt(t))return r=t[e],r===void 0?n:r;let u;switch(d(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case w:r=t[e];break;default:if(u=t.get,typeof u=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function On(t){return t!=null&&!!t[Symbol.iterator]}function Rt(t){return Array.isArray(t)||t?.[_]===k}function zn(t){return t==null||ee(t)||!!t[Symbol.iterator]}const ae=Symbol("squint.lang.map-entry");function pe(t){return t[ae]=!0,t}function $n(t){return Array.isArray(t)&&t[ae]===!0}function a(t){if(t==null)return[];if(t[Symbol.iterator])return t;if(t instanceof Object)return Object.entries(t).map(pe);throw new TypeError(`${t} is not iterable`)}const he=Symbol("Iterable"),Gn=Symbol.iterator;function _e(t){return t[Symbol.iterator]()}const b=_e;function R(t){if(t==null)return t;if(typeof t=="string")return t.length?[...t]:null;const e=a(t);return e.length===0||e.size===0?null:e instanceof Set||e[_]===m?[...e]:e[Symbol.iterator]().next().done?null:e}function O(t){if(t==null)return;if(Array.isArray(t))return t[0];if(t instanceof y)return t.force(),t.chunk===null?void 0:t.chunk[0];const[e]=a(t);return e}function Bn(t){if(t instanceof y){t.force();const r=t.chunk;return r===null?void 0:r.length>1?r[1]:O(t._rest)}const[e,n]=a(t);return n}function qn(t){return O(O(t))}function H(t){const e=jt(t);e.force();const n=e.chunk;if(n===null)return e;if(n.length>1){const r=new y(null);return r.realized=!0,r.chunk=n.slice(1),r._rest=e._rest,r}return e._rest}class C{value;constructor(e){this.value=e}_deref(){return this.value}}function Cn(t){if(t=a(t),Array.isArray(t))return t[t.length-1];const e=$(t);let n,r;for(;(r=e())!==null;)n=r[r.length-1];return n}function at(t){return new C(t)}function q(t){return t instanceof C}function B(t,e,n){t=l(t);const r=arguments.length!==2,u=r?n:e;let o=r?e:void 0;if(Array.isArray(u)){let f=0;if(!r){if(u.length===0)return t();o=u[0],f=1}if(o instanceof C)return o.value;for(;f<u.length;f++)if(o=t(o,u[f]),o instanceof C)return o.value;return o}const i=$(u);let s=i(),c=0;if(!r){if(s===null)return t();o=s[0],c=1}if(o instanceof C)return o.value;for(;s!==null;){for(;c<s.length;c++)if(o=t(o,s[c]),o instanceof C)return o.value;s=i(),c=0}return o}function*Ln(t,e){const n=e.next();n.done?yield t():yield*de(t,n.value,e)}function*de(t,e,n){let r=e;const u=n;for(;;){if(q(r)){yield r.value;return}else yield r;const o=u.next();if(o.done)break;r=t(r,o.value)}}function Dn(t,e,n){if(t=l(t),arguments.length===2){const u=b(a(e));return g(function*(){yield*Ln(t,u)})}const r=b(a(n));return g(function*(){yield*de(t,e,r)})}function Pn(){console.warn("warn-on-lazy-reusage! is deprecated and does nothing: lazy values are now cached.")}const pt=32,y=class xe{constructor(e){this[_]=k,this[he]=!0,this.step=e,this.realized=!1,this.chunk=null,this._rest=null}force(){if(!this.realized){this.realized=!0;const e=this.step();this.step=null,e!=null&&(this.chunk=e[0],this._rest=new xe(e[1]))}return this}[Symbol.iterator](){let e=this,n=0;return{next(){for(;;){e.force();const r=e.chunk;if(r===null)return{value:void 0,done:!0};if(n<r.length)return{value:r[n++],done:!1};e=e._rest,n=0}},[Symbol.iterator](){return this}}}indexOf(e,n=0){let r=0;for(const u of this){if(r>=n&&j(u,e))return r;r++}return-1}};function Kt(t){const e=()=>{const n=t.next();return n.done?null:[[n.value],e]};return e}function g(t){return new y(Kt(t()))}function z(t,e){const n=b(a(t));return g(()=>e(n))}function jt(t){if(t instanceof y)return t;if(Array.isArray(t)){const e=n=>()=>{if(n>=t.length)return null;const r=Math.min(n+pt,t.length);return[t.slice(n,r),e(r)]};return new y(e(0))}return new y(Kt(b(a(t))))}function $(t){if(t instanceof y){let n=t;return()=>{if(n===null)return null;n.force();const r=n.chunk;return n=r===null?null:n._rest,r}}const e=b(a(t));return()=>{const n=[];for(let r=0;r<pt;r++){const u=e.next();if(u.done)break;n.push(u.value)}return n.length===0?null:n}}function tt(t,e){const n=jt(t),r=(u,o)=>()=>{let i=u,s=o;for(;;){i.force();const c=i.chunk;if(c===null)return null;const f=e(c,s),p=i._rest;if(s+=c.length,f.length!==0)return[f,r(p,s)];i=p}};return new y(r(n,0))}const ye=class{constructor(e,n){this[_]=k,this.x=e,this.coll=n}[Symbol.iterator](){const e=this.x;let n=this.coll,r=!1,u=null;return{next(){return r?(u||(u=b(a(n)),n=null),u.next()):(r=!0,{value:e,done:!1})},[Symbol.iterator](){return this}}}};function Fn(t,e){return new ye(t,e)}function F(t,...e){switch(t=l(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return tt(e[0],n=>{const r=new Array(n.length);for(let u=0;u<n.length;u++)r[u]=t(n[u]);return r});default:{const n=e.map(r=>b(a(r)));return g(function*(){for(;;){const r=[];for(const u of n){const o=u.next();if(o.done)return;r.push(o.value)}yield t(...r)}})}}}function v(t){return e=>{const n=t(e);return(...r)=>r.length===0?e():r.length===1?e(r[0]):n(r[0],r[1])}}function ge(t){return v(e=>(n,r)=>x(t(r))?e(n,r):n)}function ht(t,e){return arguments.length===1?ge(t):(t=l(t),tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=n[u];x(t(o))&&r.push(o)}return r}))}function Yn(t,e){return xt([],ht(t,e))}function Un(t,e){return arguments.length===1?ge(nt(t)):ht(nt(t),e)}function Vn(t){return v(e=>{let n=-1;return(r,u)=>e(r,t(++n,u))})}function Wn(t,e){return t=l(t),arguments.length===1?Vn(t):tt(e,(n,r)=>{const u=new Array(n.length);for(let o=0;o<n.length;o++)u[o]=t(r+o,n[o]);return u})}function Hn(t,e){return t=l(t),tt(e,(n,r)=>{const u=[];for(let o=0;o<n.length;o++){const i=t(r+o,n[o]);x(i)&&u.push(i)}return u})}function Jn(t){return v(e=>{let n=-1;return(r,u)=>{const o=t(++n,u);return o==null?r:e(r,o)}})}function Zn(t,e){return arguments.length===1?Jn(t):Hn(t,e)}function It(...t){return t.join("")}function Xn(t){if(typeof t=="string"){const e=t.indexOf("/");return e>=1?t.slice(e+1):t}throw new Error("Doesn't support name: "+typeof t)}function Tt(t){return!x(t)}function tr(t){return t==null}const er={};class me{constructor(e){this.val=e,this._watches={},this._deref=()=>this.val,this._hasWatches=!1,this._reset_BANG_=n=>{const r=this.val;if(this.val=n,this._hasWatches)for(const u of Object.entries(this._watches)){const o=u[0],i=u[1];i(o,this,r,n)}return n},this._add_watch=(n,r)=>{this._watches[n]=r,this._hasWatches=!0},this._remove_watch=n=>{delete this._watches[n]}}}function nr(t){return new me(t)}function Y(t){return t._deref()}function Ae(t,e){t._reset_BANG_(e)}function rr(t,e,...n){e=l(e);const r=e(Y(t),...n);return Ae(t,r),r}function ur(t,e,...n){const r=Y(t);e=l(e);const u=e(r,...n);return t._reset_BANG_(u),[r,u]}function or(t,e){const n=Y(t);return t._reset_BANG_(e),[n,e]}function ir(t,e,n){return Y(t)===e?(t._reset_BANG_(n),!0):!1}function sr(t,e,n){let r=t,u=e,o=n;e===void 0&&(r=0,u=t);const i=r||0;o=n??1;const s=o>=0,c=p=>u===void 0||s&&p<u||!s&&u<p,f=p=>()=>{if(!c(p))return null;const N=[];let G=p;for(;N.length<pt&&c(G);)N.push(G),G+=o;return[N,f(G)]};return new y(f(i))}function cr(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function fr(t,e){if(bt(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function lr(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function ar(t,e,n){if(!X(t))throw new Error("subvec: argument must be a vector");if(n===void 0&&(n=t.length),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>t.length)throw new Error("subvec: index out of bounds");return t.slice(e,n)}function _t(...t){return t}const pr=_t;function hr(t){return X(t)}function dt(...t){if(t.length===2){const[n,r]=t,u=l(n),o=a(r);if(Array.isArray(o)){const i=new Array(o.length);for(var e=0;e<o.length;e++)i[e]=u(o[e]);return i}else{const i=[],s=$(o);let c;for(;(c=s())!==null;)for(let f=0;f<c.length;f++)i.push(u(c[f]));return i}}return[...F(...t)]}function xt(t,e){if(e instanceof y){let n=e;for(;;){n.force();const r=n.chunk;if(r===null)return t;Array.prototype.push.apply(t,r),n=n._rest}}for(const n of a(e))t.push(n);return t}function yt(t){return t instanceof y?xt([],t):[...a(t)]}function U(t){return X(t)?t:xt([],t)}function _r(t){return new Set(a(t))}function dr(t){return d(t)===m}function we(t,...e){t=l(t);const n=e.slice(0,e.length-1),r=e[e.length-1],u=t.squint$lang$variadic;if(u){const o=u.length-1,i=[];let s=0,c;for(;s<o&&s<n.length;s++)i.push(n[s]);if(s<o){let f=R(r);for(;s<o&&f!=null;s++)i.push(O(f)),f=st(f);c=f}else c=s<n.length?rt([n.slice(s),r]):r;return c=c==null?null:R(c),c==null?t(...i):u(...i,c)}return t(...n,...a(r))}function be(t){if(!Number.isInteger(t))throw new Error(`Argument must be an integer: ${t}`);return t%2==0}function xr(t){return!be(t)}function nt(t){return t=l(t),(...e)=>Tt(t(...e))}function yr(t){return(...e)=>t}class et extends Array{constructor(...e){super(),this[_]=E,this.push(...e)}}function Ot(t){return t?.[_]===E}function Me(...t){return new et(...t)}function gr(...t){const e=t.pop();return new et(...t,...a(e))}function zt(t){return Array.isArray(t)}const kt=Symbol("concat-done");function rt(t){const e=Array.isArray(t),n=e?t.slice():null,r=e?null:b(a(t));let u=0;const o=()=>{if(e){if(u>=n.length)return kt;const c=n[u];return n[u]=null,u++,c}const s=r.next();return s.done?kt:s.value},i=s=>()=>{for(;;){if(s!==null)if(s instanceof y){if(s.force(),s.chunk!==null)return[s.chunk,i(s._rest)];s=null}else{const f=s.a,p=s.pos;if(p<f.length){const N=Math.min(p+pt,f.length);return[f.slice(p,N),i({a:f,pos:N})]}s=null}const c=o();if(c===kt)return null;s=c instanceof y?c:Array.isArray(c)?{a:c,pos:0}:jt(c)}};return new y(i(null))}const mr=kn((...t)=>rt(t),t=>rt(t));function Ar(t,...e){return e.length===0?ue(F(t),en):rt(F(t,...e))}function ve(t){return t}function ke(...t){const e=t.map(n=>b(a(n)));return g(function*(){for(;;){const n=[];for(const r of e){const u=r.next();if(u.done)return;n.push(u.value)}yield*n}})}function wr(t){return v(e=>{let n=!1;return(r,u)=>{if(!n)return n=!0,e(r,u);const o=e(r,t);return q(o)?o:e(o,u)}})}function br(t,e){return arguments.length===1?wr(t):wt(1,ke(Gt(t),e))}function Mr(t,e){const n=d(t),r=ft(n)||{};for(const u of e){const o=S(t,u);o!==void 0&&T(r,u,o)}return r}function $t(t){return q(t)?Y(t):t}function vr(t){return e=>{let n=[];return(...r)=>{let u,o;switch(r.length){case 0:return e();case 1:return u=r[0],n.length!==0&&(o=[...n],n=[],u=$t(e(u,o))),e(u);case 2:return u=r[0],n.push(r[1]),t===n.length?(o=[...n],n=[],e(u,o)):u}}}}function Se(t,...e){if(arguments.length===1)return vr(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),Ee(t,n,[],r,!0)}function Re(t,...e){let n=t,r,u=e[0];return e.length===2?[n,u]=e:e.length>2&&([n,r,u]=e),Ee(t,n,r,u,!1)}const kr=Re,Sr=Se;function Ee(t,e,n,r,u){return z(r,function*(o){let i=[],s=0;for(const c of o)s<t&&(i.push(c),i.length===t&&(yield i,i=e<t?i.slice(e):[])),s++,s===e&&(s=0);i.length>0&&(i.length===t||u?yield i:n!==void 0&&(n!=null&&i.push(...[...a(n)].slice(0,t-i.length)),yield i))})}function Rr(t){return e=>{let n=[];const r={};let u=r;return(...o)=>{const i=o.length;if(i===0)return e();if(i===1){let s=o[0];if(n.length!==0){const c=[...n];n=[],s=$t(e(s,c))}return e(s)}if(i===2){const s=o[0],c=o[1],f=u,p=t(c);if(u=p,f===r||p===f)return n.push(c),s;{const N=[...n];n=[];const G=e(s,N);return q(G)||n.push(c),G}}}}}function Er(t,e){if(t=l(t),arguments.length===1)return Rr(t);const n=b(e);return g(function*(){const r=n.next();r.done&&(yield*null);const u=r.value;let o=t(u),i=[u],s=[];for(;;){const c=n.next();if(c.done){yield i;break}const f=c.value,p=t(f);o==p?i.push(f):(yield i,s.push(f),i=s,o=p,s=[])}})}function gt(t){const e=d(t);if(e!=null)return A(t,ft(e));throw new Error(`Can't create empty of ${typeof t}`)}function Qr(...t){if(!t.some(x))return null;const e=t[0];let n;return e==null?n={}:n=Ke(gt(e),e),W(n,...t.slice(1))}function Qe(t){return t[0]}function Ne(t){return t[1]}function Nr(t,...e){t=l(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(o,i)=>{const s=Qe(i),c=Ne(i);return se(o,s)?D(o,s,t(S(o,s),c)):D(o,s,c)};return B((o,i)=>B(r,o||{},R(i)),e)}else return null}function Kr(){return performance.now()}function Ke(...t){let e,n,r,u,o;switch(t.length){case 0:return[];case 1:return t[0];case 2:return e=t[0]??[],X(e)?xt(I(e),t[1]):B(W,I(e),t[1]);case 3:return e=t[0],n=t[1],r=t[2],u=I(e),o=(i,s)=>s===void 0?i:W(i,s),Yt(n,o,u,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function jr(t,e){return t===e}function Gt(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);if(t.length==1){const r=t[0];return g(function*(){for(;;)yield r})}const[e,n]=t;return g(function*(){for(var r=0;r<e;r++)yield n})}function je(t){return q(t)?t:at(t)}function Ir(t){return v(e=>{let n=t;return(r,u)=>{const o=--n+1;return o>0&&(r=e(r,u)),o>1?r:je(r)}})}function mt(t,e){return arguments.length===1?Ir(t):z(e,function*(n){let r=t-1;for(const u of n)if(r-->=0&&(yield u),r<0)return})}function Tr(t,e){if(t<=0)return null;if(Array.isArray(e))return R(e.slice(-t));{const n=new Array(t);let r=0;for(const u of a(e))n[r%t]=u,r++;return r===0?null:r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Or(t){return v(e=>(n,r)=>x(t(r))?e(n,r):at(n))}function At(t,e){return t=l(t),arguments.length===1?Or(t):z(e,function*(n){for(const r of n)if(x(t(r)))yield r;else return})}function zr(t){return v(e=>{let n=-1;return(r,u)=>nn(++n,t)===0?e(r,u):r})}function $r(t,e){return arguments.length===1?zr(t):t<=0?Gt(O(e)):z(e,function*(n){let r=0;for(const u of n)r%t===0&&(yield u),r++})}function Gr(t,...e){return t=l(t),function(...n){return t(...e,...n)}}function Br(t){return g(function*(){for(;;)yield*t})}function qr(t){return v(e=>{let n=t;return(r,u)=>n-- >0?r:e(r,u)})}function wt(t,e){return arguments.length===1?qr(t):z(e,function*(n){for(let r=0;r<t;r++)n.next();yield*n})}function Cr(t){return v(e=>{let n=!0;return(r,u)=>n&&x(t(u))?r:(n=!1,e(r,u))})}function Ie(t,e){return t=l(t),arguments.length===1?Cr(t):z(e,function*(n){for(;;){const r=n.next();if(r.done)break;const u=r.value;if(!x(t(u))){yield u;break}}yield*n})}function Lr(){return v(t=>{const e=new Set;return(n,r)=>e.has(r)?n:(e.add(r),t(n,r))})}function Dr(t){return arguments.length===0?Lr():z(t,function*(e){const n=new Set;for(const r of e)n.has(r)||(yield r),n.add(r)})}const ut=Symbol("dedupe-none");function Pr(){return v(t=>{let e=ut;return(n,r)=>{const u=e!==ut&&x(Z(e,r));return e=r,u?n:t(n,r)}})}function Fr(t){return arguments.length===0?Pr():z(t,function*(e){let n=ut;for(const r of e)(n===ut||!x(Z(n,r)))&&(yield r),n=r})}function Yr(t,e,n,...r){return n=l(n),D(t,e,n(S(t,e),...r))}function Bt(t,e,n){let r=t;for(const u of e)r=S(r,u);return r===void 0?n:r}function Ur(t,e,n,...r){return n=l(n),ne(t,e,n(Bt(t,e),...r))}function qt(t,...e){t=l(t);const n=e.length;return function(...r){for(let u=0;u<n;u++)r[u]==null&&(r[u]=e[u]);return t(...r)}}function Te(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++)if(!t(e[u]))return!1;return!0}const n=$(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++)if(!t(r[u]))return!1;return!0}function Vr(t,e){return!Te(t,e)}function Wr(t){return v(e=>(n,r)=>{const u=t(r);return u==null?n:e(n,u)})}function Hr(t,e){return t=l(t),arguments.length===1?Wr(t):tt(e,n=>{const r=[];for(let u=0;u<n.length;u++){const o=t(n[u]);x(o)&&r.push(o)}return r})}function Jr(t){return yt(t).reverse()}function ot(t,e){return arguments.length===1&&(e=t,t=void 0),t=l(t),yt(e).sort(t||Q)}function Ct(t){return t===Q?t:(e,n)=>{const r=t(e,n);return Ce(r)?r:r?-1:t(n,e)?1:0}}function Zr(t,e,n){return arguments.length===2&&(n=e,e=Q),t=l(t),e=l(e),ot((r,u)=>{const o=Ct(e),i=t(r),s=t(u);return o(i,s)},n)}function Xr(t){const e=yt(t);let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),u=e[n];e[n]=e[r],e[r]=u}return e}function Oe(t,e){if(t=l(t),Array.isArray(e)){for(let u=0;u<e.length;u++){const o=t(e[u]);if(x(o))return o}return}const n=$(e);let r;for(;(r=n())!==null;)for(let u=0;u<r.length;u++){const o=t(r[u]);if(x(o))return o}}function tu(t,e){return t=l(t),!Oe(t,e)}function eu(t,e){return(Array.isArray(e)?dt:F)(r=>{const u=t[r];return u!==void 0?u:r},e)}function nu(t){return!R(t)}function ru(t){return t===void 0&&(t=1),Math.random()*t}function ze(t){return Math.floor(Math.random()*t)}function uu(t){const e=ze(it(t));return le(t,e)}function ou(t){return g(function*(){for(;;)yield t()})}function iu(t,e){arguments.length===1&&(e=t,t=void 0);const n=ou(e);if(t!==void 0){if(typeof t!="number")throw new Error("repeatedly: count must be a number, got: "+It(t));return mt(t,n)}else return n}function Lt(t,e,n,...r){n=l(n);const u=S(t,e);return T(t,e,n(u,...r))}function su(t,e){t=l(t);const n={};for(const r of a(e)){const u=t(r);Lt(n,u,qt(W,[]),r)}return n}function cu(t){const e={},n=qt(ce,0);for(const r of a(t))Lt(e,r,n);return e}class fu extends y{static[Symbol.hasInstance](e){return e instanceof y}constructor(e){super(()=>Kt(b(a(e())))())}}function lu(t){const e=yt(t);return e.pop(),e.length>0?e:null}function au(...t){const[e,n]=t.length>1?t:[1,t[0]];return F((r,u)=>r,n,wt(e,n))}function pu(t,e){return[mt(t,e),wt(t,e)]}function hu(t,e){return[At(t,e),Ie(t,e)]}function it(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;const n=$(t);let r=0,u;for(;(u=n())!==null;)r+=u.length;return r}function _u(t){return t===!0}function du(t){return t===!1}function xu(t){return t!=null}function yu(t){return x(t)}function gu(t){return t===0}function mu(t){return t<0}function Au(t){return t>0}function wu(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function bu(t){return t.length}function Mu(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const u=[e,n,...r],o=u[u.length-1];let i=t,s=0;const c=u.length-2;for(;s<c;s++)i=i[u[s]];return i[u[s]]=o,n}}function vu(t){if(t instanceof y){const e=$(t);for(;e()!==null;);return null}for(const e of a(t));return null}function ku(t){return U(t)}function Su(t){return[...t]}function Ru(t,e,n){return t._add_watch(e,n),t}function Eu(t,e){return t._remove_watch(e),t}function Dt(t,e,n){if(!n)return e;var r=e;for(const u of a(n))r=t(r,u[0],u[1]);return r}function $e(t,...e){let n=t;for(const r of e)n=n>r?n:r;return n}function Qu(t,...e){let n=t;for(const r of e)n=n<r?n:r;return n}function Ge(t){return t==null?!1:!!(lt(t)||t instanceof Map||t[_]===h)}function Nu(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Ku(...t){return(...e)=>{for(const n of t)for(const r of e){const u=n(r);if(u)return u}}}function Be(t,e){return U(e||t)}function ju(t,e){var n=e;return g(function*(){for(;;)yield n,n=t(n)})}function Iu(...t){return t=t.map(l),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function st(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return R(H(t))}function Tu(t){return st(st(t))}function Q(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string"||n==="boolean"&&r==="boolean")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let u=0;u<t.length;u++){const o=Q(t[u],e[u]);if(o!=0)return o}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function Ou(t){return Be(t)}function x(t){return t!=null&&t!==!1}const zu=x;function qe(t,e,n){return t.substring(e,n)}function Pt(t){return typeof t=="function"}function $u(t){return Pt(t)}function Gu(t){return!0}function Bu(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const u of n)if(x(Z(u,r)))return!1;n.push(r)}return!0}function qu(t,e){return g(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:U(n);const o=n.index+$e(1,r.length);if(o>e.length)break;e=qe(e,o)}else break}})}function Cu(t){return Number.isNaN(t)}function Ce(t){return typeof t=="number"}function Le(t){if(t==null)return;switch(d(t)){case M:{const n=Object.keys(t);return n.length?n:void 0}case h:return t.size?Array.from(t.keys()):void 0}}function Lu(t){return Le(t)??[]}function Du(t){if(t==null)return;switch(d(t)){case M:{const n=Object.values(t);return n.length?n:void 0}case h:return t.size?Array.from(t.values()):void 0}}function bt(t){return typeof t=="string"}function Pu(t){return Math.trunc(t)}function Fu(t){return t+1}function Yu(t){return t-1}function Uu(t,e){return t+e}function Vu(t){const e=t.indexOf("/");return e>=1?t.slice(0,e):null}function Wu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Hu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Ju(t){return typeof t=="string"}function Zu(t){return typeof t=="string"}function Xu(t){return!1}function to(t){return typeof t=="string"&&!t.includes("/")}function eo(t){return typeof t=="string"&&t.includes("/")}function no(t){return d(t)!=null}function ro(t){return t instanceof RegExp}class Ft extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function uo(t){return t instanceof Ft?t._data:null}function oo(t){return t instanceof Error?t.message:null}function io(t){return t instanceof Ft?t._cause:null}function so(t,e,n){return new Ft(t,e,n)}function V(t){return Number.isInteger(t)}function co(t){return typeof t=="number"}const fo=V;function lo(t){return V(t)&&t>0}function ao(t){return V(t)&&t>-1}function po(t){return V(t)&&t<0}function De(t){return t instanceof Object?t[L]:null}function Pe(t,e){if(typeof t=="function"){const r=function(...u){return t.apply(this,u)};return r[L]=e,r}if(t?.[_]===k){const r=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return r[L]=e,r}const n=I(t);return n[L]=e,n}function ho(t,e,...n){return Pe(t,e(De(t),...n))}function _o(t){return t===!0||t===!1}function Fe(t){switch(d(t)){case w:case h:case M:case E:case m:return!0}return!1}function xo(t,e){return Fe(e)?it(e):it(mt(t,e))}function yo(t,e){const n=S(t,e);if(n!==void 0)return pe([e,n])}function go(t,e){return(t%e+e)%e}function mo(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i<=r&&(r=i,u=o)}),u}function Ao(t,e,...n){if(n.length==0)return e;var r=t(e),u=e;return n.forEach(o=>{var i=t(o);i>=r&&(r=i,u=o)}),u}function Ye(t){throw new Error(`Expected string, got: ${typeof t}`)}function wo(t){if(bt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER)return e}return null}return Ye(t)}function bo(t){return bt(t)?/^[\x00-\x20]*[+-]?NaN[\x00-\x20]*$/.test(t)?NaN:/^[\x00-\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\x00-\x20]*$/.test(t)?parseFloat(t):null:Ye(t)}function Ue(t){return t>=0?Math.floor(t):Math.ceil(t)}function Ve(t,e){const n=t%e;return Ue((t-n)/e)}function We(t,...e){if(e.length==0)for(;;){const n=t();if(x(Pt(n))){t=n;continue}else return n}else return We(function(){return we(t,e)})}function Yt(t,...e){if(e.length===2){const n=e[0],r=e[1];return Yt(t,n,n(),r)}else{let n=e[0];const r=e[1],u=e[2];n=t(n);const o=B(n,r,u);return n(o)}}function Mo(t,e){const n={},r=a(t)[Symbol.iterator](),u=a(e)[Symbol.iterator]();let o,i;for(;o=r.next(),!(o.done||(i=u.next(),i.done));)n[o.value]=i.value;return n}function vo(t){return R(t)?t:null}function He(t,e,n){const r=function*(u){if(yield u,x(t(u)))for(const o of a(e(u)))yield*r(o)};return g(function*(){yield*r(n)})}function ko(t){return ht(nt(Rt),H(He(Rt,R,t)))}function So(t){return I(t)}function Ro(t){return t}const Je=class Ze{constructor(e,n){this[_]=m,this[ct]=!0,this._cmp=n??e?._cmp,e instanceof Ze&&e._cmp===this._cmp||(e=this._cmp?ot(this._cmp,e):ot(e));const u=new Set(e);this._elts=[...u],this._set=u}add(e){if(this._set.has(e))return this;const n=this._elts,r=this._cmp;let u=!1;for(let o=0;o<n.length;o++)if((r?r(e,n[o]):Q(e,n[o]))<=0){n.splice(o,0,e),u=!0;break}return u?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}};function Eo(...t){return new Je(t)}function Qo(t,...e){return new Je(e,Ct(l(t)))}const Xe=class{constructor(e,n){if(this[_]=h,this[ct]=!0,this._cmp=n??e?._cmp,this._map=new Map,this._keys=[],this.size=0,e)for(const[r,u]of e)this.set(r,u)}set(e,n){if(!this._map.has(e)){const r=this._keys,u=this._cmp;let o=0;for(;o<r.length&&(u?u(e,r[o]):Q(e,r[o]))>0;)o++;r.splice(o,0,e)}return this._map.set(e,n),this.size=this._map.size,this}get(e){return this._map.get(e)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)&&(this._keys.splice(this._keys.indexOf(e),1),this.size=this._map.size),this}*keys(){yield*this._keys}*values(){for(const e of this._keys)yield this._map.get(e)}*entries(){for(const e of this._keys)yield[e,this._map.get(e)]}forEach(e){for(const n of this._keys)e(this._map.get(n),n,this)}clear(){this._map.clear(),this._keys=[],this.size=0}[Symbol.iterator](){return this.entries()}};function No(...t){const e=new Xe;for(let n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}function Ko(t,...e){const n=new Xe(null,Ct(l(t)));for(let r=0;r<e.length;r+=2)n.set(e[r],e[r+1]);return n}function Et(t,e,n){return r=>e(Q(r,n),0)}function tn(t,e,n=!0){let r=0;for(;r<t.length&&Q(e,t[r])>0;r++);return r}function jo([t,e,n]){const r=Et(t,e,n);if(e===Jt||e===Zt){const u=[...t],o=tn(u,n,!0);return u.splice(0,o),r(u[0])||u.splice(0,1),u}else return[...At(r,t)]}function Io([t,e,n,r,u]){const o=[...t],i=tn(o,n,!0);o.splice(0,i);const s=Et(t,r,u);return Et(t,e,n)(o[0])||o.splice(0,1),[...At(s,o)]}function To(...t){if(t.length===3)return jo(t);if(t.length===5)return Io(t)}function Oo(t){return Math.abs(t)}function zo(t){return Ue(t)}function $o(t){return t}function Go(t){return t}function Bo(t){return t!=null&&t.constructor}function qo(t){return(e,n)=>{const r=t(e,n);return q(r)?at(r):r}}function en(t){const e=qo(t);return(...n)=>{switch(n.length){case 0:return t();case 1:return t(n[0]);case 2:return B(e,n[0],n[1])}}}function nn(t,e){const n=Ve(t,e);return t-e*n}function Co(t){const e=new Map;return(...n)=>{const r=[n.length,...n],u=Bt(e,r);if(u===void 0){const o=t(...n);return re(e,r,o),o}else return u}}function Lo(t){return Ot(t)?O(t):zt(t)?t[t.length-1]:O(t)}function Do(t){if(t==null)return null;if(Ot(t)){if(t.length===0)throw new Error("Can't pop empty list");return H(t)}else if(zt(t)){if(t.length===0)throw new Error("Can't pop empty vector");const e=[...t];return e.pop(),e}else return H(t)}function Po(t,e){const n=gt(t),r=Xt(t)||T;return Dt((u,o,i)=>r(u,e(o),i),n,t),n}function rn(t,e){const n=gt(t),r=Xt(t)||T;return Dt((u,o,i)=>r(u,o,e(i)),n,t),n}function Fo(){return crypto.randomUUID()}class Mt{constructor(e){this.uuid=e}toString(){return this.uuid}}function Yo(t){return new Mt(t)}function Uo(t){return t instanceof Mt}function Vo(t){return t instanceof Date}class un{constructor(e){this.f=e}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function Wo(t){if(t instanceof un||t instanceof y)return t.realized===!0;throw new Error("realized? not supported on: "+It(t))}function Qt(t,e){if(e.has(t))return t;if(e.add(t),Ge(t))return rn(t,r=>Qt(r,e));const n=d(t);return n&&n!=M?dt(r=>Qt(r,e),t):t}function Ho(t){return Qt(t,new Set)}function Jo(t,e){B((n,r)=>t(r),null,e)}function Zo(...t){return Tt(Z(...t))}class Xo{constructor(e){this.v=e}_deref(){return this.v}}function ti(t){return new Xo(t)}function ei(t,e){return t.v=e,e}function K(t,e=new WeakSet,n=!0){if(t==null)return"nil";if(typeof t=="number")return t===1/0?"##Inf":t===-1/0?"##-Inf":Number.isNaN(t)?"##NaN":String(t);if(typeof t=="boolean")return String(t);if(typeof t=="string")return n?JSON.stringify(t):t;if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(t instanceof Mt)return n?`#uuid "${t.uuid}"`:t.uuid;if(e.has(t))return"#object[circular]";e.add(t);const r=d(t);let u,o;switch(r){case w:o=`[${t.map(i=>K(i,e,n)).join(" ")}]`;break;case m:o=`#{${Array.from(t).map(i=>K(i,e,n)).join(" ")}}`;break;case h:o=`#js/Map {${Array.from(t.entries()).map(([i,s])=>`${K(i,e,n)} ${K(s,e,n)}`).join(", ")}}`;break;case k:case E:o=`(${dt(i=>`${K(i,e,n)}`,t).join(", ")})`;break;default:if(t.constructor&&t.constructor!==Object)return e.delete(t),`#<${t.constructor.name}>`;u=Object.keys(t),o=`{${u.map(i=>`:${i} ${K(t[i],e,n)}`).join(", ")}}`}return e.delete(t),o}return`#object[${t.constructor.name}]`}function Ut(...t){return t.map((e,n)=>K(e)).join(" ")}function ni(...t){P.val(Ut(...t)),Nt.val&&P.val(`
|
|
3
|
-
`)}return
|
|
1
|
+
var squint;(squint||={}).core=(()=>{var Gt=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames;var Bn=Object.prototype.hasOwnProperty;var Fn=(t,e)=>{for(var n in e)Gt(t,n,{get:e[n],enumerable:!0})},Cn=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Gn(e))!Bn.call(t,o)&&o!==n&&Gt(t,o,{get:()=>e[o],enumerable:!(r=Dn(e,o))||r.enumerable});return t};var Ln=t=>Cn(Gt({},"__esModule",{value:!0}),t);var ts={};Fn(ts,{Atom:()=>Ze,Cons:()=>Ce,Delay:()=>we,IAtom:()=>Qr,IDeref:()=>Kr,IDeref__deref:()=>T,IIterable:()=>De,IIterable__iterator:()=>hr,IReset:()=>Ue,IReset__reset_BANG_:()=>H,ISeqable:()=>Or,ISeqable__seq:()=>ot,ISwap:()=>Ve,ISwap__swap_BANG_:()=>k,IWatchable:()=>Je,IWatchable__add_watch:()=>J,IWatchable__notify_watches:()=>wt,IWatchable__remove_watch:()=>X,LazySeq:()=>Xo,NaN_QMARK_:()=>$u,PROTOCOL_SENTINEL:()=>Tr,UUID:()=>pt,_:()=>Vn,_EQ_:()=>it,_GT_:()=>Me,_GT__EQ_:()=>Ee,_LT_:()=>Wn,_LT__EQ_:()=>Pn,_PLUS_:()=>Yn,_STAR_:()=>Un,_STAR_print_err_fn_STAR_:()=>cr,_STAR_print_fn_STAR_:()=>U,_STAR_print_newline_STAR_:()=>Ut,__protocol_satisfies:()=>Hn,__toFn:()=>a,_add_watch:()=>re,_deref:()=>ee,_iterator:()=>Ge,_notify_watches:()=>Xe,_remove_watch:()=>oe,_reset_BANG_:()=>ne,_seq:()=>Ye,_swap_BANG_:()=>He,abs:()=>vi,aclone:()=>du,add_watch:()=>Au,alength:()=>au,any_QMARK_:()=>Qu,apply:()=>tn,array:()=>Hr,array_QMARK_:()=>ie,array_map:()=>tr,aset:()=>pu,assoc:()=>Y,assoc_BANG_:()=>z,assoc_in:()=>ve,assoc_in_BANG_:()=>ke,atom:()=>Gr,boolean$:()=>iu,boolean_QMARK_:()=>ci,bounded_count:()=>fi,butlast:()=>Zo,cat:()=>$n,char_QMARK_:()=>no,clj__GT_js:()=>Pi,coll_QMARK_:()=>Hu,comp:()=>Ne,compare:()=>K,compare_and_set_BANG_:()=>Lr,complement:()=>gt,concat:()=>io,conj:()=>rr,conj_BANG_:()=>rt,cons:()=>Ar,constantly:()=>oo,contains_QMARK_:()=>Ke,count:()=>Mt,counted_QMARK_:()=>Sn,cycle:()=>Ro,dec:()=>sr,dedupe:()=>Ko,deref:()=>tt,disj:()=>or,disj_BANG_:()=>Qe,dissoc:()=>ir,dissoc_BANG_:()=>ur,distinct:()=>To,distinct_QMARK_:()=>Ku,doall:()=>_u,dorun:()=>hu,double$:()=>Ti,double_QMARK_:()=>ni,double_array:()=>gu,drop:()=>zt,drop_last:()=>tu,drop_while:()=>hn,empty:()=>$t,empty_QMARK_:()=>Wo,ensure_reduced:()=>pn,es6_iterator:()=>E,even_QMARK_:()=>en,every_QMARK_:()=>_n,every_pred:()=>Eu,ex_cause:()=>ti,ex_data:()=>Xu,ex_info:()=>ei,ex_message:()=>Zu,false_QMARK_:()=>ou,ffirst:()=>dr,filter:()=>kt,filterv:()=>br,find:()=>li,first:()=>C,flatten:()=>wi,float$:()=>Ni,float_array:()=>wu,fn_QMARK_:()=>de,fnil:()=>ae,force:()=>Wi,frequencies:()=>Jo,get:()=>v,get_in:()=>le,group_by:()=>Ho,hash_map:()=>Ie,hash_set:()=>to,identical_QMARK_:()=>mo,identity:()=>rn,ifn_QMARK_:()=>Tu,inc:()=>Oe,inst_QMARK_:()=>Fi,int_QMARK_:()=>et,int_array:()=>yu,integer_QMARK_:()=>ri,interleave:()=>on,interpose:()=>fo,into:()=>an,into_array:()=>gn,iterable:()=>f,iterate:()=>Iu,js_keys:()=>ju,js_obj:()=>lu,juxt:()=>Ru,keep:()=>zo,keep_indexed:()=>vr,key:()=>fn,keys:()=>bn,keyword:()=>Cu,keyword_QMARK_:()=>Wu,last:()=>xr,lazy:()=>w,list:()=>nn,list_QMARK_:()=>ue,list_STAR_:()=>uo,long$:()=>ki,long_array:()=>xu,map:()=>V,map_QMARK_:()=>wn,map_entry_QMARK_:()=>pr,map_indexed:()=>Sr,mapcat:()=>so,mapv:()=>Qt,max:()=>xn,max_key:()=>hi,memoize:()=>Oi,merge:()=>xo,merge_with:()=>wo,meta:()=>Mn,min:()=>Mu,min_key:()=>pi,missing_protocol:()=>Nt,mod:()=>ai,name:()=>kr,namespace:()=>Fu,nat_int_QMARK_:()=>ui,neg_QMARK_:()=>cu,neg_int_QMARK_:()=>ii,next:()=>Et,nil_QMARK_:()=>Nr,nnext:()=>vu,not:()=>Zt,not_EQ_:()=>Ui,not_any_QMARK_:()=>Co,not_empty:()=>xi,not_every_QMARK_:()=>jo,nth:()=>je,number_QMARK_:()=>An,object_QMARK_:()=>Re,object_array:()=>mu,odd_QMARK_:()=>ro,parse_double:()=>di,parse_long:()=>_i,parse_uuid:()=>Bi,partial:()=>Io,partition:()=>sn,partition_all:()=>un,partition_by:()=>yo,partitionv:()=>po,partitionv_all:()=>ho,peek:()=>$i,persistent_BANG_:()=>mi,pop:()=>ji,pos_QMARK_:()=>fu,pos_int_QMARK_:()=>oi,pr:()=>lr,pr_str:()=>ge,print:()=>$e,println:()=>fr,prn:()=>Zi,qualified_keyword_QMARK_:()=>Vu,quot:()=>vn,rand:()=>Po,rand_int:()=>yn,rand_nth:()=>Yo,random_uuid:()=>zi,range:()=>Wr,re_find:()=>Yr,re_matches:()=>Pr,re_pattern:()=>Ur,re_seq:()=>Ou,realized_QMARK_:()=>Li,reduce:()=>L,reduce_kv:()=>_e,reduced:()=>Rt,reduced_QMARK_:()=>W,reductions:()=>gr,regexp_QMARK_:()=>Ju,rem:()=>jn,remove:()=>Mr,remove_watch:()=>bu,repeat:()=>ce,repeatedly:()=>Vo,replace:()=>Lo,reset_BANG_:()=>ct,reset_vals_BANG_:()=>Cr,rest:()=>It,reverse:()=>Do,rseq:()=>Go,run_BANG_:()=>Yi,satisfies_QMARK_:()=>Jn,second:()=>_r,select_keys:()=>lo,seq:()=>N,seq_QMARK_:()=>ar,seqable_QMARK_:()=>Vt,sequential_QMARK_:()=>Lt,set:()=>Xr,set_QMARK_:()=>Zr,shuffle:()=>Fo,simple_keyword_QMARK_:()=>Uu,some:()=>dn,some_QMARK_:()=>uu,some_fn:()=>Su,sort:()=>bt,sort_by:()=>Bo,sorted_QMARK_:()=>eo,sorted_map:()=>Mi,sorted_map_by:()=>Ei,sorted_set:()=>Ai,sorted_set_by:()=>bi,split_at:()=>eu,split_with:()=>nu,str:()=>Xt,string_QMARK_:()=>Dt,subs:()=>mn,subseq:()=>Ri,subvec:()=>Vr,swap_BANG_:()=>Br,swap_vals_BANG_:()=>Fr,symbol:()=>Lu,symbol_QMARK_:()=>Pu,system_time:()=>go,t:()=>Nu,take:()=>jt,take_last:()=>bo,take_nth:()=>So,take_while:()=>qt,to_array:()=>ku,trampoline:()=>kn,transduce:()=>xe,transient$:()=>gi,tree_seq:()=>Nn,true_QMARK_:()=>ru,truth_:()=>d,type:()=>Qi,unchecked_add_int:()=>Bu,unchecked_dec_int:()=>Gu,unchecked_inc_int:()=>Du,unchecked_int:()=>zu,unreduced:()=>se,update:()=>Oo,update_BANG_:()=>he,update_in:()=>$o,update_keys:()=>qi,update_vals:()=>qn,uuid:()=>zn,uuid_QMARK_:()=>Di,val:()=>ln,vals:()=>qu,var_QMARK_:()=>Yu,vary_meta:()=>si,vec:()=>ft,vector:()=>Tt,vector_QMARK_:()=>Jr,volatile_BANG_:()=>Ji,vreset_BANG_:()=>Xi,warn_on_lazy_reusage_BANG_:()=>mr,with_meta:()=>En,zero_QMARK_:()=>su,zipmap:()=>yi});function a(t){if(t==null||typeof t=="function")return t;const e=typeof t;return e==="string"?(n,r)=>v(n,t,r):e==="object"?(n,r)=>v(t,n,r):t}var Ct=Object.prototype.hasOwnProperty;function me(t,e,n){for(n of t.keys())if($(n,e))return n}function Ae(t){return t!=null&&t[Z]===!0&&t[_]===h}function ht(t){return t!=null&&(t instanceof Set||t[_]===m)}function dt(t){return t!=null&&typeof t=="object"&&(t.constructor===Object||t instanceof Map||t[_]===h)}function be(t,e){return t instanceof Map||t[_]===h?t.has(e):Ct.call(t,e)}function Bt(t,e){return t instanceof Map||t[_]===h?t.get(e):t[e]}function _t(t){return t instanceof Map||t[_]===h?t.size:Object.keys(t).length}function $(t,e){if(t===e)return!0;if(t==null)return e==null;var n,r,o;const u=Ae(t);if(u||Ae(e)){const i=u?t:e,s=i===t?e:t;if(!dt(s)||_t(i)!==_t(s))return!1;for(const c of i.keys())if(!be(s,c)||!$(i.get(c),Bt(s,c)))return!1;return!0}if(dt(t)&&dt(e)&&t.constructor!==e.constructor){if(_t(t)!==_t(e))return!1;for(const i of t instanceof Map?t.keys():Object.keys(t))if(!be(e,i)||!$(Bt(t,i),Bt(e,i)))return!1;return!0}if(ht(t)||ht(e)){if(!ht(t)||!ht(e)||t.size!==e.size)return!1;for(let i of t)if(i&&typeof i=="object"&&(i=me(e,i),!i)||!e.has(i))return!1;return!0}if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return!1;if(n===Array){if((r=t.length)===e.length)for(;r--&&$(t[r],e[r]););return r===-1}if(n===Map){if(t.size!==e.size)return!1;for(const i of t)if(o=i[0],o&&typeof o=="object"&&(o=me(e,o),!o)||!$(i[1],e.get(o)))return!1;return!0}if((!n||typeof t=="object")&&t[_]!==I){r=0;for(const i in t)if(Ct.call(t,i)&&++r&&!Ct.call(e,i)||!(i in e)||!$(t[i],e[i]))return!1;return Object.keys(e).length===r}}if(t&&e&&(Array.isArray(t)||t[_]===I)&&(Array.isArray(e)||e[_]===I)){const i=t[Symbol.iterator](),s=e[Symbol.iterator]();for(;;){const c=i.next(),l=s.next();if(c.done||l.done)return!!(c.done&&l.done);if(!$(c.value,l.value))return!1}}return!1}function ut(t,e){return t.every(function(n,r){return r===0||e(t[r-1],n)})}function it(...t){return ut(t,(e,n)=>$(e,n))}function Me(...t){return ut(t,(e,n)=>e>n)}function Ee(...t){return ut(t,(e,n)=>e>=n)}function Wn(...t){return ut(t,(e,n)=>e<n)}function Pn(...t){return ut(t,(e,n)=>e<=n)}function Yn(...t){return t.reduce((e,n)=>e+n,0)}function Un(...t){return t.reduce((e,n)=>e*n,1)}function Vn(...t){return t.length==1?0-t[0]:t.reduce((e,n)=>e-n)}const Hn={};function Jn(t,e){return e==null?t[null]:typeof t=="symbol"?e[t]:e[t.__sym]}function Xn(t,e,n){return t.set(e,n),t}function Zn(t,e,n){return t[e]=n,t}function Se(t){switch(y(t)){case h:return Xn;case b:case g:return Zn}}function z(t,e,n,...r){if(r.length%2!==0)throw new Error("Illegal argument: assoc expects an odd number of arguments.");switch(y(t)){case h:t.set(e,n);for(let o=0;o<r.length;o+=2)t.set(r[o],r[o+1]);break;case b:case g:t[e]=n;for(let o=0;o<r.length;o+=2)t[r[o]]=r[o+1];break;default:throw new Error(`Illegal argument: assoc! expects a Map, Array, or Object as the first argument, but got ${typeof t}.`)}return t}const F=Symbol("meta");function A(t,e){const n=t?.[F];return n!==void 0&&(e[F]=n),e}function q(t){switch(y(t)){case h:return A(t,new t.constructor(t));case m:return A(t,new t.constructor(t));case b:return A(t,[...t]);case g:return A(t,{...t});case Q:return A(t,new lt(...t));default:throw new Error(`Don't know how to copy object of type ${typeof t}.`)}}function Y(t,e,n,...r){if(t==null&&(t={}),M(t)){let u=t.length;for(let i=0;i<r.length+2;i+=2){const s=i===0?e:r[i-2];if(!Number.isInteger(s))throw new Error("Vector's key for assoc must be a number.");if(s<0||s>u)throw new Error(`Index ${s} out of bounds [0,${u}]`);s===u&&u++}}const o=q(t);return z(o,e,n,...r),o}function Ie(...t){if(t.length===0)return{};if(t.length%2!==0)throw new Error("No value supplied for key: "+t[t.length-1]);return Y({},...t)}const tr=Ie,h=1,b=2,g=3,Q=4,m=5,I=6,_=Symbol("squint.lang.type"),Z=Symbol("squint.lang.sorted");function er(t,e){return t.squint$lang$variadic=e,t}function Yt(t){switch(t){case h:return new Map;case b:return[];case g:return{};case Q:return new lt;case m:return new Set;case I:return w(function*(){})}}function St(t){return t.constructor===Object}function M(t){return Array.isArray(t)&&t[_]!==Q}function Re(t){return t!=null&&St(t)}function y(t){if(t==null)return;if(St(t))return g;if(t instanceof Map)return h;if(t instanceof Set)return m;const e=t[_];if(e!==void 0)return e;if(M(t))return b;if(typeof t=="object")return g}function nr(t,e,n,r,o){r=ft(r),n=n||{};const u=y(n);if(u!==h&&u!==b&&u!==g)throw new Error(`Illegal argument: ${e} expects the first argument to be a Map, Array, or Object.`);const i=[n];let s=n;for(let c=0;c<r.length-1;c+=1){const l=r[c];let p;s instanceof Map?p=s.get(l):p=s[l],p||(p=Yt(u)),i.push(p),s=p}i.push(o);for(let c=i.length-2;c>=0;c-=1)i[c]=t(i[c],r[c],i[c+1]);return i[0]}function ve(t,e,n){return nr(Y,"assoc-in",t,e,n)}function ke(t,e,n){e=ft(e);var r=t;const o=y(t);for(const u of e.splice(0,e.length-1)){let i=v(r,u);i===void 0&&(i=Yt(o),z(r,u,i)),r=i}return z(r,e[e.length-1],n),t}function Ne(...t){if(t=t.map(a),t.length===0)return rn;if(t.length===1)return t[0];const[e,...n]=t.slice().reverse();return function(...r){let o=e(...r);for(const u of n)o=u(o);return o}}function Te(t,e){for(const n of e)t.add(n);return t}function rt(...t){const e=t.length;if(e===0)return Tt();if(e===1)return t[0];let n=t[0];if(n==null&&(n=[]),e===2)switch(y(n)){case b:return n.push(t[1]),n;case m:return n.add(t[1]),n}const r=t.slice(1);switch(y(n)){case m:Te(n,r);break;case Q:n.unshift(...r.reverse());break;case b:n.push(...r);break;case h:for(const o of r)if(M(o))xt(o),n.set(o[0],o[1]);else for(const u of yt(o))n.set(u[0],u[1]);break;case g:for(const o of r)if(M(o))xt(o),n[o[0]]=o[1];else for(const u of yt(o))n[u[0]]=u[1];break;default:throw new Error("Illegal argument: conj! expects a Set, Array, List, Map, or Object as the first argument.")}return n}function*yt(t){if(dt(t)){yield*f(t);return}for(const e of f(t)){if(!M(e))throw new Error("conj on a map takes map entries or seqables of map entries");yield e}}function xt(t){if(t.length<2)throw new Error("Vector arg to map conj must be a pair");return t}function rr(...t){if(t.length===0)return Tt();const[e,...n]=t;if(n.length===0)return e;let r=e;r==null&&(r=nn());let o,u;switch(y(r)){case m:return r[Z]?A(r,Te(new r.constructor(r),n)):A(r,new r.constructor([...r,...n]));case Q:return A(r,new lt(...n.reverse(),...r));case b:return A(r,[...r,...n]);case h:o=new Map(r);for(const i of n)if(M(i))xt(i),o.set(i[0],i[1]);else for(const s of yt(i))o.set(s[0],s[1]);return A(r,o);case I:return w(function*(){yield*n,yield*r});case g:u={...r};for(const i of n)if(M(i))xt(i),u[i[0]]=i[1];else for(const s of yt(i))u[s[0]]=s[1];return A(r,u);default:throw new Error("Illegal argument: conj expects a Set, Array, List, Map, or Object as the first argument.")}}function Qe(t,...e){for(const n of e)t.delete(n);return t}function or(t,...e){if(t==null)return t;const n=new t.constructor(t);return A(t,Qe(n,...e))}function Ke(t,e){if(typeof t=="string")return et(e)&&e>=0&&e<t.length;switch(y(t)){case m:case h:return t.has(e);case void 0:return!1;default:return e in t}}function ur(t,...e){for(const n of e)delete t[n];return t}function ir(t,...e){if(!t)return;if(e.length===0)return t;const n=y(t);if(n!==h&&n!==g)throw new Error("dissoc expects a map, got: "+typeof t);if(n===h){let u=!1;for(const s of e)if(t.has(s)){u=!0;break}if(!u)return t;const i=q(t);for(const s of e)i.delete(s);return i}let r=!1;for(const u of e)if(u in t){r=!0;break}if(!r)return t;const o=q(t);for(const u of e)delete o[u];return o}function Oe(t){return t+1}function sr(t){return t-1}const Ut={val:!1},U={val:t=>console.log(t)},cr={val:t=>console.error(t)};function $e(...t){U.val(t.map(e=>j(e,void 0,!1)).join(" "))}function fr(...t){$e(...t),Ut.val&&U.val(`
|
|
2
|
+
`)}function lr(...t){U.val(ge(...t))}function je(t,e,n){if(typeof e!="number")throw new Error("Index argument to nth must be a number");const r=arguments.length>2;if(t==null)return r?n:null;if(Array.isArray(t)){if(e>=0&&e<t.length)return t[e]}else if(e>=0){const o=G(t);let u=0,i;for(;(i=o())!==null;){if(e<u+i.length)return i[e-u];u+=i.length}}if(r)return n;throw new Error("Index out of bounds: "+e)}function v(t,e,n=void 0){if(t==null)return n;let r;if(St(t))return r=t[e],r===void 0?n:r;let o;switch(y(t)){case m:t.has(e)&&(r=e);break;case h:r=t.get(e);break;case b:r=t[e];break;default:if(o=t.get,typeof o=="function")try{r=t.get(e);break}catch{}r=t[e];break}return r!==void 0?r:n}function ar(t){return t!=null&&!!t[Symbol.iterator]}function Lt(t){return Array.isArray(t)||t?.[_]===I}function Vt(t){return t==null||Re(t)||!!t[Symbol.iterator]||!!t[Pe]}const qe=Symbol("squint.lang.map-entry");function ze(t){return t[qe]=!0,t}function pr(t){return Array.isArray(t)&&t[qe]===!0}function f(t){if(t==null)return[];if(t[Symbol.iterator])return t;if(t[ot]!==void 0)return f(t[ot](t));if(t instanceof Object)return Object.entries(t).map(ze);throw new TypeError(`${t} is not iterable`)}const De=Symbol("Iterable"),hr=Symbol.iterator;function Ge(t){return t[Symbol.iterator]()}const E=Ge;function N(t){if(t==null)return t;if(!Vt(t))throw new TypeError(t+" is not ISeqable");if(typeof t=="string")return t.length?[...t]:null;const e=f(t);return e.length===0||e.size===0?null:e instanceof Set||e[_]===m?[...e]:e[Symbol.iterator]().next().done?null:e}function C(t){if(t==null)return;if(Array.isArray(t))return t[0];if(t instanceof x)return t.force(),t.chunk===null?void 0:t.chunk[0];const[e]=f(t);return e}function _r(t){if(t instanceof x){t.force();const r=t.chunk;return r===null?void 0:r.length>1?r[1]:C(t._rest)}const[e,n]=f(t);return n}function dr(t){return C(C(t))}function It(t){const e=Jt(t);e.force();const n=e.chunk;if(n===null)return e;if(n.length>1){const r=new x(null);return r.realized=!0,r.chunk=n.slice(1),r._rest=e._rest,r}return e._rest}const yr=t=>t.value;class P{value;constructor(e){this.value=e,this[T]=yr}}function xr(t){if(t=f(t),Array.isArray(t))return t[t.length-1];const e=G(t);let n,r;for(;(r=e())!==null;)n=r[r.length-1];return n}function Rt(t){return new P(t)}function W(t){return t instanceof P}function L(t,e,n){t=a(t);const r=arguments.length!==2,o=r?n:e;let u=r?e:void 0;if(Array.isArray(o)){let l=0;if(!r){if(o.length===0)return t();u=o[0],l=1}if(u instanceof P)return u.value;for(;l<o.length;l++)if(u=t(u,o[l]),u instanceof P)return u.value;return u}const i=G(o);let s=i(),c=0;if(!r){if(s===null)return t();u=s[0],c=1}if(u instanceof P)return u.value;for(;s!==null;){for(;c<s.length;c++)if(u=t(u,s[c]),u instanceof P)return u.value;s=i(),c=0}return u}function*wr(t,e){const n=e.next();n.done?yield t():yield*Be(t,n.value,e)}function*Be(t,e,n){let r=e;const o=n;for(;;){if(W(r)){yield r.value;return}else yield r;const u=o.next();if(u.done)break;r=t(r,u.value)}}function gr(t,e,n){if(t=a(t),arguments.length===2){const o=E(f(e));return w(function*(){yield*wr(t,o)})}const r=E(f(n));return w(function*(){yield*Be(t,e,r)})}function mr(){console.warn("warn-on-lazy-reusage! is deprecated and does nothing: lazy values are now cached.")}const vt=32,x=class Fe{constructor(e){this[_]=I,this[De]=!0,this.step=e,this.realized=!1,this.chunk=null,this._rest=null}force(){if(!this.realized){this.realized=!0;const e=this.step();this.step=null,e!=null&&(this.chunk=e[0],this._rest=new Fe(e[1]))}return this}[Symbol.iterator](){let e=this,n=0;return{next(){for(;;){e.force();const r=e.chunk;if(r===null)return{value:void 0,done:!0};if(n<r.length)return{value:r[n++],done:!1};e=e._rest,n=0}},[Symbol.iterator](){return this}}}indexOf(e,n=0){let r=0;for(const o of this){if(r>=n&&o===e)return r;r++}return-1}};function Ht(t){const e=()=>{const n=t.next();return n.done?null:[[n.value],e]};return e}function w(t){return new x(Ht(t()))}function D(t,e){const n=E(f(t));return w(()=>e(n))}function Jt(t){if(t instanceof x)return t;if(Array.isArray(t)){const e=n=>()=>{if(n>=t.length)return null;const r=Math.min(n+vt,t.length);return[t.slice(n,r),e(r)]};return new x(e(0))}return new x(Ht(E(f(t))))}function G(t){if(t instanceof x){let n=t;return()=>{if(n===null)return null;n.force();const r=n.chunk;return n=r===null?null:n._rest,r}}const e=E(f(t));return()=>{const n=[];for(let r=0;r<vt;r++){const o=e.next();if(o.done)break;n.push(o.value)}return n.length===0?null:n}}function st(t,e){const n=Jt(t),r=(o,u)=>()=>{let i=o,s=u;for(;;){i.force();const c=i.chunk;if(c===null)return null;const l=e(c,s),p=i._rest;if(s+=c.length,l.length!==0)return[l,r(p,s)];i=p}};return new x(r(n,0))}const Ce=class{constructor(e,n){this[_]=I,this.x=e,this.coll=n}[Symbol.iterator](){const e=this.x;let n=this.coll,r=!1,o=null;return{next(){return r?(o||(o=E(f(n)),n=null),o.next()):(r=!0,{value:e,done:!1})},[Symbol.iterator](){return this}}}};function Ar(t,e){if(!Vt(e))throw new TypeError(e+" is not ISeqable");return new Ce(t,e)}function V(t,...e){switch(t=a(t),e.length){case 0:return n=>(...r)=>{switch(r.length){case 0:return n();case 1:return n(r[0]);case 2:return n(r[0],t(r[1]));default:return n(r[0],t(...r.slice(1)))}};case 1:return st(e[0],n=>{const r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=t(n[o]);return r});default:{const n=e.map(r=>E(f(r)));return w(function*(){for(;;){const r=[];for(const o of n){const u=o.next();if(u.done)return;r.push(u.value)}yield t(...r)}})}}}function S(t){return e=>{const n=t(e);return(...r)=>r.length===0?e():r.length===1?e(r[0]):n(r[0],r[1])}}function Le(t){return S(e=>(n,r)=>d(t(r))?e(n,r):n)}function kt(t,e){return arguments.length===1?Le(t):(t=a(t),st(e,n=>{const r=[];for(let o=0;o<n.length;o++){const u=n[o];d(t(u))&&r.push(u)}return r}))}function br(t,e){return Kt([],kt(t,e))}function Mr(t,e){return arguments.length===1?Le(gt(t)):kt(gt(t),e)}function Er(t){return S(e=>{let n=-1;return(r,o)=>e(r,t(++n,o))})}function Sr(t,e){return t=a(t),arguments.length===1?Er(t):st(e,(n,r)=>{const o=new Array(n.length);for(let u=0;u<n.length;u++)o[u]=t(r+u,n[u]);return o})}function Ir(t,e){return t=a(t),st(e,(n,r)=>{const o=[];for(let u=0;u<n.length;u++){const i=t(r+u,n[u]);d(i)&&o.push(i)}return o})}function Rr(t){return S(e=>{let n=-1;return(r,o)=>{const u=t(++n,o);return u==null?r:e(r,u)}})}function vr(t,e){return arguments.length===1?Rr(t):Ir(t,e)}function Xt(...t){return t.join("")}function kr(t){if(typeof t=="string"){const e=t.indexOf("/");return e>=1?t.slice(e+1):t}throw new Error("Doesn't support name: "+typeof t)}function Zt(t){return!d(t)}function Nr(t){return t==null}const Tr={},We=Symbol("squint.core.IAtom"),te=Symbol("squint.core.IDeref"),Pe=Symbol("squint.core.ISeqable"),Qr={__sym:We},Kr={__sym:te},T=Symbol("IDeref_-deref");function ee(t){return t!=null&&t[T]!==void 0?t[T](t):R(ee,"IDeref.-deref",t)(t)}const Or={__sym:Pe},ot=Symbol("ISeqable_-seq");function Ye(t){return t!=null&&t[ot]!==void 0?t[ot](t):R(Ye,"ISeqable.-seq",t)(t)}function R(t,e,n){const r=t[null];if(r===void 0)throw Nt(e,n);return r}const Ue={__sym:Symbol("squint.core.IReset")},H=Symbol("IReset_-reset!");function ne(t,e){return t!=null&&t[H]!==void 0?t[H](t,e):R(ne,"IReset.-reset!",t)(t,e)}const Ve={__sym:Symbol("squint.core.ISwap")},k=Symbol("ISwap_-swap!");function He(t,e,...n){return t!=null&&t[k]!==void 0?t[k](t,e,...n):R(He,"ISwap.-swap!",t)(t,e,...n)}const Je={__sym:Symbol("squint.core.IWatchable")},J=Symbol("IWatchable_-add-watch"),X=Symbol("IWatchable_-remove-watch"),wt=Symbol("IWatchable_-notify-watches");function re(t,e,n){return t!=null&&t[J]!==void 0?t[J](t,e,n):R(re,"IWatchable.-add-watch",t)(t,e,n)}function oe(t,e){return t!=null&&t[X]!==void 0?t[X](t,e):R(oe,"IWatchable.-remove-watch",t)(t,e)}function Xe(t,e,n){return t!=null&&t[wt]!==void 0?t[wt](t,e,n):R(Xe,"IWatchable.-notify-watches",t)(t,e,n)}const $r=t=>t.val,nt=(t,e)=>{if(t._validator&&!d(t._validator(e)))throw new Error("Validator rejected reference state");const n=t.val;if(t.val=e,t._hasWatches)for(const[r,o]of Object.entries(t._watches))o(r,t,n,e);return e},jr=function(t,e,n,r,o){switch(arguments.length){case 2:return nt(t,e(t.val));case 3:return nt(t,e(t.val,n));case 4:return nt(t,e(t.val,n,r));default:return nt(t,e(t.val,n,r,...o))}},qr=(t,e,n)=>{t._watches[e]=n,t._hasWatches=!0},zr=(t,e)=>{delete t._watches[e]},Dr=(t,e,n)=>{for(const[r,o]of Object.entries(t._watches))o(r,t,e,n)};class Ze{constructor(e){this.val=e,this._watches={},this._hasWatches=!1,this[We]=!0,this[te]=!0,this[T]=$r,this[Ue.__sym]=!0,this[H]=nt,this[Ve.__sym]=!0,this[k]=jr,this[Je.__sym]=!0,this[J]=qr,this[X]=zr,this[wt]=Dr}}function Gr(t,...e){const n=new Ze(t);for(let r=0;r<e.length;r+=2)e[r]==="meta"?n[F]=e[r+1]:e[r]==="validator"&&(n._validator=e[r+1]);return n}function Nt(t,e){let n;return e===null?n="null":e===void 0?n="undefined":Array.isArray(e)?n="array":typeof e=="object"&&e.constructor&&e.constructor!==Object?n=e.constructor.name:n=typeof e,new Error(`No protocol method ${t} defined for type ${n}: ${e??""}`)}function tt(t){return t?.[T]!==void 0?t[T](t):R(ee,"IDeref.-deref",t)(t)}function ct(t,e){return t?.[H]!==void 0?t[H](t,e):R(ne,"IReset.-reset!",t)(t,e)}function Br(t,e,...n){if(e=a(e),t?.[k]!==void 0)switch(n.length){case 0:return t[k](t,e);case 1:return t[k](t,e,n[0]);case 2:return t[k](t,e,n[0],n[1]);default:return t[k](t,e,n[0],n[1],n.slice(2))}const r=e(tt(t),...n);return ct(t,r),r}function Fr(t,e,...n){const r=tt(t);e=a(e);const o=e(r,...n);return ct(t,o),[r,o]}function Cr(t,e){const n=tt(t);return ct(t,e),[n,e]}function Lr(t,e,n){return tt(t)===e?(ct(t,n),!0):!1}function Wr(t,e,n){let r=t,o=e,u=n;e===void 0&&(r=0,o=t);const i=r||0;u=n??1;const s=u>=0,c=p=>o===void 0||s&&p<o||!s&&o<p,l=p=>()=>{if(!c(p))return null;const O=[];let B=p;for(;O.length<vt&&c(B);)O.push(B),B+=u;return[O,l(B)]};return new x(l(i))}function Pr(t,e){const n=t.exec(e);return n&&e===n[0]?n.length===1?n[0]:n:null}function Yr(t,e){if(Dt(e)){const n=t.exec(e);return n!=null?n.length===1?n[0]:[...n]:null}else throw new TypeError("re-find must match against a string.")}function Ur(t){if(t instanceof RegExp)return t;const e=t.match(/^\(\?([dgimsuvy]*)\)/);return e?new RegExp(t.slice(e[0].length),e[1]):new RegExp(t)}function Vr(t,e,n){if(!M(t))throw new Error("subvec: argument must be a vector");if(n===void 0&&(n=t.length),e==null||n==null)throw new Error("subvec: start and end must not be nil");if(e=e|0,n=n|0,e<0||n<e||n>t.length)throw new Error("subvec: index out of bounds");return t.slice(e,n)}function Tt(...t){return t}const Hr=Tt;function Jr(t){return M(t)}function Qt(...t){if(t.length===2){const[n,r]=t,o=a(n),u=f(r);if(Array.isArray(u)){const i=new Array(u.length);for(var e=0;e<u.length;e++)i[e]=o(u[e]);return i}else{const i=[],s=G(u);let c;for(;(c=s())!==null;)for(let l=0;l<c.length;l++)i.push(o(c[l]));return i}}return[...V(...t)]}function Kt(t,e){if(e instanceof x){let n=e;for(;;){n.force();const r=n.chunk;if(r===null)return t;Array.prototype.push.apply(t,r),n=n._rest}}for(const n of f(e))t.push(n);return t}function Ot(t){return t instanceof x?Kt([],t):[...f(t)]}function ft(t){return M(t)?t:Kt([],t)}function Xr(t){return new Set(f(t))}function Zr(t){return y(t)===m}function to(...t){return new Set(t)}function eo(t){return t!=null&&t[Z]===!0}function no(t){return typeof t=="string"&&t.length===1}function tn(t,...e){t=a(t);const n=e.slice(0,e.length-1),r=e[e.length-1],o=t.squint$lang$variadic;if(o){const u=o.length-1,i=[];let s=0,c;for(;s<u&&s<n.length;s++)i.push(n[s]);if(s<u){let l=N(r);for(;s<u&&l!=null;s++)i.push(C(l)),l=Et(l);c=l}else c=s<n.length?mt([n.slice(s),r]):r;return c=c==null?null:N(c),c==null?t(...i):o(...i,c)}return t(...n,...f(r))}function en(t){if(!Number.isInteger(t))throw new Error(`Argument must be an integer: ${t}`);return t%2==0}function ro(t){return!en(t)}function gt(t){return t=a(t),(...e)=>Zt(t(...e))}function oo(t){return(...e)=>t}class lt extends Array{constructor(...e){super(),this[_]=Q,this.push(...e)}}function ue(t){return t?.[_]===Q}function nn(...t){return new lt(...t)}function uo(...t){const e=t.pop();return new lt(...t,...f(e))}function ie(t){return Array.isArray(t)}const Ft=Symbol("concat-done");function mt(t){const e=Array.isArray(t),n=e?t.slice():null,r=e?null:E(f(t));let o=0;const u=()=>{if(e){if(o>=n.length)return Ft;const c=n[o];return n[o]=null,o++,c}const s=r.next();return s.done?Ft:s.value},i=s=>()=>{for(;;){if(s!==null)if(s instanceof x){if(s.force(),s.chunk!==null)return[s.chunk,i(s._rest)];s=null}else{const l=s.a,p=s.pos;if(p<l.length){const O=Math.min(p+vt,l.length);return[l.slice(p,O),i({a:l,pos:O})]}s=null}const c=u();if(c===Ft)return null;s=c instanceof x?c:Array.isArray(c)?{a:c,pos:0}:Jt(c)}};return new x(i(null))}const io=er((...t)=>mt(t),t=>mt(t));function so(t,...e){return e.length===0?Ne(V(t),$n):mt(V(t,...e))}function rn(t){return t}function on(...t){const e=t.map(n=>E(f(n)));return w(function*(){for(;;){const n=[];for(const r of e){const o=r.next();if(o.done)return;n.push(o.value)}yield*n}})}function co(t){return S(e=>{let n=!1;return(r,o)=>{if(!n)return n=!0,e(r,o);const u=e(r,t);return W(u)?u:e(u,o)}})}function fo(t,e){return arguments.length===1?co(t):zt(1,on(ce(t),e))}function lo(t,e){const r=y(t)===h?new Map:{};for(const o of f(e)){const u=v(t,o);u!==void 0&&z(r,o,u)}return r}function se(t){return W(t)?tt(t):t}function ao(t){return e=>{let n=[];return(...r)=>{let o,u;switch(r.length){case 0:return e();case 1:return o=r[0],n.length!==0&&(u=[...n],n=[],o=se(e(o,u))),e(o);case 2:return o=r[0],n.push(r[1]),t===n.length?(u=[...n],n=[],e(o,u)):o}}}}function un(t,...e){if(arguments.length===1)return ao(t);let n=t,r=e[0];return e.length===2&&([n,r]=e),cn(t,n,[],r,!0)}function sn(t,...e){let n=t,r,o=e[0];return e.length===2?[n,o]=e:e.length>2&&([n,r,o]=e),cn(t,n,r,o,!1)}const po=sn,ho=un;function cn(t,e,n,r,o){return D(r,function*(u){let i=[],s=0;for(const c of u)s<t&&(i.push(c),i.length===t&&(yield i,i=e<t?i.slice(e):[])),s++,s===e&&(s=0);i.length>0&&(i.length===t||o?yield i:n!==void 0&&(n!=null&&i.push(...[...f(n)].slice(0,t-i.length)),yield i))})}function _o(t){return e=>{let n=[];const r={};let o=r;return(...u)=>{const i=u.length;if(i===0)return e();if(i===1){let s=u[0];if(n.length!==0){const c=[...n];n=[],s=se(e(s,c))}return e(s)}if(i===2){const s=u[0],c=u[1],l=o,p=t(c);if(o=p,l===r||p===l)return n.push(c),s;{const O=[...n];n=[];const B=e(s,O);return W(B)||n.push(c),B}}}}}function yo(t,e){if(t=a(t),arguments.length===1)return _o(t);const n=E(e);return w(function*(){const r=n.next();r.done&&(yield*null);const o=r.value;let u=t(o),i=[o],s=[];for(;;){const c=n.next();if(c.done){yield i;break}const l=c.value,p=t(l);u==p?i.push(l):(yield i,s.push(l),i=s,u=p,s=[])}})}function $t(t){const e=y(t);if(e!=null)return A(t,Yt(e));throw new Error(`Can't create empty of ${typeof t}`)}function xo(...t){if(!t.some(d))return null;const e=t[0];let n;return e==null?n={}:y(e)===void 0?n=e:n=an($t(e),e),rt(n,...t.slice(1))}function fn(t){return t[0]}function ln(t){return t[1]}function wo(t,...e){t=a(t);var n=!1;for(const r of e)if(r!=null){n=!0;break}if(n){const r=(u,i)=>{const s=fn(i),c=ln(i);return Ke(u,s)?Y(u,s,t(v(u,s),c)):Y(u,s,c)};return L((u,i)=>L(r,u||{},N(i)),e)}else return null}function go(){return performance.now()}function an(...t){let e,n,r,o,u;switch(t.length){case 0:return[];case 1:return t[0];case 2:return e=t[0]??[],M(e)?Kt(q(e),t[1]):L(rt,q(e),t[1]);case 3:return e=t[0],n=t[1],r=t[2],o=q(e),u=(i,s)=>s===void 0?i:rt(i,s),xe(n,u,o,r);default:throw TypeError(`Invalid arity call of into: ${t.length}`)}}function mo(t,e){return t===e}function ce(...t){if(t.length==0||t.length>2)throw new Error(`Invalid arity: ${t.length}`);if(t.length==1){const r=t[0];return w(function*(){for(;;)yield r})}const[e,n]=t;return w(function*(){for(var r=0;r<e;r++)yield n})}function pn(t){return W(t)?t:Rt(t)}function Ao(t){return S(e=>{let n=t;return(r,o)=>{const u=--n+1;return u>0&&(r=e(r,o)),u>1?r:pn(r)}})}function fe(t){if(typeof t!="number")throw new Error("Assert failed: (number? n)");return t}function jt(t,e){return fe(t),arguments.length===1?Ao(t):D(e,function*(n){let r=t-1;for(const o of n)if(r-->=0&&(yield o),r<0)return})}function bo(t,e){if(fe(t),t<=0)return null;if(Array.isArray(e))return N(e.slice(-t));{const n=new Array(t);let r=0;for(const o of f(e))n[r%t]=o,r++;return r===0?null:r%t!==0&&r>=t?n.slice(r%t).concat(n.slice(0,r%t)):(n.length=Math.min(r,t),n)}}function Mo(t){return S(e=>(n,r)=>d(t(r))?e(n,r):Rt(n))}function qt(t,e){return t=a(t),arguments.length===1?Mo(t):D(e,function*(n){for(const r of n)if(d(t(r)))yield r;else return})}function Eo(t){return S(e=>{let n=-1;return(r,o)=>jn(++n,t)===0?e(r,o):r})}function So(t,e){return arguments.length===1?Eo(t):t<=0?ce(C(e)):D(e,function*(n){let r=0;for(const o of n)r%t===0&&(yield o),r++})}function Io(t,...e){return t=a(t),function(...n){return t(...e,...n)}}function Ro(t){const e=f(t);return w(function*(){const n=[];for(const r of e)n.push(r),yield r;for(;n.length;)yield*n})}function vo(t){return S(e=>{let n=t;return(r,o)=>n-- >0?r:e(r,o)})}function zt(t,e){return fe(t),arguments.length===1?vo(t):D(e,function*(n){for(let r=0;r<t;r++)n.next();yield*n})}function ko(t){return S(e=>{let n=!0;return(r,o)=>n&&d(t(o))?r:(n=!1,e(r,o))})}function hn(t,e){return t=a(t),arguments.length===1?ko(t):D(e,function*(n){for(;;){const r=n.next();if(r.done)break;const o=r.value;if(!d(t(o))){yield o;break}}yield*n})}function No(){return S(t=>{const e=new Set;return(n,r)=>e.has(r)?n:(e.add(r),t(n,r))})}function To(t){return arguments.length===0?No():D(t,function*(e){const n=new Set;for(const r of e)n.has(r)||(yield r),n.add(r)})}const At=Symbol("dedupe-none");function Qo(){return S(t=>{let e=At;return(n,r)=>{const o=e!==At&&d(it(e,r));return e=r,o?n:t(n,r)}})}function Ko(t){return arguments.length===0?Qo():D(t,function*(e){let n=At;for(const r of e)(n===At||!d(it(n,r)))&&(yield r),n=r})}function Oo(t,e,n,...r){return n=a(n),Y(t,e,n(v(t,e),...r))}function le(t,e,n){let r=t;for(const o of f(e))r=v(r,o);return r===void 0?n:r}function $o(t,e,n,...r){return n=a(n),ve(t,e,n(le(t,e),...r))}function ae(t,...e){t=a(t);const n=e.length;return function(...r){for(let o=0;o<n;o++)r[o]==null&&(r[o]=e[o]);return t(...r)}}function _n(t,e){if(t=a(t),Array.isArray(e)){for(let o=0;o<e.length;o++)if(!t(e[o]))return!1;return!0}const n=G(e);let r;for(;(r=n())!==null;)for(let o=0;o<r.length;o++)if(!t(r[o]))return!1;return!0}function jo(t,e){return!_n(t,e)}function qo(t){return S(e=>(n,r)=>{const o=t(r);return o==null?n:e(n,o)})}function zo(t,e){return t=a(t),arguments.length===1?qo(t):st(e,n=>{const r=[];for(let o=0;o<n.length;o++){const u=t(n[o]);d(u)&&r.push(u)}return r})}function Do(t){return Ot(t).reverse()}function Go(t){if(M(t))return t.length===0?null:[...t].reverse();if(t!=null&&t[Z]===!0){const e=[...t].reverse();return e.length===0?null:e}throw new Error("rseq not supported on: "+typeof t)}function bt(t,e){return arguments.length===1&&(e=t,t=void 0),t=a(t),Ot(e).sort(t||K)}function pe(t){return t===K?t:(e,n)=>{const r=t(e,n);return An(r)?r:r?-1:t(n,e)?1:0}}function Bo(t,e,n){return arguments.length===2&&(n=e,e=K),t=a(t),e=a(e),bt((r,o)=>{const u=pe(e),i=t(r),s=t(o);return u(i,s)},n)}function Fo(t){const e=Ot(t);let n=e.length;for(;n;){const r=Math.floor(Math.random()*n--),o=e[n];e[n]=e[r],e[r]=o}return e}function dn(t,e){if(t=a(t),Array.isArray(e)){for(let o=0;o<e.length;o++){const u=t(e[o]);if(d(u))return u}return}const n=G(e);let r;for(;(r=n())!==null;)for(let o=0;o<r.length;o++){const u=t(r[o]);if(d(u))return u}}function Co(t,e){return t=a(t),!dn(t,e)}function Lo(t,e){return(Array.isArray(e)?Qt:V)(r=>{const o=t[r];return o!==void 0?o:r},e)}function Wo(t){return!N(t)}function Po(t){return t===void 0&&(t=1),Math.random()*t}function yn(t){return Math.floor(Math.random()*t)}function Yo(t){const e=yn(Mt(t));return je(t,e)}function Uo(t){return w(function*(){for(;;)yield t()})}function Vo(t,e){arguments.length===1&&(e=t,t=void 0);const n=Uo(e);if(t!==void 0){if(typeof t!="number")throw new Error("repeatedly: count must be a number, got: "+Xt(t));return jt(t,n)}else return n}function he(t,e,n,...r){n=a(n);const o=v(t,e);return z(t,e,n(o,...r))}function Ho(t,e){t=a(t);const n={};for(const r of f(e)){const o=t(r);he(n,o,ae(rt,[]),r)}return n}function Jo(t){const e={},n=ae(Oe,0);for(const r of f(t))he(e,r,n);return e}class Xo extends x{static[Symbol.hasInstance](e){return e instanceof x}constructor(e){super(()=>Ht(E(f(e())))())}}function Zo(t){const e=Ot(t);return e.pop(),e.length>0?e:null}function tu(...t){const[e,n]=t.length>1?t:[1,t[0]];return V((r,o)=>r,n,zt(e,n))}function eu(t,e){return[jt(t,e),zt(t,e)]}function nu(t,e){return[qt(t,e),hn(t,e)]}function Mt(t){if(!t)return 0;const e=t.length||t.size;if(typeof e=="number")return e;const n=G(t);let r=0,o;for(;(o=n())!==null;)r+=o.length;return r}function ru(t){return t===!0}function ou(t){return t===!1}function uu(t){return t!=null}function iu(t){return d(t)}function su(t){return t===0}function cu(t){return t<0}function fu(t){return t>0}function lu(...t){let e=0;const n={};for(;!(e>=t.length);)n[t[e]]=t[e+1],e=e+2;return n}function au(t){return t.length}function pu(t,e,n,...r){if(r.length==0)return t[e]=n,n;{const o=[e,n,...r],u=o[o.length-1];let i=t,s=0;const c=o.length-2;for(;s<c;s++)i=i[o[s]];return i[o[s]]=u,n}}function hu(t){if(t instanceof x){const e=G(t);for(;e()!==null;);return null}for(const e of f(t));return null}function _u(t){if(t!=null&&t[_]===I)for(const e of t);return t}function du(t){return[...t]}function at(t,e){if(e!==void 0){const n=new Array(t);if(typeof e=="number")return n.fill(e);let r=0;for(const o of f(e)){if(r>=t)break;n[r++]=o}return n}return typeof t=="number"?new Array(t).fill(null):[...f(t)]}function yu(t,e){return at(t,e)}function xu(t,e){return at(t,e)}function wu(t,e){return at(t,e)}function gu(t,e){return at(t,e)}function mu(t,e){return at(t,e)}function Au(t,e,n){return t?.[J]!==void 0?(t[J](t,e,n),t):(R(re,"IWatchable.-add-watch",t)(t,e,n),t)}function bu(t,e){return t?.[X]!==void 0?(t[X](t,e),t):(R(oe,"IWatchable.-remove-watch",t)(t,e),t)}function _e(t,e,n){if(!n)return e;var r=e;for(const o of f(n))r=t(r,o[0],o[1]);return r}function xn(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n>r?n:r;return n}function Mu(t,...e){let n=t;for(const r of e)n=isNaN(n)?n:isNaN(r)?r:n<r?n:r;return n}function wn(t){return t==null?!1:!!(St(t)||t instanceof Map||t[_]===h)}function Eu(...t){return(...e)=>{for(const n of t)for(const r of e)if(!n(r))return!1;return!0}}function Su(...t){return(...e)=>{let n;for(const r of t)for(const o of e)if(n=r(o),d(n))return n;return n}}function gn(t,e){return ft(e||t)}function Iu(t,e){var n=e;return w(function*(){for(;;)yield n,n=t(n)})}function Ru(...t){return t=t.map(a),(...e)=>{const n=[];for(const r of t)n.push(r(...e));return n}}function Et(t){if(Array.isArray(t)){const e=t.slice(1);return e.length>0?e:null}else return N(It(t))}function vu(t){return Et(Et(t))}function K(t,e){if(t===e)return 0;{if(t==null)return-1;if(e==null)return 1;const n=typeof t,r=typeof e;if(n==="number"&&r==="number"||n==="string"&&r==="string"||n==="boolean"&&r==="boolean")return t===e?0:t<e?-1:1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length<e.length)return-1;if(t.length>e.length)return 1;for(let o=0;o<t.length;o++){const u=K(t[o],e[o]);if(u!=0)return u}return 0}else throw new Error(`comparing ${n} to ${r}`)}}function ku(t){return gn(t)}function d(t){return t!=null&&t!==!1}const Nu=d;function mn(t,e,n){return t.substring(e,n)}function de(t){return typeof t=="function"}function Tu(t){return de(t)}function Qu(t){return!0}function Ku(t,...e){if(e.length===0)return!0;const n=[t];for(const r of e){for(const o of n)if(d(it(o,r)))return!1;n.push(r)}return!0}function Ou(t,e){return w(function*(){for(;;){const n=t.exec(e);if(n){const r=n[0];yield n.length===1?r:ft(n);const u=n.index+xn(1,r.length);if(u>e.length)break;e=mn(e,u)}else break}})}function $u(t){return isNaN(t)}function An(t){return typeof t=="number"}function bn(t){if(t==null)return null;switch(y(t)){case g:{const n=Object.keys(t);return n.length?n:void 0}case h:return t.size?Array.from(t.keys()):void 0}for(const n of f(t))throw new TypeError(t+" is not a map");return null}function ju(t){return bn(t)??[]}function qu(t){if(t==null)return null;switch(y(t)){case g:{const n=Object.values(t);return n.length?n:void 0}case h:return t.size?Array.from(t.values()):void 0}for(const n of f(t))throw new TypeError(t+" is not a map");return null}function Dt(t){return typeof t=="string"}function zu(t){return Math.trunc(t)}function Du(t){return t+1}function Gu(t){return t-1}function Bu(t,e){return t+e}function Fu(t){const e=t.indexOf("/");return e>=1?t.slice(0,e):null}function Cu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Lu(t,e){return e!==void 0?(t!=null?t+"/":"")+e:t}function Wu(t){return typeof t=="string"}function Pu(t){return typeof t=="string"}function Yu(t){return!1}function Uu(t){return typeof t=="string"&&!t.includes("/")}function Vu(t){return typeof t=="string"&&t.includes("/")}function Hu(t){return y(t)!=null}function Ju(t){return t instanceof RegExp}class ye extends Error{constructor(e,n,r){super(e),this._data=n,this._cause=r}}function Xu(t){return t instanceof ye?t._data:null}function Zu(t){return t instanceof Error?t.message:null}function ti(t){return t instanceof ye?t._cause:null}function ei(t,e,n){return new ye(t,e,n)}function et(t){return Number.isInteger(t)}function ni(t){return typeof t=="number"}const ri=et;function oi(t){return et(t)&&t>0}function ui(t){return et(t)&&t>-1}function ii(t){return et(t)&&t<0}function Mn(t){return t instanceof Object?t[F]:null}function En(t,e){if(typeof t=="function"){const r=function(...o){return t.apply(this,o)};return r[F]=e,r}if(t?.[_]===I){const r=Object.assign(Object.create(Object.getPrototypeOf(t)),t);return r[F]=e,r}const n=q(t);return n[F]=e,n}function si(t,e,...n){return En(t,e(Mn(t),...n))}function ci(t){return t===!0||t===!1}function Sn(t){switch(y(t)){case b:case h:case g:case Q:case m:return!0}return!1}function fi(t,e){return Sn(e)?Mt(e):Mt(jt(t,e))}function li(t,e){const n=v(t,e);if(n!==void 0)return ze([e,n])}function ai(t,e){return(t%e+e)%e}function pi(t,e,...n){t=a(t);let r=e;for(const o of n)t(r)<t(o)||(r=o);return r}function hi(t,e,...n){t=a(t);let r=e;for(const o of n)t(r)>t(o)||(r=o);return r}function In(t){throw new Error(`Expected string, got: ${typeof t}`)}function _i(t){if(Dt(t)){if(/^[+-]?\d+$/.test(t)){const e=parseInt(t);if(Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER)return e}return null}return In(t)}function di(t){return Dt(t)?/^[\x00-\x20]*[+-]?NaN[\x00-\x20]*$/.test(t)?NaN:/^[\x00-\x20]*[+-]?(Infinity|((\d+\.?\d*|\.\d+)([eE][+-]?\d+)?)[dDfF]?)[\x00-\x20]*$/.test(t)?parseFloat(t):null:In(t)}function Rn(t){return t>=0?Math.floor(t):Math.ceil(t)}function vn(t,e){const n=t%e;return Rn((t-n)/e)}function kn(t,...e){if(e.length==0)for(;;){const n=t();if(d(de(n))){t=n;continue}else return n}else return kn(function(){return tn(t,e)})}function xe(t,...e){if(e.length===2){const n=e[0],r=e[1];return xe(t,n,n(),r)}else{let n=e[0];const r=e[1],o=e[2];n=t(n);const u=L(n,r,o);return n(u)}}function yi(t,e){const n={},r=f(t)[Symbol.iterator](),o=f(e)[Symbol.iterator]();let u,i;for(;u=r.next(),!(u.done||(i=o.next(),i.done));)n[u.value]=i.value;return n}function xi(t){return N(t)?t:null}function Nn(t,e,n){const r=function*(o){if(yield o,d(t(o)))for(const u of f(e(o)))yield*r(u)};return w(function*(){yield*r(n)})}function wi(t){return kt(gt(Lt),It(Nn(Lt,N,t)))}function gi(t){return q(t)}function mi(t){return t}const Tn=class Qn{constructor(e,n){this[_]=m,this[Z]=!0,this._cmp=n??e?._cmp,e instanceof Qn&&e._cmp===this._cmp||(e=this._cmp?bt(this._cmp,e):bt(e));const o=new Set(e);this._elts=[...o],this._set=o,this.size=this._elts.length}add(e){if(this._set.has(e))return this;const n=this._elts,r=this._cmp;let o=!1;for(let u=0;u<n.length;u++)if((r?r(e,n[u]):K(e,n[u]))<=0){n.splice(u,0,e),o=!0;break}return o?this._set=new Set(n):(n.push(e),this._set.add(e)),this.size=n.length,this}delete(e){if(!this._set.has(e))return this;const n=this._elts,r=n.indexOf(e);return n.splice(r,1),this._set=new Set(n),this.size=n.length,this}has(e){return this._set.has(e)}keys(){return this.values()}values(){return this._elts[Symbol.iterator]()}entries(){return this._set.entries()}forEach(...e){return this.set.forEach(...e)}clear(){this._elts=[],this._set=new Set(this._elts)}[Symbol.iterator](){return this.keys()}};function Ai(...t){return new Tn(t)}function bi(t,...e){return new Tn(e,pe(a(t)))}const Kn=class{constructor(e,n){if(this[_]=h,this[Z]=!0,this._cmp=n??e?._cmp,this._map=new Map,this._keys=[],this.size=0,e)for(const[r,o]of e)this.set(r,o)}set(e,n){if(!this._map.has(e)){const r=this._keys,o=this._cmp;let u=0;for(;u<r.length&&(o?o(e,r[u]):K(e,r[u]))>0;)u++;r.splice(u,0,e)}return this._map.set(e,n),this.size=this._map.size,this}get(e){return this._map.get(e)}has(e){return this._map.has(e)}delete(e){return this._map.delete(e)&&(this._keys.splice(this._keys.indexOf(e),1),this.size=this._map.size),this}*keys(){yield*this._keys}*values(){for(const e of this._keys)yield this._map.get(e)}*entries(){for(const e of this._keys)yield[e,this._map.get(e)]}forEach(e){for(const n of this._keys)e(this._map.get(n),n,this)}clear(){this._map.clear(),this._keys=[],this.size=0}[Symbol.iterator](){return this.entries()}};function Mi(...t){const e=new Kn;for(let n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}function Ei(t,...e){const n=new Kn(null,pe(a(t)));for(let r=0;r<e.length;r+=2)n.set(e[r],e[r+1]);return n}function Wt(t,e,n){return r=>e(K(r,n),0)}function On(t,e,n=!0){let r=0;for(;r<t.length&&K(e,t[r])>0;r++);return r}function Si([t,e,n]){const r=Wt(t,e,n);if(e===Me||e===Ee){const o=[...t],u=On(o,n,!0);return o.splice(0,u),r(o[0])||o.splice(0,1),o}else return[...qt(r,t)]}function Ii([t,e,n,r,o]){const u=[...t],i=On(u,n,!0);u.splice(0,i);const s=Wt(t,r,o);return Wt(t,e,n)(u[0])||u.splice(0,1),[...qt(s,u)]}function Ri(...t){if(t.length===3)return Si(t);if(t.length===5)return Ii(t)}function vi(t){return Math.abs(t)}function ki(t){return Rn(t)}function Ni(t){return t}function Ti(t){return t}function Qi(t){return t!=null&&t.constructor}function Ki(t){return(e,n)=>{const r=t(e,n);return W(r)?Rt(r):r}}function $n(t){const e=Ki(t);return(...n)=>{switch(n.length){case 0:return t();case 1:return t(n[0]);case 2:return L(e,n[0],n[1])}}}function jn(t,e){const n=vn(t,e);return t-e*n}function Oi(t){const e=new Map;return(...n)=>{const r=[n.length,...n],o=le(e,r);if(o===void 0){const u=t(...n);return ke(e,r,u),u}else return o}}function $i(t){if(t==null)return null;if(ue(t))return C(t);if(ie(t))return t[t.length-1];throw Nt("IStack.-peek",t)}function ji(t){if(t==null)return null;if(ue(t)){if(t.length===0)throw new Error("Can't pop empty list");return It(t)}else if(ie(t)){if(t.length===0)throw new Error("Can't pop empty vector");const e=[...t];return e.pop(),e}else throw Nt("IStack.-pop",t)}function qi(t,e){const n=$t(t),r=Se(t)||z;return _e((o,u,i)=>r(o,e(u),i),n,t),n}function qn(t,e){const n=$t(t),r=Se(t)||z;return _e((o,u,i)=>r(o,u,e(i)),n,t),n}function zi(){return new pt(crypto.randomUUID())}class pt{constructor(e){this.uuid=e}toString(){return this.uuid}}function zn(t){return new pt(t.toLowerCase())}function Di(t){return t instanceof pt}const Gi=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;function Bi(t){if(typeof t!="string")throw new Error("Expected string, got: "+(t===null?"nil":typeof t));return Gi.test(t)?zn(t):null}function Fi(t){return t instanceof Date}const Ci=t=>t._deref();class we{constructor(e){this.f=e,this[te]=!0,this[T]=Ci}_deref(){return this.realized?this.v:(this.v=this.f(),this.realized=!0,this.v)}}function Li(t){if(t instanceof we||t instanceof x)return t.realized===!0;throw new Error("realized? not supported on: "+Xt(t))}function Wi(t){return t instanceof we?t._deref():t}function Pt(t,e){if(e.has(t))return t;if(e.add(t),wn(t))return qn(t,r=>Pt(r,e));const n=y(t);return n&&n!=g?Qt(r=>Pt(r,e),t):t}function Pi(t){return Pt(t,new Set)}function Yi(t,e){L((n,r)=>t(r),null,e)}function Ui(...t){return Zt(it(...t))}const Vi=t=>t.v;class Hi{constructor(e){this.v=e,this[T]=Vi}}function Ji(t){return new Hi(t)}function Xi(t,e){return t.v=e,e}function j(t,e=new WeakSet,n=!0){if(t==null)return"nil";if(typeof t=="number")return t===1/0?"##Inf":t===-1/0?"##-Inf":Number.isNaN(t)?"##NaN":String(t);if(typeof t=="boolean")return String(t);if(typeof t=="string")return n?JSON.stringify(t):t;if(typeof t=="bigint")return`${t}N`;if(typeof t=="object"){if(t instanceof pt)return n?`#uuid "${t.uuid}"`:t.uuid;if(e.has(t))return"#object[circular]";e.add(t);const r=y(t);let o,u;switch(r){case b:u=`[${t.map(i=>j(i,e,n)).join(" ")}]`;break;case m:u=`#{${Array.from(t).map(i=>j(i,e,n)).join(" ")}}`;break;case h:u=`#js/Map {${Array.from(t.entries()).map(([i,s])=>`${j(i,e,n)} ${j(s,e,n)}`).join(", ")}}`;break;case I:case Q:u=`(${Qt(i=>`${j(i,e,n)}`,t).join(", ")})`;break;default:if(t.constructor&&t.constructor!==Object)return e.delete(t),`#<${t.constructor.name}>`;o=Object.keys(t),u=`{${o.map(i=>`:${i} ${j(t[i],e,n)}`).join(", ")}}`}return e.delete(t),u}return`#object[${t.constructor.name}]`}function ge(...t){return t.map((e,n)=>j(e)).join(" ")}function Zi(...t){U.val(ge(...t)),Ut.val&&U.val(`
|
|
3
|
+
`)}return Ln(ts);})();
|