@webqit/webflo 0.10.5 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1082 -323
- package/package.json +2 -2
- package/src/config-pi/runtime/Client.js +7 -10
- package/src/config-pi/runtime/client/Worker.js +30 -12
- package/src/runtime-pi/Router.js +1 -1
- package/src/runtime-pi/client/Runtime.js +98 -49
- package/src/runtime-pi/client/RuntimeClient.js +12 -40
- package/src/runtime-pi/client/Workport.js +163 -0
- package/src/runtime-pi/client/generate.js +71 -37
- package/src/runtime-pi/client/worker/Worker.js +57 -23
- package/src/runtime-pi/client/worker/Workport.js +80 -0
- package/src/runtime-pi/server/Runtime.js +22 -8
- package/src/runtime-pi/server/RuntimeClient.js +6 -6
- package/src/runtime-pi/util.js +2 -2
- package/test/site/package.json +9 -0
- package/test/site/public/bundle.html +3 -0
- package/test/site/public/bundle.html.json +1 -0
- package/test/site/public/bundle.js +1 -1
- package/test/site/public/bundle.js.gz +0 -0
- package/test/site/public/bundle.webflo.js +8 -8
- package/test/site/public/bundle.webflo.js.gz +0 -0
- package/test/site/public/index.html +5 -5
- package/test/site/public/index1.html +35 -0
- package/test/site/public/page-2/bundle.js +1 -1
- package/test/site/public/page-2/bundle.js.gz +0 -0
- package/test/site/public/page-2/index.html +3 -4
- package/test/site/public/page-3/logo-130x130.png +0 -0
- package/test/site/public/page-4/subpage/bundle.js +1 -1
- package/test/site/public/page-4/subpage/bundle.js.gz +0 -0
- package/test/site/public/sparoots.json +5 -0
- package/test/site/public/worker.js +1 -1
- package/test/site/public/worker.js.gz +0 -0
- package/test/site/server/index.js +14 -6
- package/docker/Dockerfile +0 -26
- package/docker/README.md +0 -77
- package/src/runtime-pi/client/WorkerComm.js +0 -102
|
Binary file
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head>
|
|
2
2
|
<title>Home</title>
|
|
3
|
+
|
|
3
4
|
<script type="module" src="/bundle.webflo.js" by="webflo"></script>
|
|
4
5
|
<script type="module" src="/bundle.js" by="webflo"></script>
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
<template name="routes" src="/bundle.html" by="oohtml-cli"></template>
|
|
8
|
+
</head><body><h1>Home</h1>
|
|
7
9
|
|
|
8
|
-
<
|
|
10
|
+
<a href="#">Hash</a>
|
|
9
11
|
|
|
10
12
|
<ul>
|
|
11
13
|
<li><a href="/">Home</a></li>
|
|
@@ -25,6 +27,4 @@
|
|
|
25
27
|
</ul>
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
30
|
</body></html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head>
|
|
2
|
+
<title>Home</title>
|
|
3
|
+
<style>
|
|
4
|
+
b, i, a, span {
|
|
5
|
+
background-color: aqua;
|
|
6
|
+
}
|
|
7
|
+
div, ul, ol, li, p, h1, h2, h3, h4, h5, h6 {
|
|
8
|
+
background-color: yellow;
|
|
9
|
+
}
|
|
10
|
+
li {
|
|
11
|
+
background-color: violet;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
<script type="module" src="/bundle.webflo.js" by="webflo"></script>
|
|
15
|
+
<script type="module" src="/bundle.js" by="webflo"></script></head>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
This i s some text this This is some text this This is some text this This is some text this
|
|
21
|
+
This is some text this This is <b>some text this</b> This is some <div>text this This
|
|
22
|
+
is some text this This is some text this This is some text this This is some text this This
|
|
23
|
+
is some <i>text this</i> This</div> is some text this
|
|
24
|
+
|
|
25
|
+
<ul>
|
|
26
|
+
<li>Item 1</li>
|
|
27
|
+
<li>Item 2</li>
|
|
28
|
+
<li>Item 3</li>
|
|
29
|
+
<li>Item 4</li>
|
|
30
|
+
<li>Item 5</li>
|
|
31
|
+
</ul>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @webqit/webflo */
|
|
2
|
-
var{start:
|
|
2
|
+
var{start:r}=WebQit.Webflo,e={},o={bundle_filename:"bundle.js",public_base_url:"/",spa_routing:!0,oohtml_support:"full",service_worker_support:!0,worker_scope:"/",worker_filename:"worker.js",routing:{root:"/page-2",subroots:[],targets:0}};r.call({layout:e,params:o});
|
|
Binary file
|
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
-->
|
|
6
6
|
<script type="module" src="/bundle.webflo.js" by="webflo"></script>
|
|
7
7
|
<script type="module" src="/page-2/bundle.js" by="webflo"></script>
|
|
8
|
-
|
|
9
|
-
</head>
|
|
8
|
+
<template name="routes" src="/page-2/bundle.html" by="oohtml-cli"></template></head>
|
|
10
9
|
<body>
|
|
11
10
|
|
|
12
11
|
<h1>Page 2</h1>
|
|
13
12
|
|
|
14
13
|
<!--
|
|
15
|
-
<import template="
|
|
14
|
+
<import template="routes" name="main.html"></import>
|
|
16
15
|
-->
|
|
17
16
|
|
|
18
17
|
<ul>
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
<script>
|
|
36
35
|
setTimeout(() => {
|
|
37
36
|
let importEl = document.createElement('import');
|
|
38
|
-
importEl.setAttribute('template', '
|
|
37
|
+
importEl.setAttribute('template', 'routes');
|
|
39
38
|
importEl.setAttribute('name', 'main.html');
|
|
40
39
|
document.body.append('importEl');
|
|
41
40
|
document.body.appendChild(importEl);
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @webqit/webflo */
|
|
2
|
-
var{start:
|
|
2
|
+
var{start:e}=WebQit.Webflo,r={},o={bundle_filename:"bundle.js",public_base_url:"/",spa_routing:!0,oohtml_support:"full",service_worker_support:!0,worker_scope:"/",worker_filename:"worker.js",routing:{root:"/page-4/subpage",subroots:[],targets:0}};e.call({layout:r,params:o});
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** @webqit/webflo */(async () => {
|
|
2
|
-
var gr=Object.defineProperty;var _r=(e,t)=>()=>(e&&(t=e(e=0)),t);var yr=(e,t)=>{for(var r in t)gr(e,r,{get:t[r],enumerable:!0})};var Wt={};yr(Wt,{URLPattern:()=>Mt});function Rr(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function Ct(e,t=!1){let r=[],n=0;for(;n<e.length;){let i=e[n],o=function(s){if(!t)throw new TypeError(s);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if(i==="*"){r.push({type:"ASTERISK",index:n,value:e[n++]});continue}if(i==="+"||i==="?"){r.push({type:"MODIFIER",index:n,value:e[n++]});continue}if(i==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if(i==="{"){r.push({type:"OPEN",index:n,value:e[n++]});continue}if(i==="}"){r.push({type:"CLOSE",index:n,value:e[n++]});continue}if(i===":"){let s="",f=n+1;for(;f<e.length;){let a=e.substr(f,1);if(f===n+1&&Ar.test(a)||f!==n+1&&Cr.test(a)){s+=e[f++];continue}break}if(!s){o(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:s}),n=f;continue}if(i==="("){let s=1,f="",a=n+1,u=!1;if(e[a]==="?"){o(`Pattern cannot start with "?" at ${a}`);continue}for(;a<e.length;){if(!Rr(e[a],!1)){o(`Invalid character '${e[a]}' at ${a}.`),u=!0;break}if(e[a]==="\\"){f+=e[a++]+e[a++];continue}if(e[a]===")"){if(s--,s===0){a++;break}}else if(e[a]==="("&&(s++,e[a+1]!=="?")){o(`Capturing groups are not allowed at ${a}`),u=!0;break}f+=e[a++]}if(u)continue;if(s){o(`Unbalanced pattern at ${n}`);continue}if(!f){o(`Missing pattern at ${n}`);continue}r.push({type:"PATTERN",index:n,value:f}),n=a;continue}r.push({type:"CHAR",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function Rt(e,t={}){let r=Ct(e),{prefixes:n="./"}=t,i=`[^${le(t.delimiter||"/#?")}]+?`,o=[],s=0,f=0,a="",u=new Set,c=b=>{if(f<r.length&&r[f].type===b)return r[f++].value},l=()=>{let b=c("MODIFIER");return b||c("ASTERISK")},p=b=>{let F=c(b);if(F!==void 0)return F;let{type:v,index:$}=r[f];throw new TypeError(`Unexpected ${v} at ${$}, expected ${b}`)},m=()=>{let b="",F;for(;F=c("CHAR")||c("ESCAPED_CHAR");)b+=F;return b},C=b=>b,O=t.encodePart||C;for(;f<r.length;){let b=c("CHAR"),F=c("NAME"),v=c("PATTERN");if(!F&&!v&&c("ASTERISK")&&(v=".*"),F||v){let w=b||"";n.indexOf(w)===-1&&(a+=w,w=""),a&&(o.push(O(a)),a="");let I=F||s++;if(u.has(I))throw new TypeError(`Duplicate name '${I}'.`);u.add(I),o.push({name:I,prefix:O(w),suffix:"",pattern:v||i,modifier:l()||""});continue}let $=b||c("ESCAPED_CHAR");if($){a+=$;continue}if(c("OPEN")){let w=m(),I=c("NAME")||"",W=c("PATTERN")||"";!I&&!W&&c("ASTERISK")&&(W=".*");let Ie=m();p("CLOSE");let wt=l()||"";if(!I&&!W&&!wt){a+=w;continue}if(!I&&!W&&!w)continue;a&&(o.push(O(a)),a=""),o.push({name:I||(W?s++:""),pattern:I&&!W?i:W,prefix:O(w),suffix:O(Ie),modifier:wt});continue}a&&(o.push(O(a)),a=""),p("END")}return o}function le(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function jt(e){return e&&e.sensitive?"u":"ui"}function jr(e,t){if(!t)return e;let r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);for(;i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}function Tr(e,t,r){let n=e.map(i=>Ft(i,t,r).source);return new RegExp(`(?:${n.join("|")})`,jt(r))}function Fr(e,t,r){return Tt(Rt(e,r),t,r)}function Tt(e,t,r={}){let{strict:n=!1,start:i=!0,end:o=!0,encode:s=c=>c}=r,f=`[${le(r.endsWith||"")}]|$`,a=`[${le(r.delimiter||"/#?")}]`,u=i?"^":"";for(let c of e)if(typeof c=="string")u+=le(s(c));else{let l=le(s(c.prefix)),p=le(s(c.suffix));if(c.pattern)if(t&&t.push(c),l||p)if(c.modifier==="+"||c.modifier==="*"){let m=c.modifier==="*"?"?":"";u+=`(?:${l}((?:${c.pattern})(?:${p}${l}(?:${c.pattern}))*)${p})${m}`}else u+=`(?:${l}(${c.pattern})${p})${c.modifier}`;else c.modifier==="+"||c.modifier==="*"?u+=`((?:${c.pattern})${c.modifier})`:u+=`(${c.pattern})${c.modifier}`;else u+=`(?:${l}${p})${c.modifier}`}if(o)n||(u+=`${a}?`),u+=r.endsWith?`(?=${f})`:"$";else{let c=e[e.length-1],l=typeof c=="string"?a.indexOf(c[c.length-1])>-1:c===void 0;n||(u+=`(?:${a}(?=${f}))?`),l||(u+=`(?=${a}|${f})`)}return new RegExp(u,jt(r))}function Ft(e,t,r){return e instanceof RegExp?jr(e,t):Array.isArray(e)?Tr(e,t,r):Fr(e,t,r)}function $r(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}function It(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function kr(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function Lt(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}function kt(e){if(!e)return!0;for(let t of $t)if(e.test(t))return!0;return!1}function Dr(e,t){if(e=It(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function Nr(e,t){if(e=It(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function Ur(e,t){return t||e===""?e:Lt(e)?Ut(e):Nt(e)}function Hr(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function Mr(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function Wr(e,t,r){if(r||e==="")return e;if(t&&!$t.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]=="/";return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function qr(e,t,r){return Dt(t)===e&&(e=""),r||e===""?e:Ht(e)}function zr(e,t){return e=kr(e,":"),t||e===""?e:ct(e)}function Dt(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function ct(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function Br(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function Gr(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Nt(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Ut(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function Ht(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function Vr(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function Qr(e){return e===""?e:new URL(`data:${e}`).pathname}function Kr(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function Xr(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}function At(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!=""?r.search.substring(1,r.search.length):void 0,hash:r.hash!=""?r.hash.substring(1,r.hash.length):void 0}}function Se(e,t,r){let n;if(typeof t.baseURL=="string")try{n=new URL(t.baseURL),e.protocol=n.protocol?n.protocol.substring(0,n.protocol.length-1):"",e.username=n.username,e.password=n.password,e.hostname=n.hostname,e.port=n.port,e.pathname=n.pathname,e.search=n.search?n.search.substring(1,n.search.length):"",e.hash=n.hash?n.hash.substring(1,n.hash.length):""}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol=="string"&&(e.protocol=zr(t.protocol,r)),typeof t.username=="string"&&(e.username=Mr(t.username,r)),typeof t.password=="string"&&(e.password=Hr(t.password,r)),typeof t.hostname=="string"&&(e.hostname=Ur(t.hostname,r)),typeof t.port=="string"&&(e.port=qr(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,n&&!$r(e.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(e.pathname=n.pathname.substring(0,i+1)+e.pathname)}e.pathname=Wr(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=Nr(t.search,r)),typeof t.hash=="string"&&(e.hash=Dr(t.hash,r)),e}function Pe(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function Jr(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function en(e,t){let r=".*",n=`[^${Jr(t.delimiter||"/#?")}]+?`,i=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let s=0;s<e.length;++s){let f=e[s],a=s>0?e[s-1]:null,u=s<e.length-1?e[s+1]:null;if(typeof f=="string"){o+=Pe(f);continue}if(f.pattern===""){if(f.modifier===""){o+=Pe(f.prefix);continue}o+=`{${Pe(f.prefix)}}${f.modifier}`;continue}let c=typeof f.name!="number",l=t.prefixes!==void 0?t.prefixes:"./",p=f.suffix!==""||f.prefix!==""&&(f.prefix.length!==1||!l.includes(f.prefix));if(!p&&c&&f.pattern===n&&f.modifier===""&&u&&!u.prefix&&!u.suffix)if(typeof u=="string"){let m=u.length>0?u[0]:"";p=i.test(m)}else p=typeof u.name=="number";if(!p&&f.prefix===""&&a&&typeof a=="string"&&a.length>0){let m=a[a.length-1];p=l.includes(m)}p&&(o+="{"),o+=Pe(f.prefix),c&&(o+=`:${f.name}`),f.pattern===r?!c&&(!a||typeof a=="string"||a.modifier||p||f.prefix!=="")?o+="*":o+=`(${r})`:f.pattern===n?c||(o+=`(${n})`):o+=`(${f.pattern})`,f.pattern===n&&c&&f.suffix!==""&&i.test(f.suffix[0])&&(o+="\\"),o+=Pe(f.suffix),p&&(o+="}"),o+=f.modifier}return o}var Ar,Cr,Q,Ir,Lr,$t,Zr,Yr,V,Mt,qt=_r(()=>{Ar=/[$_\p{ID_Start}]/u,Cr=/[$_\u200C\u200D\p{ID_Continue}]/u;Q={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Lr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};$t=["ftp","file","http","https","ws","wss"];Zr=class{constructor(e){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=e}get result(){return this.internalResult}parse(){for(this.tokenList=Ct(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let e=7,t=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(e=2,t=3):this.shouldTreatAsStandardURL&&(e=2),this.changeState(e,t)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(e,t){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(e,t)}changeStateWithoutSettingComponent(e,t){this.state=e,this.componentStart=this.tokenIndex+t,this.tokenIndex+=t,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(e){this.rewind(),this.state=e}safeToken(e){return e<0&&(e=this.tokenList.length-e),e<this.tokenList.length?this.tokenList[e]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(e,t){let r=this.safeToken(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let e=this.safeToken(this.tokenIndex-1);return e.type!=="NAME"&&e.type!=="PATTERN"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let e=this.tokenList[this.tokenIndex],t=this.safeToken(this.componentStart).index;return this.input.substring(t,e.index)}computeShouldTreatAsStandardURL(){let e={};Object.assign(e,Q),e.encodePart=ct;let t=Ft(this.makeComponentString(),void 0,e);this.shouldTreatAsStandardURL=kt(t)}},Yr=["protocol","username","password","hostname","port","pathname","search","hash"],V="*";Mt=class{constructor(e={},t){this.regexp={},this.keys={},this.component_pattern={};try{if(typeof e=="string"){let i=new Zr(e);if(i.parse(),e=i.result,t)if(typeof t=="string")e.baseURL=t;else throw new TypeError("'baseURL' parameter is not of type 'string'.");else if(typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.")}else if(t)throw new TypeError("parameter 1 is not of type 'string'.");if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");let r={pathname:V,protocol:V,username:V,password:V,hostname:V,port:V,search:V,hash:V};this.pattern=Se(r,e,!0),Dt(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let n;for(n of Yr){if(!(n in this.pattern))continue;let i={},o=this.pattern[n];switch(this.keys[n]=[],n){case"protocol":Object.assign(i,Q),i.encodePart=ct;break;case"username":Object.assign(i,Q),i.encodePart=Br;break;case"password":Object.assign(i,Q),i.encodePart=Gr;break;case"hostname":Object.assign(i,Ir),Lt(o)?i.encodePart=Ut:i.encodePart=Nt;break;case"port":Object.assign(i,Q),i.encodePart=Ht;break;case"pathname":kt(this.regexp.protocol)?(Object.assign(i,Lr),i.encodePart=Vr):(Object.assign(i,Q),i.encodePart=Qr);break;case"search":Object.assign(i,Q),i.encodePart=Kr;break;case"hash":Object.assign(i,Q),i.encodePart=Xr;break}try{let s=Rt(o,i);this.regexp[n]=Tt(s,this.keys[n],i),this.component_pattern[n]=en(s,i)}catch{throw new TypeError(`invalid ${n} pattern '${this.pattern[n]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=Se(r,e,!1):r=Se(r,At(e,t),!1)}catch{return!1}let n;for(n in this.pattern)if(!this.regexp[n].exec(r[n]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{typeof e=="object"?r=Se(r,e,!1):r=Se(r,At(e,t),!1)}catch{return null}let n={};t?n.inputs=[e,t]:n.inputs=[e];let i;for(i in this.pattern){let o=this.regexp[i].exec(r[i]);if(!o)return null;let s={};for(let[f,a]of this.keys[i].entries())if(typeof a.name=="string"||typeof a.name=="number"){let u=o[f+1];s[a.name]=u}n[i]={input:r[i]||"",groups:s}}return n}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Mt)});var ge=class{constructor(t,r=null){Object.defineProperty(this,"dict",{value:Object.create(t)});for(let n in this.dict)n in this||(this[n]=this.dict[n]);arguments.length>1&&Object.defineProperty(this.dict,"CWD",{get:()=>r})}get name(){return"webflo"}static create(...t){return new this(...t)}get CWD(){return this.dict.CWD||""}get meta(){return this.dict.meta||{}}get app(){return this.dict.app||{}}get config(){return this.dict.config||{}}get flags(){return this.dict.flags||{}}set flags(t){this.dict.flags=t}get layout(){return this.dict.layout||{}}set layout(t){this.dict.layout=t}get logger(){return this.dict.logger}set logger(t){this.dict.logger=t}};var _e=class extends ge{};var ye=class extends _e{};function d(e){return!Array.isArray(e)&&typeof e=="object"&&e}function S(e){return typeof e}function x(e,...t){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(e);if(!r){if(r=new Map,t[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(e,r)}for(var n,i;n=t.shift();)if((i=r)&&!(r=r.get(n))){if(r=new Map,t[0]===!1)return r;i.set(n,r)}return r}function h(e){return Array.isArray(e)}function te(e){return typeof e=="function"}function nt(e){return te(e)&&/^class\s?/.test(Function.prototype.toString.call(e))}function Le(e){return e===null||e===""}function D(e){return arguments.length&&(e===void 0||typeof e>"u")}function g(e){return Array.isArray(e)||typeof e=="object"&&e||te(e)}function B(e){return Le(e)||D(e)||e===!1||e===0||g(e)&&!Object.keys(e).length}function _(e){return te(e)||e&&{}.toString.call(e)==="[object function]"}function q(e){return e instanceof Number||typeof e=="number"}function P(e){return q(e)||e!==!0&&e!==!1&&e!==null&&e!==""&&!isNaN(e*1)}function it(e){return h(e)&&Object.getPrototypeOf(e)===Array.prototype}function $e(e){return d(e)&&Object.getPrototypeOf(e)===Object.prototype}function L(e){return e instanceof String||typeof e=="string"&&e!==null}function ot(e){return!L(e)&&!D(e.length)}function xe(e,t=1){var r=0;e.forEach(i=>{r++});var n=e.slice(e.length-r,t);return arguments.length>1?n:n[0]}function be(e,t=1){return arguments.length>1?xe(e.slice().reverse(),t).reverse():xe(e.slice().reverse())}function ke(e,...t){return t.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),e}function st(n,t){t=t||Object.prototype,t=t&&!h(t)?[t]:t;for(var r=[],n=n;n&&(!t||t.indexOf(n)<0)&&n.name!=="default";)r.push(n),n=n?Object.getPrototypeOf(n):null;return r}function at(e,t){var r=[];return st(e,t).forEach(n=>{ke(r,...Object.getOwnPropertyNames(n))}),r}function U(e,t,r=!1,n=!1,i=!1){var o=0,s=e.shift();if((P(s)||s===!0||s===!1)&&(o=s,s=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach((f,a)=>{!g(f)&&!_(f)||(r?at(f):Object.keys(f)).forEach(u=>{if(!!t(u,s,f,a)){var c=s[u],l=f[u];if((h(c)&&h(l)||d(c)&&d(l))&&(o===!0||o>0))s[u]=h(c)&&h(l)?[]:{},U([P(o)?o-1:o,s[u],c,l],t,r,n,i);else if(h(s)&&h(f))n?s[u]=l:s.push(l);else try{i?Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(f,u)):s[u]=f[u]}catch{}}})}),s}function M(e,t){var r=void 0;return g(e)&&Object.keys(e).forEach((n,i)=>{r!==!1&&(r=t(P(n)?parseFloat(n):n,e[n],i))}),r}function re(...e){return U(e,(t,r,n)=>!0,!1,!1,!1)}function z(e,t,r=!1){if(t=="")return e;var n=r?e.lastIndexOf(t):e.indexOf(t);return n===-1?"":e.substr(n+t.length)}function ft(e,t){return z(e,t,!0)}function fe(e,t,r=!1){if(t=="")return e;var n=r?e.lastIndexOf(t):e.indexOf(t);return n===-1?e:e.substr(0,n)}function ne(e,t){return fe(e,t,!0)}function ue(e,t,r=null,n=!1){return t.length>e.length?-1:(typeof r=="number"?n?e.slice(0,r+1+(r<0?e.length:0)):e.slice(r):e).reduce((i,o,s)=>{var[f,a,u]=i;if(!n&&f>-1)return[f,a,u];var c=u+1,l=o===t[c]?c===0?[s,0]:[a,c]:[-1,-1];return l[1]===t.length-1&&(l[1]=-1,l[0]>-1)?[l[0]].concat(l):[f].concat(l)},[-1,-1,-1])[0]+(n||typeof r!="number"?0:r>-1?r:e.length-r)}function ce(e,t,r=null,n=!1){var i=ue(e,t,r,n);return i===-1?[]:e.slice(i+t.length)}function we(e,t){return e.reduce((r,n,i)=>r||t(n,i),!1)}function y(e,t=!0){return h(e)?e:!t&&d(e)?[e]:e!==!1&&e!==0&&B(e)?[]:ot(e)?Array.prototype.slice.call(e):d(e)?Object.values(e):[e]}function G(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?e.join(".")===t.join("."):e.length===t.length&&e.reduce((n,i,o)=>n&&i===t[o],!0)}function ve(e,t,r=null){return h(t)?e.filter(n=>r?t.filter(i=>r(n,i)).length:t.indexOf(n)!==-1):[]}function Oe(e,t,r=null){return r||r!==!1&&e.dotSafe&&t.dotSafe?(e.join(".")+".").startsWith(t.join(".")+"."):t.reduce((n,i,o)=>n&&i===e[o],!0)}function ut(e){let t=(r,n,i)=>i.indexOf(r)===n;return e.filter(t)}typeof URLPattern>"u"&&await Promise.resolve().then(()=>(qt(),Wt));function zt(e,t,r,n=!1){if(L(t)&&t.endsWith("]")){var i=ne(ft(t,"["),"]")||0;return P(i)&&(i=parseInt(i)),t=ne(t,"[")||0,P(t)&&(t=parseInt(t)),zt(e,t,(o,s)=>{if(!o[s]){if(!n)return r();o[s]=P(i)?[]:{}}return r(o[s],i)},n)}else return r(e,t)}function De(e,t,r,n=!0){zt(e,t,(i,o)=>{P(o)?(o=o||h(i)?i.length:Object.keys(i).filter(P).length,y(r,!1).forEach((s,f)=>{i[o+f]=s})):i[o]=n&&o in i?y(i[o],!1).concat(r):r},!0)}function ie(e,t={},r="&"){return e=e||"",(e.startsWith("?")?e.substr(1):e).split(r).filter(n=>n).map(n=>n.split("=").map(i=>i.trim())).forEach(n=>De(t,n[0],decodeURIComponent(n[1]))),t}function Ne(e,t,r,n=null){if((d(t)||h(t))&&(!n||n(t,e))){var i=h(t);Object.keys(t).forEach(o=>{Ne(`${e}[${o}]`,t[o],r,n)})}else r(e,!t&&t!==0?"":t)}function pe(e,t="&",r=null){var n=[];return Object.keys(e).forEach(i=>{Ne(i,e[i],(o,s)=>{n.push(`${o}=${encodeURIComponent(s)}`)},r)}),n.join(t)}var Bt={join(){for(var e=[],t=0,r=0,n=arguments.length;r<n;r++)e=e.concat(arguments[r].split("/"));var i=[];for(r=0,n=e.length;r<n;r++){var o=e[r];!o||o==="."||(o===".."?i.length?i.pop():t++:i.push(o))}return e[0]===""&&i.unshift(""),"../".repeat(t)+i.join("/")||(i.length?"/":".")},dirname(e){return this.join(e,"..")}},lt=(e,t=null)=>({pattern:new URLPattern(e,t),isPattern(){return Object.keys(this.pattern.keys).some(r=>this.pattern.keys[r].length)},test(...r){this.pattern.test(...r)},exec(...r){let n=this.pattern.exec(...r);if(!!n)return n.vars=Object.keys(this.pattern.keys).reduce(({named:i,unnamed:o},s)=>(this.pattern.keys[s].forEach(f=>{let a=n[s].groups[f.name];typeof f.name=="number"?o.push(a):i[f.name]=a}),{named:i,unnamed:o}),{named:{},unnamed:[]}),n.render=i=>i.replace(/\$(\$|[0-9A-Z]+)/gi,(o,s)=>s==="$"?"$":(P(s)?n.vars.unnamed[s-1]:n.vars.named[s])||""),n}});var Ee=class{constructor(t,r){this.cx=t,this.path=h(r)?r:(r+"").split("/").filter(n=>n)}async route(t,r,n,i,o=null){let s=this,f=async function(a){let u={};if(!a.trail||a.trail.length<a.destination.length){if(a=await s.readTick(a),u.pathname=`/${a.trail.join("/")}`,u.stepname=a.trail[a.trail.length-1],s.finalizeHandlerContext(u,a),a.exports){a.exports.hints&&await r.port.post({...a.exports.hints,$type:"handler:hints"});let c=y(a.method),l=_(a.exports)&&c.includes("default")?a.exports:c.reduce((p,m)=>p||a.exports[m.toLowerCase()],null);if(l){let p=async(...C)=>{let O={...a,arg:C[0]};if(C.length>1){var b=C[1],F,v={...C[2]||{}};if(C[1]instanceof O.event.Request)F=C[1],b=F.url;else if(!L(b))throw new Error("Router redirect url must be a string!");var $=b.startsWith("/")?b:s.pathJoin(`/${a.trail.join("/")}`,b);if($.startsWith("../"))throw new Error("Router redirect cannot traverse beyond the routing directory! ("+b+" >> "+$+")");v.method&&(O.method=v.method,h(v.method)&&(v.method=v.method[0])),F?O.event=a.event.retarget(F,{...v,_proxy:{url:$}}):O.event=a.event.retarget($,v),O.source=a.destination.join("/"),O.destination=$.split("?").shift().split("/").map(k=>k.trim()).filter(k=>k),O.trail=C[1].startsWith("/")?[]:a.trail.reduce((k,w,I)=>k.length===I&&w===O.destination[I]?k.concat(w):k,[]),O.trailOnFile=a.trailOnFile.slice(0,O.trail.length)}return f(O)},m=a.destination.slice(a.trail.length);return p.pathname=m.join("/"),p.stepname=m[0],await l.call(u,a.event,a.arg,p,o)}return f(a)}else if((a.currentSegmentOnFile||{}).dirExists)return f(a)}if(i)return await i.call(u,a.event,a.arg,o)};return f({destination:this.path,event:r,method:t,arg:n})}};var Ae=class extends Ee{async readTick(t){var r=this.cx.layout,n=Object.keys(this.cx.layout);return t.trail?(t.currentSegment=t.destination[t.trail.length],t.currentSegmentOnFile=[t.currentSegment,"-"].reduce((i,o)=>{if(i.index)return i;var s=`/${t.trailOnFile.concat(o).join("/")}`;return r[s]?{seg:o,index:s}:n.filter(f=>f.startsWith(`${s}/`)).length?{seg:o,dirExists:!0}:i},{seg:null}),t.trail.push(t.currentSegment),t.trailOnFile.push(t.currentSegmentOnFile.seg),t.exports=r[t.currentSegmentOnFile.index]):(t.trail=[],t.trailOnFile=[],t.currentSegmentOnFile={index:"/"},t.exports=r["/"]),t}finalizeHandlerContext(t,r){return t.dirname=r.currentSegmentOnFile.index}pathJoin(...t){return Bt.join(...t)}};var Ce=class{constructor(t){this.cx=t}async handle(t,r){let n=new Ae(this.cx,t.url.pathname);return(async()=>{let o=t.request.method.toLowerCase(),s=await n.route([o==="delete"?"del":o,"default"],t,{},async f=>r(f.request),r);return s instanceof t.Response||(s=t.Response.compat(s)),s})()}};function oe(e){return(pt(e)?e:y(e).length?[e]:[]).reduce((t,r)=>t.concat([y(r)]),[]).map(t=>K.resolve(t))}var K=class extends Array{static resolve(t){return t.every(r=>!(r+"").includes("."))?new K().concat(t):t}get dotSafe(){return!0}};function pt(e){return y(e).reduce((t,r)=>t||h(r),!1)}function mt(e){return e.filter(t=>t||t===0).length!==e.length}function Gt(e){return e.filter(t=>mt(y(t))).length>0}var se=class{constructor(t){this.target=t,this.fireables=[],this.currentlyFiring=[]}add(t){return this.fireables.push(t),t}remove(t){this.fireables=this.fireables.filter(r=>r!==t)}removeMatches(t){this.match(t).forEach(r=>{this.fireables=this.fireables.filter(n=>n!==r)})}match(t){return this.fireables.filter(r=>{var n=oe(r.filter),i=y((r.params||{}).tags),o=oe(t.filter),s=y((t.params||{}).tags);return(!t.originalHandler||r.handler===t.originalHandler)&&(!o.length||G(o,n))&&(!s.length||s.length===i.length&&ve(i,s).length===s.length)})}static _getFirebase(t,r,n=!0,i=this.__namespace){if(!g(r))throw new Error('Subject must be of type object; "'+S(r)+'" given!');var o=this;return i&&globalThis.WebQitObserverNamespaceRegistry.has(t+"-"+i)&&(o=globalThis.WebQitObserverNamespaceRegistry.get(t+"-"+i),t+="-"+i),!x(r,"firebases").has(t)&&n&&x(r,"firebases").set(t,new o(r)),x(r,"firebases").get(t)}static _namespace(t,r,n=null){if(t+="-"+r,arguments.length===2)return globalThis.WebQitObserverNamespaceRegistry.get(t);if(!(n.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(t,n),n.__namespace=r}};globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);var ae=class{constructor(t,r){this.target=t,this.handler=r.handler,this.filter=r.filter,this.params=r.params}disconnect(){this.disconnected=!0}};var Re=class extends ae{fire(t,r,n){return this.disconnected||this.filter&&!ve(y(this.filter),[t.type]).length?r(...Array.prototype.slice.call(arguments,2)):this.handler(t,n,r)}};function Ue(e,t=[],r=!0){var n=0;return P(arguments[0])&&g(arguments[1])&&(n=arguments[0],e=arguments[1],t=arguments[2]||[]),U([n,{},e],(i,o,s)=>_(t)?t(i):h(t)&&t.length?t.indexOf(i)>-1:!0,!1,!1,r)}var me=class{constructor(t,r){if(this.target=t,!r.type)throw new Error("Action type must be given in definition!");M(r,(n,i)=>{Object.defineProperty(this,n,{value:i,enumerable:!0})}),Object.seal(this)}};var j=class extends se{add(t){return super.add(new Re(this.target,t))}fire(t,r=null){if(t instanceof me||(t=new me(this.target,t)),this.currentlyFiring.filter(o=>o.type===t.type&&o.name===t.name).length)return r?r():void 0;this.currentlyFiring.push(t);let n=(o,...s)=>{var f=this.fireables[o];return f?f.fire(t,(...a)=>n(o+1,...a),...s):r?r(...s):s[0]};var i=n(0);return this.currentlyFiring.pop(),i}static getFirebase(t,r=!0,n=null){return super._getFirebase("interceptor",...arguments)}static namespace(t,r=null){return super._namespace("interceptor",...arguments)}};function A(e){return x(e,!1).get(e)||e}function T(e,t,r={},n={}){if(!t||!g(t))throw new Error("Target must be of type object!");t=A(t);var i,o=function(s){return arguments.length?s:Reflect[e](t,...Object.values(r))};return(i=j.getFirebase(t,!1,n.namespace))?i.fire({type:e,...r},o):o()}function Me(e,t,r,n={}){return T("apply",e,{thisArgument:t,argumentsList:r},n)}function We(e,t,r=null,n={}){return T("construct",e,arguments.length>2?{argumentsList:t,newTarget:r}:{argumentsList:t},n)}var H=class{constructor(t,r=!1){this._={},this._.target=t,this._.cancellable=r,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(t){t instanceof Promise&&(this._.promises.push(t),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(t){var r,n=d(t)&&!D(t.propagationStopped)&&!D(t.defaultPrevented);t===!1||n&&t.propagationStopped?this.stopPropagation():t===!1||n&&t.defaultPrevented?this.preventDefault():(t instanceof Promise&&(r=t)||n&&(r=t.promises))&&this.waitUntil(r)}};var je=class extends ae{constructor(t,r){if(super(t,r),this.filters2D=oe(this.filter),this.filtersIsOriginally2D=pt(this.filter),this.filtersIsDynamic=Gt(this.filters2D),this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map(n=>"["+n.join(", ")+"]").join(", ")+'" have been bound together.')}fire(t){if(this.disconnected||this.params.type&&!we(t,s=>this.params.type===s.type))return;let r=s=>!["set","def"].includes(s.type)||!this.params.diff||(_(this.params.diff)?this.params.diff(s.value,s.oldValue):s.value!==s.oldValue);var n=new H(this.target);if(this.filters2D.length){var i=t.filter(s=>this.filters2D.filter((f,a)=>{var u=f.slice();return this.filtersIsDynamic&&s.path.forEach((c,l)=>{u[l]=u[l]||u[l]===0?u[l]:c}),(!this.filtersIsDynamic||!mt(u))&&r(s)&&(!this.params.subtree&&G(u,s.path)||this.params.suptree&&Oe(u,s.path)&&(!P(this.params.suptree)||ce(u,s.path).length<=this.params.suptree)||this.params.subtree&&s.path.length>=u.length&&Oe(s.path,u)&&(!P(this.params.subtree)||ce(s.path,u).length<=this.params.subtree))}).length);if(i.length)if(this.filtersIsOriginally2D||this.params.subtree){var o=i;d(this.filter)&&(o={...this.filter},i.forEach((s,f)=>{o[s.name]=s})),n.respondWith(this.handler(o,n))}else i.forEach((s,f)=>{n.respondWith(this.handler(s,n))})}else(this.params.subtree||t.filter(s=>G(s.path,[s.name])).length===t.length)&&t.filter(s=>r(s)).length&&n.respondWith(this.handler(t,n));return n}};var X=class{constructor(t,r){if(this.target=t,r.originalSubject||(this.originalSubject=t),!("type"in r))throw new Error("Mutation type must be given in definition!");if(!("name"in r))throw new Error("Property name must be given in definition!");M(r,(n,i)=>{n==="path"&&(i=K.resolve(i)),Object.defineProperty(this,n,{value:i,enumerable:!0})}),this.path||Object.defineProperty(this,"path",{value:K.resolve([r.name]),enumerable:!0}),Object.seal(this)}};var E=class extends se{constructor(t){super(t),this.buffers=[]}add(t){return super.add(new je(this.target,t))}fire(t,r){var n=new H(this.target,r);return t=y(t,!1).map(i=>i instanceof X?i:new X(this.target,i)),this.buffers.length?(be(this.buffers)(t),n):(this.currentlyFiring.filter(i=>t.filter(o=>i.type===o.type&&i.name===o.name).length).length,this.fireables.forEach(i=>{if(n.propagationStopped&&r)return n;n.respondWith(i.fire(t))}),n)}static getFirebase(t,r=!0,n=null){return super._getFirebase("observer",...arguments)}static namespace(t,r=null){return super._namespace("observer",...arguments)}};function N(e,t,r=null,n={}){if(e=r||e,!e||!g(e))throw new Error("Target must be of type object!");e=A(e);var i=y(t),o=i.map(s=>{var f,a=function(u){return arguments.length?u:x(e,"accessorizedProps").has(s)&&x(e,"accessorizedProps").get(s).touch(!0)?x(e,"accessorizedProps").get(s).get():r?Reflect.get(e,s,r):Reflect.get(e,s)};return(f=j.getFirebase(e,!0,n.namespace))?f.fire({type:"get",name:s,related:i,receiver:r},a):a()});return h(t)?o:o[0]}function qe(e,t,r=null,n={}){if(e=A(e),!e||!g(e))throw new Error('Observable subjects must be of type object; "'+S(e)+'" given!');if(_(t)&&(n=arguments.length>2?r:{},r=t,t=null),!_(r))throw new Error('Handler must be a function; "'+S(r)+'" given!');var i,o=E.getFirebase(e,!0,n.namespace),s={filter:t,handler:r,params:n};if((s.filter||s.params.subtree==="*"||s.params.subtree&&he(e))&&Z(e,s.filter,s.params.subtree,n.namespace),s.params.unique&&(i=o.match({filter:t,params:n})).length){if(s.params.unique!=="replace")return i[0];o.remove(i[0])}return o.add(s)}function Y(e,t,r,n=null,i={}){if(e!==r){var o;if(qe(r,(f,a)=>{if(o=E.getFirebase(e,!1,i.namespace)){var u=f.map(c=>{var l=c;do if(l.target===e)return;while(l=l.src);var p={};return M(c,(m,C)=>{m!=="target"&&m!=="name"&&m!=="path"&&m!=="src"&&(p[m]=C)}),p.name=t,p.path=[t].concat(c.path),p.originalSubject=c.originalSubject,p.src=c,new X(e,p)}).filter(c=>c);if(u.length)return o.fire(u,a.cancellable)}},{subtree:!0,...i,unique:!0,tags:[dt,t,e]}),d(n)&&(o=E.getFirebase(e,!1,i.namespace))){var s=re({name:t,type:"set",value:r,related:[t]},n);let f=o.fire(s,i.cancellable);if(i.eventTypeReturn)return f}}}var dt={};function Z(e,t=null,r=!1,n=null){if(!e||!g(e))throw new Error("Target must be of type object!");var i=E.getFirebase(e,!0,n);if(!(!i||i.build)){i.build=r;var o=oe(t),s=!o.length||o.filter(a=>!a[0]&&a[0]!==0).length?Object.keys(e):o.map(a=>a[0]),f=o.length?o.map(a=>a.slice(1)).filter(a=>a.length):null;i.subBuild=f&&f.length?f:null,s.forEach(a=>{var u=N(e,a,null,{namespace:n});try{g(u)&&(Y(e,a,u,null,params),(i.subBuild&&he(u)||(_isFunction(r)?r(u):r&&he(u)))&&Z(u,i.subBuild,r,n))}catch{}})}}var he=e=>(e instanceof Object||e instanceof Array||e instanceof Function)&&(typeof window>"u"||e!==window);function ze(e,t,r=null,n={}){if(e=A(e),!e||!g(e))throw new Error('Observable subjects must be of type object; "'+S(e)+'" given!');if(_(t)&&(n=arguments.length>2?r:{},r=t,t=null),r&&!_(r))throw new Error('Handler must be a function; "'+S(r)+'" given!');var i;if(i=E.getFirebase(e,!1,n.namespace))return i.removeMatches({filter:t,originalHandler:r,params:n})}function J(e,t,r,n=null,i={}){ze(r,null,null,{...i,tags:[dt,t,e]});var o;if(d(n)&&(o=E.getFirebase(e,!1,i.namespace))){var s=re({name:t,type:"del",oldValue:r,related:[t]},n);o.fire(s,i.cancellable)}}function ee(e,t,r={}){return T("has",e,{name:t},r)}function Be(e,t,r,n={}){t=r.receiver||t;var i=r.keysOrPayload,o=r.value;if(!t||!g(t))throw new Error("Target must be of type object!");d(i)&&(n=o||{},o=null),t=A(t);var s=j.getFirebase(t,!1,n.namespace),f=E.getFirebase(t,!1,n.namespace);let a=(m,C,O,b)=>{var F="set",v;e&&(F="defineProperty",v=C||{},C=v.value);var $=!1,k;ee(t,m,n)&&($=!0,k=N(t,m,r.receiver,n));var w={name:m,type:F,value:C,receiver:r.receiver,related:O,detail:b,isUpdate:$,oldValue:k},I=function(Ie){return arguments.length&&(v?v=Ie:C=Ie),v?x(t,"accessorizedProps",!1).has(m)&&!x(t,"accessorizedProps").get(m).restore()?!1:(Object.defineProperty(t,m,v),!0):x(t,"accessorizedProps",!1).has(m)?x(t,"accessorizedProps").get(m).set(C):(t[m]=C,!0)};if(s){var W=v?{type:"defineProperty",name:m,descriptor:v,receiver:r.receiver,related:O,detail:b,isUpdate:$,oldValue:k}:{type:"set",name:m,value:C,receiver:r.receiver,related:O,detail:b,isUpdate:$,oldValue:k};w.success=s.fire(W,I)}else w.success=I();return w.success&&w.value!==w.oldValue&&(g(w.oldValue)&&J(t,m,w.oldValue,null,n),g(w.value)&&(Y(t,m,w.value,null,n),f&&(f.subBuild||f.build&&he(w.value))&&Z(w.value,f.subBuild,f.build,n.namespace))),w};var u,c=[];h(i)||(L(i)||q(i))&&(u=y(i))?c=u.map(m=>a(m,o,u,n.detail)):d(i)&&(u=Object.keys(i))&&(c=u.map(m=>a(m,i[m],u,n.detail)));var l=c.filter(m=>m.success!==!1),p;return f?(p=f.fire(l,n.cancellable),p.successCount=l.length):n.eventTypeReturn&&(p=new H(t)),n.eventTypeReturn?p:l.length>0}function Ge(e,t,r=null,n={}){return Be(!0,e,{keysOrPayload:t,value:r},n)}function Ve(e,t,r={}){if(!e||!g(e))throw new Error("Target must be of type object!");e=A(e);var n=y(t),i=n.map(a=>{var u;ee(e,a,r)&&(u=N(e,a,null,r));var c={name:a,type:"deleteProperty",related:n,detail:r.detail,oldValue:u},l,p=function(m){return arguments.length?m:x(e,"accessorizedProps",!1).has(a)&&!x(e,"accessorizedProps").get(a).restore()?!1:(delete e[a],!0)};return(l=j.getFirebase(e,!1,r.namespace))?c.success=l.fire({type:"deleteProperty",name:a,oldValue:u,related:n},p):c.success=p(),c.success&&g(c.oldValue)&&J(e,a,c.oldValue,null,r),c}),o=i.filter(a=>a.success!==!1),s,f;return(s=E.getFirebase(e,!1,r.namespace))?(f=s.fire(o,r.cancellable),f.successCount=o.length):r.eventTypeReturn&&(f=new H(e)),r.eventTypeReturn?f:o.length>0}function Qe(e,t,r={}){return T("getOwnPropertyDescriptor",e,{name:t},r)}function Ke(e,t={}){return T("getPrototypeOf",e,{},t)}function Xe(e,t={}){return T("isExtensible",e,{},t)}function Ze(e,t={}){return T("ownKeys",e,{},t)}function Ye(e,t={}){return T("preventExtensions",e,{},t)}function de(e,t,r=null,n=null,i={}){return Be(!1,e,arguments.length>3?{keysOrPayload:t,value:r,receiver:n}:{keysOrPayload:t,value:r},i)}function Je(e,t,r={}){return T("setPrototypeOf",e,{prototype:t},r)}function Vt(e,t=[],r={}){r=d(t)?t:r;var n=(arguments.length===1?Object.keys(e):y(t)).map(i=>{if(x(e,"accessorizedProps").has(i)&&x(e,"accessorizedProps").get(i).touch(!0))return!1;let o=()=>{for(var p,m=e;!p&&(m=Object.getPrototypeOf(m));)p=Object.getOwnPropertyDescriptor(m,i);return p};var s=Object.getOwnPropertyDescriptor(e,i),f,a;s||(f={writable:!0,enumerable:!(i in e),configurable:r.configurable!==!1});var u={...s||f};"value"in u&&delete u.value,"writable"in u&&delete u.writable,u.get=()=>{if(l.ongoingGets.length)return l.get();l.ongoingGets.push(1);var p=N(e,i,null,r);return l.ongoingGets.pop(),p};var c;u.set=p=>{if(l.ongoingSets.length)return l.set(p);l.ongoingSets.push(1);var m=de(e,i,p,null,r);return l.ongoingSets.pop(),m};var l={ongoingGets:[],ongoingSets:[],get:function(){var p=s;return p||(a?p=f:p=o()||f),p.get?p.get.call(e):p.value},set:function(p){var m=s;return m||(a?m=f:(m=o())?"value"in m&&(m=f,a=!0):(m=f,a=!0)),m.set||m.get?m.set?m.set.call(e,p):!1:(m.value=p,!0)},restore:function(){try{return this.intact()&&(s||a?Object.defineProperty(e,i,s||f):delete e[i],x(e,"accessorizedProps").delete(i)),!0}catch{}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(e,i)||{}).get===u.get},touch:function(p=!1){return this.intact()||(p?!this.restore():!1)}};try{return Object.defineProperty(e,i,u),x(e,"accessorizedProps").set(i,l),!0}catch{}return!1});return h(t)?n:n[0]}function Qt(e,t=[],r={}){r=d(t)?t:r;var n=(arguments.length===1?Object.keys(e):y(t)).map(i=>x(e,"accessorizedProps",!1).has(i)?x(e,"accessorizedProps").get(i).restore():!0);return h(t)?n:n[0]}function Kt(e,t={}){if(!g(e))throw new Error('Object must be of type target; "'+S(e)+'" given!');var r=new Proxy(e,{apply:(n,i,o)=>Me(n,i,o,t),construct:(n,i,o=null)=>We(n,i,o,t),defineProperty:(n,i,o)=>Ge(n,i,o,t),deleteProperty:(n,i)=>Ve(n,i,t),get:(n,i,o=null)=>{var s=N(n,i,o,t);return t.proxyAutoBinding!==!1&&_(s)&&!nt(s)?s.bind(r):s},getOwnPropertyDescriptor:(n,i)=>Qe(n,i,t),getPrototypeOf:n=>Ke(n,t),has:(n,i)=>ee(n,i,t),isExtensible:n=>Xe(n,t),ownKeys:n=>Ze(n,t),preventExtensions:n=>Ye(n,t),set:(n,i,o,s=null)=>de(n,i,o,s,t),setPrototypeOf:(n,i)=>Je(n,i,t)});return x(r).set(r,e),r}function Xt(e,t,r={}){if(e=A(e),!g(e))throw new Error('Object must be of type target; "'+S(handler)+'" given!');var n={},i=!0;d(t)||(_(t)?t={"":t}:_(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),i=!1);var o=j.getFirebase(e,!0,r.namespace);return Object.keys(t).forEach(s=>{if(!_(t[s]))throw new Error("Callback"+(s===null?"":" for "+s)+' must be a function; "'+S(t[s])+'" given!');var f={filter:s,handler:t[s],params:r},a;if(f.params.unique&&(a=o.match(f)).length){if(f.params.unique!=="replace")return a[0];o.remove(a[0])}i?n[s]=o.add(f):n=o.add(f)}),n}function Zt(e,t=null,r={}){if(e=A(e),!e||!g(e))throw new Error('Object must be of type target; "'+S(e)+'" given!');var n=j.getFirebase(e,!1,r.namespace);_isObject(t)||(_(t)?t={[null]:t}:_(r)&&(t={[t]:r},r=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(n=j.getFirebase(e,!1,r.namespace))&&Object.keys(t).forEach(i=>{if(!_(t[i]))throw new Error("Callback"+(i===null?"":" for "+i)+' must be a function; "'+S(t[i])+'" given!');var o={filter:i,originalHandler:t[i],params:r};return n.removeMatches(o)})}function Yt(e,...t){var r=t.map(o=>{if(o=A(o),!g(o))throw new Error("Target must be of type object!");return{target:o,subjectCopy:h(o)?o.slice(0):Ue(o)}}),n=e(...t);let i=()=>{r.map(o=>{var s=Object.keys(o.subjectCopy),f=Object.keys(o.target),a=[],u=ut(s.concat(f)).map(l=>{if(o.subjectCopy[l]!==o.target[l]){a.push(l);var p={name:l,related:a,buffered:!0};return f.includes(l)?(p.type="set",p.value=o.target[l],s.includes(l)&&(p.isUpdate=!0)):p.type="del",s.includes(l)&&(p.oldValue=o.subjectCopy[l]),g(o.subjectCopy[l])&&J(o.target,l,o.subjectCopy[l]),g(o.target[l])&&Y(o.target,l,o.target[l]),p}}).filter(l=>l),c;if(u.length&&(c=E.getFirebase(o.target,!1)))return c.fire(u)})};return n instanceof Promise?n.then(i):i(),n}var R={apply:Me,construct:We,defineProperty:Ge,deleteProperty:Ve,get:N,getOwnPropertyDescriptor:Qe,getPrototypeOf:Ke,has:ee,isExtensible:Xe,ownKeys:Ze,preventExtensions:Ye,set:de,setPrototypeOf:Je,accessorize:Vt,unaccessorize:Qt,proxy:Kt,unproxy:A,observe:qe,unobserve:ze,intercept:Xt,unintercept:Zt,closure:Yt,build:Z,link:Y,unlink:J,Observers:E,Interceptors:j};var{URL:Jt,fetch:er,Headers:gt,Request:tr,Response:rr,FormData:nr,ReadableStream:on,File:gd,Blob:_t}=globalThis;var an=e=>{let t=class extends e{constructor(...r){super(...r);var n=ie(this.search);let i=o=>{var s=pe(o);s=s?"?"+s:"",s!==this.search&&(this.search=s)};this.__query={value:n,proxy:new Proxy(n,{set(o,s,f){return o[s]=f,i(o),!0},deleteProperty(o,s){return delete o[s],i(o),!0}})}}set search(r){super.search=r;var n=ie(r);yt(n,this.query)||(this.query=n)}get search(){return super.search}get query(){return this.__query.proxy}};return t.Observable=class extends t{constructor(){super(...arguments);let{Observer:r}=WebQit;r.accessorize(this,["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"])}},t},yt=(e,t)=>d(e)&&d(t)?yt(Object.keys(e),Object.keys(t))&&yt(Object.values(e),Object.values(t)):h(e)&&h(t)?e.length===t.length&&e.reduce((r,n,i)=>r&&n===t[i],!0):e===t,ir=an;var fn=e=>class extends e{tee(t=null){let r=new this.constructor,n=new this.constructor;for(var[i,o]of this.entries()){let s=s(o);t&&t(o,i,s)||!t&&!s?r.append(i,o):n.append(i,o)}return[r,n]}json(t={},r=null){if(arguments.length){Object.keys(t).forEach(s=>{Ne(s,t[s],(f,a)=>{(!r||r(f,a,g(a)))&&this.append(f,a)},f=>!xt(f))});return}var n;for(var[i,o]of this.entries())n||(n=P(fe(i,"["))?[]:{}),De(n,i,o);return n}},or=fn,xt=(e,t=null)=>{if(!g(e))return;let r=e[Symbol.toStringTag];return(t||["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream"]).reduce((n,i)=>n||(r===i?i:null),null)};var un=e=>class extends e{constructor(t={}){t instanceof e?super(t):(super(),this.json(t))}json(t={},r=!0){if(arguments.length){let s=sr(this),f=Object.keys(s).reduce((a,u)=>a.concat(typeof u!="symbol"&&"set"in s[u]?u:[]),[]);Object.keys(t).forEach(a=>{var u=f.reduce((c,l)=>c||(l===a||l.toLocaleLowerCase()===a?l:null),null);u?(r||this[u]===void 0)&&(this[u]=t[a]):(r||!this.has(a))&&this.set(a,t[a])});return}let n={};for(var[i,o]of this)n[i]=o;return n}set cacheControl(t){return this.set("Cache-Control",t)}get cacheControl(){return this.get("Cache-Control")}set contentLength(t){return this.set("Content-Length",t)}get contentLength(){return this.get("Content-Length")}set contentType(t){return this.set("Content-Type",t)}get contentType(){return this.get("Content-Type")}},et=un;function sr(e){if(e){let t=Object.getPrototypeOf(e);return t===Object.prototype?{}:{...sr(t),...Object.getOwnPropertyDescriptors(e)}}else return Object.create(null)}var cn=e=>class extends et(e){set accept(t){return this.set("Accept",t)}get accept(){let t=this.get("Accept"),r=t&&t.split(",").map(n=>(n=n.trim().split(";").map(i=>i.trim()),[n.shift(),parseFloat((n.pop()||"1").replace("q=",""))])).sort((n,i)=>n[1]>i[1]?-1:1)||[];return{match(n){return n=(n+"").split("/"),r.reduce((i,o)=>i||(o=o[0].split("/"))&&[0,1].every(s=>n[s]===o[s]||n[s]==="*"||o[s]==="*"),!1)},toString(){return t}}}set cookies(t){if(!d(t))throw new Error(`Cookies must be of type object. Received type: ${S(t)}.`);return this.set("Cookie",pe(t,";")),this._cookies=null,!0}get cookies(){return this._cookies||(this._cookies=ie(this.get("cookie"),{},";")),this._cookies}set range(t){let r=[];return y(t).forEach((n,i)=>{let o=Array.isArray(n)?n.join("-"):n+"";i===0&&!o.includes("bytes=")&&(o=`bytes=${o}`),r.push(o)}),this.set("Range",r.join(", "))}get range(){let t=this.get("Range");return t?z(t,"bytes=").split(",").map(n=>{let i=n.trim().split("-");return i[0]=i[0]?parseInt(i[0],10):void 0,i[1]&&(i[1]=parseInt(i[1],10)),i.clamp=o=>{(i[1]>o-1||i[1]===void 0)&&(i[1]=o-1),i[0]===void 0&&(i[0]=i[1]?o-i[1]-1:0)},i}):void 0}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}},ar=cn;var ln=e=>class extends et(e){set cookies(t){if(!d(t))throw new Error(`The "cookies" response directive cannot be of type: ${S(t)}`);for(let r in t){let n=t[r];if(d(n)){let i=[n.value];for(let o in n){if(o==="value")continue;let s=o[0].toUpperCase()+o.substring(1);s==="MaxAge"&&(s="Max-Age"),i.push(n[o]===!0?s:`${s}=${n[o]}`)}n=i.join("; ")}this.append("Set-Cookie",`${r}=${n}`)}return!0}get cookies(){let t=this.get("Set-Cookie");return t&&t.split(",").reduce((r,n)=>{let[i,o]=n.split(";"),[s,f]=i.trim().split("=");return r[s]={value:f},o&&(o||"").split(/\;/g).map(a=>a.trim().split("=")).forEach(a=>{r[s][a[0][0].toLowerCase()+a[0].substring(1).replace("-","")]=a.length===1?!0:a[1]}),r},{})}set contentRange(t){if(Array.isArray(t)){if(t.length===2&&!t[0].includes("-")||t.length<2)throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");return this.set("Content-Range",`bytes ${t.join("/")}`)}return this.set("Content-Range",t)}get contentRange(){let t=this.get("Content-Range");return t&&z(t,"bytes ").split("/")}set cors(t){return this.set("Access-Control-Allow-Origin",t===!0?"*":t===!1?"":t)}get cors(){return this.get("Access-Control-Allow-Origin")}set attachment(t){if(t=t===!0?"attachment":t===!1?"inline":t,!L(t))throw new Error(`The "download" response directive does not support the type: ${S(t)}`);return["attachment","inline"].includes(t)||(t=`attachment; filename="${t}"`),this.set("Content-Disposition",t)}get attachment(){var t=(this.get("Content-Disposition")||"").trim();return t=t==="attachment"?!0:t==="inline"?!1:z(ne(t,'"'),'filename="'),t}get location(){return this.get("Location")}set location(t){return this.set("Location",t)}get redirect(){return this.get("Location")}set redirect(t){return this.set("Location",t)}},fr=ln;var pn=(e,t,r)=>{let n=class extends e{constructor(i,o,s){"headers"in o&&!(o.headers instanceof t)&&(o={...o},o.headers=new t(o.headers),arguments[1]=o),B(o)?super(i):super(i,o),this._headers=o.headers,s.headers&&this.headers.json(s.headers);let f={};Object.defineProperty(this,"attrs",{get:()=>f}),Object.defineProperty(this,"bodyAttrs",{get:()=>s})}clone(){return new this.constructor(super.clone())}get headers(){return this._headers||(this._headers=new t(super.headers)),this._headers}get attrs(){return this.attrs}get url(){return"url"in this.attrs?this.attrs.url:super.url}async arrayBuffer(){return this.bodyAttrs.arrayBuffer?this.bodyAttrs.arrayBuffer:super.arrayBuffer()}async blob(){return this.bodyAttrs.blob?this.bodyAttrs.blob:super.blob()}async formData(){if(this.bodyAttrs.formData)return this.bodyAttrs.formData;let i=await super.formData();return i.tee=r.prototype.tee.bind(i),i.json=r.prototype.json.bind(i),i}async json(){return this.bodyAttrs.json?this.bodyAttrs.json:super.json()}async text(){return this.bodyAttrs.text?this.bodyAttrs.text:super.text()}jsonfy(i=!1){return(!this.bodyAttrs.jsonfied||i)&&(this.bodyAttrs.jsonfied=new Promise(async(o,s)=>{var f=this,a,u=f.headers.get("content-type")||"",c=u==="application/json"||this.bodyAttrs.json?"json":u==="application/x-www-form-urlencoded"||u.startsWith("multipart/form-data")||this.bodyAttrs.formData?"formData":u==="text/plain"?"plain":"other";try{c==="formData"?a=(await f.formData()).json():a=c==="json"?await f.json():c==="plain"?await f.text():f.body,o(a)}catch(l){s(l)}})),this.bodyAttrs.jsonfied}};return n.Headers=t,n},tt=pn;function rt(e,t,r){let n={body:e,input:e},i=(f,a)=>{if(!t.encode)return;let[u,c]=t.encode(a);f.body=u,f.headers=c};if(L(e)||q(e))return n.inputType="text",n.text=e,n.headers={contentLength:(e+"").length},n;if(n.inputType=xt(e),["Blob","File"].includes(n.inputType))n.blob=e,n.headers={contentType:e.type,contentLength:e.size};else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(n.inputType))n.arrayBuffer=e,n.headers={contentLength:e.byteLength};else if(n.inputType==="FormData")n.formData=e,i(n,e);else if(d(e)&&$e(e)||h(e)&&it(e)){n.inputType="object";var o,s=new t;s.json(e,(f,a,u)=>(o=o||u,!0)),o?(n.formData=s,i(n,s)):(n.json=e,n.body=JSON.stringify(e),n.headers={contentType:"application/json",contentLength:new r([n.body]).size}),n.jsonfied=e}return n}var mn=(e,t,r,n)=>class extends tt(e,t,r){constructor(i,o={}){o={...o};let s={};i instanceof e&&(o.method&&i.method!==o.method.toUpperCase()&&["GET","HEAD"].includes(o.method.toUpperCase())?(i=i.url,["headers","mode","credentials","cache","redirect","referrer","integrity"].forEach(a=>{a in o||(o[a]=i[a])})):s=i.bodyAttrs||{}),"body"in o&&(s=rt(o.body,r,n),o.body=s.body);let f;o.mode==="navigate"&&(f=!0,o={...o},delete o.mode),super(i,o,s),f&&(this.attrs.mode="navigate")}get mode(){return"mode"in this.attrs?this.attrs.mode:super.mode}get cache(){return"cache"in this.attrs?this.attrs.cache:super.cache}get destination(){return"destination"in this.attrs?this.attrs.destination:super.destination}get referrer(){return"referrer"in this.attrs?this.attrs.referrer:super.referrer}static compat(i,o=null){return i instanceof e?Object.setPrototypeOf(i,new this):new this(o,i)}},ur=mn;var hn=(e,t,r,n)=>class extends tt(e,t,r){constructor(i=null,o={}){let s={},f;arguments.length&&(i instanceof e?(f=i,o={status:i.status,statusText:i.statusText,headers:i.headers,...o},i.status===0&&delete o.status,s=i.bodyAttrs||{},i=i.body):(s=rt(i,r,n),i=s.body)),super(i,o,s),f&&(this.attrs.url=f.url,this.attrs.ok=f.ok,this.attrs.status=f.status,this.attrs.type=f.type,this.attrs.redirected=f.redirected)}get ok(){return"ok"in this.attrs?this.attrs.ok:super.ok}get status(){return"status"in this.attrs?this.attrs.status:super.status}get statusText(){return"statusText"in this.attrs?this.attrs.statusText:super.statusText}get type(){return"type"in this.attrs?this.attrs.type:super.type}get redirected(){return"redirected"in this.attrs?this.attrs.redirected:super.redirected}static compat(i){return i instanceof e?Object.setPrototypeOf(i,new this):new this(i)}},cr=hn;var dn=e=>e,lr=dn;var gn=(e,t,r)=>{let n=class{constructor(i,o,s){this._request=i,this._detail=o||{},this._sessionFactory=s,this.Request=e,this.Response=t,this.URL=r,this.port={listeners:[],post(f){let a=this.listeners.map(u=>u(f)).filter(u=>u instanceof Promise);if(process.length)return Promise.all(a)},listen(f){this.listeners.push(f)}}}get url(){return this._url||(this._url=new this.URL(this._request.url)),this._url}get request(){return this._request}get detail(){return this._detail}get session(){return this._session||(this._session=this.sessionFactory().get()),this._session}sessionFactory(...i){return this._sessionFactory(...i)}retarget(i,o={}){var s;return i instanceof e?B(o)?s=i:s=new e(i,o):(s=new e(this._request,o),s.attrs.url=`${this.url.origin}${i}`,s.attrs.referrer=this.request.url),new n(s,this.detail)}};return n},pr=gn;var _n=ir(Jt),mr=or(nr);var yn=ar(gt),xn=fr(gt),bt=ur(tr,yn,mr,_t),Te=cr(rr,xn,mr,_t),Ag=lr(er),hr=pr(bt,Te,_n);var Fe=class{constructor(t,r){this.cx=t,this.clients=new Map,this.mockSessionStore={},this.cx.runtime=this;let n=r(this.cx,"*");if(!n||!n.handle)throw new Error('Application instance must define a ".handle()" method.');this.clients.set("*",n),self.addEventListener("install",i=>{this.cx.params.skip_waiting&&self.skipWaiting(),this.cx.params.cache_name&&(this.cx.params.cache_only_urls||[]).length&&i.waitUntil(self.caches.open(this.cx.params.cache_name).then(o=>{this.cx.logger&&this.cx.logger.log("[ServiceWorker] Pre-caching resources.");let s=(this.cx.params.cache_only_urls||[]).map(f=>f.trim()).filter(f=>f&&!lt(f,self.origin).isPattern());return o.addAll(s)}))}),self.addEventListener("activate",i=>{i.waitUntil(new Promise(async o=>{this.cx.params.skip_waiting&&await self.clients.claim(),this.cx.params.cache_name&&await self.caches.keys().then(s=>Promise.all(s.map(f=>{if(f!==this.cx.params.cache_name&&f!==this.cx.params.cache_name+"_json")return this.cx.logger&&this.cx.logger.log("[ServiceWorker] Removing old cache:",f),self.caches.delete(f)}))),o()}))}),self.addEventListener("fetch",i=>{!i.request.url.startsWith("http")||i.respondWith((async(o,s)=>{let f=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((a,u)=>({[u]:o[u],...a}),{});return["GET","HEAD"].includes(o.method)||(f.body=await o.text()),o.cache==="force-cache"&&(f.cache="default"),this.go(o.url,f,{event:s})})(i.request,i))}),R.set(this,"location",{}),R.set(this,"network",{}),R.observe(this.network,i=>{})}async go(t,r={},n={}){t=typeof t=="string"?new URL(t):t,r={referrer:this.location.href,...r};let i=await this.generateRequest(t.href,r);n.event&&Object.defineProperty(n.event,"request",{value:i});let o=new hr(i,n,(a=null,u=!1)=>this.getSession(o,a,u));o.port.listen(a=>{if(a.$type==="handler:hints"&&a.session)return Promise.resolve()});let s;return o.request.url.startsWith(self.origin)?s=await this.clients.get("*").handle(o,(...a)=>this.remoteFetch(...a)):s=await this.remoteFetch(o.request),this.handleResponse(o,s)}generateRequest(t,r){return new bt(t,r)}getSession(t,r=null,n=!1){return{get:()=>this.mockSessionStore,set:i=>{this.mockSessionStore=i}}}remoteFetch(t,...r){arguments.length>1&&(t=this.generateRequest(t,...r));let n=(s,f)=>we((s||[]).map(a=>a.trim()).filter(a=>a),a=>lt(a,self.origin).test(f)),o=(()=>n(this.cx.params.cache_only_urls,t.url)?(R.set(this.network,"strategy","cache-only"),this.cacheFetch(t,{networkFallback:!1,cacheRefresh:!1})):n(this.cx.params.network_only_urls,t.url)?(R.set(this.network,"strategy","network-only"),this.networkFetch(t,{cacheFallback:!1,cacheRefresh:!1})):n(this.cx.params.cache_first_urls,t.url)?(R.set(this.network,"strategy","cache-first"),this.cacheFetch(t,{networkFallback:!0,cacheRefresh:!0})):(R.set(this.network,"strategy","network-first"),this.networkFetch(t,{cacheFallback:!0,cacheRefresh:!0})))(t);return o.catch(s=>R.set(this.network,"error",s.message)),o.then(s=>Te.compat(s))}cacheFetch(t,r={}){return this.getRequestCache(t).then(n=>n.match(t).then(i=>!i&&r.networkFallback?this.networkFetch(t,{...r,cacheFallback:!1}):(i&&r.cacheRefresh&&this.networkFetch(t,{...r,justRefreshing:!0}),R.set(this.network,"cache",!0),i)))}networkFetch(t,r={}){return r.cacheFallback?self.fetch(t).then(n=>(r.cacheRefresh&&this.refreshCache(t,n),R.set(this.network,"remote",!0),n)).catch(()=>this.getRequestCache(t).then(n=>(R.set(this.network,"cache",!0),n.match(t)))):(R.set(this.network,"remote",!0),self.fetch(t))}refreshCache(t,r){if(t.method!=="GET"||!r||r.status!==200||r.type!=="basic"&&r.type!=="cors")return r;var n=r.clone();return this.getRequestCache(t).then(i=>{R.set(this.network,"cacheRefresh",!0),i.put(t,n)}),r}getRequestCache(t){let r=t.headers.get("Accept")==="application/json"?this.cx.params.cache_name+"_json":this.cx.params.cache_name;return self.caches.open(r)}handleResponse(t,r){return r instanceof Te||(r=Te.compat(r)),r}};async function dr(e=null){let t=this||{},r=n=>new Ce(n);return new Fe(ye.create(t),(...n)=>e?e(...n.concat(r)):r(...n))}var bn={},wn={cache_name:"cache_v0",cache_only_urls:[],cache_first_urls:[],network_only_urls:[],network_first_urls:[],skip_waiting:!1,support_push:!1,push_registration_url:"",push_deregistration_url:"",push_public_key:"",routing:{scope:"/",subscopes:[]}};dr.call({layout:bn,params:wn});
|
|
2
|
+
var _r=Object.defineProperty;var yr=(t,e)=>()=>(t&&(e=t(t=0)),e);var xr=(t,e)=>{for(var r in e)_r(t,r,{get:e[r],enumerable:!0})};var qt={};xr(qt,{URLPattern:()=>Wt});function Tr(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function Rt(t,e=!1){let r=[],n=0;for(;n<t.length;){let i=t[n],s=function(o){if(!e)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})};if(i==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(i==="+"||i==="?"){r.push({type:"MODIFIER",index:n,value:t[n++]});continue}if(i==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(i==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(i==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(i===":"){let o="",f=n+1;for(;f<t.length;){let a=t.substr(f,1);if(f===n+1&&Ar.test(a)||f!==n+1&&Rr.test(a)){o+=t[f++];continue}break}if(!o){s(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=f;continue}if(i==="("){let o=1,f="",a=n+1,u=!1;if(t[a]==="?"){s(`Pattern cannot start with "?" at ${a}`);continue}for(;a<t.length;){if(!Tr(t[a],!1)){s(`Invalid character '${t[a]}' at ${a}.`),u=!0;break}if(t[a]==="\\"){f+=t[a++]+t[a++];continue}if(t[a]===")"){if(o--,o===0){a++;break}}else if(t[a]==="("&&(o++,t[a+1]!=="?")){s(`Capturing groups are not allowed at ${a}`),u=!0;break}f+=t[a++]}if(u)continue;if(o){s(`Unbalanced pattern at ${n}`);continue}if(!f){s(`Missing pattern at ${n}`);continue}r.push({type:"PATTERN",index:n,value:f}),n=a;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function Tt(t,e={}){let r=Rt(t),{prefixes:n="./"}=e,i=`[^${le(e.delimiter||"/#?")}]+?`,s=[],o=0,f=0,a="",u=new Set,c=w=>{if(f<r.length&&r[f].type===w)return r[f++].value},l=()=>{let w=c("MODIFIER");return w||c("ASTERISK")},p=w=>{let L=c(w);if(L!==void 0)return L;let{type:v,index:k}=r[f];throw new TypeError(`Unexpected ${v} at ${k}, expected ${w}`)},h=()=>{let w="",L;for(;L=c("CHAR")||c("ESCAPED_CHAR");)w+=L;return w},R=w=>w,O=e.encodePart||R;for(;f<r.length;){let w=c("CHAR"),L=c("NAME"),v=c("PATTERN");if(!L&&!v&&c("ASTERISK")&&(v=".*"),L||v){let b=w||"";n.indexOf(b)===-1&&(a+=b,b=""),a&&(s.push(O(a)),a="");let F=L||o++;if(u.has(F))throw new TypeError(`Duplicate name '${F}'.`);u.add(F),s.push({name:F,prefix:O(b),suffix:"",pattern:v||i,modifier:l()||""});continue}let k=w||c("ESCAPED_CHAR");if(k){a+=k;continue}if(c("OPEN")){let b=h(),F=c("NAME")||"",W=c("PATTERN")||"";!F&&!W&&c("ASTERISK")&&(W=".*");let Ie=h();p("CLOSE");let vt=l()||"";if(!F&&!W&&!vt){a+=b;continue}if(!F&&!W&&!b)continue;a&&(s.push(O(a)),a=""),s.push({name:F||(W?o++:""),pattern:F&&!W?i:W,prefix:O(b),suffix:O(Ie),modifier:vt});continue}a&&(s.push(O(a)),a=""),p("END")}return s}function le(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function jt(t){return t&&t.sensitive?"u":"ui"}function jr(t,e){if(!e)return t;let r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(t.source);for(;i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(t.source);return t}function Lr(t,e,r){let n=t.map(i=>Ft(i,e,r).source);return new RegExp(`(?:${n.join("|")})`,jt(r))}function Fr(t,e,r){return Lt(Tt(t,r),e,r)}function Lt(t,e,r={}){let{strict:n=!1,start:i=!0,end:s=!0,encode:o=c=>c}=r,f=`[${le(r.endsWith||"")}]|$`,a=`[${le(r.delimiter||"/#?")}]`,u=i?"^":"";for(let c of t)if(typeof c=="string")u+=le(o(c));else{let l=le(o(c.prefix)),p=le(o(c.suffix));if(c.pattern)if(e&&e.push(c),l||p)if(c.modifier==="+"||c.modifier==="*"){let h=c.modifier==="*"?"?":"";u+=`(?:${l}((?:${c.pattern})(?:${p}${l}(?:${c.pattern}))*)${p})${h}`}else u+=`(?:${l}(${c.pattern})${p})${c.modifier}`;else c.modifier==="+"||c.modifier==="*"?u+=`((?:${c.pattern})${c.modifier})`:u+=`(${c.pattern})${c.modifier}`;else u+=`(?:${l}${p})${c.modifier}`}if(s)n||(u+=`${a}?`),u+=r.endsWith?`(?=${f})`:"$";else{let c=t[t.length-1],l=typeof c=="string"?a.indexOf(c[c.length-1])>-1:c===void 0;n||(u+=`(?:${a}(?=${f}))?`),l||(u+=`(?=${a}|${f})`)}return new RegExp(u,jt(r))}function Ft(t,e,r){return t instanceof RegExp?jr(t,e):Array.isArray(t)?Lr(t,e,r):Fr(t,e,r)}function $r(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function It(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function Nr(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function kt(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function Nt(t){if(!t)return!0;for(let e of $t)if(t.test(e))return!0;return!1}function Dr(t,e){if(t=It(t,"#"),e||t==="")return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function Ur(t,e){if(t=It(t,"?"),e||t==="")return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function Mr(t,e){return e||t===""?t:kt(t)?Mt(t):Ut(t)}function Hr(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Wr(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function qr(t,e,r){if(r||t==="")return t;if(e&&!$t.includes(e))return new URL(`${e}:${t}`).pathname;let n=t[0]=="/";return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function zr(t,e,r){return Dt(e)===t&&(t=""),r||t===""?t:Ht(t)}function Br(t,e){return t=Nr(t,":"),e||t===""?t:lt(t)}function Dt(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function lt(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Gr(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Vr(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function Ut(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function Mt(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function Ht(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Qr(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}function Kr(t){return t===""?t:new URL(`data:${t}`).pathname}function Xr(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Zr(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function At(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!=""?r.search.substring(1,r.search.length):void 0,hash:r.hash!=""?r.hash.substring(1,r.hash.length):void 0}}function Se(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),t.protocol=n.protocol?n.protocol.substring(0,n.protocol.length-1):"",t.username=n.username,t.password=n.password,t.hostname=n.hostname,t.port=n.port,t.pathname=n.pathname,t.search=n.search?n.search.substring(1,n.search.length):"",t.hash=n.hash?n.hash.substring(1,n.hash.length):""}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Br(e.protocol,r)),typeof e.username=="string"&&(t.username=Wr(e.username,r)),typeof e.password=="string"&&(t.password=Hr(e.password,r)),typeof e.hostname=="string"&&(t.hostname=Mr(e.hostname,r)),typeof e.port=="string"&&(t.port=zr(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!$r(t.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(t.pathname=n.pathname.substring(0,i+1)+t.pathname)}t.pathname=qr(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=Ur(e.search,r)),typeof e.hash=="string"&&(t.hash=Dr(e.hash,r)),t}function Pe(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function en(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function tn(t,e){let r=".*",n=`[^${en(e.delimiter||"/#?")}]+?`,i=/[$_\u200C\u200D\p{ID_Continue}]/u,s="";for(let o=0;o<t.length;++o){let f=t[o],a=o>0?t[o-1]:null,u=o<t.length-1?t[o+1]:null;if(typeof f=="string"){s+=Pe(f);continue}if(f.pattern===""){if(f.modifier===""){s+=Pe(f.prefix);continue}s+=`{${Pe(f.prefix)}}${f.modifier}`;continue}let c=typeof f.name!="number",l=e.prefixes!==void 0?e.prefixes:"./",p=f.suffix!==""||f.prefix!==""&&(f.prefix.length!==1||!l.includes(f.prefix));if(!p&&c&&f.pattern===n&&f.modifier===""&&u&&!u.prefix&&!u.suffix)if(typeof u=="string"){let h=u.length>0?u[0]:"";p=i.test(h)}else p=typeof u.name=="number";if(!p&&f.prefix===""&&a&&typeof a=="string"&&a.length>0){let h=a[a.length-1];p=l.includes(h)}p&&(s+="{"),s+=Pe(f.prefix),c&&(s+=`:${f.name}`),f.pattern===r?!c&&(!a||typeof a=="string"||a.modifier||p||f.prefix!=="")?s+="*":s+=`(${r})`:f.pattern===n?c||(s+=`(${n})`):s+=`(${f.pattern})`,f.pattern===n&&c&&f.suffix!==""&&i.test(f.suffix[0])&&(s+="\\"),s+=Pe(f.suffix),p&&(s+="}"),s+=f.modifier}return s}var Ar,Rr,Q,Ir,kr,$t,Yr,Jr,V,Wt,zt=yr(()=>{Ar=/[$_\p{ID_Start}]/u,Rr=/[$_\u200C\u200D\p{ID_Continue}]/u;Q={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},kr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};$t=["ftp","file","http","https","ws","wss"];Yr=class{constructor(t){this.tokenList=[],this.internalResult={},this.tokenIndex=0,this.tokenIncrement=1,this.componentStart=0,this.state=0,this.groupDepth=0,this.hostnameIPv6BracketDepth=0,this.shouldTreatAsStandardURL=!1,this.input=t}get result(){return this.internalResult}parse(){for(this.tokenList=Rt(this.input,!0);this.tokenIndex<this.tokenList.length;this.tokenIndex+=this.tokenIncrement){if(this.tokenIncrement=1,this.tokenList[this.tokenIndex].type==="END"){if(this.state===0){this.rewind(),this.isHashPrefix()?this.changeState(9,1):this.isSearchPrefix()?(this.changeState(8,1),this.internalResult.hash=""):(this.changeState(7,0),this.internalResult.search="",this.internalResult.hash="");continue}else if(this.state===2){this.rewindAndSetState(5);continue}this.changeState(10,0);break}if(this.groupDepth>0)if(this.isGroupClose())this.groupDepth-=1;else continue;if(this.isGroupOpen()){this.groupDepth+=1;continue}switch(this.state){case 0:this.isProtocolSuffix()&&(this.internalResult.username="",this.internalResult.password="",this.internalResult.hostname="",this.internalResult.port="",this.internalResult.pathname="",this.internalResult.search="",this.internalResult.hash="",this.rewindAndSetState(1));break;case 1:if(this.isProtocolSuffix()){this.computeShouldTreatAsStandardURL();let t=7,e=1;this.shouldTreatAsStandardURL&&(this.internalResult.pathname="/"),this.nextIsAuthoritySlashes()?(t=2,e=3):this.shouldTreatAsStandardURL&&(t=2),this.changeState(t,e)}break;case 2:this.isIdentityTerminator()?this.rewindAndSetState(3):(this.isPathnameStart()||this.isSearchPrefix()||this.isHashPrefix())&&this.rewindAndSetState(5);break;case 3:this.isPasswordPrefix()?this.changeState(4,1):this.isIdentityTerminator()&&this.changeState(5,1);break;case 4:this.isIdentityTerminator()&&this.changeState(5,1);break;case 5:this.isIPv6Open()?this.hostnameIPv6BracketDepth+=1:this.isIPv6Close()&&(this.hostnameIPv6BracketDepth-=1),this.isPortPrefix()&&!this.hostnameIPv6BracketDepth?this.changeState(6,1):this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 6:this.isPathnameStart()?this.changeState(7,0):this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 7:this.isSearchPrefix()?this.changeState(8,1):this.isHashPrefix()&&this.changeState(9,1);break;case 8:this.isHashPrefix()&&this.changeState(9,1);break;case 9:break;case 10:break}}}changeState(t,e){switch(this.state){case 0:break;case 1:this.internalResult.protocol=this.makeComponentString();break;case 2:break;case 3:this.internalResult.username=this.makeComponentString();break;case 4:this.internalResult.password=this.makeComponentString();break;case 5:this.internalResult.hostname=this.makeComponentString();break;case 6:this.internalResult.port=this.makeComponentString();break;case 7:this.internalResult.pathname=this.makeComponentString();break;case 8:this.internalResult.search=this.makeComponentString();break;case 9:this.internalResult.hash=this.makeComponentString();break;case 10:break}this.changeStateWithoutSettingComponent(t,e)}changeStateWithoutSettingComponent(t,e){this.state=t,this.componentStart=this.tokenIndex+e,this.tokenIndex+=e,this.tokenIncrement=0}rewind(){this.tokenIndex=this.componentStart,this.tokenIncrement=0}rewindAndSetState(t){this.rewind(),this.state=t}safeToken(t){return t<0&&(t=this.tokenList.length-t),t<this.tokenList.length?this.tokenList[t]:this.tokenList[this.tokenList.length-1]}isNonSpecialPatternChar(t,e){let r=this.safeToken(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}isProtocolSuffix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}nextIsAuthoritySlashes(){return this.isNonSpecialPatternChar(this.tokenIndex+1,"/")&&this.isNonSpecialPatternChar(this.tokenIndex+2,"/")}isIdentityTerminator(){return this.isNonSpecialPatternChar(this.tokenIndex,"@")}isPasswordPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPortPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,":")}isPathnameStart(){return this.isNonSpecialPatternChar(this.tokenIndex,"/")}isSearchPrefix(){if(this.isNonSpecialPatternChar(this.tokenIndex,"?"))return!0;if(this.tokenList[this.tokenIndex].value!=="?")return!1;let t=this.safeToken(this.tokenIndex-1);return t.type!=="NAME"&&t.type!=="PATTERN"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}isHashPrefix(){return this.isNonSpecialPatternChar(this.tokenIndex,"#")}isGroupOpen(){return this.tokenList[this.tokenIndex].type=="OPEN"}isGroupClose(){return this.tokenList[this.tokenIndex].type=="CLOSE"}isIPv6Open(){return this.isNonSpecialPatternChar(this.tokenIndex,"[")}isIPv6Close(){return this.isNonSpecialPatternChar(this.tokenIndex,"]")}makeComponentString(){let t=this.tokenList[this.tokenIndex],e=this.safeToken(this.componentStart).index;return this.input.substring(e,t.index)}computeShouldTreatAsStandardURL(){let t={};Object.assign(t,Q),t.encodePart=lt;let e=Ft(this.makeComponentString(),void 0,t);this.shouldTreatAsStandardURL=Nt(e)}},Jr=["protocol","username","password","hostname","port","pathname","search","hash"],V="*";Wt=class{constructor(t={},e){this.regexp={},this.keys={},this.component_pattern={};try{if(typeof t=="string"){let i=new Yr(t);if(i.parse(),t=i.result,e)if(typeof e=="string")t.baseURL=e;else throw new TypeError("'baseURL' parameter is not of type 'string'.");else if(typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.")}else if(e)throw new TypeError("parameter 1 is not of type 'string'.");if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");let r={pathname:V,protocol:V,username:V,password:V,hostname:V,port:V,search:V,hash:V};this.pattern=Se(r,t,!0),Dt(this.pattern.protocol)===this.pattern.port&&(this.pattern.port="");let n;for(n of Jr){if(!(n in this.pattern))continue;let i={},s=this.pattern[n];switch(this.keys[n]=[],n){case"protocol":Object.assign(i,Q),i.encodePart=lt;break;case"username":Object.assign(i,Q),i.encodePart=Gr;break;case"password":Object.assign(i,Q),i.encodePart=Vr;break;case"hostname":Object.assign(i,Ir),kt(s)?i.encodePart=Mt:i.encodePart=Ut;break;case"port":Object.assign(i,Q),i.encodePart=Ht;break;case"pathname":Nt(this.regexp.protocol)?(Object.assign(i,kr),i.encodePart=Qr):(Object.assign(i,Q),i.encodePart=Kr);break;case"search":Object.assign(i,Q),i.encodePart=Xr;break;case"hash":Object.assign(i,Q),i.encodePart=Zr;break}try{let o=Tt(s,i);this.regexp[n]=Lt(o,this.keys[n],i),this.component_pattern[n]=tn(o,i)}catch{throw new TypeError(`invalid ${n} pattern '${this.pattern[n]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}test(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{typeof t=="object"?r=Se(r,t,!1):r=Se(r,At(t,e),!1)}catch{return!1}let n;for(n in this.pattern)if(!this.regexp[n].exec(r[n]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?r=Se(r,t,!1):r=Se(r,At(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let i;for(i in this.pattern){let s=this.regexp[i].exec(r[i]);if(!s)return null;let o={};for(let[f,a]of this.keys[i].entries())if(typeof a.name=="string"||typeof a.name=="number"){let u=s[f+1];o[a.name]=u}n[i]={input:r[i]||"",groups:o}}return n}get protocol(){return this.component_pattern.protocol}get username(){return this.component_pattern.username}get password(){return this.component_pattern.password}get hostname(){return this.component_pattern.hostname}get port(){return this.component_pattern.port}get pathname(){return this.component_pattern.pathname}get search(){return this.component_pattern.search}get hash(){return this.component_pattern.hash}};globalThis.URLPattern||(globalThis.URLPattern=Wt)});var ge=class{constructor(e,r=null){Object.defineProperty(this,"dict",{value:Object.create(e)});for(let n in this.dict)n in this||(this[n]=this.dict[n]);arguments.length>1&&Object.defineProperty(this.dict,"CWD",{get:()=>r})}get name(){return"webflo"}static create(...e){return new this(...e)}get CWD(){return this.dict.CWD||""}get meta(){return this.dict.meta||{}}get app(){return this.dict.app||{}}get config(){return this.dict.config||{}}get flags(){return this.dict.flags||{}}set flags(e){this.dict.flags=e}get layout(){return this.dict.layout||{}}set layout(e){this.dict.layout=e}get logger(){return this.dict.logger}set logger(e){this.dict.logger=e}};var _e=class extends ge{};var ye=class extends _e{};function d(t){return!Array.isArray(t)&&typeof t=="object"&&t}function S(t){return typeof t}function x(t,...e){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(t);if(!r){if(r=new Map,e[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(t,r)}for(var n,i;n=e.shift();)if((i=r)&&!(r=r.get(n))){if(r=new Map,e[0]===!1)return r;i.set(n,r)}return r}function m(t){return Array.isArray(t)}function te(t){return typeof t=="function"}function it(t){return te(t)&&/^class\s?/.test(Function.prototype.toString.call(t))}function ke(t){return t===null||t===""}function N(t){return arguments.length&&(t===void 0||typeof t>"u")}function g(t){return Array.isArray(t)||typeof t=="object"&&t||te(t)}function B(t){return ke(t)||N(t)||t===!1||t===0||g(t)&&!Object.keys(t).length}function _(t){return te(t)||t&&{}.toString.call(t)==="[object function]"}function q(t){return t instanceof Number||typeof t=="number"}function P(t){return q(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function st(t){return m(t)&&Object.getPrototypeOf(t)===Array.prototype}function $e(t){return d(t)&&Object.getPrototypeOf(t)===Object.prototype}function I(t){return t instanceof String||typeof t=="string"&&t!==null}function ot(t){return!I(t)&&!N(t.length)}function xe(t,e=1){var r=0;t.forEach(i=>{r++});var n=t.slice(t.length-r,e);return arguments.length>1?n:n[0]}function we(t,e=1){return arguments.length>1?xe(t.slice().reverse(),e).reverse():xe(t.slice().reverse())}function Ne(t,...e){return e.forEach(r=>{t.indexOf(r)<0&&t.push(r)}),t}function at(n,e){e=e||Object.prototype,e=e&&!m(e)?[e]:e;for(var r=[],n=n;n&&(!e||e.indexOf(n)<0)&&n.name!=="default";)r.push(n),n=n?Object.getPrototypeOf(n):null;return r}function ft(t,e){var r=[];return at(t,e).forEach(n=>{Ne(r,...Object.getOwnPropertyNames(n))}),r}function U(t,e,r=!1,n=!1,i=!1){var s=0,o=t.shift();if((P(o)||o===!0||o===!1)&&(s=o,o=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((f,a)=>{!g(f)&&!_(f)||(r?ft(f):Object.keys(f)).forEach(u=>{if(!!e(u,o,f,a)){var c=o[u],l=f[u];if((m(c)&&m(l)||d(c)&&d(l))&&(s===!0||s>0))o[u]=m(c)&&m(l)?[]:{},U([P(s)?s-1:s,o[u],c,l],e,r,n,i);else if(m(o)&&m(f))n?o[u]=l:o.push(l);else try{i?Object.defineProperty(o,u,Object.getOwnPropertyDescriptor(f,u)):o[u]=f[u]}catch{}}})}),o}function H(t,e){var r=void 0;return g(t)&&Object.keys(t).forEach((n,i)=>{r!==!1&&(r=e(P(n)?parseFloat(n):n,t[n],i))}),r}function re(...t){return U(t,(e,r,n)=>!0,!1,!1,!1)}function z(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?"":t.substr(n+e.length)}function ut(t,e){return z(t,e,!0)}function fe(t,e,r=!1){if(e=="")return t;var n=r?t.lastIndexOf(e):t.indexOf(e);return n===-1?t:t.substr(0,n)}function ne(t,e){return fe(t,e,!0)}function ue(t,e,r=null,n=!1){return e.length>t.length?-1:(typeof r=="number"?n?t.slice(0,r+1+(r<0?t.length:0)):t.slice(r):t).reduce((i,s,o)=>{var[f,a,u]=i;if(!n&&f>-1)return[f,a,u];var c=u+1,l=s===e[c]?c===0?[o,0]:[a,c]:[-1,-1];return l[1]===e.length-1&&(l[1]=-1,l[0]>-1)?[l[0]].concat(l):[f].concat(l)},[-1,-1,-1])[0]+(n||typeof r!="number"?0:r>-1?r:t.length-r)}function ce(t,e,r=null,n=!1){var i=ue(t,e,r,n);return i===-1?[]:t.slice(i+e.length)}function be(t,e){return t.reduce((r,n,i)=>r||e(n,i),!1)}function y(t,e=!0){return m(t)?t:!e&&d(t)?[t]:t!==!1&&t!==0&&B(t)?[]:ot(t)?Array.prototype.slice.call(t):d(t)?Object.values(t):[t]}function G(t,e,r=null){return r||r!==!1&&t.dotSafe&&e.dotSafe?t.join(".")===e.join("."):t.length===e.length&&t.reduce((n,i,s)=>n&&i===e[s],!0)}function ve(t,e,r=null){return m(e)?t.filter(n=>r?e.filter(i=>r(n,i)).length:e.indexOf(n)!==-1):[]}function Oe(t,e,r=null){return r||r!==!1&&t.dotSafe&&e.dotSafe?(t.join(".")+".").startsWith(e.join(".")+"."):e.reduce((n,i,s)=>n&&i===t[s],!0)}function ct(t){let e=(r,n,i)=>i.indexOf(r)===n;return t.filter(e)}typeof URLPattern>"u"&&await Promise.resolve().then(()=>(zt(),qt));function Bt(t,e,r,n=!1){if(I(e)&&e.endsWith("]")){var i=ne(ut(e,"["),"]")||0;return P(i)&&(i=parseInt(i)),e=ne(e,"[")||0,P(e)&&(e=parseInt(e)),Bt(t,e,(s,o)=>{if(!s[o]){if(!n)return r();s[o]=P(i)?[]:{}}return r(s[o],i)},n)}else return r(t,e)}function De(t,e,r,n=!0){Bt(t,e,(i,s)=>{P(s)?(s=s||m(i)?i.length:Object.keys(i).filter(P).length,y(r,!1).forEach((o,f)=>{i[s+f]=o})):i[s]=n&&s in i?y(i[s],!1).concat(r):r},!0)}function ie(t,e={},r="&"){return t=t||"",(t.startsWith("?")?t.substr(1):t).split(r).filter(n=>n).map(n=>n.split("=").map(i=>i.trim())).forEach(n=>De(e,n[0],decodeURIComponent(n[1]))),e}function Ue(t,e,r,n=null){if((d(e)||m(e))&&(!n||n(e,t))){var i=m(e);Object.keys(e).forEach(s=>{Ue(`${t}[${s}]`,e[s],r,n)})}else r(t,!e&&e!==0?"":e)}function pe(t,e="&",r=null){var n=[];return Object.keys(t).forEach(i=>{Ue(i,t[i],(s,o)=>{n.push(`${s}=${encodeURIComponent(o)}`)},r)}),n.join(e)}var Gt={join(){for(var t=[],e=0,r=0,n=arguments.length;r<n;r++)t=t.concat(arguments[r].split("/"));var i=[];for(r=0,n=t.length;r<n;r++){var s=t[r];!s||s==="."||(s===".."?i.length?i.pop():e++:i.push(s))}return t[0]===""&&i.unshift(""),"../".repeat(e)+i.join("/")||(i.length?"/":".")},dirname(t){return this.join(t,"..")}},pt=(t,e=null)=>({pattern:new URLPattern(t,e),isPattern(){return Object.keys(this.pattern.keys||{}).some(r=>this.pattern.keys[r].length)},test(...r){return this.pattern.test(...r)},exec(...r){let n=this.pattern.exec(...r);if(!!n)return n.vars=Object.keys(this.pattern.keys).reduce(({named:i,unnamed:s},o)=>(this.pattern.keys[o].forEach(f=>{let a=n[o].groups[f.name];typeof f.name=="number"?s.push(a):i[f.name]=a}),{named:i,unnamed:s}),{named:{},unnamed:[]}),n.render=i=>i.replace(/\$(\$|[0-9A-Z]+)/gi,(s,o)=>o==="$"?"$":(P(o)?n.vars.unnamed[o-1]:n.vars.named[o])||""),n}});var Ee=class{constructor(e,r){this.cx=e,this.path=m(r)?r:(r+"").split("/").filter(n=>n)}async route(e,r,n,i,s=null){let o=this,f=async function(a){let u={};if(!a.trail||a.trail.length<a.destination.length){if(a=await o.readTick(a),u.pathname=`/${a.trail.join("/")}`,u.stepname=a.trail[a.trail.length-1],o.finalizeHandlerContext(u,a),a.exports){a.exports.hints&&await r.port.post({...a.exports.hints,$type:"handler:hints"});let c=y(a.method),l=_(a.exports)&&c.includes("default")?a.exports:c.reduce((p,h)=>p||a.exports[h.toLowerCase()],null);if(l){let p=async(...R)=>{let O={...a,arg:R[0]};if(R.length>1){var w=R[1],L,v={...R[2]||{}};if(R[1]instanceof O.event.Request)L=R[1],w=L.url;else if(!I(w))throw new Error("Router redirect url must be a string!");var k=w.startsWith("/")?w:o.pathJoin(`/${a.trail.join("/")}`,w);if(k.startsWith("../"))throw new Error("Router redirect cannot traverse beyond the routing directory! ("+w+" >> "+k+")");v.method&&(O.method=v.method,m(v.method)&&(v.method=v.method[0])),L?O.event=a.event.retarget(L,{...v,_proxy:{url:k}}):O.event=a.event.retarget(k,v),O.source=a.destination.join("/"),O.destination=k.split("?").shift().split("/").map($=>$.trim()).filter($=>$),O.trail=R[1].startsWith("/")?[]:a.trail.reduce(($,b,F)=>$.length===F&&b===O.destination[F]?$.concat(b):$,[]),O.trailOnFile=a.trailOnFile.slice(0,O.trail.length)}return f(O)},h=a.destination.slice(a.trail.length);return p.pathname=h.join("/"),p.stepname=h[0],await l.call(u,a.event,a.arg,p,s)}return f(a)}else if((a.currentSegmentOnFile||{}).dirExists)return f(a)}if(i)return await i.call(u,a.event,a.arg,s)};return f({destination:this.path,event:r,method:e,arg:n})}};var Ce=class extends Ee{async readTick(e){var r=this.cx.layout,n=Object.keys(this.cx.layout);return e.trail?(e.currentSegment=e.destination[e.trail.length],e.currentSegmentOnFile=[e.currentSegment,"-"].reduce((i,s)=>{if(i.index)return i;var o=`/${e.trailOnFile.concat(s).join("/")}`;return r[o]?{seg:s,index:o}:n.filter(f=>f.startsWith(`${o}/`)).length?{seg:s,dirExists:!0}:i},{seg:null}),e.trail.push(e.currentSegment),e.trailOnFile.push(e.currentSegmentOnFile.seg),e.exports=r[e.currentSegmentOnFile.index]):(e.trail=[],e.trailOnFile=[],e.currentSegmentOnFile={index:"/"},e.exports=r["/"]),e}finalizeHandlerContext(e,r){return e.dirname=r.currentSegmentOnFile.index}pathJoin(...e){return Gt.join(...e)}};var Ae=class{constructor(e){this.cx=e}async handle(e,r){let n=new Ce(this.cx,e.url.pathname);return(async()=>{let s=e.request.method.toLowerCase(),o=await n.route([s==="delete"?"del":s,"default"],e,{},async f=>r(f.request),r);return o instanceof e.Response||(o=e.Response.compat(o)),o})()}};function se(t){return(ht(t)?t:y(t).length?[t]:[]).reduce((e,r)=>e.concat([y(r)]),[]).map(e=>K.resolve(e))}var K=class extends Array{static resolve(e){return e.every(r=>!(r+"").includes("."))?new K().concat(e):e}get dotSafe(){return!0}};function ht(t){return y(t).reduce((e,r)=>e||m(r),!1)}function mt(t){return t.filter(e=>e||e===0).length!==t.length}function Vt(t){return t.filter(e=>mt(y(e))).length>0}var oe=class{constructor(e){this.target=e,this.fireables=[],this.currentlyFiring=[]}add(e){return this.fireables.push(e),e}remove(e){this.fireables=this.fireables.filter(r=>r!==e)}removeMatches(e){this.match(e).forEach(r=>{this.fireables=this.fireables.filter(n=>n!==r)})}match(e){return this.fireables.filter(r=>{var n=se(r.filter),i=y((r.params||{}).tags),s=se(e.filter),o=y((e.params||{}).tags);return(!e.originalHandler||r.handler===e.originalHandler)&&(!s.length||G(s,n))&&(!o.length||o.length===i.length&&ve(i,o).length===o.length)})}static _getFirebase(e,r,n=!0,i=this.__namespace){if(!g(r))throw new Error('Subject must be of type object; "'+S(r)+'" given!');var s=this;return i&&globalThis.WebQitObserverNamespaceRegistry.has(e+"-"+i)&&(s=globalThis.WebQitObserverNamespaceRegistry.get(e+"-"+i),e+="-"+i),!x(r,"firebases").has(e)&&n&&x(r,"firebases").set(e,new s(r)),x(r,"firebases").get(e)}static _namespace(e,r,n=null){if(e+="-"+r,arguments.length===2)return globalThis.WebQitObserverNamespaceRegistry.get(e);if(!(n.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(e,n),n.__namespace=r}};globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);var ae=class{constructor(e,r){this.target=e,this.handler=r.handler,this.filter=r.filter,this.params=r.params}disconnect(){this.disconnected=!0}};var Re=class extends ae{fire(e,r,n){return this.disconnected||this.filter&&!ve(y(this.filter),[e.type]).length?r(...Array.prototype.slice.call(arguments,2)):this.handler(e,n,r)}};function Me(t,e=[],r=!0){var n=0;return P(arguments[0])&&g(arguments[1])&&(n=arguments[0],t=arguments[1],e=arguments[2]||[]),U([n,{},t],(i,s,o)=>_(e)?e(i):m(e)&&e.length?e.indexOf(i)>-1:!0,!1,!1,r)}var he=class{constructor(e,r){if(this.target=e,!r.type)throw new Error("Action type must be given in definition!");H(r,(n,i)=>{Object.defineProperty(this,n,{value:i,enumerable:!0})}),Object.seal(this)}};var T=class extends oe{add(e){return super.add(new Re(this.target,e))}fire(e,r=null){if(e instanceof he||(e=new he(this.target,e)),this.currentlyFiring.filter(s=>s.type===e.type&&s.name===e.name).length)return r?r():void 0;this.currentlyFiring.push(e);let n=(s,...o)=>{var f=this.fireables[s];return f?f.fire(e,(...a)=>n(s+1,...a),...o):r?r(...o):o[0]};var i=n(0);return this.currentlyFiring.pop(),i}static getFirebase(e,r=!0,n=null){return super._getFirebase("interceptor",...arguments)}static namespace(e,r=null){return super._namespace("interceptor",...arguments)}};function A(t){return x(t,!1).get(t)||t}function j(t,e,r={},n={}){if(!e||!g(e))throw new Error("Target must be of type object!");e=A(e);var i,s=function(o){return arguments.length?o:Reflect[t](e,...Object.values(r))};return(i=T.getFirebase(e,!1,n.namespace))?i.fire({type:t,...r},s):s()}function We(t,e,r,n={}){return j("apply",t,{thisArgument:e,argumentsList:r},n)}function qe(t,e,r=null,n={}){return j("construct",t,arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},n)}var M=class{constructor(e,r=!1){this._={},this._.target=e,this._.cancellable=r,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(e){e instanceof Promise&&(this._.promises.push(e),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(e){var r,n=d(e)&&!N(e.propagationStopped)&&!N(e.defaultPrevented);e===!1||n&&e.propagationStopped?this.stopPropagation():e===!1||n&&e.defaultPrevented?this.preventDefault():(e instanceof Promise&&(r=e)||n&&(r=e.promises))&&this.waitUntil(r)}};var Te=class extends ae{constructor(e,r){if(super(e,r),this.filters2D=se(this.filter),this.filtersIsOriginally2D=ht(this.filter),this.filtersIsDynamic=Vt(this.filters2D),this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map(n=>"["+n.join(", ")+"]").join(", ")+'" have been bound together.')}fire(e){if(this.disconnected||this.params.type&&!be(e,o=>this.params.type===o.type))return;let r=o=>!["set","def"].includes(o.type)||!this.params.diff||(_(this.params.diff)?this.params.diff(o.value,o.oldValue):o.value!==o.oldValue);var n=new M(this.target);if(this.filters2D.length){var i=e.filter(o=>this.filters2D.filter((f,a)=>{var u=f.slice();return this.filtersIsDynamic&&o.path.forEach((c,l)=>{u[l]=u[l]||u[l]===0?u[l]:c}),(!this.filtersIsDynamic||!mt(u))&&r(o)&&(!this.params.subtree&&G(u,o.path)||this.params.suptree&&Oe(u,o.path)&&(!P(this.params.suptree)||ce(u,o.path).length<=this.params.suptree)||this.params.subtree&&o.path.length>=u.length&&Oe(o.path,u)&&(!P(this.params.subtree)||ce(o.path,u).length<=this.params.subtree))}).length);if(i.length)if(this.filtersIsOriginally2D||this.params.subtree){var s=i;d(this.filter)&&(s={...this.filter},i.forEach((o,f)=>{s[o.name]=o})),n.respondWith(this.handler(s,n))}else i.forEach((o,f)=>{n.respondWith(this.handler(o,n))})}else(this.params.subtree||e.filter(o=>G(o.path,[o.name])).length===e.length)&&e.filter(o=>r(o)).length&&n.respondWith(this.handler(e,n));return n}};var X=class{constructor(e,r){if(this.target=e,r.originalSubject||(this.originalSubject=e),!("type"in r))throw new Error("Mutation type must be given in definition!");if(!("name"in r))throw new Error("Property name must be given in definition!");H(r,(n,i)=>{n==="path"&&(i=K.resolve(i)),Object.defineProperty(this,n,{value:i,enumerable:!0})}),this.path||Object.defineProperty(this,"path",{value:K.resolve([r.name]),enumerable:!0}),Object.seal(this)}};var E=class extends oe{constructor(e){super(e),this.buffers=[]}add(e){return super.add(new Te(this.target,e))}fire(e,r){var n=new M(this.target,r);return e=y(e,!1).map(i=>i instanceof X?i:new X(this.target,i)),this.buffers.length?(we(this.buffers)(e),n):(this.currentlyFiring.filter(i=>e.filter(s=>i.type===s.type&&i.name===s.name).length).length,this.fireables.forEach(i=>{if(n.propagationStopped&&r)return n;n.respondWith(i.fire(e))}),n)}static getFirebase(e,r=!0,n=null){return super._getFirebase("observer",...arguments)}static namespace(e,r=null){return super._namespace("observer",...arguments)}};function D(t,e,r=null,n={}){if(t=r||t,!t||!g(t))throw new Error("Target must be of type object!");t=A(t);var i=y(e),s=i.map(o=>{var f,a=function(u){return arguments.length?u:x(t,"accessorizedProps").has(o)&&x(t,"accessorizedProps").get(o).touch(!0)?x(t,"accessorizedProps").get(o).get():r?Reflect.get(t,o,r):Reflect.get(t,o)};return(f=T.getFirebase(t,!0,n.namespace))?f.fire({type:"get",name:o,related:i,receiver:r},a):a()});return m(e)?s:s[0]}function ze(t,e,r=null,n={}){if(t=A(t),!t||!g(t))throw new Error('Observable subjects must be of type object; "'+S(t)+'" given!');if(_(e)&&(n=arguments.length>2?r:{},r=e,e=null),!_(r))throw new Error('Handler must be a function; "'+S(r)+'" given!');var i,s=E.getFirebase(t,!0,n.namespace),o={filter:e,handler:r,params:n};if((o.filter||o.params.subtree==="*"||o.params.subtree&&me(t))&&Z(t,o.filter,o.params.subtree,n.namespace),o.params.unique&&(i=s.match({filter:e,params:n})).length){if(o.params.unique!=="replace")return i[0];s.remove(i[0])}return s.add(o)}function Y(t,e,r,n=null,i={}){if(t!==r){var s;if(ze(r,(f,a)=>{if(s=E.getFirebase(t,!1,i.namespace)){var u=f.map(c=>{var l=c;do if(l.target===t)return;while(l=l.src);var p={};return H(c,(h,R)=>{h!=="target"&&h!=="name"&&h!=="path"&&h!=="src"&&(p[h]=R)}),p.name=e,p.path=[e].concat(c.path),p.originalSubject=c.originalSubject,p.src=c,new X(t,p)}).filter(c=>c);if(u.length)return s.fire(u,a.cancellable)}},{subtree:!0,...i,unique:!0,tags:[gt,e,t]}),d(n)&&(s=E.getFirebase(t,!1,i.namespace))){var o=re({name:e,type:"set",value:r,related:[e]},n);let f=s.fire(o,i.cancellable);if(i.eventTypeReturn)return f}}}var gt={};function Z(t,e=null,r=!1,n=null){if(!t||!g(t))throw new Error("Target must be of type object!");var i=E.getFirebase(t,!0,n);if(!(!i||i.build)){i.build=r;var s=se(e),o=!s.length||s.filter(a=>!a[0]&&a[0]!==0).length?Object.keys(t):s.map(a=>a[0]),f=s.length?s.map(a=>a.slice(1)).filter(a=>a.length):null;i.subBuild=f&&f.length?f:null,o.forEach(a=>{var u=D(t,a,null,{namespace:n});try{g(u)&&(Y(t,a,u,null,params),(i.subBuild&&me(u)||(_isFunction(r)?r(u):r&&me(u)))&&Z(u,i.subBuild,r,n))}catch{}})}}var me=t=>(t instanceof Object||t instanceof Array||t instanceof Function)&&(typeof window>"u"||t!==window);function Be(t,e,r=null,n={}){if(t=A(t),!t||!g(t))throw new Error('Observable subjects must be of type object; "'+S(t)+'" given!');if(_(e)&&(n=arguments.length>2?r:{},r=e,e=null),r&&!_(r))throw new Error('Handler must be a function; "'+S(r)+'" given!');var i;if(i=E.getFirebase(t,!1,n.namespace))return i.removeMatches({filter:e,originalHandler:r,params:n})}function J(t,e,r,n=null,i={}){Be(r,null,null,{...i,tags:[gt,e,t]});var s;if(d(n)&&(s=E.getFirebase(t,!1,i.namespace))){var o=re({name:e,type:"del",oldValue:r,related:[e]},n);s.fire(o,i.cancellable)}}function ee(t,e,r={}){return j("has",t,{name:e},r)}function Ge(t,e,r,n={}){e=r.receiver||e;var i=r.keysOrPayload,s=r.value;if(!e||!g(e))throw new Error("Target must be of type object!");d(i)&&(n=s||{},s=null),e=A(e);var o=T.getFirebase(e,!1,n.namespace),f=E.getFirebase(e,!1,n.namespace);let a=(h,R,O,w)=>{var L="set",v;t&&(L="defineProperty",v=R||{},R=v.value);var k=!1,$;ee(e,h,n)&&(k=!0,$=D(e,h,r.receiver,n));var b={name:h,type:L,value:R,receiver:r.receiver,related:O,detail:w,isUpdate:k,oldValue:$},F=function(Ie){return arguments.length&&(v?v=Ie:R=Ie),v?x(e,"accessorizedProps",!1).has(h)&&!x(e,"accessorizedProps").get(h).restore()?!1:(Object.defineProperty(e,h,v),!0):x(e,"accessorizedProps",!1).has(h)?x(e,"accessorizedProps").get(h).set(R):(e[h]=R,!0)};if(o){var W=v?{type:"defineProperty",name:h,descriptor:v,receiver:r.receiver,related:O,detail:w,isUpdate:k,oldValue:$}:{type:"set",name:h,value:R,receiver:r.receiver,related:O,detail:w,isUpdate:k,oldValue:$};b.success=o.fire(W,F)}else b.success=F();return b.success&&b.value!==b.oldValue&&(g(b.oldValue)&&J(e,h,b.oldValue,null,n),g(b.value)&&(Y(e,h,b.value,null,n),f&&(f.subBuild||f.build&&me(b.value))&&Z(b.value,f.subBuild,f.build,n.namespace))),b};var u,c=[];m(i)||(I(i)||q(i))&&(u=y(i))?c=u.map(h=>a(h,s,u,n.detail)):d(i)&&(u=Object.keys(i))&&(c=u.map(h=>a(h,i[h],u,n.detail)));var l=c.filter(h=>h.success!==!1),p;return f?(p=f.fire(l,n.cancellable),p.successCount=l.length):n.eventTypeReturn&&(p=new M(e)),n.eventTypeReturn?p:l.length>0}function Ve(t,e,r=null,n={}){return Ge(!0,t,{keysOrPayload:e,value:r},n)}function Qe(t,e,r={}){if(!t||!g(t))throw new Error("Target must be of type object!");t=A(t);var n=y(e),i=n.map(a=>{var u;ee(t,a,r)&&(u=D(t,a,null,r));var c={name:a,type:"deleteProperty",related:n,detail:r.detail,oldValue:u},l,p=function(h){return arguments.length?h:x(t,"accessorizedProps",!1).has(a)&&!x(t,"accessorizedProps").get(a).restore()?!1:(delete t[a],!0)};return(l=T.getFirebase(t,!1,r.namespace))?c.success=l.fire({type:"deleteProperty",name:a,oldValue:u,related:n},p):c.success=p(),c.success&&g(c.oldValue)&&J(t,a,c.oldValue,null,r),c}),s=i.filter(a=>a.success!==!1),o,f;return(o=E.getFirebase(t,!1,r.namespace))?(f=o.fire(s,r.cancellable),f.successCount=s.length):r.eventTypeReturn&&(f=new M(t)),r.eventTypeReturn?f:s.length>0}function Ke(t,e,r={}){return j("getOwnPropertyDescriptor",t,{name:e},r)}function Xe(t,e={}){return j("getPrototypeOf",t,{},e)}function Ze(t,e={}){return j("isExtensible",t,{},e)}function Ye(t,e={}){return j("ownKeys",t,{},e)}function Je(t,e={}){return j("preventExtensions",t,{},e)}function de(t,e,r=null,n=null,i={}){return Ge(!1,t,arguments.length>3?{keysOrPayload:e,value:r,receiver:n}:{keysOrPayload:e,value:r},i)}function et(t,e,r={}){return j("setPrototypeOf",t,{prototype:e},r)}function Qt(t,e=[],r={}){r=d(e)?e:r;var n=(arguments.length===1?Object.keys(t):y(e)).map(i=>{if(x(t,"accessorizedProps").has(i)&&x(t,"accessorizedProps").get(i).touch(!0))return!1;let s=()=>{for(var p,h=t;!p&&(h=Object.getPrototypeOf(h));)p=Object.getOwnPropertyDescriptor(h,i);return p};var o=Object.getOwnPropertyDescriptor(t,i),f,a;o||(f={writable:!0,enumerable:!(i in t),configurable:r.configurable!==!1});var u={...o||f};"value"in u&&delete u.value,"writable"in u&&delete u.writable,u.get=()=>{if(l.ongoingGets.length)return l.get();l.ongoingGets.push(1);var p=D(t,i,null,r);return l.ongoingGets.pop(),p};var c;u.set=p=>{if(l.ongoingSets.length)return l.set(p);l.ongoingSets.push(1);var h=de(t,i,p,null,r);return l.ongoingSets.pop(),h};var l={ongoingGets:[],ongoingSets:[],get:function(){var p=o;return p||(a?p=f:p=s()||f),p.get?p.get.call(t):p.value},set:function(p){var h=o;return h||(a?h=f:(h=s())?"value"in h&&(h=f,a=!0):(h=f,a=!0)),h.set||h.get?h.set?h.set.call(t,p):!1:(h.value=p,!0)},restore:function(){try{return this.intact()&&(o||a?Object.defineProperty(t,i,o||f):delete t[i],x(t,"accessorizedProps").delete(i)),!0}catch{}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(t,i)||{}).get===u.get},touch:function(p=!1){return this.intact()||(p?!this.restore():!1)}};try{return Object.defineProperty(t,i,u),x(t,"accessorizedProps").set(i,l),!0}catch{}return!1});return m(e)?n:n[0]}function Kt(t,e=[],r={}){r=d(e)?e:r;var n=(arguments.length===1?Object.keys(t):y(e)).map(i=>x(t,"accessorizedProps",!1).has(i)?x(t,"accessorizedProps").get(i).restore():!0);return m(e)?n:n[0]}function Xt(t,e={}){if(!g(t))throw new Error('Object must be of type target; "'+S(t)+'" given!');var r=new Proxy(t,{apply:(n,i,s)=>We(n,i,s,e),construct:(n,i,s=null)=>qe(n,i,s,e),defineProperty:(n,i,s)=>Ve(n,i,s,e),deleteProperty:(n,i)=>Qe(n,i,e),get:(n,i,s=null)=>{var o=D(n,i,s,e);return e.proxyAutoBinding!==!1&&_(o)&&!it(o)?o.bind(r):o},getOwnPropertyDescriptor:(n,i)=>Ke(n,i,e),getPrototypeOf:n=>Xe(n,e),has:(n,i)=>ee(n,i,e),isExtensible:n=>Ze(n,e),ownKeys:n=>Ye(n,e),preventExtensions:n=>Je(n,e),set:(n,i,s,o=null)=>de(n,i,s,o,e),setPrototypeOf:(n,i)=>et(n,i,e)});return x(r).set(r,t),r}function Zt(t,e,r={}){if(t=A(t),!g(t))throw new Error('Object must be of type target; "'+S(handler)+'" given!');var n={},i=!0;d(e)||(_(e)?e={"":e}:_(r)&&(e={[e]:r},r=arguments.length>3?arguments[3]:{}),i=!1);var s=T.getFirebase(t,!0,r.namespace);return Object.keys(e).forEach(o=>{if(!_(e[o]))throw new Error("Callback"+(o===null?"":" for "+o)+' must be a function; "'+S(e[o])+'" given!');var f={filter:o,handler:e[o],params:r},a;if(f.params.unique&&(a=s.match(f)).length){if(f.params.unique!=="replace")return a[0];s.remove(a[0])}i?n[o]=s.add(f):n=s.add(f)}),n}function Yt(t,e=null,r={}){if(t=A(t),!t||!g(t))throw new Error('Object must be of type target; "'+S(t)+'" given!');var n=T.getFirebase(t,!1,r.namespace);_isObject(e)||(_(e)?e={[null]:e}:_(r)&&(e={[e]:r},r=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(n=T.getFirebase(t,!1,r.namespace))&&Object.keys(e).forEach(i=>{if(!_(e[i]))throw new Error("Callback"+(i===null?"":" for "+i)+' must be a function; "'+S(e[i])+'" given!');var s={filter:i,originalHandler:e[i],params:r};return n.removeMatches(s)})}function Jt(t,...e){var r=e.map(s=>{if(s=A(s),!g(s))throw new Error("Target must be of type object!");return{target:s,subjectCopy:m(s)?s.slice(0):Me(s)}}),n=t(...e);let i=()=>{r.map(s=>{var o=Object.keys(s.subjectCopy),f=Object.keys(s.target),a=[],u=ct(o.concat(f)).map(l=>{if(s.subjectCopy[l]!==s.target[l]){a.push(l);var p={name:l,related:a,buffered:!0};return f.includes(l)?(p.type="set",p.value=s.target[l],o.includes(l)&&(p.isUpdate=!0)):p.type="del",o.includes(l)&&(p.oldValue=s.subjectCopy[l]),g(s.subjectCopy[l])&&J(s.target,l,s.subjectCopy[l]),g(s.target[l])&&Y(s.target,l,s.target[l]),p}}).filter(l=>l),c;if(u.length&&(c=E.getFirebase(s.target,!1)))return c.fire(u)})};return n instanceof Promise?n.then(i):i(),n}var C={apply:We,construct:qe,defineProperty:Ve,deleteProperty:Qe,get:D,getOwnPropertyDescriptor:Ke,getPrototypeOf:Xe,has:ee,isExtensible:Ze,ownKeys:Ye,preventExtensions:Je,set:de,setPrototypeOf:et,accessorize:Qt,unaccessorize:Kt,proxy:Xt,unproxy:A,observe:ze,unobserve:Be,intercept:Zt,unintercept:Yt,closure:Jt,build:Z,link:Y,unlink:J,Observers:E,Interceptors:T};var{URL:er,fetch:tr,Headers:_t,Request:rr,Response:nr,FormData:ir,ReadableStream:on,File:_d,Blob:yt}=globalThis;var fn=t=>{let e=class extends t{constructor(...r){super(...r);var n=ie(this.search);let i=s=>{var o=pe(s);o=o?"?"+o:"",o!==this.search&&(this.search=o)};this.__query={value:n,proxy:new Proxy(n,{set(s,o,f){return s[o]=f,i(s),!0},deleteProperty(s,o){return delete s[o],i(s),!0}})}}set search(r){super.search=r;var n=ie(r);xt(n,this.query)||(this.query=n)}get search(){return super.search}get query(){return this.__query.proxy}};return e.Observable=class extends e{constructor(){super(...arguments);let{Observer:r}=WebQit;r.accessorize(this,["protocol","username","password","host","hostname","port","origin","pathname","search","query","hash","href"])}},e},xt=(t,e)=>d(t)&&d(e)?xt(Object.keys(t),Object.keys(e))&&xt(Object.values(t),Object.values(e)):m(t)&&m(e)?t.length===e.length&&t.reduce((r,n,i)=>r&&n===e[i],!0):t===e,sr=fn;var un=t=>class extends t{tee(e=null){let r=new this.constructor,n=new this.constructor;for(var[i,s]of this.entries()){let o=o(s);e&&e(s,i,o)||!e&&!o?r.append(i,s):n.append(i,s)}return[r,n]}json(e={},r=null){if(arguments.length){Object.keys(e).forEach(o=>{Ue(o,e[o],(f,a)=>{(!r||r(f,a,g(a)))&&this.append(f,a)},f=>!wt(f))});return}var n;for(var[i,s]of this.entries())n||(n=P(fe(i,"["))?[]:{}),De(n,i,s);return n}},or=un,wt=(t,e=null)=>{if(!g(t))return;let r=t[Symbol.toStringTag];return(e||["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream"]).reduce((n,i)=>n||(r===i?i:null),null)};var cn=t=>class extends t{constructor(e={}){e instanceof t?super(e):(super(),this.json(e))}json(e={},r=!0){if(arguments.length){let o=ar(this),f=Object.keys(o).reduce((a,u)=>a.concat(typeof u!="symbol"&&"set"in o[u]?u:[]),[]);Object.keys(e).forEach(a=>{var u=f.reduce((c,l)=>c||(l===a||l.toLocaleLowerCase()===a?l:null),null);u?(r||this[u]===void 0)&&(this[u]=e[a]):(r||!this.has(a))&&this.set(a,e[a])});return}let n={};for(var[i,s]of this)n[i]=s;return n}set cacheControl(e){return this.set("Cache-Control",e)}get cacheControl(){return this.get("Cache-Control")}set contentLength(e){return this.set("Content-Length",e)}get contentLength(){return this.get("Content-Length")}set contentType(e){return this.set("Content-Type",e)}get contentType(){return this.get("Content-Type")}},tt=cn;function ar(t){if(t){let e=Object.getPrototypeOf(t);return e===Object.prototype?{}:{...ar(e),...Object.getOwnPropertyDescriptors(t)}}else return Object.create(null)}var ln=t=>class extends tt(t){set accept(e){return this.set("Accept",e)}get accept(){let e=this.get("Accept"),r=e&&e.split(",").map(n=>(n=n.trim().split(";").map(i=>i.trim()),[n.shift(),parseFloat((n.pop()||"1").replace("q=",""))])).sort((n,i)=>n[1]>i[1]?-1:1)||[];return{match(n){return n=(n+"").split("/"),r.reduce((i,s)=>i||(s=s[0].split("/"))&&[0,1].every(o=>n[o]===s[o]||n[o]==="*"||s[o]==="*"),!1)},toString(){return e}}}set cookies(e){if(!d(e))throw new Error(`Cookies must be of type object. Received type: ${S(e)}.`);return this.set("Cookie",pe(e,";")),this._cookies=null,!0}get cookies(){return this._cookies||(this._cookies=ie(this.get("cookie"),{},";")),this._cookies}set range(e){let r=[];return y(e).forEach((n,i)=>{let s=Array.isArray(n)?n.join("-"):n+"";i===0&&!s.includes("bytes=")&&(s=`bytes=${s}`),r.push(s)}),this.set("Range",r.join(", "))}get range(){let e=this.get("Range");return e?z(e,"bytes=").split(",").map(n=>{let i=n.trim().split("-");return i[0]=i[0]?parseInt(i[0],10):void 0,i[1]&&(i[1]=parseInt(i[1],10)),i.clamp=s=>{(i[1]>s-1||i[1]===void 0)&&(i[1]=s-1),i[0]===void 0&&(i[0]=i[1]?s-i[1]-1:0)},i}):void 0}set cors(e){return this.set("Access-Control-Allow-Origin",e===!0?"*":e===!1?"":e)}get cors(){return this.get("Access-Control-Allow-Origin")}},fr=ln;var pn=t=>class extends tt(t){set cookies(e){if(!d(e))throw new Error(`The "cookies" response directive cannot be of type: ${S(e)}`);for(let r in e){let n=e[r];if(d(n)){let i=[n.value];for(let s in n){if(s==="value")continue;let o=s[0].toUpperCase()+s.substring(1);o==="MaxAge"&&(o="Max-Age"),i.push(n[s]===!0?o:`${o}=${n[s]}`)}n=i.join("; ")}this.append("Set-Cookie",`${r}=${n}`)}return!0}get cookies(){let e=this.get("Set-Cookie");return e&&e.split(",").reduce((r,n)=>{let[i,s]=n.split(";"),[o,f]=i.trim().split("=");return r[o]={value:f},s&&(s||"").split(/\;/g).map(a=>a.trim().split("=")).forEach(a=>{r[o][a[0][0].toLowerCase()+a[0].substring(1).replace("-","")]=a.length===1?!0:a[1]}),r},{})}set contentRange(e){if(Array.isArray(e)){if(e.length===2&&!e[0].includes("-")||e.length<2)throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");return this.set("Content-Range",`bytes ${e.join("/")}`)}return this.set("Content-Range",e)}get contentRange(){let e=this.get("Content-Range");return e&&z(e,"bytes ").split("/")}set cors(e){return this.set("Access-Control-Allow-Origin",e===!0?"*":e===!1?"":e)}get cors(){return this.get("Access-Control-Allow-Origin")}set attachment(e){if(e=e===!0?"attachment":e===!1?"inline":e,!I(e))throw new Error(`The "download" response directive does not support the type: ${S(e)}`);return["attachment","inline"].includes(e)||(e=`attachment; filename="${e}"`),this.set("Content-Disposition",e)}get attachment(){var e=(this.get("Content-Disposition")||"").trim();return e=e==="attachment"?!0:e==="inline"?!1:z(ne(e,'"'),'filename="'),e}get location(){return this.get("Location")}set location(e){return this.set("Location",e)}get redirect(){return this.get("Location")}set redirect(e){return this.set("Location",e)}},ur=pn;var hn=(t,e,r)=>{let n=class extends t{constructor(i,s,o){"headers"in s&&!(s.headers instanceof e)&&(s={...s},s.headers=new e(s.headers),arguments[1]=s),B(s)?super(i):super(i,s),this._headers=s.headers,o.headers&&this.headers.json(o.headers);let f={};Object.defineProperty(this,"attrs",{get:()=>f}),Object.defineProperty(this,"bodyAttrs",{get:()=>o})}clone(){return new this.constructor(super.clone())}get headers(){return this._headers||(this._headers=new e(super.headers)),this._headers}get attrs(){return this.attrs}get url(){return"url"in this.attrs?this.attrs.url:super.url}async arrayBuffer(){return this.bodyAttrs.arrayBuffer?this.bodyAttrs.arrayBuffer:super.arrayBuffer()}async blob(){return this.bodyAttrs.blob?this.bodyAttrs.blob:super.blob()}async formData(){if(this.bodyAttrs.formData)return this.bodyAttrs.formData;let i=await super.formData();return i.tee=r.prototype.tee.bind(i),i.json=r.prototype.json.bind(i),i}async json(){return this.bodyAttrs.json?this.bodyAttrs.json:super.json()}async text(){return this.bodyAttrs.text?this.bodyAttrs.text:super.text()}jsonfy(i=!1){return(!this.bodyAttrs.jsonfied||i)&&(this.bodyAttrs.jsonfied=new Promise(async(s,o)=>{var f=this,a,u=f.headers.get("content-type")||"",c=u==="application/json"||this.bodyAttrs.json?"json":u==="application/x-www-form-urlencoded"||u.startsWith("multipart/form-data")||this.bodyAttrs.formData?"formData":u==="text/plain"?"plain":"other";try{c==="formData"?a=(await f.formData()).json():a=c==="json"?await f.json():c==="plain"?await f.text():f.body,s(a)}catch(l){o(l)}})),this.bodyAttrs.jsonfied}};return n.Headers=e,n},rt=hn;function nt(t,e,r){let n={body:t,input:t},i=(f,a)=>{if(!e.encode)return;let[u,c]=e.encode(a);f.body=u,f.headers=c};if(I(t)||q(t))return n.inputType="text",n.text=t,n.headers={contentLength:(t+"").length},n;if(n.inputType=wt(t),["Blob","File"].includes(n.inputType))n.blob=t,n.headers={contentType:t.type,contentLength:t.size};else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(n.inputType))n.arrayBuffer=t,n.headers={contentLength:t.byteLength};else if(n.inputType==="FormData")n.formData=t,i(n,t);else if(d(t)&&$e(t)||m(t)&&st(t)){n.inputType="object";var s,o=new e;o.json(t,(f,a,u)=>(s=s||u,!0)),s?(n.formData=o,i(n,o)):(n.json=t,n.body=JSON.stringify(t),n.headers={contentType:"application/json",contentLength:new r([n.body]).size}),n.jsonfied=t}return n}var mn=(t,e,r,n)=>class extends rt(t,e,r){constructor(i,s={}){s={...s};let o={};i instanceof t&&(s.method&&i.method!==s.method.toUpperCase()&&["GET","HEAD"].includes(s.method.toUpperCase())?(i=i.url,["headers","mode","credentials","cache","redirect","referrer","integrity"].forEach(a=>{a in s||(s[a]=i[a])})):o=i.bodyAttrs||{}),"body"in s&&(o=nt(s.body,r,n),s.body=o.body);let f;s.mode==="navigate"&&(f=!0,s={...s},delete s.mode),super(i,s,o),f&&(this.attrs.mode="navigate")}get mode(){return"mode"in this.attrs?this.attrs.mode:super.mode}get cache(){return"cache"in this.attrs?this.attrs.cache:super.cache}get destination(){return"destination"in this.attrs?this.attrs.destination:super.destination}get referrer(){return"referrer"in this.attrs?this.attrs.referrer:super.referrer}static compat(i,s=null){return i instanceof t?Object.setPrototypeOf(i,new this):new this(s,i)}},cr=mn;var dn=(t,e,r,n)=>class extends rt(t,e,r){constructor(i=null,s={}){let o={},f;arguments.length&&(i instanceof t?(f=i,s={status:i.status,statusText:i.statusText,headers:i.headers,...s},i.status===0&&delete s.status,o=i.bodyAttrs||{},i=i.body):(o=nt(i,r,n),i=o.body)),super(i,s,o),f&&(this.attrs.url=f.url,this.attrs.ok=f.ok,this.attrs.status=f.status,this.attrs.type=f.type,this.attrs.redirected=f.redirected)}get ok(){return"ok"in this.attrs?this.attrs.ok:super.ok}get status(){return"status"in this.attrs?this.attrs.status:super.status}get statusText(){return"statusText"in this.attrs?this.attrs.statusText:super.statusText}get type(){return"type"in this.attrs?this.attrs.type:super.type}get redirected(){return"redirected"in this.attrs?this.attrs.redirected:super.redirected}static compat(i){return i instanceof t?Object.setPrototypeOf(i,new this):new this(i)}},lr=dn;var gn=t=>t,pr=gn;var _n=(t,e,r)=>{let n=class{constructor(i,s,o){this._request=i,this._detail=s||{},this._sessionFactory=o,this.Request=t,this.Response=e,this.URL=r,this.port={listeners:[],post(f){let a=this.listeners.map(u=>u(f)).filter(u=>u instanceof Promise);if(process.length)return Promise.all(a)},listen(f){this.listeners.push(f)}}}get url(){return this._url||(this._url=new this.URL(this._request.url)),this._url}get request(){return this._request}get detail(){return this._detail}get session(){return this._session||(this._session=this.sessionFactory().get()),this._session}sessionFactory(...i){return this._sessionFactory(...i)}retarget(i,s={}){var o;return i instanceof t?B(s)?o=i:o=new t(i,s):(o=new t(this._request,s),o.attrs.url=`${this.url.origin}${i}`,o.attrs.referrer=this.request.url),new n(o,this.detail)}};return n},hr=_n;var yn=sr(er),mr=or(ir);var xn=fr(_t),wn=ur(_t),bt=cr(rr,xn,mr,yt),je=lr(nr,wn,mr,yt),Fg=pr(tr),dr=hr(bt,je,yn);var Le=class{constructor(){this.messaging={post:(e,r=this.client)=>{if(!r)throw new Error("No client for this operation.");return r.postMessage(e),this.post},listen:(e,r=this.client)=>r?(r.addEventListener("message",e),this.post):(self.addEventListener("message",n=>{this.client=n.source,e(n)}),this.post),request:(e,r=this.client)=>{if(!r)throw new Error("No client for this operation.");return new Promise(n=>{let i=new MessageChannel;r.postMessage(e,[i.port2]),i.port1.onmessage=s=>n(s.data)})},channel(e){this.channels.has(e)||this.channels.set(e,new BroadcastChannel(r));let r=this.channels.get(e);return{broadcast:n=>r.postMessage(n),listen:n=>r.addEventListener("message",n)}},channels:new Map},this.notifications={fire:(e,r={})=>new Promise((n,i)=>{if(!(self.Notification&&self.Notification.permission==="granted"))return i(self.Notification&&self.Notification.permission);s.addEventListener("error",i);let s=new self.Notification(e,r);s.addEventListener("click",n),s.addEventListener("close",n)}),listen:e=>(self.addEventListener("notificationclick",e),this.notifications)},this.push={listen:e=>(self.addEventListener("push",e),this.post)}}setCurrentClient(e){this.client=e}};var Fe=class{constructor(e,r){this.cx=e,this.clients=new Map,this.mockSessionStore={},this.cx.runtime=this;let n=r(this.cx,"*");if(!n||!n.handle)throw new Error('Application instance must define a ".handle()" method.');this.clients.set("*",n),self.addEventListener("install",s=>{this.cx.params.skip_waiting&&self.skipWaiting(),this.cx.params.cache_name&&(this.cx.params.cache_only_urls||[]).length&&s.waitUntil(self.caches.open(this.cx.params.cache_name).then(o=>{this.cx.logger&&this.cx.logger.log("[ServiceWorker] Pre-caching resources.");let f=(this.cx.params.cache_only_urls||[]).map(a=>a.trim()).filter(a=>a&&!pt(a,self.origin).isPattern());return o.addAll(f)}))}),self.addEventListener("activate",s=>{s.waitUntil(new Promise(async o=>{this.cx.params.skip_waiting&&await self.clients.claim(),this.cx.params.cache_name&&await self.caches.keys().then(f=>Promise.all(f.map(a=>{if(a!==this.cx.params.cache_name&&a!==this.cx.params.cache_name+"_json")return this.cx.logger&&this.cx.logger.log("[ServiceWorker] Removing old cache:",a),self.caches.delete(a)}))),o()}))}),self.addEventListener("fetch",s=>{!s.request.url.startsWith("http")||s.respondWith((async(o,f)=>{let a=await self.clients.get(s.clientId);this.workport.setCurrentClient(a);let u=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((c,l)=>({[l]:o[l],...c}),{});return["GET","HEAD"].includes(o.method)||(u.body=await o.text()),o.cache==="force-cache"&&(u.cache="default"),this.go(o.url,u,{event:f})})(s.request,s))});let i=new Le;C.set(this,"workport",i),i.messaging.listen(async s=>{let o=s.ports[0],f=this.clients.get("*"),a=f.alert&&await f.alert(s);o&&(a instanceof Promise?a.then(u=>{o.postMessage(u)}):o.postMessage(a))}),i.notifications.listen(async s=>{let o=this.clients.get("*");o.alert&&await o.alert(s)}),i.push.listen(async s=>{let o=this.clients.get("*");o.alert&&await o.alert(s)}),C.set(this,"location",{}),C.set(this,"network",{}),C.observe(this.network,s=>{})}async go(e,r={},n={}){e=typeof e=="string"?new URL(e):e,r={referrer:this.location.href,...r};let i=await this.generateRequest(e.href,r);n.event&&Object.defineProperty(n.event,"request",{value:i});let s=new dr(i,n,(a=null,u=!1)=>this.getSession(s,a,u));s.port.listen(a=>{if(a.$type==="handler:hints"&&a.session)return Promise.resolve()});let o;return s.request.url.startsWith(self.origin)?o=await this.clients.get("*").handle(s,(...a)=>this.remoteFetch(...a)):o=await this.remoteFetch(s.request),this.handleResponse(s,o)}generateRequest(e,r){return new bt(e,r)}getSession(e,r=null,n=!1){return{get:()=>this.mockSessionStore,set:i=>{this.mockSessionStore=i}}}remoteFetch(e,...r){arguments.length>1&&(e=this.generateRequest(e,...r));let n=(o,f)=>be((o||[]).map(a=>a.trim()).filter(a=>a),a=>pt(a,self.origin).test(f)),s=(()=>{if(!this.cx.params.default_fetching_strategy||this.cx.params.default_fetching_strategy==="network-first"||n(this.cx.params.network_first_urls,e.url))return C.set(this.network,"strategy","network-first"),this.networkFetch(e,{cacheFallback:!0,cacheRefresh:!0});if(this.cx.params.default_fetching_strategy==="cache-first"||n(this.cx.params.cache_first_urls,e.url))return C.set(this.network,"strategy","cache-first"),this.cacheFetch(e,{networkFallback:!0,cacheRefresh:!0});if(this.cx.params.default_fetching_strategy==="network-only"||n(this.cx.params.network_only_urls,e.url))return C.set(this.network,"strategy","network-only"),this.networkFetch(e,{cacheFallback:!1,cacheRefresh:!1});if(this.cx.params.default_fetching_strategy==="cache-only"||n(this.cx.params.cache_only_urls,e.url))return C.set(this.network,"strategy","cache-only"),this.cacheFetch(e,{networkFallback:!1,cacheRefresh:!1})})(e);return s.catch(o=>C.set(this.network,"error",o.message)),s.then(o=>je.compat(o))}networkFetch(e,r={}){return r.cacheFallback?self.fetch(e).then(n=>(r.cacheRefresh&&this.refreshCache(e,n),C.set(this.network,"remote",!0),n)).catch(()=>this.getRequestCache(e).then(n=>(C.set(this.network,"cache",!0),n.match(e)))):(C.set(this.network,"remote",!0),self.fetch(e))}cacheFetch(e,r={}){return this.getRequestCache(e).then(n=>n.match(e).then(i=>!i&&r.networkFallback?this.networkFetch(e,{...r,cacheFallback:!1}):(i&&r.cacheRefresh&&this.networkFetch(e,{...r,justRefreshing:!0}),C.set(this.network,"cache",!0),i)))}refreshCache(e,r){if(e.method!=="GET"||!r||r.status!==200||r.type!=="basic"&&r.type!=="cors")return r;var n=r.clone();return this.getRequestCache(e).then(i=>{C.set(this.network,"cacheRefresh",!0),i.put(e,n)}),r}getRequestCache(e){let r=e.headers.get("Accept")==="application/json"?this.cx.params.cache_name+"_json":this.cx.params.cache_name;return self.caches.open(r)}handleResponse(e,r){return r instanceof je||(r=je.compat(r)),r}};async function gr(t=null){let e=this||{},r=n=>new Ae(n);return new Fe(ye.create(e),(...n)=>t?t(...n.concat(r)):r(...n))}var bn={},vn={cache_name:"cache_v0",default_fetching_strategy:"network-first",network_first_urls:[],cache_first_urls:[],network_only_urls:[],cache_only_urls:["/page-3/.webqit/oohtml-cli/bundler.json"],skip_waiting:!1,support_push:!1,push_registration_url:"",push_deregistration_url:"",push_public_key:"",routing:{root:"/",subroots:[],targets:3}};gr.call({layout:bn,params:vn});
|
|
3
3
|
})();
|
|
Binary file
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
export default function(e, c, n) {
|
|
2
|
-
if (n.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
if (n.pathname === 'page-1') {
|
|
3
|
+
return new Promise(res => {
|
|
4
|
+
setTimeout(() => {
|
|
5
|
+
res({});
|
|
6
|
+
}, 4000);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
if (!n.pathname || ['page-3', 'page-4'].includes(n.pathname)) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
if (n.pathname === 'page-5') {
|
|
13
|
+
return new e.Response(null, { status: 302, headers: { Location: '/page-4/subpage', } });
|
|
14
|
+
}
|
|
15
|
+
if (n.stepname) return n();
|
|
8
16
|
}
|
package/docker/Dockerfile
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Base installations
|
|
2
|
-
FROM node:12-alpine
|
|
3
|
-
RUN apk add git
|
|
4
|
-
|
|
5
|
-
# We'll install npm packages at one-level higher than
|
|
6
|
-
# actuall app root, so that we can bind-mount host system's app root
|
|
7
|
-
# without overriding the container's node_modules directory
|
|
8
|
-
WORKDIR /home/www
|
|
9
|
-
RUN npm install
|
|
10
|
-
RUN npm install @webqit/webflo -g
|
|
11
|
-
RUN npm install @webqit/playui-cli -g
|
|
12
|
-
|
|
13
|
-
# Move one-level in, for the reasons above
|
|
14
|
-
WORKDIR /home/www/app
|
|
15
|
-
ENV NODE_OPTIONS=--openssl-legacy-provider
|
|
16
|
-
|
|
17
|
-
# To auto-start app (flags optional), we would add...
|
|
18
|
-
# CMD ["webflo", "start", "--env=dev", "--watch", "--http-only"]
|
|
19
|
-
|
|
20
|
-
# To build the image locally...
|
|
21
|
-
# docker build --no-cache -t webflo ./docker
|
|
22
|
-
|
|
23
|
-
# To publish to docker hub...
|
|
24
|
-
# docker login -u webqit
|
|
25
|
-
# docker tag webflo webqit/webflo
|
|
26
|
-
# docker push webqit/webflo
|
package/docker/README.md
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Webflo Container
|
|
2
|
-
|
|
3
|
-
This is simply a node.js container with the `@webqit/webflo` framework installed. Once started, any webflo app can be deployed into the container from any git repository.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
This container image lives on Docker Hub and can be pulled to a local machine or a remote Virtual Machine (VM) on any cloud platform.
|
|
8
|
-
|
|
9
|
-
+ [To Use Locally](#to-use-locally)
|
|
10
|
-
+ [To Use In the Cloud](#to-use-in-the-cloud)
|
|
11
|
-
* [To Deploy An App From Any Repo](#to-deploy-an-app-from-any-repo)
|
|
12
|
-
|
|
13
|
-
### To Use Locally
|
|
14
|
-
|
|
15
|
-
Ensure you have docker installed on your computer and run the following command from any location on your terminal:
|
|
16
|
-
|
|
17
|
-
```shell
|
|
18
|
-
docker pull webqit/webflo:latest
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The above command pulls the `webqit/webflo` image to your local machine. (But this can be automatically done by docker on running any docker commands that reference the `webqit/webflo` image.)
|
|
22
|
-
|
|
23
|
-
Next is to use the following commands to start the container and the Webflo runtime. In each case, the first part of the command starts the container, while the second part (from `webflo start`) starts the application.
|
|
24
|
-
|
|
25
|
-
#### To Start
|
|
26
|
-
|
|
27
|
-
Start the container using `docker run`; map a port (e.g `80`) of your host machine to `3000` of the container (unless changed webflo expects to run on port `3000`); optionally, give your container a name; reference `webqit/webflo` as the image to use; and lastly, start webflo using `webflo start`.
|
|
28
|
-
|
|
29
|
-
```shell
|
|
30
|
-
docker run -d -p 80:3000 --name my-app webqit/webflo webflo start
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Visit [localhost](http://localhost) to view your app.
|
|
34
|
-
|
|
35
|
-
#### To Start In Dev Mode
|
|
36
|
-
|
|
37
|
-
Webflo's *dev* mode is the perfect mode for developing locally. All you do is append the `--env=dev --watch` flags to your webflo commands. [(Learn more)](#)
|
|
38
|
-
|
|
39
|
-
```shell
|
|
40
|
-
docker run -d -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
In *dev* mode, webflo automatically restarts as you make changes to your codebase. Since webflo now lives inside a container, you'll need to *bind* the directory of your source code on your host machine to the `/home/www/app` directory of the container.
|
|
44
|
-
|
|
45
|
-
```shell
|
|
46
|
-
docker run -d -v /Users/me/my-app:/home/www/app -p 80:3000 --name my-app webqit/webflo webflo start --env=dev --watch
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### To Use In the Cloud
|
|
50
|
-
|
|
51
|
-
TODO
|
|
52
|
-
|
|
53
|
-
### To Deploy An App From Any Repo
|
|
54
|
-
|
|
55
|
-
Whether running locally or in the cloud, webflo can easily take your application from any git repo. This follows webflo's normal `deploy` command.
|
|
56
|
-
|
|
57
|
-
Simply point docker at your container (using `docker exec [container-name]`) and execute the `webflo deploy` command.
|
|
58
|
-
|
|
59
|
-
```shell
|
|
60
|
-
docker exec my-app webflo deploy https://github.com/me/my-app
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
If you will need to install any npm dependencies, you would run `npm install` on the appropriate directory in your container.
|
|
64
|
-
|
|
65
|
-
```shell
|
|
66
|
-
docker exec my-app npm install
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
If you will need to run additional webflo commands (e.g `webflo restart` to restart the application), you would follow the same pattern above.
|
|
70
|
-
|
|
71
|
-
```shell
|
|
72
|
-
docker exec my-app webflo restart
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Extending this Build
|
|
76
|
-
|
|
77
|
-
TODO
|