@webqit/fetch-plus 0.1.21 → 0.1.22
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/dist/main.js +1 -1
- package/dist/main.js.map +3 -3
- package/package.json +3 -3
- package/src/HeadersPlus.js +3 -0
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var Pr=Object.defineProperty;var Rt=(t,e)=>()=>(t&&(e=t(t=0)),e);var $e=(t,e)=>{for(var r in e)Pr(t,r,{get:e[r],enumerable:!0})};function Lt(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function tt(t,e=!1){let r=[],n=0;for(;n<t.length;){let s=t[n],i=g(function(a){if(!e)throw new TypeError(a);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if(s==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(s==="+"||s==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(s==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(s==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(s===":"){let a="",o=n+1;for(;o<t.length;){let u=t.substr(o,1);if(o===n+1&&Rr.test(u)||o!==n+1&&jr.test(u)){a+=t[o++];continue}break}if(!a){i(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:a}),n=o;continue}if(s==="("){let a=1,o="",u=n+1,f=!1;if(t[u]==="?"){i(`Pattern cannot start with "?" at ${u}`);continue}for(;u<t.length;){if(!Lt(t[u],!1)){i(`Invalid character '${t[u]}' at ${u}.`),f=!0;break}if(t[u]==="\\"){o+=t[u++]+t[u++];continue}if(t[u]===")"){if(a--,a===0){u++;break}}else if(t[u]==="("&&(a++,t[u+1]!=="?")){i(`Capturing groups are not allowed at ${u}`),f=!0;break}o+=t[u++]}if(f)continue;if(a){i(`Unbalanced pattern at ${n}`);continue}if(!o){i(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=u;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function rt(t,e={}){let r=tt(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${$(e.delimiter)}]+?`,s=[],i=0,a=0,o="",u=new Set,f=g(m=>{if(a<r.length&&r[a].type===m)return r[a++].value},"tryConsume"),c=g(()=>f("OTHER_MODIFIER")??f("ASTERISK"),"tryConsumeModifier"),l=g(m=>{let P=f(m);if(P!==void 0)return P;let{type:E,index:q}=r[a];throw new TypeError(`Unexpected ${E} at ${q}, expected ${m}`)},"mustConsume"),p=g(()=>{let m="",P;for(;P=f("CHAR")??f("ESCAPED_CHAR");)m+=P;return m},"consumeText"),h=g(m=>m,"DefaultEncodePart"),d=e.encodePart||h,y="",b=g(m=>{y+=m},"appendToPendingFixedValue"),_=g(()=>{y.length&&(s.push(new we(3,"","",d(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),w=g((m,P,E,q,U)=>{let L=3;switch(U){case"?":L=1;break;case"*":L=0;break;case"+":L=2;break}if(!P&&!E&&L===3){b(m);return}if(_(),!P&&!E){if(!m)return;s.push(new we(3,"","",d(m),"",L));return}let R;E?E==="*"?R=Ze:R=E:R=n;let _e=2;R===n?(_e=1,R=""):R===Ze&&(_e=0,R="");let Z;if(P?Z=P:E&&(Z=i++),u.has(Z))throw new TypeError(`Duplicate name '${Z}'.`);u.add(Z),s.push(new we(_e,Z,d(m),R,d(q),L))},"addPart");for(;a<r.length;){let m=f("CHAR"),P=f("NAME"),E=f("REGEX");if(!P&&!E&&(E=f("ASTERISK")),P||E){let U=m??"";e.prefixes.indexOf(U)===-1&&(b(U),U=""),_();let L=c();w(U,P,E,"",L);continue}let q=m??f("ESCAPED_CHAR");if(q){b(q);continue}if(f("OPEN")){let U=p(),L=f("NAME"),R=f("REGEX");!L&&!R&&(R=f("ASTERISK"));let _e=p();l("CLOSE");let Z=c();w(U,L,R,_e,Z);continue}_(),l("END")}return s}function $(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ye(t){return t&&t.ignoreCase?"ui":"u"}function Dt(t,e,r){return nt(rt(t,r),e,r)}function re(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function nt(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of t){if(o.type===3){o.modifier===3?n+=$(o.value):n+=`(?:${$(o.value)})${re(o.modifier)}`;continue}e&&e.push(o.name);let u=`[^${$(r.delimiter)}]+?`,f=o.value;if(o.type===1?f=u:o.type===0&&(f=Ze),!o.prefix.length&&!o.suffix.length){o.modifier===3||o.modifier===1?n+=`(${f})${re(o.modifier)}`:n+=`((?:${f})${re(o.modifier)})`;continue}if(o.modifier===3||o.modifier===1){n+=`(?:${$(o.prefix)}(${f})${$(o.suffix)})`,n+=re(o.modifier);continue}n+=`(?:${$(o.prefix)}`,n+=`((?:${f})(?:`,n+=$(o.suffix),n+=$(o.prefix),n+=`(?:${f}))*)${$(o.suffix)})`,o.modifier===0&&(n+="?")}let s=`[${$(r.endsWith)}]|$`,i=`[${$(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,Ye(r));r.strict||(n+=`(?:${i}(?=${s}))?`);let a=!1;if(t.length){let o=t[t.length-1];o.type===3&&o.modifier===3&&(a=r.delimiter.indexOf(o)>-1)}return a||(n+=`(?=${i}|${s})`),new RegExp(n,Ye(r))}function kt(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function st(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function qt(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function ot(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function it(t){if(!t)return!0;for(let e of Ut)if(t.test(e))return!0;return!1}function Nt(t,e){if(t=st(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 Ft(t,e){if(t=st(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 Ht(t,e){return e||t===""?t:ot(t)?ut(t):ft(t)}function Bt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Wt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function zt(t,e,r){if(r||t==="")return t;if(e&&!Ut.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 Vt(t,e,r){return at(e)===t&&(t=""),r||t===""?t:ct(t)}function Gt(t,e){return t=qt(t,":"),e||t===""?t:Le(t)}function at(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Le(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Jt(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Kt(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function ft(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 ut(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function ct(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Xt(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 Qt(t){return t===""?t:new URL(`data:${t}`).pathname}function Zt(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Yt(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function et(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 N(t,e){return e?be(t):t}function ye(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=N(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=N(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=N(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=N(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=N(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=N(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=N(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=N(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Gt(e.protocol,r)),typeof e.username=="string"&&(t.username=Wt(e.username,r)),typeof e.password=="string"&&(t.password=Bt(e.password,r)),typeof e.hostname=="string"&&(t.hostname=Ht(e.hostname,r)),typeof e.port=="string"&&(t.port=Vt(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!kt(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=N(n.pathname.substring(0,s+1),r)+t.pathname)}t.pathname=zt(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=Ft(e.search,r)),typeof e.hash=="string"&&(t.hash=Nt(e.hash,r)),t}function be(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function tr(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function rr(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${tr(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,i="";for(let a=0;a<t.length;++a){let o=t[a];if(o.type===3){if(o.modifier===3){i+=be(o.value);continue}i+=`{${be(o.value)}}${re(o.modifier)}`;continue}let u=o.hasCustomName(),f=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!e.prefixes.includes(o.prefix)),c=a>0?t[a-1]:null,l=a<t.length-1?t[a+1]:null;if(!f&&u&&o.type===1&&o.modifier===3&&l&&!l.prefix.length&&!l.suffix.length)if(l.type===3){let p=l.value.length>0?l.value[0]:"";f=s.test(p)}else f=!l.hasCustomName();if(!f&&!o.prefix.length&&c&&c.type===3){let p=c.value[c.value.length-1];f=e.prefixes.includes(p)}f&&(i+="{"),i+=be(o.prefix),u&&(i+=`:${o.name}`),o.type===2?i+=`(${o.value})`:o.type===1?u||(i+=`(${n})`):o.type===0&&(!u&&(!c||c.type===3||c.modifier!==3||f||o.prefix!=="")?i+="*":i+=`(${r})`),o.type===1&&u&&o.suffix.length&&s.test(o.suffix[0])&&(i+="\\"),i+=be(o.suffix),f&&(i+="}"),o.modifier!==3&&(i+=re(o.modifier))}return i}var $r,g,we,Rr,jr,Ze,ee,Ir,Lr,Ut,er,Qe,Y,De,nr=Rt(()=>{$r=Object.defineProperty,g=(t,e)=>$r(t,"name",{value:e,configurable:!0}),we=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,s,i){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=s,this.modifier=i}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};g(we,"Part");Rr=/[$_\p{ID_Start}]/u,jr=/[$_\u200C\u200D\p{ID_Continue}]/u,Ze=".*";g(Lt,"isASCII");g(tt,"lexer");g(rt,"parse");g($,"escapeString");g(Ye,"flags");g(Dt,"stringToRegexp");g(re,"modifierToString");g(nt,"partsToRegexp");ee={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Lr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};g(kt,"isAbsolutePathname");g(st,"maybeStripPrefix");g(qt,"maybeStripSuffix");g(ot,"treatAsIPv6Hostname");Ut=["ftp","file","http","https","ws","wss"];g(it,"isSpecialScheme");g(Nt,"canonicalizeHash");g(Ft,"canonicalizeSearch");g(Ht,"canonicalizeHostname");g(Bt,"canonicalizePassword");g(Wt,"canonicalizeUsername");g(zt,"canonicalizePathname");g(Vt,"canonicalizePort");g(Gt,"canonicalizeProtocol");g(at,"defaultPortForProtocol");g(Le,"protocolEncodeCallback");g(Jt,"usernameEncodeCallback");g(Kt,"passwordEncodeCallback");g(ft,"hostnameEncodeCallback");g(ut,"ipv6HostnameEncodeCallback");g(ct,"portEncodeCallback");g(Xt,"standardURLPathnameEncodeCallback");g(Qt,"pathURLPathnameEncodeCallback");g(Zt,"searchEncodeCallback");g(Yt,"hashEncodeCallback");er=class{#n;#e=[];#r={};#t=0;#s=1;#f=0;#i=0;#u=0;#c=0;#l=!1;constructor(t){this.#n=t}get result(){return this.#r}parse(){for(this.#e=tt(this.#n,!0);this.#t<this.#e.length;this.#t+=this.#s){if(this.#s=1,this.#e[this.#t].type==="END"){if(this.#i===0){this.#p(),this.#g()?this.#o(9,1):this.#y()?this.#o(8,1):this.#o(7,0);continue}else if(this.#i===2){this.#h(5);continue}this.#o(10,0);break}if(this.#u>0)if(this.#O())this.#u-=1;else continue;if(this.#S()){this.#u+=1;continue}switch(this.#i){case 0:this.#_()&&this.#h(1);break;case 1:if(this.#_()){this.#M();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#o(t,e)}break;case 2:this.#w()?this.#h(3):(this.#x()||this.#y()||this.#g())&&this.#h(5);break;case 3:this.#P()?this.#o(4,1):this.#w()&&this.#o(5,1);break;case 4:this.#w()&&this.#o(5,1);break;case 5:this.#A()?this.#c+=1:this.#C()&&(this.#c-=1),this.#E()&&!this.#c?this.#o(6,1):this.#x()?this.#o(7,0):this.#y()?this.#o(8,1):this.#g()&&this.#o(9,1);break;case 6:this.#x()?this.#o(7,0):this.#y()?this.#o(8,1):this.#g()&&this.#o(9,1);break;case 7:this.#y()?this.#o(8,1):this.#g()&&this.#o(9,1);break;case 8:this.#g()&&this.#o(9,1);break;case 9:break;case 10:break}}this.#r.hostname!==void 0&&this.#r.port===void 0&&(this.#r.port="")}#o(t,e){switch(this.#i){case 0:break;case 1:this.#r.protocol=this.#d();break;case 2:break;case 3:this.#r.username=this.#d();break;case 4:this.#r.password=this.#d();break;case 5:this.#r.hostname=this.#d();break;case 6:this.#r.port=this.#d();break;case 7:this.#r.pathname=this.#d();break;case 8:this.#r.search=this.#d();break;case 9:this.#r.hash=this.#d();break;case 10:break}this.#i!==0&&t!==10&&([1,2,3,4].includes(this.#i)&&[6,7,8,9].includes(t)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#i)&&[8,9].includes(t)&&(this.#r.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#i)&&t===9&&(this.#r.search??="")),this.#b(t,e)}#b(t,e){this.#i=t,this.#f=this.#t+e,this.#t+=e,this.#s=0}#p(){this.#t=this.#f,this.#s=0}#h(t){this.#p(),this.#i=t}#m(t){return t<0&&(t=this.#e.length-t),t<this.#e.length?this.#e[t]:this.#e[this.#e.length-1]}#a(t,e){let r=this.#m(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#_(){return this.#a(this.#t,":")}#v(){return this.#a(this.#t+1,"/")&&this.#a(this.#t+2,"/")}#w(){return this.#a(this.#t,"@")}#P(){return this.#a(this.#t,":")}#E(){return this.#a(this.#t,":")}#x(){return this.#a(this.#t,"/")}#y(){if(this.#a(this.#t,"?"))return!0;if(this.#e[this.#t].value!=="?")return!1;let t=this.#m(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#g(){return this.#a(this.#t,"#")}#S(){return this.#e[this.#t].type=="OPEN"}#O(){return this.#e[this.#t].type=="CLOSE"}#A(){return this.#a(this.#t,"[")}#C(){return this.#a(this.#t,"]")}#d(){let t=this.#e[this.#t],e=this.#m(this.#f).index;return this.#n.substring(e,t.index)}#M(){let t={};Object.assign(t,ee),t.encodePart=Le;let e=Dt(this.#d(),void 0,t);this.#l=it(e)}};g(er,"Parser");Qe=["protocol","username","password","hostname","port","pathname","search","hash"],Y="*";g(et,"extractValues");g(N,"processBaseURLString");g(ye,"applyInit");g(be,"escapePatternString");g(tr,"escapeRegexpString");g(rr,"partsToPattern");De=class{#n;#e={};#r={};#t={};#s={};#f=!1;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let o=new er(t);if(o.parse(),t=o.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let s={ignoreCase:r.ignoreCase===!0},i={pathname:Y,protocol:Y,username:Y,password:Y,hostname:Y,port:Y,search:Y,hash:Y};this.#n=ye(i,t,!0),at(this.#n.protocol)===this.#n.port&&(this.#n.port="");let a;for(a of Qe){if(!(a in this.#n))continue;let o={},u=this.#n[a];switch(this.#r[a]=[],a){case"protocol":Object.assign(o,ee),o.encodePart=Le;break;case"username":Object.assign(o,ee),o.encodePart=Jt;break;case"password":Object.assign(o,ee),o.encodePart=Kt;break;case"hostname":Object.assign(o,Ir),ot(u)?o.encodePart=ut:o.encodePart=ft;break;case"port":Object.assign(o,ee),o.encodePart=ct;break;case"pathname":it(this.#e.protocol)?(Object.assign(o,Lr,s),o.encodePart=Xt):(Object.assign(o,ee,s),o.encodePart=Qt);break;case"search":Object.assign(o,ee,s),o.encodePart=Zt;break;case"hash":Object.assign(o,ee,s),o.encodePart=Yt;break}try{this.#s[a]=rt(u,o),this.#e[a]=nt(this.#s[a],this.#r[a],o),this.#t[a]=rr(this.#s[a],o),this.#f=this.#f||this.#s[a].some(f=>f.type===2)}catch{throw new TypeError(`invalid ${a} pattern '${this.#n[a]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return!1}let n;for(n of Qe)if(!this.#e[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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of Qe){let i=this.#e[s].exec(r[s]);if(!i)return null;let a={};for(let[o,u]of this.#r[s].entries())if(typeof u=="string"||typeof u=="number"){let f=i[o+1];a[u]=f}n[s]={input:r[s]??"",groups:a}}return n}static compareComponent(t,e,r){let n=g((o,u)=>{for(let f of["type","modifier","prefix","value","suffix"]){if(o[f]<u[f])return-1;if(o[f]!==u[f])return 1}return 0},"comparePart"),s=new we(3,"","","","",3),i=new we(0,"","","","",3),a=g((o,u)=>{let f=0;for(;f<Math.min(o.length,u.length);++f){let c=n(o[f],u[f]);if(c)return c}return o.length===u.length?0:n(o[f]??s,u[f]??s)},"comparePartList");return!e.#t[t]&&!r.#t[t]?0:e.#t[t]&&!r.#t[t]?a(e.#s[t],[i]):!e.#t[t]&&r.#t[t]?a([i],r.#s[t]):a(e.#s[t],r.#s[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#f}};g(De,"URLPattern")});var sr={};$e(sr,{URLPattern:()=>De});var or=Rt(()=>{nr();globalThis.URLPattern||(globalThis.URLPattern=De)});var $t={};$e($t,{FormDataPlus:()=>B,HeadersPlus:()=>W,LiveResponse:()=>ze,Observer:()=>cr,RequestPlus:()=>He,ResponsePlus:()=>z,fetchPlus:()=>mr});function v(t){return!Array.isArray(t)&&typeof t=="object"&&t}function pe(t){return typeof t}function j(t){return Array.isArray(t)}function Re(t){return t===!0||t===!1}function de(t){return typeof t=="function"}function Ve(t){return t===null||t===""}function te(t){return arguments.length&&(t===void 0||typeof t>"u")}function x(t){return Array.isArray(t)||typeof t=="object"&&t||de(t)}function Ge(t){return Ve(t)||te(t)||t===!1||t===0||x(t)&&!Object.keys(t).length}function V(t){return de(t)||t&&{}.toString.call(t)==="[object function]"}function me(t){return t instanceof Number||typeof t=="number"}function G(t){return me(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Je(t){return j(t)&&Object.getPrototypeOf(t)===Array.prototype}function Ke(t){return v(t)&&Object.getPrototypeOf(t)===Object.prototype}function J(t){return t instanceof String||typeof t=="string"&&t!==null}function Xe(t){return!J(t)&&!te(t.length)}function D(t,...e){if(!t||!["object","function"].includes(typeof t))throw new Error("Argument #1 must be of type object");let r=t[Symbol.for("wq")];if(r||(r=new je,Object.defineProperty(t,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!e.length)return r;let n,s;for(;n=e.shift();)(s=r)&&!(r=r.get(n))&&(r=new je,s.set(n,r));return r}var je=class extends Map{};function ge(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 Ie(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)}(async()=>typeof URLPattern>"u"&&await Promise.resolve().then(()=>(or(),sr)))();var lt=class extends URLPattern{#n;constructor(e,r=null){typeof e=="object"&&e?.baseURL&&({baseURL:r,...e}=e),super(e,r),this.#n=new URL(e,r)}isPattern(){let e=(s,i)=>{if(!s)return!1;let a=!1;for(let o of s){if(a){a=!1;continue}if(o==="\\"){a=!0;continue}if(i.has(o))return!0}return!1},r={protocol:new Set(["*"]),username:new Set(["*"]),password:new Set(["*"]),hostname:new Set(["*","{"]),port:new Set(["*","{"]),pathname:new Set(["*",":","{","("]),search:new Set(["*","{"]),hash:new Set(["*","{"])},n=this.#n;return e(n.protocol,r.protocol)||e(n.username,r.username)||e(n.password,r.password)||e(n.hostname,r.hostname)||e(n.port,r.port)||e(n.pathname,r.pathname)||e(n.search,r.search)||e(n.hash,r.hash)}exec(...e){let r=super.exec(...e);if(!r)return;let n={};for(let a of Object.values(r))a?.groups&&Object.assign(n,a.groups);let s={named:n};return{...r,vars:s,render:a=>a.replace(/\$(\$|[A-Z0-9_]+)/gi,(o,u)=>u==="$"?"$":s.named[u]??"")}}};var Ot={};$e(Ot,{any:()=>Kr,apply:()=>xt,batch:()=>St,construct:()=>wt,defineProperties:()=>Yr,defineProperty:()=>Se,deleteProperties:()=>en,deleteProperty:()=>Oe,get:()=>X,getOwnPropertyDescriptor:()=>qe,getOwnPropertyDescriptors:()=>Qr,getPrototypeOf:()=>gt,has:()=>Ue,intercept:()=>Xr,isExtensible:()=>yt,map:()=>Zr,observe:()=>Et,ownKeys:()=>bt,path:()=>Gr,preventExtensions:()=>vt,reduce:()=>Pt,set:()=>oe,setPrototypeOf:()=>_t,subtree:()=>Jr});function F(t,e=!0){return j(t)?t:!e&&v(t)?[t]:t!==!1&&t!==0&&Ge(t)?[]:Xe(t)?Array.prototype.slice.call(t):v(t)?Object.values(t):[t]}var O=(t,...e)=>D(t,"observerAPI",...e),xe=(t,e)=>t instanceof Promise?t.then(e):e(t),ke={};var ne=class{constructor(e,r){this.registry=e,Object.assign(this,{...r,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var ve=class extends ne{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ke.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(e){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let r=e,n=this.filter;if(n!==1/0&&(n=F(n,!1))&&(r=e.filter(i=>n.includes(i.key))),this.params.diff&&(r=r.filter(i=>i.type!=="set"||i.value!==i.oldValue)),!r.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...r);return}this.emit.recursionTarget=this.params.recursions==="inject"?r:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(r,this):this.emit(r[0],this);return xe(s,i=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):i})}};var se=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(r=>r!==e)}static _getInstance(e,r,n=!0,s=this.__namespace){if(!x(r))throw new Error(`Subject must be of type object; "${pe(r)}" given!`);let i=this;return s&&O(globalThis,"observerAPI","namespaces").has(e+"-"+s)&&(i=O(globalThis,"observerAPI","namespaces").get(e+"-"+s),e+="-"+s),!O(r,"registry").has(e)&&n&&O(r,"registry").set(e,new i(r)),O(r,"registry").get(e)}static _namespace(e,r,n=null){if(e+="-"+r,arguments.length===2)return O(globalThis,"observerAPI","namespaces").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}.`);O(globalThis,"observerAPI","namespaces").set(e,n),n.__namespace=r}};var A=class{constructor(e,r){if(this.target=e,!r.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,r)}get[Symbol.toStringTag](){return"Descriptor"}static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="Descriptor"&&e.operation}};var I=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("listeners",...arguments)}static namespace(e,r=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,r,n){return super.addRegistration(new ve(this,{filter:e,emit:r,params:n}))}emit(e,{eventsArePropertyDescriptors:r=!1,eventIsArrayMethodDescriptor:n=!1}={}){if(this.batches.length){let s=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...e],arrayMethodName:s,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n});return}this.$emit(this.entries,[{events:e,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n}])}$emit(e,r){let n=0,s=0,i=0;for(let c of e)n+=1,c.params.withPropertyDescriptors&&(s+=1),c.params.withArrayMethodDescriptors&&(i+=1);let a=[],o=[],u=[],f=[];for(let c of r){let l=c.arrayMethodName,p=c.eventsArePropertyDescriptors,h=c.eventIsArrayMethodDescriptor;for(let d of c.events)if(l&&(d.operation=l),s&&(i&&a.push(d),h||i!==n&&o.push(d)),s!==n){let y=d;if(p){let{target:b,type:_,...w}=d;y=new A(b,{type:"set",...w}),Object.defineProperty(y,"value","get"in w.value?{get:()=>w.value.get()}:{value:w.value.value}),w.oldValue&&Object.defineProperty(y,"oldValue","get"in w.oldValue?{get:()=>w.oldValue.get()}:{value:w.oldValue.value})}i&&u.push(y),h||i!==n&&f.push(y)}}for(let c of e)c.params.withPropertyDescriptors?c.params.withArrayMethodDescriptors?a.length&&c.fire(a):o.length&&c.fire(o):c.params.withArrayMethodDescriptors?u.length&&c.fire(u):f.length&&c.fire(f)}batch(e,r={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:r});let n=e();return xe(n,s=>{let i=this.batches.shift();return i.snapshots.length&&this.$emit(i.entries,i.snapshots),s})}};var Pe=class extends ne{exec(e,r,n){return this.running||!this.traps[e.operation]?r(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.operation](e,n,(...s)=>(this.running=!1,r(...s))))}};var K=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("traps",...arguments)}static namespace(e,r=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new Pe(this,e))}emit(e,r=null){let n=this;return function s(i,...a){let o=n.entries[i];return o?o.exec(e,(...u)=>s(i+1,...u),...a):r?r(e,...a):a[0]}(0)}};var mt={};$e(mt,{accessorize:()=>zr,proxy:()=>pt,unaccessorize:()=>Vr,unproxy:()=>Ee});var fr=Symbol("wqOriginal");function zr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(u){let f,c=t;do f=Object.getOwnPropertyDescriptor(c,u);while(!f&&(c=Object.getPrototypeOf(c)));return f?{proto:c,descriptor:f}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function i(u){if(n.has(u+""))return!0;let f=s(u);f.getValue=function(p=!1){return p?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},f.setValue=function(p,h=!1){if(this.dirty=!0,h){this.descriptor=p;return}return this.descriptor.set?this.descriptor.set(p)!==!1:(this.descriptor.value=p,!0)},f.intact=function(){let p=Object.getOwnPropertyDescriptor(t,u);return p?.get===l.get&&p?.set===l.set&&n.get(u+"")===this},f.restore=function(){return this.intact()?(this.proto&&this.proto!==t||!this.proto&&!this.dirty?delete t[u]:Object.defineProperty(t,u,this.descriptor),n.delete(u+""),!0):!1},n.set(isNaN(u)?u:parseInt(u),f);let{enumerable:c=!0}=f.descriptor,l={enumerable:c,configurable:!0};("value"in f.descriptor||f.descriptor.set)&&(l.set=function(p){return oe(this,u,p,r)}),("value"in f.descriptor||f.descriptor.get)&&(l.get=function(){return X(this,u,r)});try{return Object.defineProperty(t,u,l),!0}catch{return n.delete(u+""),!1}}let o=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(i);return e===void 0||Array.isArray(e)?o:o[0]}function Vr(t,e,r={}){t=dt(t);let n=O(t,"accessorizedProps");function s(o){return n.has(o+"")?n.get(o+"").restore():!0}let a=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(s);return e===void 0||Array.isArray(e)?a:a[0]}function pt(t,e={},r=void 0){let n=dt(t);if(typeof e.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(e.membrane&&O(n,"membraneRef").has(e.membrane))return O(n,"membraneRef").get(e.membrane);let s={apply:(o,u,f)=>xt(o,u,f,void 0,e),construct:(o,u,f=null)=>wt(o,u,f,e),defineProperty:(o,u,f)=>Se(o,u,f,e),deleteProperty:(o,u)=>Oe(o,u,e),get:(o,u,f=null)=>{if(u===fr)return n;let c={...e,receiver:f},l=X(o,u,c);return Array.isArray(o)&&typeof l=="function"&&!/^class\s?/.test(Function.prototype.toString.call(l))?pt(l,{...e,arrayMethodName:u,membrane:f},r):e.chainable&&x(l)&&u!=="prototype"&&!(typeof l=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(l)))?pt(l,e,r):l},getOwnPropertyDescriptor:(o,u)=>qe(o,u,e),getPrototypeOf:o=>gt(o,e),has:(o,u)=>Ue(o,u,e),isExtensible:o=>yt(o,e),ownKeys:o=>bt(o,e),preventExtensions:o=>vt(o,e),set:(o,u,f,c=null)=>oe(o,u,f,{...e,receiver:c}),setPrototypeOf:(o,u)=>_t(o,u,e)},i=r?.(s)||s,a=new Proxy(n,i);return e.membrane&&O(n,"membraneRef").set(e.membrane,a),a}function Ee(t){return t&&t[fr]||t}function dt(t){if(!t||!x(t))throw new Error("Target must be of type object!");return Ee(t)}var Ae=class extends Array{get[Symbol.toStringTag](){return"Path"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Path"}};function Gr(...t){return new Ae(...t)}var ie=class extends Array{get[Symbol.toStringTag](){return"Subtree"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Subtree"}};function Jr(){return new ie}function Kr(){return 1/0}function Pt(t,e,r,n=i=>i,s={}){let i=e instanceof ie;if(!(!i&&!e?.length))return function a(o,u,f,c){let l=c||u[f.level]instanceof ie,p=l?1/0:u[f.level],h=l?!1:f.level===u.length-1;return o instanceof A&&o.operation!=="get"?f={...f,probe:"always"}:f.probe!=="always"&&(f={...f,probe:!h}),r(o,p,(d,...y)=>{let b=m=>{m instanceof A&&(m.path="key"in m?[m.key]:[],o instanceof A&&(m.path="key"in m?o.path.concat(m.key):o.path.slice(0),Object.defineProperty(m,"context",{get:()=>o,configurable:!0})))},_=y[0]||{},w=m=>{if(m instanceof A&&"argumentsList"in m)return;let P=H(m,!1);return xe(P,E=>(m instanceof A?m.value=E:m=E,a(m,u,{...f,..._,keyInParent:m.key,level:f.level+1},l)))};if(Ce(p)&&Array.isArray(d)){if(d.forEach(b),h)return n(d,...y);l&&d[0]instanceof A&&(d[0].operation!=="get"||s.asGet)&&n(d,...y);for(let m of d)w(m);return}return b(d),h?n(d,...y):w(d)},f)}(t,e.slice(0),{...s,level:0},i)}function Et(t,e,r,n={}){let s=H(t,!n.level);if(V(arguments[1])&&([,r,n={}]=arguments,e=1/0),!V(r))throw new Error(`Handler must be a function; "${pe(r)}" given!`);if(e instanceof Ae||e instanceof ie)return Pt(s,e,Et,r,n);if(n={...n,descripted:!0},delete n.live,!x(s))return n.probe&&X(s,e,r,n)||void 0;let i=ur(s,e,r,n);return n.probe?X(s,e,i,n):i()}function Xr(t,e,r={}){let n=H(t);return v(e)||([,,,r={}]=arguments,e={[arguments[1]]:arguments[2]}),K.getInstance(n,!0,r.namespace).addRegistration({traps:e,params:r})}function qe(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptor",{key:e},r,n)}function Qr(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptors",{key:e},r,n)}function gt(t,e=n=>n,r={}){return k(t,"getPrototypeOf",{},e,r)}function yt(t,e=n=>n,r={}){return k(t,"isExtensible",{},e,r)}function bt(t,e=n=>n,r={}){return k(t,"ownKeys",{},e,r)}function Ue(t,e,r=s=>s,n={}){return k(t,"has",{key:e},r,n)}function X(t,e,r=s=>s,n={}){let s,i=H(t,!n.level);return v(r)?[n,r]=[r,a=>a]:n.live&&(s=!0),e instanceof Ae||e instanceof ie?Pt(i,e,X,r,{...n,asGet:!0}):tn(i,e,a=>{let o=[...a];return function u(f,c,l){if(!c.length)return l(f);let p=c.shift();if(!["string","number","symbol"].includes(typeof p))throw new Error(`Property name/key ${p} invalid.`);function h(b,_=void 0){let w=E=>(b.value=E,u([...f,n.live||n.descripted?b:E],c,l));if(arguments.length>1)return w(_);if(!x(i))return w(i?.[b.key]);let m=O(i,"accessorizedProps",!1),P=m&&m.get(b.key);if(P&&P.intact())return w(P.getValue(n.withPropertyDescriptors));if(n.withPropertyDescriptors){let E=Object.getOwnPropertyDescriptor(i,b.key);return w(E)}return w(Reflect.get(i,b.key))}let d=new A(i,{type:"get",key:p,value:void 0,operation:"get",related:o});if(!x(i))return h(d);let y=K.getInstance(i,!1,n.namespace);return y?y.emit(d,h):h(d)}([],a.slice(0),u=>{let f=Ce(e)?u:u[0];return s&&x(i)?ur(i,e,r,n,t.key)(f):r(f)})},n)}function St(t,e,r={}){let n=H(t);return I.getInstance(n,!0,r.namespace).batch(e,r)}function Zr(t,e,r={}){e=H(e),t=H(t);let n=(r.only||[]).slice(0),s=(r.except||[]).slice(0),i=Object.keys(r.spread?[...t]:t).map(f=>isNaN(f)?f:parseInt(f)),a=n.length?n.filter(f=>i.includes(f)):i.filter(f=>!s.includes(f)),o=f=>!Array.isArray(e)||isNaN(f)?f:f-s.filter(c=>c<f).length,u=f=>{let c=qe(t,f,r);"value"in c&&c.writable&&c.enumerable&&c.configurable?oe(e,o(f),c.value,r):(c.enumerable||r.onlyEnumerable===!1)&&Se(e,f,{...c,configurable:!0},r)};return St(e,()=>{a.forEach(u)}),Et(t,f=>{f.filter(c=>n.length?n.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.type==="delete")return Oe(e,o(c.key),r);if(c.type==="def"){(c.value.enumerable||r.onlyEnumerable===!1)&&Se(e,o(c.key),{...c.value,configurable:!0},r);return}u(c.key)})},{...r,withPropertyDescriptors:!0})}function oe(t,e,r,n=a=>a,s={},i=!1){let a=H(t),o=[[e,r]];v(e)&&([,,n=f=>f,s={},i=!1]=arguments,o=Object.entries(e)),v(n)&&([i,s,n]=[typeof s=="boolean"?s:i,n,f=>f]);let u=o.map(([f])=>f);return function f(c,l,p){if(!l.length)return p(c);let[h,d]=l.shift();function y(_,w=void 0){let m=q=>(_.status=q,f(c.concat(_),l,p));if(arguments.length>1)return m(_,w);let P=O(a,"accessorizedProps",!1),E=P&&P.get(_.key);return _.type==="def"?(E&&!E.restore()&&m(!1),Object.defineProperty(a,_.key,_.value),m(!0)):E&&E.intact()?m(E.setValue(_.value)):m(Reflect.set(a,_.key,_.value))}function b(_,w){if(s.diff&&d===w)return f(c,l,p);let m=new A(a,{type:i?"def":"set",key:h,value:d,isUpdate:_,oldValue:w,related:[...u],operation:i?"defineProperty":"set",detail:s.detail}),P=K.getInstance(a,!1,s.namespace);return P?P.emit(m,y):y(m)}return Ue(a,h,_=>{if(!_)return b(_);if(h==="length"&&Array.isArray(a)&&O(a).has("$length"))return b(!0,O(a).get("$length"));let w={...s,withPropertyDescriptors:i};return X(a,h,m=>b(_,m),w)},s)}([],o.slice(0),f=>{let c=I.getInstance(a,!1,s.namespace);return c&&c.emit(f,{eventsArePropertyDescriptors:!!i}),n(Ce(e)?f.map(l=>l.status):f[0]?.status)})}function Se(t,e,r,n=i=>i,s={}){return oe(t,e,r,n,s,!0)}function Yr(t,e,r=s=>s,n={}){return oe(t,e,r,n,!0)}function Oe(t,e,r=s=>s,n={}){let s=H(t);v(r)&&([n,r]=[r,o=>o]);let i=F(e,!1),a=[...i];return function o(u,f,c){if(!f.length)return c(u);let l=f.shift();function p(d,y=void 0){let b=m=>(d.status=m,o(u.concat(d),f,c));if(arguments.length>1)return b(d,y);let _=O(s,"accessorizedProps",!1),w=_&&_.get(d.key);return w&&!w.restore()&&b(!1),b(Reflect.deleteProperty(s,d.key))}function h(d){let y=new A(s,{type:"delete",key:l,oldValue:d,related:[...a],operation:"deleteProperty",detail:n.detail}),b=K.getInstance(s,!1,n.namespace);return b?b.emit(y,p):p(y)}return X(s,l,h,n)}([],i.slice(0),o=>{let u=I.getInstance(s,!1,n.namespace);return u&&u.emit(o),r(Ce(e)?o.map(f=>f.status):o[0].status)})}function en(t,e,r=s=>s,n={}){return Oe(...arguments)}function wt(t,e,r=null,n=i=>i,s={}){return k(t,"construct",arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},n,s)}function xt(t,e,r,n=i=>i,s={}){let i=Ee(e),a;if(Array.isArray(e)){if(s.arrayMethodName){let o=new A(i,{operation:s.arrayMethodName,argumentsList:r});I.getInstance(i,!1,s.namespace)?.emit([o],{eventIsArrayMethodDescriptor:!0})}O(i).set("$length",i.length),a=St(i,()=>k(t,"apply",{thisArgument:e,argumentsList:r},n,s),s),O(i).delete("$length")}else a=k(t,"apply",{thisArgument:i,argumentsList:r},n,s);return a}function _t(t,e,r=s=>s,n={}){return k(t,"setPrototypeOf",{proto:e},r,n)}function vt(t,e=n=>n,r={}){return k(t,"preventExtensions",{},e,r)}function ur(t,e,r,n={}){let s=new AbortController;ke.setMaxListeners?.(0,s.signal),n.signal&&n.signal.addEventListener("abort",()=>s.abort());let i={...n,signal:s.signal},a=I.getInstance(t,!0,i.namespace),o=new Map;return function u(f=[],c=null){let l,p,h;if(Ce(e)){if(c){h=!0,p=c;for(let d of f)o.get(d.key)?.remove(),o.delete(d.key)}else p=a.addRegistration(e,u,i);l={signal:p.signal,childRegistrations:o}}else c?.remove(),p=a.addRegistration(e,u,i),l={signal:p.signal};if(i.childRegistrations&&i.keyInParent&&i.childRegistrations.set(i.keyInParent,p),arguments.length){let d=r(f,l);if(arguments.length>1)return d}return s}}function k(t,e,r={},n=i=>i,s={}){t=H(t),v(n)&&([s,n]=[n,u=>u]);function i(u,f){return arguments.length>1?n(f):n((Reflect[e]||Object[e])(t,...Object.values(r)))}let a=new A(t,{operation:e,...r}),o=K.getInstance(t,!1,s.namespace);return o?o.emit(a,i):i(a)}function Ce(t){return t===1/0||Array.isArray(t)}function H(t,e=!0,r=!0){if((!t||!x(t))&&e)throw new Error(`Object must be of type object or array! "${pe(t)}" given.`);return t instanceof A&&(t.type==="def"&&r?t=typeof t.value.get=="function"?t.value.get():t.value.value:t=t.value),t&&Ee(t)}function tn(t,e,r,n={}){return e===1/0?n.level&&!x(t)?r([]):r(Object.entries(Object.getOwnPropertyDescriptors(t)).filter(([,s])=>s.writable!==!1&&!s.get&&!s.set).map(([s])=>s)):r(F(e,!1))}var S={...Ot,...mt},cr=S;var ae=class t extends URLSearchParams{#n;#e;get compatMode(){return this.#e}#r=new Set;#t;#s=!1;#f;_changeCallbackGC;constructor(e={},{compatMode:r=!0,prettyPrint:n=!1,changeCallback:s=null}={}){super(),this.#e=r,this.#t=n;let i;e instanceof t?(i=structuredClone(e.json()),r&&(this.#r=new Set(e.keys()))):e instanceof URLSearchParams||e instanceof FormData?(i=Object.fromEntries(e),r&&(this.#r=new Set(e.keys()))):J(e)?(e=decodeURIComponent(e.replace(/^\?/,"")),i=this.constructor.parse(e,!r),r&&(this.#r=new Set(e.split("&").map(a=>a.split("=")[0])))):Array.isArray(e)?(i=this.constructor.fromEntries(e),r&&(this.#r=new Set(e.map(([a])=>a)))):v(e)?(i=e,r&&this.constructor.reduceValue(e,"",(a,o,u)=>{if(u)return u;/\[\d+\]$/.test(o)&&([,o]=/^(.*)\[\d+\]$/.exec(o)),this.#r.add(o)})):i={},this._changeCallback=s,this._resetJson(i)}_resetJson(e){this.#n=S.proxy(e),this.#f&&(this._changeCallbackGC?.abort(),this._changeCallbackGC=S.observe(this.#n,S.subtree(),this.#f))}get(e){let r=this.#i(e);return this.#e&&Array.isArray(r)?r[0]:r}#i(e,r=!1){if(this.#e&&!this.#r.has(e))return null;let n=this.constructor.get(this.#n,e,r);return n===void 0?null:Array.isArray(n)?this.#e?n.map(s=>typeof s=="number"?s+"":s):n.map(s=>v(s)?new t(s,{compatMode:this.#e}):s):!this.#e&&v(n)?new t(n,{compatMode:this.#e}):this.#e&&typeof n=="number"?n+"":n}getAll(e){let r=this.#i(e,!0);return r===null?[]:Array.isArray(r)?r:[r]}set(e,r){return this.#e&&this.#r.add(e),this.constructor.set(this.#n,e,r),this}append(e,r){return this.#e&&this.#r.add(e),this.constructor.set(this.#n,e,r,!0),this}has(e){return this.#e&&!this.#r.has(e)?!1:this.constructor.get(this.#n,e)!==void 0}delete(e){if(this.#e&&!this.#r.has(e))return;let r=this.constructor.parsePath(e),n=r.pop(),s=r.length?this.constructor.get(this.#n,r):this.#n;v(s)&&S.deleteProperty(s,n)}sort(){return this.#s=!0,this}json(){return S.unproxy(this.#n)}stringify({prettyPrint:e=this.#t}={}){return this.constructor.stringify(this.#n,{only:this.#e&&this.#r,sorted:this.#s,prettyPrint:e})}toString(){return this.stringify()}entries(){let e=[];return this.constructor.reduceValue(this.#n,"",(r,n,s)=>{if(s)return s;if(this.#e&&!this.#r.has(n))if(/\[\d+\]$/.test(n)){if([,n]=/^(.*)\[\d+\]$/.exec(n),!this.#r.has(n)&&!this.#r.has(n=`${n}[]`))return}else return;this.#e&&typeof r=="number"&&(r=r+""),e.push([n,r])}),e[Symbol.iterator]()}keys(){return Array.from(this.entries(),([e])=>e)[Symbol.iterator]()}values(){return Array.from(this.entries(),([,e])=>e)[Symbol.iterator]()}forEach(e,r){for(let[n,s]of this.entries())e.call(r,s,n,this)}[Symbol.iterator](){return this.entries()}get size(){let e=0;return this.forEach(()=>e++),e}static parse(e,r=!1,n="&"){let s={};return(e.startsWith("?")?e.slice(1):e).split(n).filter(Boolean).forEach(i=>{let a=i.indexOf("="),o=a===-1?i:i.slice(0,a),u=a===-1?"":i.slice(a+1);this.set(s,o,u,!0,r)}),s}static fromEntries(e){let r={};for(let[n,s]of e)this.set(r,n,s,!0);return r}static stringify(e,{sorted:r=!1,only:n=null,prettyPrint:s=!1,delim:i="&"}={}){let a=[],o=Object.keys(e);return r&&o.sort(),o.forEach(u=>{this.reduceValue(e[u],u,(f,c,l)=>{if(l)return r?[...l].sort():l;if(n&&!n.has(c))if(/\[\d+\]$/.test(c)){if([,c]=/^(.*)\[\d+\]$/.exec(c),!n.has(c)&&!n.has(c=`${c}[]`))return}else return;s||(c=encodeURIComponent(c)),a.push(c+"="+encodeURIComponent(f))},!!s)}),a.join(i)}static get(e,r,n=!1){return this.reducePath(r,e,(s,i,a)=>a||(s===""?n?i:i?.[0]:i?.[s]))}static set(e,r,n,s=!1,i=!1){this.reducePath(r,e,(a,o,u)=>{let f=u??n;return i&&/^-?\d+(\.\d+)?$/.test(f+"")&&(f=parseFloat(f)),a===""&&Array.isArray(o)?S.proxy(o).push(f):s&&o?.[a]?Array.isArray(o[a])?S.proxy(o[a]).push(f):S.set(o,a,[o[a],f]):S.set(o,a,f),f})}static reduceValue(e,r,n,s=!1){if(x(e)){let i=Object.keys(e),a=n(e,r,i);if(Array.isArray(a)){a.forEach(o=>{s&&(o=encodeURIComponent(o)),this.reduceValue(e[o],r?`${r}[${o}]`:o,n,s)});return}}n(e,r)}static reducePath(e,r,n){let s=this.parsePath(e),i=r;for(let a=0;a<s.length;a++){let o=s[a];if(G(o)&&(o=+o),a===s.length-1)return n(o,i);if(!x(i))return;if(!x(i[o])){let u=s[a+1];i[o]=n(o,i,G(u)||u===""?[]:{})}i=i[o]}}static parsePath(e){if(Array.isArray(e))return e;if(!J(e))return[];let r=[];return e.replace(/\[([^\]]*)\]|([^[\]]+)/g,(n,s,i)=>{r.push(s??i)}),r}};var B=class t extends FormData{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}static json(e={},{encodeLiterals:r=!0,meta:n=!1}={}){let s=new t,i=!0;return ae.reduceValue(e,"",(a,o,u=void 0)=>{if(u){let f=Ne(a)==="json";return i=i&&f,f&&u}r&&[!0,!1,null].includes(a)&&(a=new Blob([a+""],{type:"application/json"})),s.append(o,a)}),n?{result:s,isDirectlySerializable:i}:s}async json({decodeLiterals:e=!0,meta:r=!1}={}){let n=!0,s;for(let[i,a]of this.entries()){s||(s=G(Ie(i,"["))?[]:{});let o=Ne(a);if(e&&["Blob","File"].includes(o)&&a.type==="application/json"&&[4,5].includes(a.size)){let u=JSON.parse(await a.text());[null,!0,!1].includes(u)&&(a=u,o="json")}n=n&&o==="json",/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(a)&&(a=Number(a)),ae.set(s,i,a)}return r?{result:s,isDirectlySerializable:n}:s}};var fe=(t,...e)=>D(t,"fetch+",...e),C=(t,...e)=>D(t,"fetch+","meta",...e);function Fe(t){return class extends t{static from(e){let r=e.headers instanceof Headers?[...e.headers.entries()].reduce((i,[a,o])=>{let u=a.toLowerCase();return i[u]=i[u]?[].concat(i[u],o):o,i},{}):Object.keys(e.headers||{}).reduce((i,a)=>(i[a.toLowerCase()]=e.headers[a],i),{}),n=e.body,s=[null,void 0].includes(n)?null:Ne(n);if(["Blob","File"].includes(s))r["content-type"]??=n.type,r["content-length"]??=n.size;else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(s))r["content-length"]??=n.byteLength;else if(s==="json"&&x(n)){let{result:i,isDirectlySerializable:a}=B.json(n,{encodeLiterals:!0,meta:!0});a?(n=JSON.stringify(n,(o,u)=>u instanceof Error?{...u,message:u.message}:u),r["content-type"]="application/json",r["content-length"]=new Blob([n]).size):(n=i,s="FormData")}else["text","json"].includes(s)&&!r["content-length"]&&(r["content-length"]=new Blob([n]).size);return!["FormData",null].includes(s)&&!["function"].includes(typeof n)&&!r["content-type"]&&(r["content-type"]="application/octet-stream"),{body:n,headers:new Headers(r),$type:s}}async formData(){let e=await super.formData();return B.upgradeInPlace(e),e}async any({to:e=null,memo:r=!1}={}){if(e&&!["blob","text","json","arrayBuffer","bytes","formData"].includes(e))throw new Error(`Invalid target type specified: ${e}`);if(this.body===null)return null;let n=C(this,"cache"),s=async o=>{if(!r)return await this[o||"bytes"]();let u=c=>{if(c instanceof FormData){let l=new B;for(let[p,h]of c.entries())l.append(p,h);return l}return(!o||o==="json")&&(Ke(c)||Je(c))?structuredClone(c):c};if(!o&&n.has("original"))return u(n.has("original"));if(o??="bytes",n.has(o))return u(n.get(o));let f;return n.has("memo")?f=n.get("memo").clone()[o]():(n.set("memo",this.clone()),f=await this[o]()),n.set(o,f),u(f)},i=(this.headers.get("Content-Type")||"").split(";")[0].trim(),a;if((!e||["formData","json"].includes(e))&&["multipart/form-data","application/x-www-form-urlencoded"].includes(i)){let o=await s("formData");B.upgradeInPlace(o),e==="json"&&(o=await o.json({decodeLiterals:!0})),a=o}else if((!e||["formData","json"].includes(e))&&i==="application/json"){let o=await s("json");e==="formData"&&(o=B.json(o,{encodeLiterals:!0})),a=o}else if(!e&&(i.startsWith("image/")||i.startsWith("video/")||i.startsWith("audio/")||i.startsWith("application/")&&!["xml","json","javascript","x-www-form-urlencoded"].some(o=>i.includes(o))))a=await s("blob");else if(!e&&(i.startsWith("text/")||i.startsWith("application/")&&["xml","javascript"].some(o=>i.includes(o))))a=await s("text");else{if(["json","formData"].includes(e))throw new Error(`Cannot convert body of type ${i} to ${e}`);a=await s(e)}return a}forget(){C(this,"cache").clear()}}}function Ne(t){if(t instanceof FormData)return"FormData";if(t===null||me(t)||Re(t))return"json";if(J(t))return"text";if(x(t)){let e=t[Symbol.toStringTag],r=["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream","ReadableStream"].reduce((n,s)=>n||(e===s?s:null),null);if(r)return r;if(v(t)||Array.isArray(t))return"json";if("toString"in t)return"text"}return null}function nn(t){return t!==null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}function At(t){return t instanceof ReadableStream||nn(t)}var W=class t extends Headers{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}set(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){this.delete(e);for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=lr(r)),/^Content-Range$/i.test(e)&&(r=pr(r)),/^Range$/i.test(e)&&(r=hr(r)),/^Accept$/i.test(e)&&(r=dr(r)),super.set(e,r)}append(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=lr(r)),/^Content-Range$/i.test(e)&&(r=pr(r)),/^Range$/i.test(e)&&(r=hr(r)),/^Accept$/i.test(e)&&(r=dr(r)),super.append(e,r)}get(e,r=!1){let n=super.get(e);if(/^Set-Cookie$/i.test(e)&&r&&(n=this.getSetCookie().map(s=>{let[i,...a]=s.split(";"),[o,u]=i.split("=").map(c=>c.trim()),f={name:o,value:u};return a.map(c=>c.trim().split("=")).forEach(c=>{f[c[0][0].toLowerCase()+c[0].substring(1).replace("-","")]=c.length===1?!0:c[1]}),f})),/^Cookie$/i.test(e)&&r&&(n=n?.split(";").map(s=>{let[i,a]=s.split("=").map(o=>o.trim());return{name:i,value:a}})||[]),/^Content-Range$/i.test(e)&&n&&r&&(n=ge(n,"bytes ").split("/")),/^Range$/i.test(e)&&r&&(n=n?ge(n,"bytes=").split(",").map(s=>{let i=s.trim().split("-").map(a=>a?parseInt(a,10):null);return i.resolveAgainst=a=>{let o=[...i];return o[1]===null?o[1]=a-1:o[1]=Math.min(o[1],a)-1,o[0]===null&&(o[0]=o[1]?a-o[1]-1:0),o},i.canResolveAgainst=(a,o)=>{let u=[typeof i[0]=="number"?i[0]:a,typeof i[1]=="number"?i[1]:o-1];return!(u[0]>u[1]||u[0]<a||u[1]>=o)},i.toString=()=>s,i}):[]),/^Accept$/i.test(e)&&n&&r){let s=a=>{let[o,u]=a.trim().split(";").map(f=>f.trim());return[o,parseFloat((u||"q=1").replace("q=",""))]},i=n;n=n.split(",").map(a=>s(a)).sort((a,o)=>a[1]>o[1]?-1:1)||[],n.match=a=>{if(!a)return 0;let o=f=>f.split("/").map(c=>c.trim()),u=o(a+"");return n.reduce((f,[c,l])=>{if(f)return f;let p=o(c);return[0,1].every(h=>u[h]===p[h]||u[h]==="*"||p[h]==="*")?l:0},0)},n.toString=()=>i}return n}};function Ct(t){let e=[`${t.name}=${t.value}`];for(let r in t){if(["name","value"].includes(r))continue;let n=r[0].toUpperCase()+r.substring(1);n==="MaxAge"&&(n="Max-Age"),e.push(t[r]===!0?n:`${n}=${t[r]}`)}return e.join("; ")}function lr(t){return x(t)&&(t=[].concat(t).map(Ct).join("; ")),t}function hr(t){let e=[];return F(t).forEach((r,n)=>{let s=Array.isArray(r)?r.map(i=>[null,void 0].includes(i)?"":i).join("-"):r+"";n===0&&!s.includes("bytes=")&&(s=`bytes=${s}`),e.push(s)}),e.join(", ")}function pr(t){if(Array.isArray(t)){if(t.length<2||!t[0].includes("-"))throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");t=`bytes ${t.join("/")}`}return t}function dr(t){return Array.isArray(t)&&(t=t.map(e=>Array.isArray(e)?e.map((r,n)=>n===1&&(r=parseFloat(r),!0)?r===1?"":`;q=${r}`:r.trim()).join(""):e.trim()).join(",")),t}var z=class t extends Fe(Response){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Response)return e;let s;if(typeof e<"u"){let a;({body:e,headers:a,$type:s}=super.from({body:e,headers:n.headers})),n={...n,headers:a}}let i=new this(e,n);if(r){let a=C(i,"cache"),o={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};a.set(o[s]||"original",e)}return i}get status(){return this.headers.has("X-Redirect-Code")?200:super.status}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};async function mr(t,e={}){let r=await fetch(t,e);return z.upgradeInPlace(r),r}var He=class t extends Fe(Request){constructor(e,r={}){super(e,r),W.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),W.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Request)return e;let s,i=n.body;if("body"in n){let{body:o,headers:u,$type:f}=super.from(n);n={...n,body:o,headers:u},s=f}let a=new this(e,n);if(r){let o=C(a,"cache"),u={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};o.set(u[s]||"original",i)}return a}static async copy(e,r={}){let s=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((i,a)=>({...i,[a]:a in r?r[a]:a==="headers"?new Headers(e[a]):e[a]}),{});return["GET","HEAD"].includes(s.method.toUpperCase())?s.body=null:"body"in r?(s.body=r.body,"headers"in r||(s.headers.delete("Content-Type"),s.headers.delete("Content-Length"))):s.body=await e.clone().arrayBuffer(),s.mode==="navigate"&&(s.mode="cors"),{url:r.url||e.url,...s}}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};var Q=class extends MessageEvent{#n;get originalTarget(){return this.#n}#e;get eventID(){return this.#e}#r;get data(){return this.#r}#t;get live(){return this.#t}#s;get bubbles(){return this.#s}#f;get forwarded(){return this.#f}#i;get honourDoneMutationFlags(){return this.#i}#u=[];get ports(){return this.#u}constructor(e,{originalTarget:r=null,type:n="message",eventID:s,live:i=!1,honourDoneMutationFlags:a=!1,bubbles:o=!1,forwarded:u=!1,ports:f=[]}={}){if(n&&typeof n!="string")throw new TypeError("Where specified, wqEventOptions.type must be a string");if(super(n),this.#r=e,this.#n=r,this.#e=s,this.#t=i,this.#s=o,this.#f=u,this.#i=a,this.#u=f,this.#u.forEach(c=>M.upgradeInPlace(c)),x(this.#r)&&this.#t){if(typeof s!="string")throw new TypeError("eventID must be a non-empty string");Mt.call(r,this.#r,this.#e,{honourDoneMutationFlags:this.#i})}}#c=!1;get immediatePropagationStopped(){return this.#c}stopImmediatePropagation(){this.#c=!0,this.#l=!0,super.stopImmediatePropagation()}#l=!1;get propagationStopped(){return this.#l}stopPropagation(){this.#l=!0,super.stopPropagation()}#o=!1;get defaultPrevented(){return this.#o}preventDefault(){this.#o=!0,super.preventDefault()}respondWith(e,r=[]){for(let n of this.#u)n.postMessage(e,r);return!!this.#u.length}};var ue=class extends Be(EventTarget){#n;#e;constructor(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(super(),typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if(T(this).set("options",{handshake:r,postAwaitsOpen:n}),this.#n=typeof e=="string"?new WebSocket(e):e,this.constructor.upgradeEvents(this.#n,this),this.#e=new Promise(i=>{this.#n.readyState===WebSocket.OPEN?i():this.#n.addEventListener("open",()=>i(),{once:!0})}),r===0&&this.#e.then(()=>this.start()),this.#n.readyState===WebSocket.CLOSED)try{this.close()}catch{}else this.#n.addEventListener("close",()=>{try{this.close()}catch{}},{once:!0})}static _hydrateMessage(e,r){try{let n;if(typeof r.data=="string"&&v(n=JSON.parse(r.data))&&n[".wq"])return Object.defineProperty(r,"data",{value:n,configurable:!0}),super._hydrateMessage(e,r)}catch{}return r}__postMessage(e,r){this.#e.then(()=>{this.#n.send(JSON.stringify(e),r)})}_close(){this.#n.close()}};var gr=(t,...e)=>D(t,"port+",...e),T=(t,...e)=>D(t,"port+","meta",...e),ce=t=>D(t,"port+","meta").get("options")||{},yr=["addEventListener","addRequestListener","postMessage","postRequest","dispatchEvent","relay","start","readyStateChange","removeEventListener","close"],br=["options","readyState","onmessage","onmessageerror"],M=class extends wr(EventTarget){constructor({handshake:e=0,postAwaitsOpen:r=!1,...n}={}){if(typeof e!="number")throw new Error("handshake must be a number");if(e<0||e>2)throw new Error("handshake must be between 0 and 2");super(),gr(this,"meta").set("options",{handshake:e,postAwaitsOpen:r,...n})}static[Symbol.hasInstance](e){return Function.prototype[Symbol.hasInstance].call(this,e)?!0:yr.every(r=>typeof e[r]=="function")||br.every(r=>r in e)}};function wr(t){return class extends t{static upgradeInPlace(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(e instanceof M)return e;if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");let s=this.prototype;for(let a of yr.concat("_autoStart")){let o=e[a],u=s[a];o&&Object.defineProperty(e,`_${a}`,{value:o.bind(e),configurable:!0}),Object.defineProperty(e,a,{value:u.bind(e),configurable:!0})}for(let a of br){let o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),a),u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),a);o&&Object.defineProperty(e,`_${a}`,{...o,configurable:!0}),Object.defineProperty(e,a,{...u,configurable:!0})}return gr(e,"meta").set("options",{handshake:r,postAwaitsOpen:n}),this.upgradeEvents(e),r===0&&e.start(),e}static upgradeEvents(e,r=null){r||(r=e);let n=T(e);if(n.get("events+"))return;let s=T(r),i=ce(r),a=he.call(r),o=le.call(r);e instanceof BroadcastChannel&&(i.clientServerMode==="server"?s.set("clients",new Set):i.clientServerMode==="client"&&s.set("client_id",`client-${(0|Math.random()*9e6).toString(36)}`));let u=c=>{if(c instanceof Q)return;if(e===r&&c.stopImmediatePropagation?.(),c=this._hydrateMessage?.(r,c)||c,c.data.ping==="connect"&&typeof c.data?.[".wq"]?.eventID=="string"&&(!(e instanceof WebSocket)||i.handshake)){let d=i.handshake===0||s.get("start.called"),y={isOpen:d};e instanceof BroadcastChannel&&(i.clientServerMode==="server"&&typeof c.data.id=="string"?(s.get("clients").add(c.data.id),y.id="server"):c.data.id==="server"&&s.has("client_id")&&(y.id=s.get("client_id"))),c.ports?.forEach(b=>b.postMessage(y)),d&&(s.set("remote.open.called",!0),r.start());return}if(c.data.ping==="disconnect"&&typeof c.data?.[".wq"]?.eventID=="string"){let d=()=>{s.set("remote.close.called",!0),r.close()};e instanceof BroadcastChannel?i.clientServerMode==="server"&&typeof c.data.id=="string"?(s.get("clients").delete(c.data.id),!s.get("clients").size&&i.autoClose&&!o.close.state&&d()):i.clientServerMode==="client"&&c.data.id==="server"&&d():e instanceof MessagePort&&d();return}let l=c.data,p={};typeof c.data?.[".wq"]?.eventID=="string"&&({message:l,".wq":p}=c.data);let h=new Q(l,{originalTarget:e,...p,ports:c.ports});r.dispatchEvent(h)},f=c=>{};n.set("internal_call",!0),e.addEventListener("message",u),e.addEventListener("error",f),n.delete("internal_call"),a.add(()=>{e.removeEventListener("message",u),e.removeEventListener("error",f),n.set("events+",!1)}),n.set("events+",!0)}get options(){return{...ce(this)}}get onmessageerror(){return typeof super.onmessageerror<"u"?super.onmessageerror:typeof this._onmessageerror<"u"?this._onmessageerror:null}set onmessageerror(e){if(typeof super.onmessageerror<"u"){super.onmessageerror=e;return}if(e!==null&&typeof e!="function")throw new TypeError("onmessageerror must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessageerror")?.set){this._onmessageerror=e;return}this._onmessageerror&&this.removeEventListener("messageerror",this._onmessageerror),this.addEventListener("messageerror",e),this._onmessageerror=e}get onmessage(){return typeof super.onmessage<"u"?super.onmessage:typeof this._onmessage<"u"?this._onmessage:null}set onmessage(e){if(typeof super.onmessage<"u"){super.onmessage=e,this._autoStart();return}if(e!==null&&typeof e!="function")throw new TypeError("onmessage must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessage")?.set){this._onmessage=e,this._autoStart();return}this._onmessage&&this.removeEventListener("message",this._onmessage),this.addEventListener("message",e),this._onmessage=e,this._autoStart()}addEventListener(...e){he.call(this).add(()=>{this._removeEventListener?this._removeEventListener(...e):super.removeEventListener(...e)});let n=this._addEventListener?this._addEventListener(...e):super.addEventListener(...e);return this._autoStart(),n}dispatchEvent(e){let r=this._dispatchEvent?this._dispatchEvent(e):super.dispatchEvent(e);return e instanceof Q&&sn.call(this,e),r}postMessage(e,r={}){this._autoStart();let n;r?.portPlusIgnore&&({portPlusIgnore:n,...r}=r);let s=le.call(this);s.messaging.state=!0,s.messaging.resolve(this);let i;if(!n){let{portOptions:u,wqOptions:{relayedFrom:f,...c}}=We.call(this,e,r);(c.type!=="message"||c.live||c.bubbles||u.transfer?.length&&(this instanceof BroadcastChannel||this instanceof ue))&&(e={message:e,".wq":c}),r=u,i=f}let a=()=>{this._postMessage?this._postMessage(e,r,i):super.postMessage(e,r)};ce(this).postAwaitsOpen?s.open.promise.then(a):a()}addRequestListener(e,r,n={}){let s=async i=>{let a=await r(i);for(let o of i.ports)o.postMessage(a)};this.addEventListener(e,s,n)}postRequest(e,r,n={}){let s;v(r)&&(n={once:!0,...r},s=new Promise(c=>{r=c}));let i=new MessageChannel;M.upgradeInPlace(i.port1),i.port1.start();let{signal:a,once:o=!1,transfer:u=[],...f}=n;return i.port1.addEventListener("message",c=>r(c),{signal:a||void 0,once:o}),a?.addEventListener("abort",()=>{i.port1.close(),i.port2.close()}),this.postMessage(e,{...f,transfer:[i.port2].concat(u)}),s}relay({to:e,from:r,types:n="*",channel:s=null,resolveMessage:i=null,bidirectional:a=!1}={}){if(e&&r)throw new Error('Only one of "to" and "from" may be specified');if(r?e=this:r=this,e===r)throw new Error("Source and target ports cannot be the same");if(!(r instanceof M)||!(e instanceof M))throw new Error("Both source and target ports must be instance of MessagePortPlus.");if(typeof n!="function"&&!(n=[].concat(n)).length)throw new Error("Event types must be specified.");if(typeof s=="string")s={from:s};else if(v(s)){if(Object.keys(s).filter(c=>!["from","to"].includes(c)).length)throw new Error('Channel must be a string or an object of "from"/"to" members')}else if(s)throw new Error("Invalid channel parameter");let o=xr.call(r),u={targetPort:e,types:n,channel:s,resolveMessage:i};o.add(u);let f;return a&&(f=e.relay({to:r,types:n,channel:s&&{to:s.from,from:s.to},resolveMessage:i,bidirectional:!1})),()=>{o.delete(u),f?.()}}channel(e,r=null,{handshake:n=0,postAwaitsOpen:s=!1}={}){let i=new MessageChannel;return M.upgradeInPlace(i.port1,{handshake:n,postAwaitsOpen:s}),M.upgradeInPlace(i.port2,{handshake:n,postAwaitsOpen:s}),he.call(this).add(this.relay({channel:e,to:i.port2,bidirectional:!0,resolveMessage:r})),i.port2.start(),this.readyStateChange("close").then(()=>{i.port2.close()}),i.port1}projectMutations({from:e,to:r,...n}){if(!e||!r||typeof e=="string"&&typeof r=="string"||x(e)&&x(r))throw new Error('Invalid "from"/"to" parameters');if(typeof e=="string"){if(!x(r))throw new Error('Invalid "to" parameter. Object/array expected');return Mt.call(this,r,e,n)}if(typeof r=="string"){if(!x(e))throw new Error('Invalid "from" parameter. Object/array expected');return _r.call(this,e,r,n)}throw new Error('Invalid "from"/"to" parameters')}get readyState(){let e=le.call(this);return e.close.state?"closed":e.open.state?"open":"connecting"}readyStateChange(e){if(!["open","messaging","close"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return le.call(this)[e].promise}_autoStart(){let e=T(this),r=ce(this);!e.get("internal_call")&&r.handshake===1&&this.start()}start(){let e=le.call(this);if(e.open.state)return;let r=T(this),n=ce(this),s=f=>{f&&(e.open.state=!0,e.open.resolve(this));let c=r.get("handshake_channel");setTimeout(()=>{c?.port1.close(),c?.port2.close(),r.delete("handshake_channel")},100)};if(r.get("remote.open.called")){s(!0);return}if(r.get("start.called"))return;if(r.set("start.called",!0),this._start?this._start():super.start?.(),n.handshake===0){s(!0);return}let i=new MessageChannel;r.set("handshake_channel",i),i.port1.onmessage=f=>{this instanceof BroadcastChannel&&n.clientServerMode==="server"&&typeof f.data?.id=="string"&&r.get("clients").add(f.data.id),f.data?.isOpen,s(!0)};let{wqOptions:a}=We.call(this),o=n.clientServerMode==="server"?"server":n.clientServerMode==="client"?r.get("client_id"):null,u={".wq":a,ping:"connect",id:o};this._postMessage?this._postMessage(u,{transfer:[i.port2]}):super.postMessage(u,{transfer:[i.port2]})}close(...e){let r=le.call(this);if(r.close.state)return;r.close.state=!0;let n=T(this),s=ce(this);if(s.handshake>0&&!n.get("remote.close.called")&&(this instanceof BroadcastChannel||this instanceof MessagePort)){let{wqOptions:i}=We.call(this),a=s.clientServerMode==="server"?"server":s.clientServerMode==="client"?n.get("client_id"):null,o={".wq":i,ping:"disconnect",id:a};this._postMessage?this._postMessage(o):super.postMessage(o)}this._close?this._close(...e):super.close(...e),r.close.resolve(this),on.call(this)}}}function Be(t){return class extends wr(t){static _hydrateMessage(e,r){if(typeof r.data?.[".wq"]?.numPorts!="number"||typeof r.data[".wq"].eventID!="string")return r;let n=he.call(e),s=r.data[".wq"].numPorts;Object.defineProperty(r,"ports",{value:[],configurable:!0});for(let i=0;i<s;i++){let a=e.channel(`${r.data[".wq"].eventID}:${i}`);r.ports.push(a)}return r}_postMessage(e,r={}){let{transfer:n=[],...s}=r;if(typeof e?.[".wq"]?.eventID=="string"){let i=he.call(this),a=n.filter(u=>u instanceof MessagePort),o=a.length;for(let u=0;u<o;u++)M.upgradeInPlace(a[u]),i.add(this.relay({channel:`${e[".wq"].eventID}:${u}`,to:a[u],bidirectional:!0})),a[u].start(),a[u].readyStateChange("close").then(()=>{let{wqOptions:f}=We.call(this),c={".wq":f,ping:"disconnect"};this.postMessage(c,{type:`${e[".wq"].eventID}:${u}:message`})});e[".wq"].numPorts=o}return this.__postMessage(e,s)}}}function sn(t){if(t.propagationStopped)return;let e=T(this);e.get("parentNode")instanceof EventTarget&&(t.bubbles||e.get("parentNode")?.findPort?.(n=>n===this)&&t instanceof Q)&&e.get("parentNode").dispatchEvent(t);let r=xr.call(this);if(r.size&&t instanceof Q){let{type:n,eventID:s,data:i,live:a,bubbles:o,ports:u}=t,f=new WeakSet;for(let{targetPort:c,types:l,channel:p,resolveMessage:h}of r){if(f.has(c))continue;let d=n;p.from&&([,d]=new RegExp(`^${p.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}:([^:]+)$`).exec(n)||[],!d)||!(typeof l=="function"?l(d,this,c,p):[].concat(l).find(b=>b===d||b==="*"))||(f.add(c),c.postMessage(h?h(i,this,c,p):i,{transfer:u,type:p.to?`${p.to}:${d}`:d,eventID:s,bubbles:o,live:a,forwarded:!0,relayedFrom:this}))}}}function he(){let t=T(this);return t.has("garbage_collection")||t.set("garbage_collection",new Set),t.get("garbage_collection")}function xr(){let t=T(this);return t.has("downstream_registry")||t.set("downstream_registry",new Set),t.get("downstream_registry")}function le(){let t=T(this);if(!t.has("readystate_registry")){let e=r=>(r.promise=new Promise((n,s)=>(r.resolve=n,r.reject=s)),r);t.set("readystate_registry",{open:e({}),messaging:e({}),close:e({})})}return t.get("readystate_registry")}function on(){let t=T(this);for(let e of t.get("garbage_collection")||[])e instanceof AbortController?e.abort():typeof e=="function"&&e();t.get("garbage_collection")?.clear(),t.get("downstream_registry")?.clear()}function We(t=void 0,e={}){if(Array.isArray(e))e={transfer:e};else if(!e||typeof e!="object")throw new TypeError("transferOrOptions must be an array or an object");let{type:r="message",eventID:n=null,live:s=!1,observing:i=!1,bubbles:a=!1,forwarded:o=!1,relayedFrom:u=null,signal:f=void 0,withArrayMethodDescriptors:c=!1,honourDoneMutationFlags:l=!1,...p}=e;return n||(n=`${r}-${(0|Math.random()*9e6).toString(36)}`),!i&&!o&&x(t)&&s&&!r?.endsWith(".mutate")&&(_r.call(this,t,n,{signal:f||void 0,withArrayMethodDescriptors:c,honourDoneMutationFlags:l}),i=!0),{portOptions:p,wqOptions:{type:r,eventID:n,live:s,observing:i,honourDoneMutationFlags:l,bubbles:a,forwarded:o,relayedFrom:u}}}function _r(t,e,{signal:r,withArrayMethodDescriptors:n=!0,honourDoneMutationFlags:s=!1}={}){if(!x(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let i=u=>{let f;n&&Array.isArray(u[0].target)&&!u[0].argumentsList&&!["set","defineProperty","deleteProperty"].includes(u[0].operation)||(this.postMessage(u.map(c=>(f=!f&&s&&c.detail?.done,{...c,target:void 0})),{type:`${e}.mutate`}),f&&a.abort())},a=S.observe(t,S.subtree(),i,{signal:r||void 0,withArrayMethodDescriptors:n});return he.call(this).add(a),a}function Mt(t,e,{signal:r,honourDoneMutationFlags:n=!1}={}){if(!x(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let s=o=>{if(!o.data?.length)return;let u;S.batch(t,()=>{for(let f of o.data){if(u=!u&&n&&f.detail?.done,f.argumentsList){let c=f.path.length?S.get(t,S.path(...f.path)):t;S.proxy(c)[f.operation](...f.argumentsList);continue}if(f.key!=="length"||["set","defineProperty","deleteProperty"].includes(f.operation)){let c=f.path.length===1?t:S.get(t,S.path(...f.path.slice(0,-1)));f.type==="delete"?S.deleteProperty(c,f.key):S.set(c,f.key,f.value)}}}),u&&i()};this.addEventListener(`${e}.mutate`,s,{signal:r||void 0});let i=()=>this.removeEventListener(`${e}.mutate`,s);return he.call(this).add(i),i}var Me=class extends Be(BroadcastChannel){constructor(e,{handshake:r=0,postAwaitsOpen:n=!1,clientServerMode:s=null,autoClose:i=!1}={}){super(e);let a=T(this);if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if(s&&!["server","client"].includes(s))throw new Error('clientServerMode must be "server" or "client"');a.set("options",{handshake:r,postAwaitsOpen:n,clientServerMode:s,autoClose:i}),this.constructor.upgradeEvents(this),r===0&&this.start()}__postMessage(e,r){BroadcastChannel.prototype.postMessage.call(this,e)}};var ze=class t extends EventTarget{get[Symbol.toStringTag](){return"LiveResponse"}static[Symbol.hasInstance](e){return e instanceof EventTarget&&e?.[Symbol.toStringTag]==="LiveResponse"&&typeof e.replaceWith=="function"&&typeof e.now=="function"}static get xHeaderName(){return"X-Message-Port"}static test(e){return e instanceof t?"LiveResponse":e instanceof Te?"LiveProgramHandle":e instanceof Response?"Response":vr(e)?"Generator":"Default"}static hasPort(e){return e instanceof t&&e.#p?!0:!!C(e).get("port")||!!e.headers?.get?.(this.xHeaderName)?.trim()}static getPort(e,{handshake:r=1}={}){if(e instanceof t&&e.#p)return e.#p;if(!(e instanceof Response||e instanceof t))return;let n=C(e);if(!n.has("port")){let s=e.headers.get(this.xHeaderName)?.trim();if(!s)return;let[,i,a]=/^(socket|channel):\/\/(.*)$/.exec(s)||[];if(!i||!a)throw new Error(`Unknown port messaging protocol: ${s}`);let o=i==="channel"?new Me(a,{handshake:r,postAwaitsOpen:!0,clientServerMode:"client"}):new ue(a,{handshake:r,postAwaitsOpen:!0});n.set("port",o)}return n.get("port")}static attachPort(e,r){if(r&&!(r instanceof M))throw new Error("Client must be a MessagePortPlus interface");if(e instanceof t){e.#p=r;return}C(e).set("port",r)}static from(e,...r){return e instanceof t?e.clone(...r):new this(e,...r)}#n;#e;#r=new AbortController;#t=new AbortController;constructor(e,...r){super(),this.#n=I.getInstance(this,!0);let n=a=>(a.promise=new Promise((o,u)=>(a.resolve=o,a.reject=u)),a);this.#e={live:n({}),done:n({})};let s=this.#e;(function a(){return s.now=n({}),s.now.refresh=a,s.now})();let i=this.#e.now;this.#a(i,e,...r).catch(a=>{i.reject(a)})}#s=null;get body(){return this.#s}#f=!1;get concurrent(){return this.#f}get bodyUsed(){return!0}#i=new Headers;get headers(){return this.#i}#u=200;get status(){return this.#u}#c="";get statusText(){return this.#c}#l="basic";get type(){return this.#l}#o=!1;get redirected(){return this.#o}#b=null;get url(){return this.#b}get ok(){return this.#u>=200&&this.#u<299}#p;get port(){return this.#p}get readyState(){return this.#e.done.state?"done":this.#e.live.state?"live":"waiting"}readyStateChange(e){if(!["live","now","done"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return this.#e[e].promise}disconnect(e=!1){this.#r.abort(),this.#r=new AbortController,e&&(this.#t.abort(),this.#t=new AbortController)}#h;#m(e){if(this.#e.done.state)throw new Error("Response already done.");return this.#h=e,e.then(r=>{this.#h===e&&(this.#h=null,this.#e.done.state=!0,this.#e.done.resolve(r))}).catch(r=>{this.#h===e&&(this.#h=null,this.#e.done.state=!0,this.#e.done.reject(r))}),e}async now(){return this.#e.now.promise}async replaceWith(e,...r){if(this.readyState==="done")throw new Error("Response already done.");this.disconnect(),await this.#a(null,e,...r)}async#a(e,r,...n){let s=e||this.#e.now.refresh();if(r instanceof Promise)return this.#m(new Promise((p,h)=>{this.#r.signal.addEventListener("abort",()=>{s.aborted=!0,p()}),r.then(async d=>{await this.#a(s,d,...n),p()}).catch(d=>h(d))}));let i=(p,h)=>{if(h=Object.freeze({...h,ok:h.status>=200&&h.status<299,bodyUsed:!0}),p?.aborted){p.resolve(h);return}let d=p||this.#e.now.refresh(),y=h.body;this.#u=h.status,this.#c=h.statusText;for(let[w]of[...this.#i.entries()])this.#i.delete(w);for(let[w,m]of h.headers.entries())this.#i.append(w,m);this.#l=h.type,this.#o=h.redirected,this.#b=h.url;let b=this.#s;this.#s=y,this.#f=!!h.concurrent,this.#p=h.port,this.#f||(this.#t.abort(),this.#t=new AbortController);let _=new A(this,{type:"set",key:"body",value:y,oldValue:b,isUpdate:!0,related:[],operation:"set",detail:null});this.#e.live.state=!0,this.#e.live.resolve(this),d.resolve(h),this.#n.emit([_]),this.dispatchEvent(new Tt(h))},a=(p,h,d)=>{i(p,{body:h,status:200,statusText:"",...d,headers:d.headers instanceof Headers?d.headers:new Headers(d.headers||{}),type:"basic",redirected:!1,url:null})},o=async(p,h,d)=>{let y,b,_=!0;if(h instanceof Response){if(h.bodyUsed)throw new Error("Response body already used");try{y=await z.prototype.any.call(h,{to:"json"})}catch{_=!1,y=await z.prototype.any.call(h)}b=this.constructor.getPort(h,{handshake:2})}else y=(await h.readyStateChange("live")).body,b=h.port;if(i(p,{body:y,status:h.status,statusText:h.statusText,headers:h.headers,concurrent:h.concurrent,...d,port:b,type:h.type,redirected:h.redirected,url:h.url}),h instanceof t){let w=()=>{a(null,h.body,h)};return h.addEventListener("replace",w,{signal:this.#r.signal}),await h.readyStateChange("done"),h.removeEventListener("replace",w),h}if(b){_&&y!==null&&b.projectMutations({from:"initial_response",to:y,signal:this.#t.signal});let w=new Promise(m=>{let P=E=>{let{body:q,...U}=E.data;a(null,q,{...U})};b.addEventListener("response.replace",P,{signal:this.#r.signal}),b.addEventListener("response.done",()=>{b.removeEventListener("response.replace",P),m(this)},{once:!0}),b.readyStateChange("close").then(m)});return b.start(),w}},u=async(p,h,d)=>{let y=await h.next(),b=await y.value;await this.#a(p,b,{done:y.done,...d});let _=y,w=b;for(;!_.done&&!this.#r.signal.aborted;)_=await h.next(),w=await _.value,this.#r.signal.aborted||await this.#a(null,w,{concurrent:d.concurrent,done:d.done===!1?!1:_.done})},f=async(p,h,d)=>(await this.#a(p,h.value,d),S.observe(h,"value",y=>this.#a(null,y.value,{concurrent:d.concurrent,done:!1}),{signal:this.#r.signal}),new Promise(()=>{})),c=typeof n[0]=="function"?n.shift():null,l=v(n[0])?{...n.shift()}:{};if("status"in l&&(l.status=parseInt(l.status),l.status<200||l.status>599))throw new Error(`The status provided (${l.status}) is outside the range [200, 599].`);if("statusText"in l&&(l.statusText=String(l.statusText)),l.headers&&!(l.headers instanceof Headers)&&(l.headers=new Headers(l.headers)),"concurrent"in l&&(l.concurrent=!!l.concurrent),r instanceof Response||r instanceof t){if(c)throw new Error("frameClosure is not supported for responses.");s.donePromise=o(s,r,l)}else if(vr(r)){if(c)throw new Error("frameClosure is not supported for generators.");s.donePromise=u(s,r,l)}else if(r instanceof Te){if(c)throw new Error("frameClosure is not supported for live program handles.");s.donePromise=f(s,r,l)}else if(s.donePromise=Promise.resolve(a(s,r,l)),c){let p=x(r)&&!At(r)?S.proxy(r,{chainable:!0,membrane:r}):r;s.donePromise=Promise.resolve(c.call(this,p,this.#t.signal))}return this.#m(l.done===!1?new Promise(()=>{}):s.donePromise),await new Promise((p,h)=>{this.#r.signal.addEventListener("abort",()=>p(!1)),s.donePromise.then(()=>p(!0)).catch(h)})}toResponse({port:e,signal:r}={}){if(e&&!(e instanceof M))throw new Error("Client must be a MessagePortPlus interface");let n=z.from(this.body,{status:this.#u,statusText:this.#c,headers:this.#i}),s=C(this);if(fe(n).set("meta",new Map(s)),!e)return n;x(this.#s)&&!At(this.#s)&&e.projectMutations({from:this.#s,to:"initial_response",signal:AbortSignal.any([this.#t.signal].concat(r||[]))});let i=()=>{let a=Object.fromEntries([...this.headers.entries()]);a?.["set-cookie"]&&(delete a["set-cookie"],console.warn('Warning: The "set-cookie" header is not supported for security reasons and has been removed from the response.')),e.postMessage({body:this.#s,status:this.#u,statusText:this.#c,headers:a,type:this.type,url:this.url,redirect:this.redirect,concurrent:this.#f},{type:"response.replace",live:!0,signal:AbortSignal.any([this.#t.signal].concat(r||[]))})};return this.addEventListener("replace",i,{signal:r||void 0}),this.readyStateChange("done").then(()=>{e.postMessage(null,{type:"response.done"})}),n}async*toGenerator({signal:e}={}){do yield this.body;while(await new Promise(r=>{this.addEventListener("replace",()=>r(!0),{once:!0,signal:e||void 0}),this.readyStateChange("done").then(()=>r(!1))}))}toLiveProgramHandle({signal:e}={}){let r=new Te,n=()=>S.defineProperty(r,"value",{value:this.body,enumerable:!1,configurable:!0});return this.addEventListener("replace",n,{signal:e||void 0}),n(),r}clone(e={}){let r=new this.constructor,n=C(this);return fe(r).set("meta",new Map(n)),r.replaceWith(this,e),r}},vr=t=>typeof t?.next=="function"&&typeof t?.throw=="function"&&typeof t?.return=="function",Tt=class extends Event{[Symbol.toStringTag]="ReplaceEvent";static[Symbol.hasInstance](e){return e instanceof Event&&e[Symbol.toStringTag]==="ReplaceEvent"}#n;get data(){return this.#n}constructor(e){super("replace"),this.#n=e}},Te=class{[Symbol.toStringTag]="LiveProgramHandle";static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="LiveProgramHandle"}abort(){}};globalThis.webqit||(globalThis.webqit={});Object.assign(globalThis.webqit,$t);})();
|
|
1
|
+
(()=>{var Pr=Object.defineProperty;var jt=(t,e)=>()=>(t&&(e=t(t=0)),e);var Me=(t,e)=>{for(var r in e)Pr(t,r,{get:e[r],enumerable:!0})};function Lt(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function tt(t,e=!1){let r=[],n=0;for(;n<t.length;){let s=t[n],o=g(function(a){if(!e)throw new TypeError(a);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})},"ErrorOrInvalid");if(s==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(s==="+"||s==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(s==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(s==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(s==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(s===":"){let a="",i=n+1;for(;i<t.length;){let u=t.substr(i,1);if(i===n+1&&jr.test(u)||i!==n+1&&Rr.test(u)){a+=t[i++];continue}break}if(!a){o(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:a}),n=i;continue}if(s==="("){let a=1,i="",u=n+1,f=!1;if(t[u]==="?"){o(`Pattern cannot start with "?" at ${u}`);continue}for(;u<t.length;){if(!Lt(t[u],!1)){o(`Invalid character '${t[u]}' at ${u}.`),f=!0;break}if(t[u]==="\\"){i+=t[u++]+t[u++];continue}if(t[u]===")"){if(a--,a===0){u++;break}}else if(t[u]==="("&&(a++,t[u+1]!=="?")){o(`Capturing groups are not allowed at ${u}`),f=!0;break}i+=t[u++]}if(f)continue;if(a){o(`Unbalanced pattern at ${n}`);continue}if(!i){o(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:i}),n=u;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function rt(t,e={}){let r=tt(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${M(e.delimiter)}]+?`,s=[],o=0,a=0,i="",u=new Set,f=g(d=>{if(a<r.length&&r[a].type===d)return r[a++].value},"tryConsume"),c=g(()=>f("OTHER_MODIFIER")??f("ASTERISK"),"tryConsumeModifier"),l=g(d=>{let P=f(d);if(P!==void 0)return P;let{type:E,index:q}=r[a];throw new TypeError(`Unexpected ${E} at ${q}, expected ${d}`)},"mustConsume"),p=g(()=>{let d="",P;for(;P=f("CHAR")??f("ESCAPED_CHAR");)d+=P;return d},"consumeText"),h=g(d=>d,"DefaultEncodePart"),m=e.encodePart||h,y="",b=g(d=>{y+=d},"appendToPendingFixedValue"),_=g(()=>{y.length&&(s.push(new we(3,"","",m(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),w=g((d,P,E,q,U)=>{let L=3;switch(U){case"?":L=1;break;case"*":L=0;break;case"+":L=2;break}if(!P&&!E&&L===3){b(d);return}if(_(),!P&&!E){if(!d)return;s.push(new we(3,"","",m(d),"",L));return}let j;E?E==="*"?j=Ze:j=E:j=n;let _e=2;j===n?(_e=1,j=""):j===Ze&&(_e=0,j="");let Z;if(P?Z=P:E&&(Z=o++),u.has(Z))throw new TypeError(`Duplicate name '${Z}'.`);u.add(Z),s.push(new we(_e,Z,m(d),j,m(q),L))},"addPart");for(;a<r.length;){let d=f("CHAR"),P=f("NAME"),E=f("REGEX");if(!P&&!E&&(E=f("ASTERISK")),P||E){let U=d??"";e.prefixes.indexOf(U)===-1&&(b(U),U=""),_();let L=c();w(U,P,E,"",L);continue}let q=d??f("ESCAPED_CHAR");if(q){b(q);continue}if(f("OPEN")){let U=p(),L=f("NAME"),j=f("REGEX");!L&&!j&&(j=f("ASTERISK"));let _e=p();l("CLOSE");let Z=c();w(U,L,j,_e,Z);continue}_(),l("END")}return s}function M(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function Ye(t){return t&&t.ignoreCase?"ui":"u"}function Dt(t,e,r){return nt(rt(t,r),e,r)}function re(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function nt(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let i of t){if(i.type===3){i.modifier===3?n+=M(i.value):n+=`(?:${M(i.value)})${re(i.modifier)}`;continue}e&&e.push(i.name);let u=`[^${M(r.delimiter)}]+?`,f=i.value;if(i.type===1?f=u:i.type===0&&(f=Ze),!i.prefix.length&&!i.suffix.length){i.modifier===3||i.modifier===1?n+=`(${f})${re(i.modifier)}`:n+=`((?:${f})${re(i.modifier)})`;continue}if(i.modifier===3||i.modifier===1){n+=`(?:${M(i.prefix)}(${f})${M(i.suffix)})`,n+=re(i.modifier);continue}n+=`(?:${M(i.prefix)}`,n+=`((?:${f})(?:`,n+=M(i.suffix),n+=M(i.prefix),n+=`(?:${f}))*)${M(i.suffix)})`,i.modifier===0&&(n+="?")}let s=`[${M(r.endsWith)}]|$`,o=`[${M(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${o}?`),r.endsWith.length?n+=`(?=${s})`:n+="$",new RegExp(n,Ye(r));r.strict||(n+=`(?:${o}(?=${s}))?`);let a=!1;if(t.length){let i=t[t.length-1];i.type===3&&i.modifier===3&&(a=r.delimiter.indexOf(i)>-1)}return a||(n+=`(?=${o}|${s})`),new RegExp(n,Ye(r))}function kt(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function st(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function qt(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function it(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}function ot(t){if(!t)return!0;for(let e of Ut)if(t.test(e))return!0;return!1}function Nt(t,e){if(t=st(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 Ft(t,e){if(t=st(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 zt(t,e){return e||t===""?t:it(t)?ut(t):ft(t)}function Ht(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function Bt(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function Wt(t,e,r){if(r||t==="")return t;if(e&&!Ut.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 Vt(t,e,r){return at(e)===t&&(t=""),r||t===""?t:ct(t)}function Gt(t,e){return t=qt(t,":"),e||t===""?t:Le(t)}function at(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function Le(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function Jt(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function Kt(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function ft(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 ut(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function ct(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function Xt(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 Qt(t){return t===""?t:new URL(`data:${t}`).pathname}function Zt(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function Yt(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}function et(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 N(t,e){return e?be(t):t}function ye(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=N(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=N(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=N(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=N(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=N(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=N(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=N(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=N(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=Gt(e.protocol,r)),typeof e.username=="string"&&(t.username=Bt(e.username,r)),typeof e.password=="string"&&(t.password=Ht(e.password,r)),typeof e.hostname=="string"&&(t.hostname=zt(e.hostname,r)),typeof e.port=="string"&&(t.port=Vt(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!kt(t.pathname,r)){let s=n.pathname.lastIndexOf("/");s>=0&&(t.pathname=N(n.pathname.substring(0,s+1),r)+t.pathname)}t.pathname=Wt(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=Ft(e.search,r)),typeof e.hash=="string"&&(t.hash=Nt(e.hash,r)),t}function be(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function tr(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function rr(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${tr(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let a=0;a<t.length;++a){let i=t[a];if(i.type===3){if(i.modifier===3){o+=be(i.value);continue}o+=`{${be(i.value)}}${re(i.modifier)}`;continue}let u=i.hasCustomName(),f=!!i.suffix.length||!!i.prefix.length&&(i.prefix.length!==1||!e.prefixes.includes(i.prefix)),c=a>0?t[a-1]:null,l=a<t.length-1?t[a+1]:null;if(!f&&u&&i.type===1&&i.modifier===3&&l&&!l.prefix.length&&!l.suffix.length)if(l.type===3){let p=l.value.length>0?l.value[0]:"";f=s.test(p)}else f=!l.hasCustomName();if(!f&&!i.prefix.length&&c&&c.type===3){let p=c.value[c.value.length-1];f=e.prefixes.includes(p)}f&&(o+="{"),o+=be(i.prefix),u&&(o+=`:${i.name}`),i.type===2?o+=`(${i.value})`:i.type===1?u||(o+=`(${n})`):i.type===0&&(!u&&(!c||c.type===3||c.modifier!==3||f||i.prefix!=="")?o+="*":o+=`(${r})`),i.type===1&&u&&i.suffix.length&&s.test(i.suffix[0])&&(o+="\\"),o+=be(i.suffix),f&&(o+="}"),i.modifier!==3&&(o+=re(i.modifier))}return o}var Mr,g,we,jr,Rr,Ze,ee,Ir,Lr,Ut,er,Qe,Y,De,nr=jt(()=>{Mr=Object.defineProperty,g=(t,e)=>Mr(t,"name",{value:e,configurable:!0}),we=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,s,o){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=s,this.modifier=o}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};g(we,"Part");jr=/[$_\p{ID_Start}]/u,Rr=/[$_\u200C\u200D\p{ID_Continue}]/u,Ze=".*";g(Lt,"isASCII");g(tt,"lexer");g(rt,"parse");g(M,"escapeString");g(Ye,"flags");g(Dt,"stringToRegexp");g(re,"modifierToString");g(nt,"partsToRegexp");ee={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Ir={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Lr={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};g(kt,"isAbsolutePathname");g(st,"maybeStripPrefix");g(qt,"maybeStripSuffix");g(it,"treatAsIPv6Hostname");Ut=["ftp","file","http","https","ws","wss"];g(ot,"isSpecialScheme");g(Nt,"canonicalizeHash");g(Ft,"canonicalizeSearch");g(zt,"canonicalizeHostname");g(Ht,"canonicalizePassword");g(Bt,"canonicalizeUsername");g(Wt,"canonicalizePathname");g(Vt,"canonicalizePort");g(Gt,"canonicalizeProtocol");g(at,"defaultPortForProtocol");g(Le,"protocolEncodeCallback");g(Jt,"usernameEncodeCallback");g(Kt,"passwordEncodeCallback");g(ft,"hostnameEncodeCallback");g(ut,"ipv6HostnameEncodeCallback");g(ct,"portEncodeCallback");g(Xt,"standardURLPathnameEncodeCallback");g(Qt,"pathURLPathnameEncodeCallback");g(Zt,"searchEncodeCallback");g(Yt,"hashEncodeCallback");er=class{#n;#e=[];#r={};#t=0;#s=1;#f=0;#o=0;#u=0;#c=0;#l=!1;constructor(t){this.#n=t}get result(){return this.#r}parse(){for(this.#e=tt(this.#n,!0);this.#t<this.#e.length;this.#t+=this.#s){if(this.#s=1,this.#e[this.#t].type==="END"){if(this.#o===0){this.#p(),this.#g()?this.#i(9,1):this.#y()?this.#i(8,1):this.#i(7,0);continue}else if(this.#o===2){this.#h(5);continue}this.#i(10,0);break}if(this.#u>0)if(this.#O())this.#u-=1;else continue;if(this.#S()){this.#u+=1;continue}switch(this.#o){case 0:this.#_()&&this.#h(1);break;case 1:if(this.#_()){this.#T();let t=7,e=1;this.#v()?(t=2,e=3):this.#l&&(t=2),this.#i(t,e)}break;case 2:this.#w()?this.#h(3):(this.#x()||this.#y()||this.#g())&&this.#h(5);break;case 3:this.#P()?this.#i(4,1):this.#w()&&this.#i(5,1);break;case 4:this.#w()&&this.#i(5,1);break;case 5:this.#A()?this.#c+=1:this.#C()&&(this.#c-=1),this.#E()&&!this.#c?this.#i(6,1):this.#x()?this.#i(7,0):this.#y()?this.#i(8,1):this.#g()&&this.#i(9,1);break;case 6:this.#x()?this.#i(7,0):this.#y()?this.#i(8,1):this.#g()&&this.#i(9,1);break;case 7:this.#y()?this.#i(8,1):this.#g()&&this.#i(9,1);break;case 8:this.#g()&&this.#i(9,1);break;case 9:break;case 10:break}}this.#r.hostname!==void 0&&this.#r.port===void 0&&(this.#r.port="")}#i(t,e){switch(this.#o){case 0:break;case 1:this.#r.protocol=this.#m();break;case 2:break;case 3:this.#r.username=this.#m();break;case 4:this.#r.password=this.#m();break;case 5:this.#r.hostname=this.#m();break;case 6:this.#r.port=this.#m();break;case 7:this.#r.pathname=this.#m();break;case 8:this.#r.search=this.#m();break;case 9:this.#r.hash=this.#m();break;case 10:break}this.#o!==0&&t!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(t)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(t)&&(this.#r.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#o)&&t===9&&(this.#r.search??="")),this.#b(t,e)}#b(t,e){this.#o=t,this.#f=this.#t+e,this.#t+=e,this.#s=0}#p(){this.#t=this.#f,this.#s=0}#h(t){this.#p(),this.#o=t}#d(t){return t<0&&(t=this.#e.length-t),t<this.#e.length?this.#e[t]:this.#e[this.#e.length-1]}#a(t,e){let r=this.#d(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#_(){return this.#a(this.#t,":")}#v(){return this.#a(this.#t+1,"/")&&this.#a(this.#t+2,"/")}#w(){return this.#a(this.#t,"@")}#P(){return this.#a(this.#t,":")}#E(){return this.#a(this.#t,":")}#x(){return this.#a(this.#t,"/")}#y(){if(this.#a(this.#t,"?"))return!0;if(this.#e[this.#t].value!=="?")return!1;let t=this.#d(this.#t-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#g(){return this.#a(this.#t,"#")}#S(){return this.#e[this.#t].type=="OPEN"}#O(){return this.#e[this.#t].type=="CLOSE"}#A(){return this.#a(this.#t,"[")}#C(){return this.#a(this.#t,"]")}#m(){let t=this.#e[this.#t],e=this.#d(this.#f).index;return this.#n.substring(e,t.index)}#T(){let t={};Object.assign(t,ee),t.encodePart=Le;let e=Dt(this.#m(),void 0,t);this.#l=ot(e)}};g(er,"Parser");Qe=["protocol","username","password","hostname","port","pathname","search","hash"],Y="*";g(et,"extractValues");g(N,"processBaseURLString");g(ye,"applyInit");g(be,"escapePatternString");g(tr,"escapeRegexpString");g(rr,"partsToPattern");De=class{#n;#e={};#r={};#t={};#s={};#f=!1;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let i=new er(t);if(i.parse(),t=i.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let s={ignoreCase:r.ignoreCase===!0},o={pathname:Y,protocol:Y,username:Y,password:Y,hostname:Y,port:Y,search:Y,hash:Y};this.#n=ye(o,t,!0),at(this.#n.protocol)===this.#n.port&&(this.#n.port="");let a;for(a of Qe){if(!(a in this.#n))continue;let i={},u=this.#n[a];switch(this.#r[a]=[],a){case"protocol":Object.assign(i,ee),i.encodePart=Le;break;case"username":Object.assign(i,ee),i.encodePart=Jt;break;case"password":Object.assign(i,ee),i.encodePart=Kt;break;case"hostname":Object.assign(i,Ir),it(u)?i.encodePart=ut:i.encodePart=ft;break;case"port":Object.assign(i,ee),i.encodePart=ct;break;case"pathname":ot(this.#e.protocol)?(Object.assign(i,Lr,s),i.encodePart=Xt):(Object.assign(i,ee,s),i.encodePart=Qt);break;case"search":Object.assign(i,ee,s),i.encodePart=Zt;break;case"hash":Object.assign(i,ee,s),i.encodePart=Yt;break}try{this.#s[a]=rt(u,i),this.#e[a]=nt(this.#s[a],this.#r[a],i),this.#t[a]=rr(this.#s[a],i),this.#f=this.#f||this.#s[a].some(f=>f.type===2)}catch{throw new TypeError(`invalid ${a} pattern '${this.#n[a]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return!1}let n;for(n of Qe)if(!this.#e[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=ye(r,t,!1):r=ye(r,et(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let s;for(s of Qe){let o=this.#e[s].exec(r[s]);if(!o)return null;let a={};for(let[i,u]of this.#r[s].entries())if(typeof u=="string"||typeof u=="number"){let f=o[i+1];a[u]=f}n[s]={input:r[s]??"",groups:a}}return n}static compareComponent(t,e,r){let n=g((i,u)=>{for(let f of["type","modifier","prefix","value","suffix"]){if(i[f]<u[f])return-1;if(i[f]!==u[f])return 1}return 0},"comparePart"),s=new we(3,"","","","",3),o=new we(0,"","","","",3),a=g((i,u)=>{let f=0;for(;f<Math.min(i.length,u.length);++f){let c=n(i[f],u[f]);if(c)return c}return i.length===u.length?0:n(i[f]??s,u[f]??s)},"comparePartList");return!e.#t[t]&&!r.#t[t]?0:e.#t[t]&&!r.#t[t]?a(e.#s[t],[o]):!e.#t[t]&&r.#t[t]?a([o],r.#s[t]):a(e.#s[t],r.#s[t])}get protocol(){return this.#t.protocol}get username(){return this.#t.username}get password(){return this.#t.password}get hostname(){return this.#t.hostname}get port(){return this.#t.port}get pathname(){return this.#t.pathname}get search(){return this.#t.search}get hash(){return this.#t.hash}get hasRegExpGroups(){return this.#f}};g(De,"URLPattern")});var sr={};Me(sr,{URLPattern:()=>De});var ir=jt(()=>{nr();globalThis.URLPattern||(globalThis.URLPattern=De)});var Mt={};Me(Mt,{FormDataPlus:()=>H,HeadersPlus:()=>B,LiveResponse:()=>We,Observer:()=>cr,RequestPlus:()=>ze,ResponsePlus:()=>W,fetchPlus:()=>dr});function v(t){return!Array.isArray(t)&&typeof t=="object"&&t}function pe(t){return typeof t}function R(t){return Array.isArray(t)}function je(t){return t===!0||t===!1}function me(t){return typeof t=="function"}function Ve(t){return t===null||t===""}function te(t){return arguments.length&&(t===void 0||typeof t>"u")}function x(t){return Array.isArray(t)||typeof t=="object"&&t||me(t)}function Ge(t){return Ve(t)||te(t)||t===!1||t===0||x(t)&&!Object.keys(t).length}function V(t){return me(t)||t&&{}.toString.call(t)==="[object function]"}function de(t){return t instanceof Number||typeof t=="number"}function G(t){return de(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Je(t){return R(t)&&Object.getPrototypeOf(t)===Array.prototype}function Ke(t){return v(t)&&Object.getPrototypeOf(t)===Object.prototype}function J(t){return t instanceof String||typeof t=="string"&&t!==null}function Xe(t){return!J(t)&&!te(t.length)}function D(t,...e){if(!t||!["object","function"].includes(typeof t))throw new Error("Argument #1 must be of type object");let r=t[Symbol.for("wq")];if(r||(r=new Re,Object.defineProperty(t,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!e.length)return r;let n,s;for(;n=e.shift();)(s=r)&&!(r=r.get(n))&&(r=new Re,s.set(n,r));return r}var Re=class extends Map{};function ge(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 Ie(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)}(async()=>typeof URLPattern>"u"&&await Promise.resolve().then(()=>(ir(),sr)))();var lt=class extends URLPattern{#n;constructor(e,r=null){typeof e=="object"&&e?.baseURL&&({baseURL:r,...e}=e),super(e,r),this.#n=new URL(e,r)}isPattern(){let e=(s,o)=>{if(!s)return!1;let a=!1;for(let i of s){if(a){a=!1;continue}if(i==="\\"){a=!0;continue}if(o.has(i))return!0}return!1},r={protocol:new Set(["*"]),username:new Set(["*"]),password:new Set(["*"]),hostname:new Set(["*","{"]),port:new Set(["*","{"]),pathname:new Set(["*",":","{","("]),search:new Set(["*","{"]),hash:new Set(["*","{"])},n=this.#n;return e(n.protocol,r.protocol)||e(n.username,r.username)||e(n.password,r.password)||e(n.hostname,r.hostname)||e(n.port,r.port)||e(n.pathname,r.pathname)||e(n.search,r.search)||e(n.hash,r.hash)}exec(...e){let r=super.exec(...e);if(!r)return;let n={};for(let a of Object.values(r))a?.groups&&Object.assign(n,a.groups);let s={named:n};return{...r,vars:s,render:a=>a.replace(/\$(\$|[A-Z0-9_]+)/gi,(i,u)=>u==="$"?"$":s.named[u]??"")}}};var Ot={};Me(Ot,{any:()=>Kr,apply:()=>xt,batch:()=>St,construct:()=>wt,defineProperties:()=>Yr,defineProperty:()=>Se,deleteProperties:()=>en,deleteProperty:()=>Oe,get:()=>X,getOwnPropertyDescriptor:()=>qe,getOwnPropertyDescriptors:()=>Qr,getPrototypeOf:()=>gt,has:()=>Ue,intercept:()=>Xr,isExtensible:()=>yt,map:()=>Zr,observe:()=>Et,ownKeys:()=>bt,path:()=>Gr,preventExtensions:()=>vt,reduce:()=>Pt,set:()=>ie,setPrototypeOf:()=>_t,subtree:()=>Jr});function F(t,e=!0){return R(t)?t:!e&&v(t)?[t]:t!==!1&&t!==0&&Ge(t)?[]:Xe(t)?Array.prototype.slice.call(t):v(t)?Object.values(t):[t]}var O=(t,...e)=>D(t,"observerAPI",...e),xe=(t,e)=>t instanceof Promise?t.then(e):e(t),ke={};var ne=class{constructor(e,r){this.registry=e,Object.assign(this,{...r,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var ve=class extends ne{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ke.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(e){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let r=e,n=this.filter;if(n!==1/0&&(n=F(n,!1))&&(r=e.filter(o=>n.includes(o.key))),this.params.diff&&(r=r.filter(o=>o.type!=="set"||o.value!==o.oldValue)),!r.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...r);return}this.emit.recursionTarget=this.params.recursions==="inject"?r:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(r,this):this.emit(r[0],this);return xe(s,o=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):o})}};var se=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(r=>r!==e)}static _getInstance(e,r,n=!0,s=this.__namespace){if(!x(r))throw new Error(`Subject must be of type object; "${pe(r)}" given!`);let o=this;return s&&O(globalThis,"observerAPI","namespaces").has(e+"-"+s)&&(o=O(globalThis,"observerAPI","namespaces").get(e+"-"+s),e+="-"+s),!O(r,"registry").has(e)&&n&&O(r,"registry").set(e,new o(r)),O(r,"registry").get(e)}static _namespace(e,r,n=null){if(e+="-"+r,arguments.length===2)return O(globalThis,"observerAPI","namespaces").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}.`);O(globalThis,"observerAPI","namespaces").set(e,n),n.__namespace=r}};var A=class{constructor(e,r){if(this.target=e,!r.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,r)}get[Symbol.toStringTag](){return"Descriptor"}static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="Descriptor"&&e.operation}};var I=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("listeners",...arguments)}static namespace(e,r=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,r,n){return super.addRegistration(new ve(this,{filter:e,emit:r,params:n}))}emit(e,{eventsArePropertyDescriptors:r=!1,eventIsArrayMethodDescriptor:n=!1}={}){if(this.batches.length){let s=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...e],arrayMethodName:s,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n});return}this.$emit(this.entries,[{events:e,eventsArePropertyDescriptors:r,eventIsArrayMethodDescriptor:n}])}$emit(e,r){let n=0,s=0,o=0;for(let c of e)n+=1,c.params.withPropertyDescriptors&&(s+=1),c.params.withArrayMethodDescriptors&&(o+=1);let a=[],i=[],u=[],f=[];for(let c of r){let l=c.arrayMethodName,p=c.eventsArePropertyDescriptors,h=c.eventIsArrayMethodDescriptor;for(let m of c.events)if(l&&(m.operation=l),s&&(o&&a.push(m),h||o!==n&&i.push(m)),s!==n){let y=m;if(p){let{target:b,type:_,...w}=m;y=new A(b,{type:"set",...w}),Object.defineProperty(y,"value","get"in w.value?{get:()=>w.value.get()}:{value:w.value.value}),w.oldValue&&Object.defineProperty(y,"oldValue","get"in w.oldValue?{get:()=>w.oldValue.get()}:{value:w.oldValue.value})}o&&u.push(y),h||o!==n&&f.push(y)}}for(let c of e)c.params.withPropertyDescriptors?c.params.withArrayMethodDescriptors?a.length&&c.fire(a):i.length&&c.fire(i):c.params.withArrayMethodDescriptors?u.length&&c.fire(u):f.length&&c.fire(f)}batch(e,r={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:r});let n=e();return xe(n,s=>{let o=this.batches.shift();return o.snapshots.length&&this.$emit(o.entries,o.snapshots),s})}};var Pe=class extends ne{exec(e,r,n){return this.running||!this.traps[e.operation]?r(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.operation](e,n,(...s)=>(this.running=!1,r(...s))))}};var K=class extends se{static getInstance(e,r=!0,n=null){return super._getInstance("traps",...arguments)}static namespace(e,r=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new Pe(this,e))}emit(e,r=null){let n=this;return function s(o,...a){let i=n.entries[o];return i?i.exec(e,(...u)=>s(o+1,...u),...a):r?r(e,...a):a[0]}(0)}};var dt={};Me(dt,{accessorize:()=>Wr,proxy:()=>pt,unaccessorize:()=>Vr,unproxy:()=>Ee});var fr=Symbol("wqOriginal");function Wr(t,e,r={}){t=mt(t);let n=O(t,"accessorizedProps");function s(u){let f,c=t;do f=Object.getOwnPropertyDescriptor(c,u);while(!f&&(c=Object.getPrototypeOf(c)));return f?{proto:c,descriptor:f}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function o(u){if(n.has(u+""))return!0;let f=s(u);f.getValue=function(p=!1){return p?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},f.setValue=function(p,h=!1){if(this.dirty=!0,h){this.descriptor=p;return}return this.descriptor.set?this.descriptor.set(p)!==!1:(this.descriptor.value=p,!0)},f.intact=function(){let p=Object.getOwnPropertyDescriptor(t,u);return p?.get===l.get&&p?.set===l.set&&n.get(u+"")===this},f.restore=function(){return this.intact()?(this.proto&&this.proto!==t||!this.proto&&!this.dirty?delete t[u]:Object.defineProperty(t,u,this.descriptor),n.delete(u+""),!0):!1},n.set(isNaN(u)?u:parseInt(u),f);let{enumerable:c=!0}=f.descriptor,l={enumerable:c,configurable:!0};("value"in f.descriptor||f.descriptor.set)&&(l.set=function(p){return ie(this,u,p,r)}),("value"in f.descriptor||f.descriptor.get)&&(l.get=function(){return X(this,u,r)});try{return Object.defineProperty(t,u,l),!0}catch{return n.delete(u+""),!1}}let i=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(o);return e===void 0||Array.isArray(e)?i:i[0]}function Vr(t,e,r={}){t=mt(t);let n=O(t,"accessorizedProps");function s(i){return n.has(i+"")?n.get(i+"").restore():!0}let a=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(s);return e===void 0||Array.isArray(e)?a:a[0]}function pt(t,e={},r=void 0){let n=mt(t);if(typeof e.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(e.membrane&&O(n,"membraneRef").has(e.membrane))return O(n,"membraneRef").get(e.membrane);let s={apply:(i,u,f)=>xt(i,u,f,void 0,e),construct:(i,u,f=null)=>wt(i,u,f,e),defineProperty:(i,u,f)=>Se(i,u,f,e),deleteProperty:(i,u)=>Oe(i,u,e),get:(i,u,f=null)=>{if(u===fr)return n;let c={...e,receiver:f},l=X(i,u,c);return Array.isArray(i)&&typeof l=="function"&&!/^class\s?/.test(Function.prototype.toString.call(l))?pt(l,{...e,arrayMethodName:u,membrane:f},r):e.chainable&&x(l)&&u!=="prototype"&&!(typeof l=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(l)))?pt(l,e,r):l},getOwnPropertyDescriptor:(i,u)=>qe(i,u,e),getPrototypeOf:i=>gt(i,e),has:(i,u)=>Ue(i,u,e),isExtensible:i=>yt(i,e),ownKeys:i=>bt(i,e),preventExtensions:i=>vt(i,e),set:(i,u,f,c=null)=>ie(i,u,f,{...e,receiver:c}),setPrototypeOf:(i,u)=>_t(i,u,e)},o=r?.(s)||s,a=new Proxy(n,o);return e.membrane&&O(n,"membraneRef").set(e.membrane,a),a}function Ee(t){return t&&t[fr]||t}function mt(t){if(!t||!x(t))throw new Error("Target must be of type object!");return Ee(t)}var Ae=class extends Array{get[Symbol.toStringTag](){return"Path"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Path"}};function Gr(...t){return new Ae(...t)}var oe=class extends Array{get[Symbol.toStringTag](){return"Subtree"}static[Symbol.hasInstance](e){return Array.isArray(e)&&e[Symbol.toStringTag]==="Subtree"}};function Jr(){return new oe}function Kr(){return 1/0}function Pt(t,e,r,n=o=>o,s={}){let o=e instanceof oe;if(!(!o&&!e?.length))return function a(i,u,f,c){let l=c||u[f.level]instanceof oe,p=l?1/0:u[f.level],h=l?!1:f.level===u.length-1;return i instanceof A&&i.operation!=="get"?f={...f,probe:"always"}:f.probe!=="always"&&(f={...f,probe:!h}),r(i,p,(m,...y)=>{let b=d=>{d instanceof A&&(d.path="key"in d?[d.key]:[],i instanceof A&&(d.path="key"in d?i.path.concat(d.key):i.path.slice(0),Object.defineProperty(d,"context",{get:()=>i,configurable:!0})))},_=y[0]||{},w=d=>{if(d instanceof A&&"argumentsList"in d)return;let P=z(d,!1);return xe(P,E=>(d instanceof A?d.value=E:d=E,a(d,u,{...f,..._,keyInParent:d.key,level:f.level+1},l)))};if(Ce(p)&&Array.isArray(m)){if(m.forEach(b),h)return n(m,...y);l&&m[0]instanceof A&&(m[0].operation!=="get"||s.asGet)&&n(m,...y);for(let d of m)w(d);return}return b(m),h?n(m,...y):w(m)},f)}(t,e.slice(0),{...s,level:0},o)}function Et(t,e,r,n={}){let s=z(t,!n.level);if(V(arguments[1])&&([,r,n={}]=arguments,e=1/0),!V(r))throw new Error(`Handler must be a function; "${pe(r)}" given!`);if(e instanceof Ae||e instanceof oe)return Pt(s,e,Et,r,n);if(n={...n,descripted:!0},delete n.live,!x(s))return n.probe&&X(s,e,r,n)||void 0;let o=ur(s,e,r,n);return n.probe?X(s,e,o,n):o()}function Xr(t,e,r={}){let n=z(t);return v(e)||([,,,r={}]=arguments,e={[arguments[1]]:arguments[2]}),K.getInstance(n,!0,r.namespace).addRegistration({traps:e,params:r})}function qe(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptor",{key:e},r,n)}function Qr(t,e,r=s=>s,n={}){return k(t,"getOwnPropertyDescriptors",{key:e},r,n)}function gt(t,e=n=>n,r={}){return k(t,"getPrototypeOf",{},e,r)}function yt(t,e=n=>n,r={}){return k(t,"isExtensible",{},e,r)}function bt(t,e=n=>n,r={}){return k(t,"ownKeys",{},e,r)}function Ue(t,e,r=s=>s,n={}){return k(t,"has",{key:e},r,n)}function X(t,e,r=s=>s,n={}){let s,o=z(t,!n.level);return v(r)?[n,r]=[r,a=>a]:n.live&&(s=!0),e instanceof Ae||e instanceof oe?Pt(o,e,X,r,{...n,asGet:!0}):tn(o,e,a=>{let i=[...a];return function u(f,c,l){if(!c.length)return l(f);let p=c.shift();if(!["string","number","symbol"].includes(typeof p))throw new Error(`Property name/key ${p} invalid.`);function h(b,_=void 0){let w=E=>(b.value=E,u([...f,n.live||n.descripted?b:E],c,l));if(arguments.length>1)return w(_);if(!x(o))return w(o?.[b.key]);let d=O(o,"accessorizedProps",!1),P=d&&d.get(b.key);if(P&&P.intact())return w(P.getValue(n.withPropertyDescriptors));if(n.withPropertyDescriptors){let E=Object.getOwnPropertyDescriptor(o,b.key);return w(E)}return w(Reflect.get(o,b.key))}let m=new A(o,{type:"get",key:p,value:void 0,operation:"get",related:i});if(!x(o))return h(m);let y=K.getInstance(o,!1,n.namespace);return y?y.emit(m,h):h(m)}([],a.slice(0),u=>{let f=Ce(e)?u:u[0];return s&&x(o)?ur(o,e,r,n,t.key)(f):r(f)})},n)}function St(t,e,r={}){let n=z(t);return I.getInstance(n,!0,r.namespace).batch(e,r)}function Zr(t,e,r={}){e=z(e),t=z(t);let n=(r.only||[]).slice(0),s=(r.except||[]).slice(0),o=Object.keys(r.spread?[...t]:t).map(f=>isNaN(f)?f:parseInt(f)),a=n.length?n.filter(f=>o.includes(f)):o.filter(f=>!s.includes(f)),i=f=>!Array.isArray(e)||isNaN(f)?f:f-s.filter(c=>c<f).length,u=f=>{let c=qe(t,f,r);"value"in c&&c.writable&&c.enumerable&&c.configurable?ie(e,i(f),c.value,r):(c.enumerable||r.onlyEnumerable===!1)&&Se(e,f,{...c,configurable:!0},r)};return St(e,()=>{a.forEach(u)}),Et(t,f=>{f.filter(c=>n.length?n.includes(c.key):!s.includes(c.key)).forEach(c=>{if(c.type==="delete")return Oe(e,i(c.key),r);if(c.type==="def"){(c.value.enumerable||r.onlyEnumerable===!1)&&Se(e,i(c.key),{...c.value,configurable:!0},r);return}u(c.key)})},{...r,withPropertyDescriptors:!0})}function ie(t,e,r,n=a=>a,s={},o=!1){let a=z(t),i=[[e,r]];v(e)&&([,,n=f=>f,s={},o=!1]=arguments,i=Object.entries(e)),v(n)&&([o,s,n]=[typeof s=="boolean"?s:o,n,f=>f]);let u=i.map(([f])=>f);return function f(c,l,p){if(!l.length)return p(c);let[h,m]=l.shift();function y(_,w=void 0){let d=q=>(_.status=q,f(c.concat(_),l,p));if(arguments.length>1)return d(_,w);let P=O(a,"accessorizedProps",!1),E=P&&P.get(_.key);return _.type==="def"?(E&&!E.restore()&&d(!1),Object.defineProperty(a,_.key,_.value),d(!0)):E&&E.intact()?d(E.setValue(_.value)):d(Reflect.set(a,_.key,_.value))}function b(_,w){if(s.diff&&m===w)return f(c,l,p);let d=new A(a,{type:o?"def":"set",key:h,value:m,isUpdate:_,oldValue:w,related:[...u],operation:o?"defineProperty":"set",detail:s.detail}),P=K.getInstance(a,!1,s.namespace);return P?P.emit(d,y):y(d)}return Ue(a,h,_=>{if(!_)return b(_);if(h==="length"&&Array.isArray(a)&&O(a).has("$length"))return b(!0,O(a).get("$length"));let w={...s,withPropertyDescriptors:o};return X(a,h,d=>b(_,d),w)},s)}([],i.slice(0),f=>{let c=I.getInstance(a,!1,s.namespace);return c&&c.emit(f,{eventsArePropertyDescriptors:!!o}),n(Ce(e)?f.map(l=>l.status):f[0]?.status)})}function Se(t,e,r,n=o=>o,s={}){return ie(t,e,r,n,s,!0)}function Yr(t,e,r=s=>s,n={}){return ie(t,e,r,n,!0)}function Oe(t,e,r=s=>s,n={}){let s=z(t);v(r)&&([n,r]=[r,i=>i]);let o=F(e,!1),a=[...o];return function i(u,f,c){if(!f.length)return c(u);let l=f.shift();function p(m,y=void 0){let b=d=>(m.status=d,i(u.concat(m),f,c));if(arguments.length>1)return b(m,y);let _=O(s,"accessorizedProps",!1),w=_&&_.get(m.key);return w&&!w.restore()&&b(!1),b(Reflect.deleteProperty(s,m.key))}function h(m){let y=new A(s,{type:"delete",key:l,oldValue:m,related:[...a],operation:"deleteProperty",detail:n.detail}),b=K.getInstance(s,!1,n.namespace);return b?b.emit(y,p):p(y)}return X(s,l,h,n)}([],o.slice(0),i=>{let u=I.getInstance(s,!1,n.namespace);return u&&u.emit(i),r(Ce(e)?i.map(f=>f.status):i[0].status)})}function en(t,e,r=s=>s,n={}){return Oe(...arguments)}function wt(t,e,r=null,n=o=>o,s={}){return k(t,"construct",arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},n,s)}function xt(t,e,r,n=o=>o,s={}){let o=Ee(e),a;if(Array.isArray(e)){if(s.arrayMethodName){let i=new A(o,{operation:s.arrayMethodName,argumentsList:r});I.getInstance(o,!1,s.namespace)?.emit([i],{eventIsArrayMethodDescriptor:!0})}O(o).set("$length",o.length),a=St(o,()=>k(t,"apply",{thisArgument:e,argumentsList:r},n,s),s),O(o).delete("$length")}else a=k(t,"apply",{thisArgument:o,argumentsList:r},n,s);return a}function _t(t,e,r=s=>s,n={}){return k(t,"setPrototypeOf",{proto:e},r,n)}function vt(t,e=n=>n,r={}){return k(t,"preventExtensions",{},e,r)}function ur(t,e,r,n={}){let s=new AbortController;ke.setMaxListeners?.(0,s.signal),n.signal&&n.signal.addEventListener("abort",()=>s.abort());let o={...n,signal:s.signal},a=I.getInstance(t,!0,o.namespace),i=new Map;return function u(f=[],c=null){let l,p,h;if(Ce(e)){if(c){h=!0,p=c;for(let m of f)i.get(m.key)?.remove(),i.delete(m.key)}else p=a.addRegistration(e,u,o);l={signal:p.signal,childRegistrations:i}}else c?.remove(),p=a.addRegistration(e,u,o),l={signal:p.signal};if(o.childRegistrations&&o.keyInParent&&o.childRegistrations.set(o.keyInParent,p),arguments.length){let m=r(f,l);if(arguments.length>1)return m}return s}}function k(t,e,r={},n=o=>o,s={}){t=z(t),v(n)&&([s,n]=[n,u=>u]);function o(u,f){return arguments.length>1?n(f):n((Reflect[e]||Object[e])(t,...Object.values(r)))}let a=new A(t,{operation:e,...r}),i=K.getInstance(t,!1,s.namespace);return i?i.emit(a,o):o(a)}function Ce(t){return t===1/0||Array.isArray(t)}function z(t,e=!0,r=!0){if((!t||!x(t))&&e)throw new Error(`Object must be of type object or array! "${pe(t)}" given.`);return t instanceof A&&(t.type==="def"&&r?t=typeof t.value.get=="function"?t.value.get():t.value.value:t=t.value),t&&Ee(t)}function tn(t,e,r,n={}){return e===1/0?n.level&&!x(t)?r([]):r(Object.entries(Object.getOwnPropertyDescriptors(t)).filter(([,s])=>s.writable!==!1&&!s.get&&!s.set).map(([s])=>s)):r(F(e,!1))}var S={...Ot,...dt},cr=S;var ae=class t extends URLSearchParams{#n={};#e;get compatMode(){return this.#e}#r=new Set;#t;#s=!1;constructor(e={},{compatMode:r=!0,prettyPrint:n=!1}={}){super(),this.#e=r,this.#t=n;let s;e instanceof t?(s=structuredClone(e.json()),r&&(this.#r=new Set(e.keys()))):e instanceof URLSearchParams||e instanceof FormData?(s=Object.fromEntries(e),r&&(this.#r=new Set(e.keys()))):J(e)?(e=decodeURIComponent(e.replace(/^\?/,"")),s=this.constructor.parse(e,!r),r&&(this.#r=new Set(e.split("&").map(o=>o.split("=")[0])))):Array.isArray(e)?(s=this.constructor.fromEntries(e),r&&(this.#r=new Set(e.map(([o])=>o)))):v(e)?(s=e,r&&this.constructor.reduceValue(e,"",(o,a,i)=>{if(i)return i;/\[\d+\]$/.test(a)&&([,a]=/^(.*)\[\d+\]$/.exec(a)),this.#r.add(a)})):s={},this._resetJson(s)}_resetJson(e,r={}){if(!v(e))throw new Error("Argument must be a JSON object");let n=Object.keys(this.#n).filter(s=>!(s in e));return S.batch(this.#n,()=>(n.length&&S.deleteProperties(this.#n,n,r),S.set(this.#n,e,r)),r)}get(e){let r=this.#f(e);return this.#e&&Array.isArray(r)?r[0]:r}#f(e,r=!1){if(this.#e&&!this.#r.has(e))return null;let n=this.constructor.get(this.#n,e,r);return n===void 0?null:Array.isArray(n)?this.#e?n.map(s=>typeof s=="number"?s+"":s):n.map(s=>v(s)?new t(s,{compatMode:this.#e}):s):!this.#e&&v(n)?new t(n,{compatMode:this.#e}):this.#e&&typeof n=="number"?n+"":n}getAll(e){let r=this.#f(e,!0);return r===null?[]:Array.isArray(r)?r:[r]}set(e,r){return this.#e&&this.#r.add(e),this.constructor.set(this.#n,e,r),this}append(e,r){return this.#e&&this.#r.add(e),this.constructor.set(this.#n,e,r,!0),this}has(e){return this.#e&&!this.#r.has(e)?!1:this.constructor.get(this.#n,e)!==void 0}delete(e){if(this.#e&&!this.#r.has(e))return;let r=this.constructor.parsePath(e),n=r.pop(),s=r.length?this.constructor.get(this.#n,r):this.#n;v(s)&&S.deleteProperty(s,n)}sort(){return this.#s=!0,this}json(){return this.#n}stringify({prettyPrint:e=this.#t,sorted:r=this.#s}={}){return this.constructor.stringify(this.#n,{only:this.#e&&this.#r,sorted:r,prettyPrint:e})}toString(){return this.stringify()}entries(){let e=[];return this.constructor.reduceValue(this.#n,"",(r,n,s)=>{if(s)return s;if(this.#e&&!this.#r.has(n))if(/\[\d+\]$/.test(n)){if([,n]=/^(.*)\[\d+\]$/.exec(n),!this.#r.has(n)&&!this.#r.has(n=`${n}[]`))return}else return;this.#e&&typeof r=="number"&&(r=r+""),e.push([n,r])}),e[Symbol.iterator]()}keys(){return Array.from(this.entries(),([e])=>e)[Symbol.iterator]()}values(){return Array.from(this.entries(),([,e])=>e)[Symbol.iterator]()}forEach(e,r){for(let[n,s]of this.entries())e.call(r,s,n,this)}[Symbol.iterator](){return this.entries()}get size(){let e=0;return this.forEach(()=>e++),e}static parse(e,r=!1,n="&"){let s={};return(e.startsWith("?")?e.slice(1):e).split(n).filter(Boolean).forEach(o=>{let a=o.indexOf("="),i=a===-1?o:o.slice(0,a),u=a===-1?"":o.slice(a+1);this.set(s,i,u,!0,r)}),s}static fromEntries(e){let r={};for(let[n,s]of e)this.set(r,n,s,!0);return r}static stringify(e,{sorted:r=!1,only:n=null,prettyPrint:s=!1,delim:o="&"}={}){let a=[],i=Object.keys(e);return r&&i.sort(),i.forEach(u=>{this.reduceValue(e[u],u,(f,c,l)=>{if(l)return r?[...l].sort():l;if(n&&!n.has(c))if(/\[\d+\]$/.test(c)){if([,c]=/^(.*)\[\d+\]$/.exec(c),!n.has(c)&&!n.has(c=`${c}[]`))return}else return;s||(c=encodeURIComponent(c)),a.push(c+"="+encodeURIComponent(f))},!!s)}),a.join(o)}static get(e,r,n=!1){return this.reducePath(r,e,(s,o,a)=>a||(s===""?n?o:o?.[0]:o?.[s]))}static set(e,r,n,s=!1,o=!1){this.reducePath(r,e,(a,i,u)=>{let f=u??n;return o&&/^-?\d+(\.\d+)?$/.test(f+"")&&(f=parseFloat(f)),a===""&&Array.isArray(i)?S.proxy(i).push(f):s&&i?.[a]?Array.isArray(i[a])?S.proxy(i[a]).push(f):S.set(i,a,[i[a],f]):S.set(i,a,f),f})}static reduceValue(e,r,n,s=!1){if(x(e)){let o=Object.keys(e),a=n(e,r,o);if(Array.isArray(a)){a.forEach(i=>{s&&(i=encodeURIComponent(i)),this.reduceValue(e[i],r?`${r}[${i}]`:i,n,s)});return}}n(e,r)}static reducePath(e,r,n){let s=this.parsePath(e),o=r;for(let a=0;a<s.length;a++){let i=s[a];if(G(i)&&(i=+i),a===s.length-1)return n(i,o);if(!x(o))return;if(!x(o[i])){let u=s[a+1];o[i]=n(i,o,G(u)||u===""?[]:{})}o=o[i]}}static parsePath(e){if(Array.isArray(e))return e;if(!J(e))return[];let r=[];return e.replace(/\[([^\]]*)\]|([^[\]]+)/g,(n,s,o)=>{r.push(s??o)}),r}};var H=class t extends FormData{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}static json(e={},{encodeLiterals:r=!0,meta:n=!1}={}){let s=new t,o=!0;return ae.reduceValue(e,"",(a,i,u=void 0)=>{if(u){let f=Ne(a)==="json";return o=o&&f,f&&u}r&&[!0,!1,null].includes(a)&&(a=new Blob([a+""],{type:"application/json"})),s.append(i,a)}),n?{result:s,isDirectlySerializable:o}:s}async json({decodeLiterals:e=!0,meta:r=!1}={}){let n=!0,s;for(let[o,a]of this.entries()){s||(s=G(Ie(o,"["))?[]:{});let i=Ne(a);if(e&&["Blob","File"].includes(i)&&a.type==="application/json"&&[4,5].includes(a.size)){let u=JSON.parse(await a.text());[null,!0,!1].includes(u)&&(a=u,i="json")}n=n&&i==="json",/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(a)&&(a=Number(a)),ae.set(s,o,a)}return r?{result:s,isDirectlySerializable:n}:s}};var fe=(t,...e)=>D(t,"fetch+",...e),C=(t,...e)=>D(t,"fetch+","meta",...e);function Fe(t){return class extends t{static from(e){let r=e.headers instanceof Headers?[...e.headers.entries()].reduce((o,[a,i])=>{let u=a.toLowerCase();return o[u]=o[u]?[].concat(o[u],i):i,o},{}):Object.keys(e.headers||{}).reduce((o,a)=>(o[a.toLowerCase()]=e.headers[a],o),{}),n=e.body,s=[null,void 0].includes(n)?null:Ne(n);if(["Blob","File"].includes(s))r["content-type"]??=n.type,r["content-length"]??=n.size;else if(["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer"].includes(s))r["content-length"]??=n.byteLength;else if(s==="json"&&x(n)){let{result:o,isDirectlySerializable:a}=H.json(n,{encodeLiterals:!0,meta:!0});a?(n=JSON.stringify(n,(i,u)=>u instanceof Error?{...u,message:u.message}:u),r["content-type"]="application/json",r["content-length"]=new Blob([n]).size):(n=o,s="FormData")}else["text","json"].includes(s)&&!r["content-length"]&&(r["content-length"]=new Blob([n]).size);return!["FormData",null].includes(s)&&!["function"].includes(typeof n)&&!r["content-type"]&&(r["content-type"]="application/octet-stream"),{body:n,headers:new Headers(r),$type:s}}async formData(){let e=await super.formData();return H.upgradeInPlace(e),e}async any({to:e=null,memo:r=!1}={}){if(e&&!["blob","text","json","arrayBuffer","bytes","formData"].includes(e))throw new Error(`Invalid target type specified: ${e}`);if(this.body===null)return null;let n=C(this,"cache"),s=async i=>{if(!r)return await this[i||"bytes"]();let u=c=>{if(c instanceof FormData){let l=new H;for(let[p,h]of c.entries())l.append(p,h);return l}return(!i||i==="json")&&(Ke(c)||Je(c))?structuredClone(c):c};if(!i&&n.has("original"))return u(n.has("original"));if(i??="bytes",n.has(i))return u(n.get(i));let f;return n.has("memo")?f=n.get("memo").clone()[i]():(n.set("memo",this.clone()),f=await this[i]()),n.set(i,f),u(f)},o=(this.headers.get("Content-Type")||"").split(";")[0].trim(),a;if((!e||["formData","json"].includes(e))&&["multipart/form-data","application/x-www-form-urlencoded"].includes(o)){let i=await s("formData");H.upgradeInPlace(i),e==="json"&&(i=await i.json({decodeLiterals:!0})),a=i}else if((!e||["formData","json"].includes(e))&&o==="application/json"){let i=await s("json");e==="formData"&&(i=H.json(i,{encodeLiterals:!0})),a=i}else if(!e&&(o.startsWith("image/")||o.startsWith("video/")||o.startsWith("audio/")||o.startsWith("application/")&&!["xml","json","javascript","x-www-form-urlencoded"].some(i=>o.includes(i))))a=await s("blob");else if(!e&&(o.startsWith("text/")||o.startsWith("application/")&&["xml","javascript"].some(i=>o.includes(i))))a=await s("text");else{if(["json","formData"].includes(e))throw new Error(`Cannot convert body of type ${o} to ${e}`);a=await s(e)}return a}forget(){C(this,"cache").clear()}}}function Ne(t){if(t instanceof FormData)return"FormData";if(t===null||de(t)||je(t))return"json";if(J(t))return"text";if(x(t)){let e=t[Symbol.toStringTag],r=["Uint8Array","Uint16Array","Uint32Array","ArrayBuffer","Blob","File","FormData","Stream","ReadableStream"].reduce((n,s)=>n||(e===s?s:null),null);if(r)return r;if(v(t)||Array.isArray(t))return"json";if("toString"in t)return"text"}return null}function rn(t){return t!==null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}function At(t){return t instanceof ReadableStream||rn(t)}var B=class t extends Headers{static upgradeInPlace(e){return e instanceof t?e:Object.setPrototypeOf(e,t.prototype)}set(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){this.delete(e);for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=lr(r)),/^Content-Range$/i.test(e)&&(r=pr(r)),/^Range$/i.test(e)&&(r=hr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.set(e,r)}append(e,r){if(/^Set-Cookie$/i.test(e)){if(Array.isArray(r)){for(let n of r)this.append(e,n);return}v(r)&&(r=Ct(r))}return/Cookie/i.test(e)&&(r=lr(r)),/^Content-Range$/i.test(e)&&(r=pr(r)),/^Range$/i.test(e)&&(r=hr(r)),/^Accept$/i.test(e)&&(r=mr(r)),super.append(e,r)}get(e,r=!1){let n=super.get(e);if(/^Set-Cookie$/i.test(e)&&r&&(n=this.getSetCookie().map(s=>{let[o,...a]=s.split(";"),[i,u]=o.split("=").map(c=>c.trim()),f={name:i,value:u};return a.map(c=>c.trim().split("=")).forEach(c=>{f[c[0][0].toLowerCase()+c[0].substring(1).replace("-","")]=c.length===1?!0:c[1]}),f})),/^Cookie$/i.test(e)&&r&&(n=n?.split(";").map(s=>{let[o,a]=s.split("=").map(i=>i.trim());return{name:o,value:a}})||[]),/^Content-Range$/i.test(e)&&n&&r&&(n=ge(n,"bytes ").split("/")),/^Range$/i.test(e)&&r&&(n=n?ge(n,"bytes=").split(",").map(s=>{let o=s.trim().split("-").map(a=>a?parseInt(a,10):null);return o.resolveAgainst=a=>{let i=[...o];return i[1]===null?i[1]=a-1:i[1]=Math.min(i[1],a)-1,i[0]===null&&(i[0]=i[1]?a-i[1]-1:0),i},o.canResolveAgainst=(a,i)=>{let u=[typeof o[0]=="number"?o[0]:a,typeof o[1]=="number"?o[1]:i-1];return!(u[0]>u[1]||u[0]<a||u[1]>=i)},o.toString=()=>s,o}):[]),/^Accept$/i.test(e)&&n&&r){let s=a=>{let[i,u]=a.trim().split(";").map(f=>f.trim());return[i,parseFloat((u||"q=1").replace("q=",""))]},o=n;n=n.split(",").map(a=>s(a)).sort((a,i)=>a[1]>i[1]?-1:1)||[],n.match=a=>{if(!a)return 0;let i=f=>f.split("/").map(c=>c.trim()),u=i(a+"");return n.reduce((f,[c,l])=>{if(f)return f;let p=i(c);return[0,1].every(h=>u[h]===p[h]||u[h]==="*"||p[h]==="*")?l:0},0)},n.toString=()=>o}return n}};function Ct(t){let e=[`${t.name}=${t.value}`];for(let r in t){if(["name","value"].includes(r))continue;let n=r[0].toUpperCase()+r.substring(1);n==="MaxAge"&&(n="Max-Age"),t[r]!==!1&&e.push(t[r]===!0?n:`${n}=${t[r]}`)}return e.join("; ")}function lr(t){return x(t)&&(t=[].concat(t).map(Ct).join("; ")),t}function hr(t){let e=[];return F(t).forEach((r,n)=>{let s=Array.isArray(r)?r.map(o=>[null,void 0].includes(o)?"":o).join("-"):r+"";n===0&&!s.includes("bytes=")&&(s=`bytes=${s}`),e.push(s)}),e.join(", ")}function pr(t){if(Array.isArray(t)){if(t.length<2||!t[0].includes("-"))throw new Error("A Content-Range array must be in the format: [ 'start-end', 'total' ]");t=`bytes ${t.join("/")}`}return t}function mr(t){return Array.isArray(t)&&(t=t.map(e=>Array.isArray(e)?e.map((r,n)=>n===1&&(r=parseFloat(r),!0)?r===1?"":`;q=${r}`:r.trim()).join(""):e.trim()).join(",")),t}var W=class t extends Fe(Response){constructor(e,r={}){super(e,r),B.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),B.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Response)return e;let s;if(typeof e<"u"){let a;({body:e,headers:a,$type:s}=super.from({body:e,headers:n.headers})),n={...n,headers:a}}let o=new this(e,n);if(r){let a=C(o,"cache"),i={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};a.set(i[s]||"original",e)}return o}get status(){return this.headers.has("X-Redirect-Code")?200:super.status}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};async function dr(t,e={}){let r=await fetch(t,e);return W.upgradeInPlace(r),r}var ze=class t extends Fe(Request){constructor(e,r={}){super(e,r),B.upgradeInPlace(this.headers)}static upgradeInPlace(e){return e instanceof t||(Object.setPrototypeOf(e,t.prototype),B.upgradeInPlace(e.headers)),e}static from(e,{memoize:r=!1,...n}={}){if(e instanceof Request)return e;let s,o=n.body;if("body"in n){let{body:i,headers:u,$type:f}=super.from(n);n={...n,body:i,headers:u},s=f}let a=new this(e,n);if(r){let i=C(a,"cache"),u={json:"json",FormData:"formData",text:"text",ArrayBuffer:"arrayBuffer",Blob:"blob",Bytes:"bytes"};i.set(u[s]||"original",o)}return a}static async copy(e,r={}){let s=["method","headers","mode","credentials","cache","redirect","referrer","integrity"].reduce((o,a)=>({...o,[a]:a in r?r[a]:a==="headers"?new Headers(e[a]):e[a]}),{});return["GET","HEAD"].includes(s.method.toUpperCase())?s.body=null:"body"in r?(s.body=r.body,"headers"in r||(s.headers.delete("Content-Type"),s.headers.delete("Content-Length"))):s.body=await e.clone().arrayBuffer(),s.mode==="navigate"&&(s.mode="cors"),{url:r.url||e.url,...s}}clone(){let e=super.clone();t.upgradeInPlace(e);let r=C(this);return fe(e).set("meta",new Map(r)),C(e).has("cache")&&C(e).set("cache",new Map(r.get("cache"))),e}};var Q=class extends MessageEvent{#n;get originalTarget(){return this.#n}#e;get eventID(){return this.#e}#r;get data(){return this.#r}#t;get live(){return this.#t}#s;get bubbles(){return this.#s}#f;get forwarded(){return this.#f}#o;get honourDoneMutationFlags(){return this.#o}#u=[];get ports(){return this.#u}constructor(e,{originalTarget:r=null,type:n="message",eventID:s,live:o=!1,honourDoneMutationFlags:a=!1,bubbles:i=!1,forwarded:u=!1,ports:f=[]}={}){if(n&&typeof n!="string")throw new TypeError("Where specified, wqEventOptions.type must be a string");if(super(n),this.#r=e,this.#n=r,this.#e=s,this.#t=o,this.#s=i,this.#f=u,this.#o=a,this.#u=f,this.#u.forEach(c=>T.upgradeInPlace(c)),x(this.#r)&&this.#t){if(typeof s!="string")throw new TypeError("eventID must be a non-empty string");Tt.call(r,this.#r,this.#e,{honourDoneMutationFlags:this.#o})}}#c=!1;get immediatePropagationStopped(){return this.#c}stopImmediatePropagation(){this.#c=!0,this.#l=!0,super.stopImmediatePropagation()}#l=!1;get propagationStopped(){return this.#l}stopPropagation(){this.#l=!0,super.stopPropagation()}#i=!1;get defaultPrevented(){return this.#i}preventDefault(){this.#i=!0,super.preventDefault()}respondWith(e,r=[]){for(let n of this.#u)n.postMessage(e,r);return!!this.#u.length}};var ue=class extends He(EventTarget){#n;#e;constructor(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(super(),typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if($(this).set("options",{handshake:r,postAwaitsOpen:n}),this.#n=typeof e=="string"?new WebSocket(e):e,this.constructor.upgradeEvents(this.#n,this),this.#e=new Promise(o=>{this.#n.readyState===WebSocket.OPEN?o():this.#n.addEventListener("open",()=>o(),{once:!0})}),r===0&&this.#e.then(()=>this.start()),this.#n.readyState===WebSocket.CLOSED)try{this.close()}catch{}else this.#n.addEventListener("close",()=>{try{this.close()}catch{}},{once:!0})}static _hydrateMessage(e,r){try{let n;if(typeof r.data=="string"&&v(n=JSON.parse(r.data))&&n[".wq"])return Object.defineProperty(r,"data",{value:n,configurable:!0}),super._hydrateMessage(e,r)}catch{}return r}__postMessage(e,r){this.#e.then(()=>{this.#n.send(JSON.stringify(e),r)})}_close(){this.#n.close()}};var gr=(t,...e)=>D(t,"port+",...e),$=(t,...e)=>D(t,"port+","meta",...e),ce=t=>D(t,"port+","meta").get("options")||{},yr=["addEventListener","addRequestListener","postMessage","postRequest","dispatchEvent","relay","start","readyStateChange","removeEventListener","close"],br=["options","readyState","onmessage","onmessageerror"],T=class extends wr(EventTarget){constructor({handshake:e=0,postAwaitsOpen:r=!1,...n}={}){if(typeof e!="number")throw new Error("handshake must be a number");if(e<0||e>2)throw new Error("handshake must be between 0 and 2");super(),gr(this,"meta").set("options",{handshake:e,postAwaitsOpen:r,...n})}static[Symbol.hasInstance](e){return Function.prototype[Symbol.hasInstance].call(this,e)?!0:yr.every(r=>typeof e[r]=="function")||br.every(r=>r in e)}};function wr(t){return class extends t{static upgradeInPlace(e,{handshake:r=0,postAwaitsOpen:n=!1}={}){if(e instanceof T)return e;if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");let s=this.prototype;for(let a of yr.concat("_autoStart")){let i=e[a],u=s[a];i&&Object.defineProperty(e,`_${a}`,{value:i.bind(e),configurable:!0}),Object.defineProperty(e,a,{value:u.bind(e),configurable:!0})}for(let a of br){let i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),a),u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(s),a);i&&Object.defineProperty(e,`_${a}`,{...i,configurable:!0}),Object.defineProperty(e,a,{...u,configurable:!0})}return gr(e,"meta").set("options",{handshake:r,postAwaitsOpen:n}),this.upgradeEvents(e),r===0&&e.start(),e}static upgradeEvents(e,r=null){r||(r=e);let n=$(e);if(n.get("events+"))return;let s=$(r),o=ce(r),a=he.call(r),i=le.call(r);e instanceof BroadcastChannel&&(o.clientServerMode==="server"?s.set("clients",new Set):o.clientServerMode==="client"&&s.set("client_id",`client-${(0|Math.random()*9e6).toString(36)}`));let u=c=>{if(c instanceof Q)return;if(e===r&&c.stopImmediatePropagation?.(),c=this._hydrateMessage?.(r,c)||c,c.data.ping==="connect"&&typeof c.data?.[".wq"]?.eventID=="string"&&(!(e instanceof WebSocket)||o.handshake)){let m=o.handshake===0||s.get("start.called"),y={isOpen:m};e instanceof BroadcastChannel&&(o.clientServerMode==="server"&&typeof c.data.id=="string"?(s.get("clients").add(c.data.id),y.id="server"):c.data.id==="server"&&s.has("client_id")&&(y.id=s.get("client_id"))),c.ports?.forEach(b=>b.postMessage(y)),m&&(s.set("remote.open.called",!0),r.start());return}if(c.data.ping==="disconnect"&&typeof c.data?.[".wq"]?.eventID=="string"){let m=()=>{s.set("remote.close.called",!0),r.close()};e instanceof BroadcastChannel?o.clientServerMode==="server"&&typeof c.data.id=="string"?(s.get("clients").delete(c.data.id),!s.get("clients").size&&o.autoClose&&!i.close.state&&m()):o.clientServerMode==="client"&&c.data.id==="server"&&m():e instanceof MessagePort&&m();return}let l=c.data,p={};typeof c.data?.[".wq"]?.eventID=="string"&&({message:l,".wq":p}=c.data);let h=new Q(l,{originalTarget:e,...p,ports:c.ports});r.dispatchEvent(h)},f=c=>{};n.set("internal_call",!0),e.addEventListener("message",u),e.addEventListener("error",f),n.delete("internal_call"),a.add(()=>{e.removeEventListener("message",u),e.removeEventListener("error",f),n.set("events+",!1)}),n.set("events+",!0)}get options(){return{...ce(this)}}get onmessageerror(){return typeof super.onmessageerror<"u"?super.onmessageerror:typeof this._onmessageerror<"u"?this._onmessageerror:null}set onmessageerror(e){if(typeof super.onmessageerror<"u"){super.onmessageerror=e;return}if(e!==null&&typeof e!="function")throw new TypeError("onmessageerror must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessageerror")?.set){this._onmessageerror=e;return}this._onmessageerror&&this.removeEventListener("messageerror",this._onmessageerror),this.addEventListener("messageerror",e),this._onmessageerror=e}get onmessage(){return typeof super.onmessage<"u"?super.onmessage:typeof this._onmessage<"u"?this._onmessage:null}set onmessage(e){if(typeof super.onmessage<"u"){super.onmessage=e,this._autoStart();return}if(e!==null&&typeof e!="function")throw new TypeError("onmessage must be a function");if(Object.getOwnPropertyDescriptor(this,"_onmessage")?.set){this._onmessage=e,this._autoStart();return}this._onmessage&&this.removeEventListener("message",this._onmessage),this.addEventListener("message",e),this._onmessage=e,this._autoStart()}addEventListener(...e){he.call(this).add(()=>{this._removeEventListener?this._removeEventListener(...e):super.removeEventListener(...e)});let n=this._addEventListener?this._addEventListener(...e):super.addEventListener(...e);return this._autoStart(),n}dispatchEvent(e){let r=this._dispatchEvent?this._dispatchEvent(e):super.dispatchEvent(e);return e instanceof Q&&nn.call(this,e),r}postMessage(e,r={}){this._autoStart();let n;r?.portPlusIgnore&&({portPlusIgnore:n,...r}=r);let s=le.call(this);s.messaging.state=!0,s.messaging.resolve(this);let o;if(!n){let{portOptions:u,wqOptions:{relayedFrom:f,...c}}=Be.call(this,e,r);(c.type!=="message"||c.live||c.bubbles||u.transfer?.length&&(this instanceof BroadcastChannel||this instanceof ue))&&(e={message:e,".wq":c}),r=u,o=f}let a=()=>{this._postMessage?this._postMessage(e,r,o):super.postMessage(e,r)};ce(this).postAwaitsOpen?s.open.promise.then(a):a()}addRequestListener(e,r,n={}){let s=async o=>{let a=await r(o);for(let i of o.ports)i.postMessage(a)};this.addEventListener(e,s,n)}postRequest(e,r,n={}){let s;v(r)&&(n={once:!0,...r},s=new Promise(c=>{r=c}));let o=new MessageChannel;T.upgradeInPlace(o.port1),o.port1.start();let{signal:a,once:i=!1,transfer:u=[],...f}=n;return o.port1.addEventListener("message",c=>r(c),{signal:a||void 0,once:i}),a?.addEventListener("abort",()=>{o.port1.close(),o.port2.close()}),this.postMessage(e,{...f,transfer:[o.port2].concat(u)}),s}relay({to:e,from:r,types:n="*",channel:s=null,resolveMessage:o=null,bidirectional:a=!1}={}){if(e&&r)throw new Error('Only one of "to" and "from" may be specified');if(r?e=this:r=this,e===r)throw new Error("Source and target ports cannot be the same");if(!(r instanceof T)||!(e instanceof T))throw new Error("Both source and target ports must be instance of MessagePortPlus.");if(typeof n!="function"&&!(n=[].concat(n)).length)throw new Error("Event types must be specified.");if(typeof s=="string")s={from:s};else if(v(s)){if(Object.keys(s).filter(c=>!["from","to"].includes(c)).length)throw new Error('Channel must be a string or an object of "from"/"to" members')}else if(s)throw new Error("Invalid channel parameter");let i=xr.call(r),u={targetPort:e,types:n,channel:s,resolveMessage:o};i.add(u);let f;return a&&(f=e.relay({to:r,types:n,channel:s&&{to:s.from,from:s.to},resolveMessage:o,bidirectional:!1})),()=>{i.delete(u),f?.()}}channel(e,r=null,{handshake:n=0,postAwaitsOpen:s=!1}={}){let o=new MessageChannel;return T.upgradeInPlace(o.port1,{handshake:n,postAwaitsOpen:s}),T.upgradeInPlace(o.port2,{handshake:n,postAwaitsOpen:s}),he.call(this).add(this.relay({channel:e,to:o.port2,bidirectional:!0,resolveMessage:r})),o.port2.start(),this.readyStateChange("close").then(()=>{o.port2.close()}),o.port1}projectMutations({from:e,to:r,...n}){if(!e||!r||typeof e=="string"&&typeof r=="string"||x(e)&&x(r))throw new Error('Invalid "from"/"to" parameters');if(typeof e=="string"){if(!x(r))throw new Error('Invalid "to" parameter. Object/array expected');return Tt.call(this,r,e,n)}if(typeof r=="string"){if(!x(e))throw new Error('Invalid "from" parameter. Object/array expected');return _r.call(this,e,r,n)}throw new Error('Invalid "from"/"to" parameters')}get readyState(){let e=le.call(this);return e.close.state?"closed":e.open.state?"open":"connecting"}readyStateChange(e){if(!["open","messaging","close"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return le.call(this)[e].promise}_autoStart(){let e=$(this),r=ce(this);!e.get("internal_call")&&r.handshake===1&&this.start()}start(){let e=le.call(this);if(e.open.state)return;let r=$(this),n=ce(this),s=f=>{f&&(e.open.state=!0,e.open.resolve(this));let c=r.get("handshake_channel");setTimeout(()=>{c?.port1.close(),c?.port2.close(),r.delete("handshake_channel")},100)};if(r.get("remote.open.called")){s(!0);return}if(r.get("start.called"))return;if(r.set("start.called",!0),this._start?this._start():super.start?.(),n.handshake===0){s(!0);return}let o=new MessageChannel;r.set("handshake_channel",o),o.port1.onmessage=f=>{this instanceof BroadcastChannel&&n.clientServerMode==="server"&&typeof f.data?.id=="string"&&r.get("clients").add(f.data.id),f.data?.isOpen,s(!0)};let{wqOptions:a}=Be.call(this),i=n.clientServerMode==="server"?"server":n.clientServerMode==="client"?r.get("client_id"):null,u={".wq":a,ping:"connect",id:i};this._postMessage?this._postMessage(u,{transfer:[o.port2]}):super.postMessage(u,{transfer:[o.port2]})}close(...e){let r=le.call(this);if(r.close.state)return;r.close.state=!0;let n=$(this),s=ce(this);if(s.handshake>0&&!n.get("remote.close.called")&&(this instanceof BroadcastChannel||this instanceof MessagePort)){let{wqOptions:o}=Be.call(this),a=s.clientServerMode==="server"?"server":s.clientServerMode==="client"?n.get("client_id"):null,i={".wq":o,ping:"disconnect",id:a};this._postMessage?this._postMessage(i):super.postMessage(i)}this._close?this._close(...e):super.close(...e),r.close.resolve(this),sn.call(this)}}}function He(t){return class extends wr(t){static _hydrateMessage(e,r){if(typeof r.data?.[".wq"]?.numPorts!="number"||typeof r.data[".wq"].eventID!="string")return r;let n=he.call(e),s=r.data[".wq"].numPorts;Object.defineProperty(r,"ports",{value:[],configurable:!0});for(let o=0;o<s;o++){let a=e.channel(`${r.data[".wq"].eventID}:${o}`);r.ports.push(a)}return r}_postMessage(e,r={}){let{transfer:n=[],...s}=r;if(typeof e?.[".wq"]?.eventID=="string"){let o=he.call(this),a=n.filter(u=>u instanceof MessagePort),i=a.length;for(let u=0;u<i;u++)T.upgradeInPlace(a[u]),o.add(this.relay({channel:`${e[".wq"].eventID}:${u}`,to:a[u],bidirectional:!0})),a[u].start(),a[u].readyStateChange("close").then(()=>{let{wqOptions:f}=Be.call(this),c={".wq":f,ping:"disconnect"};this.postMessage(c,{type:`${e[".wq"].eventID}:${u}:message`})});e[".wq"].numPorts=i}return this.__postMessage(e,s)}}}function nn(t){if(t.propagationStopped)return;let e=$(this);e.get("parentNode")instanceof EventTarget&&(t.bubbles||e.get("parentNode")?.findPort?.(n=>n===this)&&t instanceof Q)&&e.get("parentNode").dispatchEvent(t);let r=xr.call(this);if(r.size&&t instanceof Q){let{type:n,eventID:s,data:o,live:a,bubbles:i,ports:u}=t,f=new WeakSet;for(let{targetPort:c,types:l,channel:p,resolveMessage:h}of r){if(f.has(c))continue;let m=n;p.from&&([,m]=new RegExp(`^${p.from.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}:([^:]+)$`).exec(n)||[],!m)||!(typeof l=="function"?l(m,this,c,p):[].concat(l).find(b=>b===m||b==="*"))||(f.add(c),c.postMessage(h?h(o,this,c,p):o,{transfer:u,type:p.to?`${p.to}:${m}`:m,eventID:s,bubbles:i,live:a,forwarded:!0,relayedFrom:this}))}}}function he(){let t=$(this);return t.has("garbage_collection")||t.set("garbage_collection",new Set),t.get("garbage_collection")}function xr(){let t=$(this);return t.has("downstream_registry")||t.set("downstream_registry",new Set),t.get("downstream_registry")}function le(){let t=$(this);if(!t.has("readystate_registry")){let e=r=>(r.promise=new Promise((n,s)=>(r.resolve=n,r.reject=s)),r);t.set("readystate_registry",{open:e({}),messaging:e({}),close:e({})})}return t.get("readystate_registry")}function sn(){let t=$(this);for(let e of t.get("garbage_collection")||[])e instanceof AbortController?e.abort():typeof e=="function"&&e();t.get("garbage_collection")?.clear(),t.get("downstream_registry")?.clear()}function Be(t=void 0,e={}){if(Array.isArray(e))e={transfer:e};else if(!e||typeof e!="object")throw new TypeError("transferOrOptions must be an array or an object");let{type:r="message",eventID:n=null,live:s=!1,observing:o=!1,bubbles:a=!1,forwarded:i=!1,relayedFrom:u=null,signal:f=void 0,withArrayMethodDescriptors:c=!1,honourDoneMutationFlags:l=!1,...p}=e;return n||(n=`${r}-${(0|Math.random()*9e6).toString(36)}`),!o&&!i&&x(t)&&s&&!r?.endsWith(".mutate")&&(_r.call(this,t,n,{signal:f||void 0,withArrayMethodDescriptors:c,honourDoneMutationFlags:l}),o=!0),{portOptions:p,wqOptions:{type:r,eventID:n,live:s,observing:o,honourDoneMutationFlags:l,bubbles:a,forwarded:i,relayedFrom:u}}}function _r(t,e,{signal:r,withArrayMethodDescriptors:n=!0,honourDoneMutationFlags:s=!1}={}){if(!x(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let o=u=>{let f;n&&Array.isArray(u[0].target)&&!u[0].argumentsList&&!["set","defineProperty","deleteProperty"].includes(u[0].operation)||(this.postMessage(u.map(c=>(f=!f&&s&&c.detail?.done,{...c,target:void 0})),{type:`${e}.mutate`}),f&&a.abort())},a=S.observe(t,S.subtree(),o,{signal:r||void 0,withArrayMethodDescriptors:n});return he.call(this).add(a),a}function Tt(t,e,{signal:r,honourDoneMutationFlags:n=!1}={}){if(!x(t))throw new TypeError("data must be a plain object and not a stream");if(typeof e!="string")throw new TypeError("eventID must be a non-empty string");let s=i=>{if(!i.data?.length)return;let u;S.batch(t,()=>{for(let f of i.data){if(u=!u&&n&&f.detail?.done,f.argumentsList){let c=f.path.length?S.get(t,S.path(...f.path)):t;S.proxy(c)[f.operation](...f.argumentsList);continue}if(f.key!=="length"||["set","defineProperty","deleteProperty"].includes(f.operation)){let c=f.path.length===1?t:S.get(t,S.path(...f.path.slice(0,-1)));f.type==="delete"?S.deleteProperty(c,f.key):S.set(c,f.key,f.value)}}}),u&&o()};this.addEventListener(`${e}.mutate`,s,{signal:r||void 0});let o=()=>this.removeEventListener(`${e}.mutate`,s);return he.call(this).add(o),o}var Te=class extends He(BroadcastChannel){constructor(e,{handshake:r=0,postAwaitsOpen:n=!1,clientServerMode:s=null,autoClose:o=!1}={}){super(e);let a=$(this);if(typeof r!="number")throw new Error("handshake must be a number");if(r<0||r>2)throw new Error("handshake must be between 0 and 2");if(s&&!["server","client"].includes(s))throw new Error('clientServerMode must be "server" or "client"');a.set("options",{handshake:r,postAwaitsOpen:n,clientServerMode:s,autoClose:o}),this.constructor.upgradeEvents(this),r===0&&this.start()}__postMessage(e,r){BroadcastChannel.prototype.postMessage.call(this,e)}};var We=class t extends EventTarget{get[Symbol.toStringTag](){return"LiveResponse"}static[Symbol.hasInstance](e){return e instanceof EventTarget&&e?.[Symbol.toStringTag]==="LiveResponse"&&typeof e.replaceWith=="function"&&typeof e.now=="function"}static get xHeaderName(){return"X-Message-Port"}static test(e){return e instanceof t?"LiveResponse":e instanceof $e?"LiveProgramHandle":e instanceof Response?"Response":vr(e)?"Generator":"Default"}static hasPort(e){return e instanceof t&&e.#p?!0:!!C(e).get("port")||!!e.headers?.get?.(this.xHeaderName)?.trim()}static getPort(e,{handshake:r=1}={}){if(e instanceof t&&e.#p)return e.#p;if(!(e instanceof Response||e instanceof t))return;let n=C(e);if(!n.has("port")){let s=e.headers.get(this.xHeaderName)?.trim();if(!s)return;let[,o,a]=/^(socket|channel):\/\/(.*)$/.exec(s)||[];if(!o||!a)throw new Error(`Unknown port messaging protocol: ${s}`);let i=o==="channel"?new Te(a,{handshake:r,postAwaitsOpen:!0,clientServerMode:"client"}):new ue(a,{handshake:r,postAwaitsOpen:!0});n.set("port",i)}return n.get("port")}static attachPort(e,r){if(r&&!(r instanceof T))throw new Error("Client must be a MessagePortPlus interface");if(e instanceof t){e.#p=r;return}C(e).set("port",r)}static from(e,...r){return e instanceof t?e.clone(...r):new this(e,...r)}#n;#e;#r=new AbortController;#t=new AbortController;constructor(e,...r){super(),this.#n=I.getInstance(this,!0);let n=a=>(a.promise=new Promise((i,u)=>(a.resolve=i,a.reject=u)),a);this.#e={live:n({}),done:n({})};let s=this.#e;(function a(){return s.now=n({}),s.now.refresh=a,s.now})();let o=this.#e.now;this.#a(o,e,...r).catch(a=>{o.reject(a)})}#s=null;get body(){return this.#s}#f=!1;get concurrent(){return this.#f}get bodyUsed(){return!0}#o=new Headers;get headers(){return this.#o}#u=200;get status(){return this.#u}#c="";get statusText(){return this.#c}#l="basic";get type(){return this.#l}#i=!1;get redirected(){return this.#i}#b=null;get url(){return this.#b}get ok(){return this.#u>=200&&this.#u<299}#p;get port(){return this.#p}get readyState(){return this.#e.done.state?"done":this.#e.live.state?"live":"waiting"}readyStateChange(e){if(!["live","now","done"].includes(e))throw new Error(`Invalid readyState query "${e}"`);return this.#e[e].promise}disconnect(e=!1){this.#r.abort(),this.#r=new AbortController,e&&(this.#t.abort(),this.#t=new AbortController)}#h;#d(e){if(this.#e.done.state)throw new Error("Response already done.");return this.#h=e,e.then(r=>{this.#h===e&&(this.#h=null,this.#e.done.state=!0,this.#e.done.resolve(r))}).catch(r=>{this.#h===e&&(this.#h=null,this.#e.done.state=!0,this.#e.done.reject(r))}),e}async now(){return this.#e.now.promise}async replaceWith(e,...r){if(this.readyState==="done")throw new Error("Response already done.");this.disconnect(),await this.#a(null,e,...r)}async#a(e,r,...n){let s=e||this.#e.now.refresh();if(r instanceof Promise)return this.#d(new Promise((p,h)=>{this.#r.signal.addEventListener("abort",()=>{s.aborted=!0,p()}),r.then(async m=>{await this.#a(s,m,...n),p()}).catch(m=>h(m))}));let o=(p,h)=>{if(h=Object.freeze({...h,ok:h.status>=200&&h.status<299,bodyUsed:!0}),p?.aborted){p.resolve(h);return}let m=p||this.#e.now.refresh(),y=h.body;this.#u=h.status,this.#c=h.statusText;for(let[w]of[...this.#o.entries()])this.#o.delete(w);for(let[w,d]of h.headers.entries())this.#o.append(w,d);this.#l=h.type,this.#i=h.redirected,this.#b=h.url;let b=this.#s;this.#s=y,this.#f=!!h.concurrent,this.#p=h.port,this.#f||(this.#t.abort(),this.#t=new AbortController);let _=new A(this,{type:"set",key:"body",value:y,oldValue:b,isUpdate:!0,related:[],operation:"set",detail:null});this.#e.live.state=!0,this.#e.live.resolve(this),m.resolve(h),this.#n.emit([_]),this.dispatchEvent(new $t(h))},a=(p,h,m)=>{o(p,{body:h,status:200,statusText:"",...m,headers:m.headers instanceof Headers?m.headers:new Headers(m.headers||{}),type:"basic",redirected:!1,url:null})},i=async(p,h,m)=>{let y,b,_=!0;if(h instanceof Response){if(h.bodyUsed)throw new Error("Response body already used");try{y=await W.prototype.any.call(h,{to:"json"})}catch{_=!1,y=await W.prototype.any.call(h)}b=this.constructor.getPort(h,{handshake:2})}else y=(await h.readyStateChange("live")).body,b=h.port;if(o(p,{body:y,status:h.status,statusText:h.statusText,headers:h.headers,concurrent:h.concurrent,...m,port:b,type:h.type,redirected:h.redirected,url:h.url}),h instanceof t){let w=()=>{a(null,h.body,h)};return h.addEventListener("replace",w,{signal:this.#r.signal}),await h.readyStateChange("done"),h.removeEventListener("replace",w),h}if(b){_&&y!==null&&b.projectMutations({from:"initial_response",to:y,signal:this.#t.signal});let w=new Promise(d=>{let P=E=>{let{body:q,...U}=E.data;a(null,q,{...U})};b.addEventListener("response.replace",P,{signal:this.#r.signal}),b.addEventListener("response.done",()=>{b.removeEventListener("response.replace",P),d(this)},{once:!0}),b.readyStateChange("close").then(d)});return b.start(),w}},u=async(p,h,m)=>{let y=await h.next(),b=await y.value;await this.#a(p,b,{done:y.done,...m});let _=y,w=b;for(;!_.done&&!this.#r.signal.aborted;)_=await h.next(),w=await _.value,this.#r.signal.aborted||await this.#a(null,w,{concurrent:m.concurrent,done:m.done===!1?!1:_.done})},f=async(p,h,m)=>(await this.#a(p,h.value,m),S.observe(h,"value",y=>this.#a(null,y.value,{concurrent:m.concurrent,done:!1}),{signal:this.#r.signal}),new Promise(()=>{})),c=typeof n[0]=="function"?n.shift():null,l=v(n[0])?{...n.shift()}:{};if("status"in l&&(l.status=parseInt(l.status),l.status<200||l.status>599))throw new Error(`The status provided (${l.status}) is outside the range [200, 599].`);if("statusText"in l&&(l.statusText=String(l.statusText)),l.headers&&!(l.headers instanceof Headers)&&(l.headers=new Headers(l.headers)),"concurrent"in l&&(l.concurrent=!!l.concurrent),r instanceof Response||r instanceof t){if(c)throw new Error("frameClosure is not supported for responses.");s.donePromise=i(s,r,l)}else if(vr(r)){if(c)throw new Error("frameClosure is not supported for generators.");s.donePromise=u(s,r,l)}else if(r instanceof $e){if(c)throw new Error("frameClosure is not supported for live program handles.");s.donePromise=f(s,r,l)}else if(s.donePromise=Promise.resolve(a(s,r,l)),c){let p=x(r)&&!At(r)?S.proxy(r,{chainable:!0,membrane:r}):r;s.donePromise=Promise.resolve(c.call(this,p,this.#t.signal))}return this.#d(l.done===!1?new Promise(()=>{}):s.donePromise),await new Promise((p,h)=>{this.#r.signal.addEventListener("abort",()=>p(!1)),s.donePromise.then(()=>p(!0)).catch(h)})}toResponse({port:e,signal:r}={}){if(e&&!(e instanceof T))throw new Error("Client must be a MessagePortPlus interface");let n=W.from(this.body,{status:this.#u,statusText:this.#c,headers:this.#o}),s=C(this);if(fe(n).set("meta",new Map(s)),!e)return n;x(this.#s)&&!At(this.#s)&&e.projectMutations({from:this.#s,to:"initial_response",signal:AbortSignal.any([this.#t.signal].concat(r||[]))});let o=()=>{let a=Object.fromEntries([...this.headers.entries()]);a?.["set-cookie"]&&(delete a["set-cookie"],console.warn('Warning: The "set-cookie" header is not supported for security reasons and has been removed from the response.')),e.postMessage({body:this.#s,status:this.#u,statusText:this.#c,headers:a,type:this.type,url:this.url,redirect:this.redirect,concurrent:this.#f},{type:"response.replace",live:!0,signal:AbortSignal.any([this.#t.signal].concat(r||[]))})};return this.addEventListener("replace",o,{signal:r||void 0}),this.readyStateChange("done").then(()=>{e.postMessage(null,{type:"response.done"})}),n}async*toGenerator({signal:e}={}){do yield this.body;while(await new Promise(r=>{this.addEventListener("replace",()=>r(!0),{once:!0,signal:e||void 0}),this.readyStateChange("done").then(()=>r(!1))}))}toLiveProgramHandle({signal:e}={}){let r=new $e,n=()=>S.defineProperty(r,"value",{value:this.body,enumerable:!1,configurable:!0});return this.addEventListener("replace",n,{signal:e||void 0}),n(),r}clone(e={}){let r=new this.constructor,n=C(this);return fe(r).set("meta",new Map(n)),r.replaceWith(this,e),r}},vr=t=>typeof t?.next=="function"&&typeof t?.throw=="function"&&typeof t?.return=="function",$t=class extends Event{[Symbol.toStringTag]="ReplaceEvent";static[Symbol.hasInstance](e){return e instanceof Event&&e[Symbol.toStringTag]==="ReplaceEvent"}#n;get data(){return this.#n}constructor(e){super("replace"),this.#n=e}},$e=class{[Symbol.toStringTag]="LiveProgramHandle";static[Symbol.hasInstance](e){return e?.[Symbol.toStringTag]==="LiveProgramHandle"}abort(){}};globalThis.webqit||(globalThis.webqit={});Object.assign(globalThis.webqit,Mt);})();
|
|
2
2
|
//# sourceMappingURL=main.js.map
|