halife 0.1.8 → 0.1.9

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.
@@ -1 +1 @@
1
- var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof TextEncoder<`u`&&TextEncoder.prototype.encodeInto)n=TextEncoder;else{let e=String.fromCharCode,t=function(t){let n=0|t.charCodeAt(0);if(55296<=n)if(n<56320){let r=0|t.charCodeAt(1);if(56320<=r&&r<=57343){if(n=(n<<10)+r-56613888|0,n>65535)return e(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)}else n=65533}else n<=57343&&(n=65533);return n<=2047?e(192|n>>>6,128|63&n):e(224|n>>>12,128|n>>>6&63,128|63&n)},r=function(e){return e===void 0?``:(``+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,t)};class i{constructor(){this.encoding=`utf-8`}encode(e){let t=r(e),n=0|t.length,i=new Uint8Array(n),a=0;for(;a<n;a=a+1|0)i[a]=0|t.charCodeAt(a);return i}encodeInto(e,t){let n=r(e),i=0|t.length,a=0|e.length,o=0|n.length,s=0,c=0,l=0;i<o&&(o=i);e:for(;s<o;s=s+1|0){switch(c=0|n.charCodeAt(s),c>>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l=l+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((s+1|0)<i){l=l+1|0;break}case 14:if((s+2|0)<i){l=l+1|0;break}case 15:if((s+3|0)<i){l=l+1|0;break}default:break e}t[s]=c}return{written:s,read:a<l?a:l}}toString(){return`[object TextEncoder]`}}if(typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(i.prototype,Symbol.toStringTag,{value:`TextEncoder`}),typeof TextEncoder>`u`&&(n=i),!n.prototype.encodeInto){let e=new TextEncoder;TextEncoder.prototype.encodeInto=function(t,n){let r=0|t.length,a=0|n.length;if(r<(3+(a>>1)|0)){let i=e.encode(t);if((0|i.length)<a)return n.set(i),{read:r,written:0|i.length}}return i.prototype.encodeInto(t,n)}}}e.default=n,t.exports=e.default})),r=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof TextDecoder>`u`){let e=String.fromCharCode,t=Object.prototype.toString,r=t.call(ArrayBuffer.prototype),i=typeof SharedArrayBuffer<`u`?t.call(SharedArrayBuffer):``,a=function(t){let n=t.charCodeAt(0),r=0|t.length,i=1114112,a=0,o=``;switch(n>>>4){case 12:case 13:i=(31&n)<<6|63&t.charCodeAt(1),a=i<128?0:2;break;case 14:i=(15&n)<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2),a=i<2048?0:3;break;case 15:n>>>3==30&&(i=(7&n)<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|t.charCodeAt(3),a=i<65536?0:4)}for(a&&(r<a?a=0:i<65536?o=e(i):i<1114112?(i=i-65664|0,o=e(55296+(i>>>10)|0,56320+(1023&i)|0)):a=0);a<r;a=a+1|0)o+=` `;return o},o=[`utf-8`,`utf8`,`unicode-1-1-utf-8`];class s{constructor(e,t){if(this.encoding=`utf-8`,this.fatal=!1,this.ignoreBOM=!1,e&&o.indexOf(e.toLowerCase())===-1)throw RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${e}') is invalid.`);if(t){if(t.fatal)throw Error(`Failed to construct 'TextDecoder': the 'fatal' option is unsupported.`);if(t.ignoreBOM)throw Error(`Failed to construct 'TextDecoder': the 'ignoreBOM' option is unsupported.`)}}decode(n,o){if(o&&o.stream)throw Error(`Failed to decode: the 'stream' option is unsupported.`);let s=n&&n.buffer||n,c=t.call(s);if(c!==r&&c!==i&&n!==void 0)throw TypeError(`Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'`);let l=new Uint8Array(s),u=``;for(let t=0,n=0|l.length;t<n;t=t+32768|0)u+=e.apply(0,l.subarray(t,t+32768|0));return u.replace(/[\xc0-\xff][\x80-\xbf]+|[\x80-\xff]/g,a)}toString(){return`[object TextDecoder]`}}typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(s.prototype,Symbol.toStringTag,{value:`TextDecoder`}),n=s}else n=TextDecoder;e.default=n,t.exports=e.default})),i=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof URL>`u`){let e=function(e,t){if(t=t.split(`:`)[0],e=+e,!e)return!1;switch(t){case`http`:case`ws`:return e!==80;case`https`:case`wss`:return e!==443;case`ftp`:return e!==21;case`gopher`:return e!==70;case`file`:return!1}return e!==0};var r=Object.prototype.hasOwnProperty,i;let t=function(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}},p=function(e){try{return encodeURIComponent(e)}catch{return null}},m=function(e){for(var n=/([^=?#&]+)=?([^&]*)/g,r={},i;i=n.exec(e);){var a=t(i[1]),o=t(i[2]);a===null||o===null||a in r||(r[a]=o)}return r},h=function(e,t){t||=``;var n=[],a,o;for(o in typeof t!=`string`&&(t=`?`),e)if(r.call(e,o)){if(a=e[o],!a&&(a===null||a===i||isNaN(a))&&(a=``),o=p(o),a=p(a),o===null||a===null)continue;n.push(o+`=`+a)}return n.length?t+n.join(`&`):``};var a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;let g=function(e){return(e||``).toString().replace(a,``)},_=function(e){var t=g(e),n=t.length;if(n===0)return t;for(;n&&!(t.charCodeAt(n-1)>32);)--n;return t.slice(0,n)};var d=[[`#`,`hash`],[`?`,`query`],function(e,t){return y(t.protocol)?e.replace(/\\/g,`/`):e},[`/`,`pathname`],[`@`,`auth`,1],[NaN,`host`,void 0,1,1],[/:(\d*)$/,`port`,void 0,1],[NaN,`hostname`,void 0,1,1]],f={hash:1,query:1};let v=function(e){var t=(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).location||{};e||=t;var n={},r=typeof e,i;if(e.protocol===`blob:`)n=new S(unescape(e.pathname),{});else if(r===`string`)for(i in n=new S(e,{}),f)delete n[i];else if(r===`object`){for(i in e)i in f||(n[i]=e[i]);n.slashes===void 0&&(n.slashes=s.test(e.href))}return n},y=function(e){return e===`file:`||e===`ftp:`||e===`http:`||e===`https:`||e===`ws:`||e===`wss:`},b=function(e,t){e=_(e),e=e.replace(o,``),t||={};var n=l.exec(e),r=n[1]?n[1].toLowerCase():``,i=!!n[2],a=!!n[3],s=0,c;return i?a?(c=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(c=n[2]+n[4],s=n[2].length):a?(c=n[3]+n[4],s=n[3].length):c=n[4],r===`file:`?s>=2&&(c=c.slice(2)):y(r)?c=n[4]:r?i&&(c=c.slice(2)):s>=2&&y(t.protocol)&&(c=n[4]),{protocol:r,slashes:i||y(r),slashesCount:s,rest:c}},x=function(e,t){if(e===``)return t;for(var n=(t||`/`).split(`/`).slice(0,-1).concat(e.split(`/`)),r=n.length,i=n[r-1],a=!1,o=0;r--;)n[r]===`.`?n.splice(r,1):n[r]===`..`?(n.splice(r,1),o++):o&&(r===0&&(a=!0),n.splice(r,1),o--);return a&&n.unshift(``),(i===`.`||i===`..`)&&n.push(``),n.join(`/`)};function S(t,n,r){if(!(this instanceof S))return new S(t,n,r);var i,a,o,s,c,l,f=d.slice(),p=typeof n,h=this,g=0;for(p!==`object`&&p!==`string`&&(r=n,n=null),r&&typeof r!=`function`&&(r=m),n=v(n),a=b(t||``,n),i=!a.protocol&&!a.slashes,h.slashes=a.slashes||i&&n.slashes,h.protocol=a.protocol||n.protocol||``,t=a.rest,(a.protocol===`file:`&&(a.slashesCount!==2||u.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!y(h.protocol)))&&(f[3]=[/(.*)/,`pathname`]);g<f.length;g++){if(s=f[g],typeof s==`function`){t=s(t,h);continue}o=s[0],l=s[1],o===o?typeof o==`string`?(c=o===`@`?t.lastIndexOf(o):t.indexOf(o),~c&&(typeof s[2]==`number`?(h[l]=t.slice(0,c),t=t.slice(c+s[2])):(h[l]=t.slice(c),t=t.slice(0,c)))):(c=o.exec(t))&&(h[l]=c[1],t=t.slice(0,c.index)):h[l]=t,h[l]=h[l]||i&&s[3]&&n[l]||``,s[4]&&(h[l]=h[l].toLowerCase())}r&&(h.query=r(h.query)),i&&n.slashes&&h.pathname.charAt(0)!==`/`&&(h.pathname!==``||n.pathname!==``)&&(h.pathname=x(h.pathname,n.pathname)),h.pathname.charAt(0)!==`/`&&y(h.protocol)&&(h.pathname=`/`+h.pathname),e(h.port,h.protocol)||(h.host=h.hostname,h.port=``),h.username=h.password=``,h.auth&&=(c=h.auth.indexOf(`:`),~c?(h.username=h.auth.slice(0,c),h.username=encodeURIComponent(decodeURIComponent(h.username)),h.password=h.auth.slice(c+1),h.password=encodeURIComponent(decodeURIComponent(h.password))):h.username=encodeURIComponent(decodeURIComponent(h.auth)),h.password?h.username+`:`+h.password:h.username),h.origin=h.protocol!==`file:`&&y(h.protocol)&&h.host?h.protocol+`//`+h.host:`null`,h.href=h.toString()}S.prototype={set:function(t,n,r){var i=this;switch(t){case`query`:typeof n==`string`&&n.length&&(n=(r||m)(n)),i[t]=n;break;case`port`:i[t]=n,e(n,i.protocol)?n&&(i.host=i.hostname+`:`+n):(i.host=i.hostname,i[t]=``);break;case`hostname`:i[t]=n,i.port&&(n+=`:`+i.port),i.host=n;break;case`host`:i[t]=n,c.test(n)?(n=n.split(`:`),i.port=n.pop(),i.hostname=n.join(`:`)):(i.hostname=n,i.port=``);break;case`protocol`:i.protocol=n.toLowerCase(),i.protocol&&i.protocol.charAt(i.protocol.length-1)!==`:`&&(i.protocol+=`:`),i.slashes=!r;break;case`pathname`:case`hash`:if(n&&!r){var a=t===`pathname`?`/`:`#`;i[t]=n.charAt(0)===a?n:a+n}else i[t]=n;break;case`username`:case`password`:i[t]=encodeURIComponent(n);break;case`auth`:var o=n.indexOf(`:`);~o?(i.username=n.slice(0,o),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=n.slice(o+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(n))}for(var s=0;s<d.length;s++){var l=d[s];l[4]&&(i[l[1]]=i[l[1]].toLowerCase())}return i.auth=i.password?i.username+`:`+i.password:i.username,i.origin=i.protocol!==`file:`&&y(i.protocol)&&i.host?i.protocol+`//`+i.host:`null`,i.href=i.toString(),i},toString:function(e){(!e||typeof e!=`function`)&&(e=h);var t,n=this,r=n.host,i=n.protocol;i&&i.charAt(i.length-1)!==`:`&&(i+=`:`);var a=i+(i&&n.slashes||y(i)?`//`:``);return n.username?(a+=n.username,n.password&&(a+=`:`+n.password),a+=`@`):n.password?(a+=`:`+n.password,a+=`@`):i!==`file:`&&y(i)&&!r&&n.pathname!==`/`&&(a+=`@`),(r[r.length-1]===`:`||c.test(n.hostname)&&!n.port)&&(r+=`:`),a+=r+n.pathname,t=typeof n.query==`object`?e(n.query):n.query,t&&(a+=t.charAt(0)===`?`?t:`?`+t),n.hash&&(a+=n.hash),a}},S.extractProtocol=b,S.location=v,S.trimLeft=g,S.stringify=h,S.parse=m,S.canParse=()=>{},S.createObjectURL=()=>{},S.revokeObjectURL=()=>{},typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(S.prototype,Symbol.toStringTag,{value:`URL`}),n=S}else n=URL;e.default=n,t.exports=e.default})),a,o=e((()=>{a=class{constructor(){this.listeners=new Map}addEventListener(e,t,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}removeEventListener(e,t,n){this.listeners.get(e)?.delete(t)}dispatchEvent(e){let t=this.listeners.get(e.type);if(!t)return!0;for(let n of t)typeof n==`function`?n(e):n&&typeof n.handleEvent==`function`&&n.handleEvent(e);return!0}}})),s=t(((e,t)=>{o();let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof WebSocket>`u`){class e extends a{static{this.CONNECTING=0}static{this.OPEN=1}static{this.CLOSING=2}static{this.CLOSED=3}constructor(t,n){if(super(),this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.binaryType=`arraybuffer`,this.readyState=0,this.url=``,this.extensions=``,this.bufferedAmount=0,typeof wx>`u`||!wx.connectSocket)throw Error(`This Function MUST be used in MotherFucker WeChat, you know what I mean?`);if(!(this instanceof e))throw TypeError(`Constructor WebSocket requires 'new'`);this.url=t.toString(),this.protocol=n?.[0]||``,this.readyState=e.CONNECTING;let r=wx.connectSocket({url:this.url,protocols:n,success:()=>{},complete:()=>{},fail:t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`error`,message:t.errMsg})}});r.onOpen(t=>{this.readyState=e.OPEN,this.extensions=t.header?.[`Sec-WebSocket-Extensions`]||``,this.protocol=t.header?.[`Sec-WebSocket-Protocol`],this.dispatchEvent({type:`open`})}),r.onMessage(e=>{this.dispatchEvent({type:`message`,data:e})}),r.onClose(t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`close`,detial:t.code,message:t.reason})}),r.onError(t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`error`,message:t.errMsg}),this.dispatchEvent({type:`close`,message:t.errMsg})})}send(t){if(this.readyState!==e.OPEN)return this.dispatchEvent({type:`error`,message:`Socket is not open`});wx.sendSocketMessage({data:t,success:()=>{},fail:()=>{},complete:()=>{}})}close(t=1e3,n=``){this.readyState!==e.CLOSED&&(this.readyState=e.CLOSING,wx.closeSocket({code:t,reason:n,success:()=>{},fail:()=>{},complete:()=>{}}))}onclose(){}onerror(){}onmessage(){}onopen(){}}typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e.prototype,Symbol.toStringTag,{value:`WebSocket`}),n=e}else n=WebSocket;e.default=n,t.exports=e.default})),c=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof fetch>`u`){function e(e,t){return new Promise((n,r)=>{if(typeof wx>`u`||!wx.request)return r(Error(`This Function MUST be used in MotherFucker WeChat, you know what I mean?`));let{method:i,headers:a,body:o}=t||{},s=e instanceof URL?e.href:e.toString();wx.request({url:s,method:i,header:a,data:o?.buffer,dataType:`other`,responseType:`arraybuffer`,success:e=>{let t={ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:e.errMsg,headers:e.header,arrayBuffer:()=>Promise.resolve(e.data),blob:()=>Promise.resolve(e.data),redirected:!1,url:s,clone:()=>t,type:`default`,body:e.data,bodyUsed:!1,formData:()=>Promise.resolve(e.data),json:()=>Promise.resolve(e.data),text:()=>Promise.resolve(e.data)};n(t)},fail:e=>{r(Error(e.errMsg))}})})}e.preconnect=()=>{},typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e.prototype,Symbol.toStringTag,{value:`fetch`}),n=e}else n=fetch;e.default=n,t.exports=e.default}));n(),r(),i(),s(),c(),o();export{a as EventTarget};
1
+ var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t(((e,t)=>{let n,r;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof TextEncoder>`u`||typeof TextDecoder>`u`){var i=String.fromCharCode,a={}.toString,o=a(),s=Uint8Array,c=s||Array,l=s?ArrayBuffer:c,u=l.isView||function(e){return e&&`length`in e},d=a.call(l.prototype),f=/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,p=new(s?Uint16Array:c)(32);function e(e){}class t{encoding=`utf-8`;constructor(){}encode(e){let t=e===void 0?``:``+e,n=t.length|0,r=new c((n<<1)+8|0),i,a=0,o=0,l=0,u=0,d=!s;for(a=0;a<n;a=a+1|0,o=o+1|0)if(l=t.charCodeAt(a)|0,l<=127)r[o]=l;else if(l<=2047)r[o]=192|l>>6,r[o=o+1|0]=128|l&63;else{widenCheck:{if(55296<=l)if(l<=56319){if(u=t.charCodeAt(a=a+1|0)|0,56320<=u&&u<=57343){if(l=(l<<10)+u-56613888|0,l>65535){r[o]=240|l>>18,r[o=o+1|0]=128|l>>12&63,r[o=o+1|0]=128|l>>6&63,r[o=o+1|0]=128|l&63;continue}break widenCheck}l=65533}else l<=57343&&(l=65533);!d&&a<<1<o&&a<<1<(o-7|0)&&(d=!0,i=new c(n*3),i.set(r),r=i)}r[o]=224|l>>12,r[o=o+1|0]=128|l>>6&63,r[o=o+1|0]=128|l&63}return s?r.subarray(0,o):r.slice(0,o)}encodeInto(t,n){var r=t===void 0?``:(``+t).replace(f,e),i=r.length|0,a=0,o=0,s=0,c=n.length|0,l=t.length|0;c<i&&(i=c);putChars:for(;a<i;a=a+1|0){switch(o=r.charCodeAt(a)|0,o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:s=s+1|0;case 8:case 9:case 10:case 11:break;case 12:case 13:if((a+1|0)<c){s=s+1|0;break}case 14:if((a+2|0)<c){s=s+1|0;break}case 15:if((a+3|0)<c){s=s+1|0;break}default:break putChars}n[a]=o}return{written:a,read:l<s?l:s}}}class m{constructor(){this.encoding=`utf-8`,this.fatal=!1,this.ignoreBOM=!1}decode(e){var t=e,n;if(!u(t)){if(n=a.call(t),n!==d&&n!==o)throw TypeError(`Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'`);t=s?new c(t):t||[]}for(var r=``,l=``,f=0,m=t.length|0,h=m-32|0,g=0,_=0,v=0,y=0,b=0,x=0,S=-1;f<m;){for(g=f<=h?32:m-f|0;x<g;f=f+1|0,x=x+1|0){switch(_=t[f]&255,_>>4){case 15:if(b=t[f=f+1|0]&255,b>>6!=2||247<_){f=f-1|0;break}v=(_&7)<<6|b&63,y=5,_=256;case 14:b=t[f=f+1|0]&255,v<<=6,v|=(_&15)<<6|b&63,y=b>>6==2?y+4|0:24,_=_+256&768;case 13:case 12:b=t[f=f+1|0]&255,v<<=6,v|=(_&31)<<6|b&63,y=y+7|0,f<m&&b>>6==2&&v>>y&&v<1114112?(_=v,v=v-65536|0,0<=v?(S=(v>>10)+55296|0,_=(v&1023)+56320|0,x<31?(p[x]=S,x=x+1|0,S=-1):(b=S,S=_,_=b)):g=g+1|0):(_>>=8,f=f-_-1|0,_=65533),y=0,v=0,g=f<=h?32:m-f|0;default:p[x]=_;continue;case 11:case 10:case 9:case 8:}p[x]=65533}if(l+=i(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15],p[16],p[17],p[18],p[19],p[20],p[21],p[22],p[23],p[24],p[25],p[26],p[27],p[28],p[29],p[30],p[31]),x<32&&(l=l.slice(0,x-32|0)),f<m){if(p[0]=S,x=~S>>>31,S=-1,l.length<r.length)continue}else S!==-1&&(l+=i(S));r+=l,l=``}return r}}n=t,r=m,globalThis!=`undefined`&&(globalThis.TextDecoder=r,globalThis.TextEncoder=n)}else r=TextDecoder,n=TextEncoder;e.default={TextEncoderPolyfill:n,TextDecoderPolyfill:r},t.exports=e.default})),r=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof URL>`u`){let e=function(e,t){if(t=t.split(`:`)[0],e=+e,!e)return!1;switch(t){case`http`:case`ws`:return e!==80;case`https`:case`wss`:return e!==443;case`ftp`:return e!==21;case`gopher`:return e!==70;case`file`:return!1}return e!==0};var r=Object.prototype.hasOwnProperty,i;let t=function(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}},p=function(e){try{return encodeURIComponent(e)}catch{return null}},m=function(e){for(var n=/([^=?#&]+)=?([^&]*)/g,r={},i;i=n.exec(e);){var a=t(i[1]),o=t(i[2]);a===null||o===null||a in r||(r[a]=o)}return r},h=function(e,t){t||=``;var n=[],a,o;for(o in typeof t!=`string`&&(t=`?`),e)if(r.call(e,o)){if(a=e[o],!a&&(a===null||a===i||isNaN(a))&&(a=``),o=p(o),a=p(a),o===null||a===null)continue;n.push(o+`=`+a)}return n.length?t+n.join(`&`):``};var a=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;let g=function(e){return(e||``).toString().replace(a,``)},_=function(e){var t=g(e),n=t.length;if(n===0)return t;for(;n&&!(t.charCodeAt(n-1)>32);)--n;return t.slice(0,n)};var d=[[`#`,`hash`],[`?`,`query`],function(e,t){return y(t.protocol)?e.replace(/\\/g,`/`):e},[`/`,`pathname`],[`@`,`auth`,1],[NaN,`host`,void 0,1,1],[/:(\d*)$/,`port`,void 0,1],[NaN,`hostname`,void 0,1,1]],f={hash:1,query:1};let v=function(e){var t=(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).location||{};e||=t;var n={},r=typeof e,i;if(e.protocol===`blob:`)n=new S(unescape(e.pathname),{});else if(r===`string`)for(i in n=new S(e,{}),f)delete n[i];else if(r===`object`){for(i in e)i in f||(n[i]=e[i]);n.slashes===void 0&&(n.slashes=s.test(e.href))}return n},y=function(e){return e===`file:`||e===`ftp:`||e===`http:`||e===`https:`||e===`ws:`||e===`wss:`},b=function(e,t){e=_(e),e=e.replace(o,``),t||={};var n=l.exec(e),r=n[1]?n[1].toLowerCase():``,i=!!n[2],a=!!n[3],s=0,c;return i?a?(c=n[2]+n[3]+n[4],s=n[2].length+n[3].length):(c=n[2]+n[4],s=n[2].length):a?(c=n[3]+n[4],s=n[3].length):c=n[4],r===`file:`?s>=2&&(c=c.slice(2)):y(r)?c=n[4]:r?i&&(c=c.slice(2)):s>=2&&y(t.protocol)&&(c=n[4]),{protocol:r,slashes:i||y(r),slashesCount:s,rest:c}},x=function(e,t){if(e===``)return t;for(var n=(t||`/`).split(`/`).slice(0,-1).concat(e.split(`/`)),r=n.length,i=n[r-1],a=!1,o=0;r--;)n[r]===`.`?n.splice(r,1):n[r]===`..`?(n.splice(r,1),o++):o&&(r===0&&(a=!0),n.splice(r,1),o--);return a&&n.unshift(``),(i===`.`||i===`..`)&&n.push(``),n.join(`/`)};function S(t,n,r){if(!(this instanceof S))return new S(t,n,r);var i,a,o,s,c,l,f=d.slice(),p=typeof n,h=this,g=0;for(p!==`object`&&p!==`string`&&(r=n,n=null),r&&typeof r!=`function`&&(r=m),n=v(n),a=b(t||``,n),i=!a.protocol&&!a.slashes,h.slashes=a.slashes||i&&n.slashes,h.protocol=a.protocol||n.protocol||``,t=a.rest,(a.protocol===`file:`&&(a.slashesCount!==2||u.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!y(h.protocol)))&&(f[3]=[/(.*)/,`pathname`]);g<f.length;g++){if(s=f[g],typeof s==`function`){t=s(t,h);continue}o=s[0],l=s[1],o===o?typeof o==`string`?(c=o===`@`?t.lastIndexOf(o):t.indexOf(o),~c&&(typeof s[2]==`number`?(h[l]=t.slice(0,c),t=t.slice(c+s[2])):(h[l]=t.slice(c),t=t.slice(0,c)))):(c=o.exec(t))&&(h[l]=c[1],t=t.slice(0,c.index)):h[l]=t,h[l]=h[l]||i&&s[3]&&n[l]||``,s[4]&&(h[l]=h[l].toLowerCase())}r&&(h.query=r(h.query)),i&&n.slashes&&h.pathname.charAt(0)!==`/`&&(h.pathname!==``||n.pathname!==``)&&(h.pathname=x(h.pathname,n.pathname)),h.pathname.charAt(0)!==`/`&&y(h.protocol)&&(h.pathname=`/`+h.pathname),e(h.port,h.protocol)||(h.host=h.hostname,h.port=``),h.username=h.password=``,h.auth&&=(c=h.auth.indexOf(`:`),~c?(h.username=h.auth.slice(0,c),h.username=encodeURIComponent(decodeURIComponent(h.username)),h.password=h.auth.slice(c+1),h.password=encodeURIComponent(decodeURIComponent(h.password))):h.username=encodeURIComponent(decodeURIComponent(h.auth)),h.password?h.username+`:`+h.password:h.username),h.origin=h.protocol!==`file:`&&y(h.protocol)&&h.host?h.protocol+`//`+h.host:`null`,h.href=h.toString()}S.prototype={set:function(t,n,r){var i=this;switch(t){case`query`:typeof n==`string`&&n.length&&(n=(r||m)(n)),i[t]=n;break;case`port`:i[t]=n,e(n,i.protocol)?n&&(i.host=i.hostname+`:`+n):(i.host=i.hostname,i[t]=``);break;case`hostname`:i[t]=n,i.port&&(n+=`:`+i.port),i.host=n;break;case`host`:i[t]=n,c.test(n)?(n=n.split(`:`),i.port=n.pop(),i.hostname=n.join(`:`)):(i.hostname=n,i.port=``);break;case`protocol`:i.protocol=n.toLowerCase(),i.protocol&&i.protocol.charAt(i.protocol.length-1)!==`:`&&(i.protocol+=`:`),i.slashes=!r;break;case`pathname`:case`hash`:if(n&&!r){var a=t===`pathname`?`/`:`#`;i[t]=n.charAt(0)===a?n:a+n}else i[t]=n;break;case`username`:case`password`:i[t]=encodeURIComponent(n);break;case`auth`:var o=n.indexOf(`:`);~o?(i.username=n.slice(0,o),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=n.slice(o+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(n))}for(var s=0;s<d.length;s++){var l=d[s];l[4]&&(i[l[1]]=i[l[1]].toLowerCase())}return i.auth=i.password?i.username+`:`+i.password:i.username,i.origin=i.protocol!==`file:`&&y(i.protocol)&&i.host?i.protocol+`//`+i.host:`null`,i.href=i.toString(),i},toString:function(e){(!e||typeof e!=`function`)&&(e=h);var t,n=this,r=n.host,i=n.protocol;i&&i.charAt(i.length-1)!==`:`&&(i+=`:`);var a=i+(i&&n.slashes||y(i)?`//`:``);return n.username?(a+=n.username,n.password&&(a+=`:`+n.password),a+=`@`):n.password?(a+=`:`+n.password,a+=`@`):i!==`file:`&&y(i)&&!r&&n.pathname!==`/`&&(a+=`@`),(r[r.length-1]===`:`||c.test(n.hostname)&&!n.port)&&(r+=`:`),a+=r+n.pathname,t=typeof n.query==`object`?e(n.query):n.query,t&&(a+=t.charAt(0)===`?`?t:`?`+t),n.hash&&(a+=n.hash),a}},S.extractProtocol=b,S.location=v,S.trimLeft=g,S.stringify=h,S.parse=m,S.canParse=()=>{},S.createObjectURL=()=>{},S.revokeObjectURL=()=>{},n=S,globalThis!=`undefined`&&(globalThis.URL=n)}else n=URL;e.default=n,t.exports=e.default})),i,a=e((()=>{i=class{constructor(){this.listeners=new Map}addEventListener(e,t,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}removeEventListener(e,t,n){this.listeners.get(e)?.delete(t)}dispatchEvent(e){let t=this.listeners.get(e.type);if(!t)return!0;for(let n of t)typeof n==`function`?n(e):n&&typeof n.handleEvent==`function`&&n.handleEvent(e);return!0}}})),o=t(((e,t)=>{a();let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof WebSocket>`u`){class e extends i{static{this.CONNECTING=0}static{this.OPEN=1}static{this.CLOSING=2}static{this.CLOSED=3}constructor(t,n){if(super(),this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.binaryType=`arraybuffer`,this.readyState=0,this.url=``,this.extensions=``,this.bufferedAmount=0,typeof wx>`u`||!wx.connectSocket)throw Error(`This Function MUST be used in MotherFucker WeChat, you know what I mean?`);if(!(this instanceof e))throw TypeError(`Constructor WebSocket requires 'new'`);this.url=t.toString(),this.protocol=n?.[0]||``,this.readyState=e.CONNECTING;let r=wx.connectSocket({url:this.url,protocols:n,success:()=>{},complete:()=>{},fail:t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`error`,message:t.errMsg})}});r.onOpen(t=>{this.readyState=e.OPEN,this.extensions=t.header?.[`Sec-WebSocket-Extensions`]||``,this.protocol=t.header?.[`Sec-WebSocket-Protocol`],this.dispatchEvent({type:`open`})}),r.onMessage(e=>{this.dispatchEvent({type:`message`,data:e})}),r.onClose(t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`close`,detial:t.code,message:t.reason})}),r.onError(t=>{this.readyState=e.CLOSED,this.dispatchEvent({type:`error`,message:t.errMsg}),this.dispatchEvent({type:`close`,message:t.errMsg})})}send(t){if(this.readyState!==e.OPEN)return this.dispatchEvent({type:`error`,message:`Socket is not open`});wx.sendSocketMessage({data:t,success:()=>{},fail:()=>{},complete:()=>{}})}close(t=1e3,n=``){this.readyState!==e.CLOSED&&(this.readyState=e.CLOSING,wx.closeSocket({code:t,reason:n,success:()=>{},fail:()=>{},complete:()=>{}}))}onclose(){}onerror(){}onmessage(){}onopen(){}}globalThis!=`undefined`&&(globalThis.WebSocket=e)}else n=WebSocket;e.default=n,t.exports=e.default})),s=t(((e,t)=>{let n;if(Object.defineProperty(e,`__esModule`,{value:!0}),typeof fetch>`u`){function e(e,t){return new Promise((n,r)=>{if(typeof wx>`u`||!wx.request)return r(Error(`This Function MUST be used in MotherFucker WeChat, you know what I mean?`));let{method:i,headers:a,body:o}=t||{},s=e instanceof URL?e.href:e.toString();wx.request({url:s,method:i,header:a,data:o?.buffer,dataType:`other`,responseType:`arraybuffer`,success:e=>{let t={ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:e.errMsg,headers:e.header,arrayBuffer:()=>Promise.resolve(e.data),blob:()=>Promise.resolve(e.data),redirected:!1,url:s,clone:()=>t,type:`default`,body:e.data,bodyUsed:!1,formData:()=>Promise.resolve(e.data),json:()=>Promise.resolve(e.data),text:()=>Promise.resolve(e.data)};n(t)},fail:e=>{r(Error(e.errMsg))}})})}e.preconnect=()=>{},globalThis!=`undefined`&&(globalThis.fetch=e)}else n=fetch;e.default=n,t.exports=e.default}));n(),r(),o(),s(),a();export{i as EventTarget};
@@ -0,0 +1,213 @@
1
+ import { t as __commonJSMin } from "./chunk-N6xyN86N.js";
2
+
3
+ //#region jspolyfill/textcoder.js
4
+ var require_textcoder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ let TextEncoderPolyfill;
6
+ let TextDecoderPolyfill;
7
+ if (Object.defineProperty(exports, "__esModule", { value: !0 }), "undefined" == typeof TextEncoder || "undefined" == typeof TextDecoder) {
8
+ var fromCharCode = String.fromCharCode;
9
+ var Object_prototype_toString = {}.toString;
10
+ var undefinedObjectString = Object_prototype_toString();
11
+ var NativeUint8Array = Uint8Array;
12
+ var patchedU8Array = NativeUint8Array || Array;
13
+ var nativeArrayBuffer = NativeUint8Array ? ArrayBuffer : patchedU8Array;
14
+ var arrayBuffer_isView = nativeArrayBuffer.isView || function(x) {
15
+ return x && "length" in x;
16
+ };
17
+ var arrayBufferString = Object_prototype_toString.call(nativeArrayBuffer.prototype);
18
+ var encoderRegexp = /[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g;
19
+ var tmpBufferU16 = new (NativeUint8Array ? Uint16Array : patchedU8Array)(32);
20
+ function encoderReplacer(nonAsciiChars) {}
21
+ class TextEncoderImpl {
22
+ encoding = "utf-8";
23
+ constructor() {}
24
+ encode(input) {
25
+ let inputStr = input === void 0 ? "" : "" + input;
26
+ let len = inputStr.length | 0;
27
+ let result = new patchedU8Array((len << 1) + 8 | 0), tmpResult;
28
+ let i = 0, pos = 0, point = 0, nextcode = 0;
29
+ let upgradededArraySize = !NativeUint8Array;
30
+ for (i = 0; i < len; i = i + 1 | 0, pos = pos + 1 | 0) {
31
+ point = inputStr.charCodeAt(i) | 0;
32
+ if (point <= 127) result[pos] = point;
33
+ else if (point <= 2047) {
34
+ result[pos] = 192 | point >> 6;
35
+ result[pos = pos + 1 | 0] = 128 | point & 63;
36
+ } else {
37
+ widenCheck: {
38
+ if (55296 <= point) {
39
+ if (point <= 56319) {
40
+ nextcode = inputStr.charCodeAt(i = i + 1 | 0) | 0;
41
+ if (56320 <= nextcode && nextcode <= 57343) {
42
+ point = (point << 10) + nextcode - 56613888 | 0;
43
+ if (point > 65535) {
44
+ result[pos] = 240 | point >> 18;
45
+ result[pos = pos + 1 | 0] = 128 | point >> 12 & 63;
46
+ result[pos = pos + 1 | 0] = 128 | point >> 6 & 63;
47
+ result[pos = pos + 1 | 0] = 128 | point & 63;
48
+ continue;
49
+ }
50
+ break widenCheck;
51
+ }
52
+ point = 65533;
53
+ } else if (point <= 57343) point = 65533;
54
+ }
55
+ if (!upgradededArraySize && i << 1 < pos && i << 1 < (pos - 7 | 0)) {
56
+ upgradededArraySize = true;
57
+ tmpResult = new patchedU8Array(len * 3);
58
+ tmpResult.set(result);
59
+ result = tmpResult;
60
+ }
61
+ }
62
+ result[pos] = 224 | point >> 12;
63
+ result[pos = pos + 1 | 0] = 128 | point >> 6 & 63;
64
+ result[pos = pos + 1 | 0] = 128 | point & 63;
65
+ }
66
+ }
67
+ return NativeUint8Array ? result.subarray(0, pos) : result.slice(0, pos);
68
+ }
69
+ encodeInto(input, u8Arr) {
70
+ var encodedString = input === void 0 ? "" : ("" + input).replace(encoderRegexp, encoderReplacer);
71
+ var len = encodedString.length | 0, i = 0, char = 0, read = 0, u8ArrLen = u8Arr.length | 0, inputLength = input.length | 0;
72
+ if (u8ArrLen < len) len = u8ArrLen;
73
+ putChars: for (; i < len; i = i + 1 | 0) {
74
+ char = encodedString.charCodeAt(i) | 0;
75
+ switch (char >> 4) {
76
+ case 0:
77
+ case 1:
78
+ case 2:
79
+ case 3:
80
+ case 4:
81
+ case 5:
82
+ case 6:
83
+ case 7: read = read + 1 | 0;
84
+ case 8:
85
+ case 9:
86
+ case 10:
87
+ case 11: break;
88
+ case 12:
89
+ case 13: if ((i + 1 | 0) < u8ArrLen) {
90
+ read = read + 1 | 0;
91
+ break;
92
+ }
93
+ case 14: if ((i + 2 | 0) < u8ArrLen) {
94
+ read = read + 1 | 0;
95
+ break;
96
+ }
97
+ case 15: if ((i + 3 | 0) < u8ArrLen) {
98
+ read = read + 1 | 0;
99
+ break;
100
+ }
101
+ default: break putChars;
102
+ }
103
+ u8Arr[i] = char;
104
+ }
105
+ return {
106
+ written: i,
107
+ read: inputLength < read ? inputLength : read
108
+ };
109
+ }
110
+ }
111
+ class TextDecoderImpl {
112
+ constructor() {
113
+ this.encoding = "utf-8";
114
+ this.fatal = false;
115
+ this.ignoreBOM = false;
116
+ }
117
+ decode(inputArrayOrBuffer) {
118
+ var inputAs8 = inputArrayOrBuffer, asObjectString;
119
+ if (!arrayBuffer_isView(inputAs8)) {
120
+ asObjectString = Object_prototype_toString.call(inputAs8);
121
+ if (asObjectString !== arrayBufferString && asObjectString !== undefinedObjectString) throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
122
+ inputAs8 = NativeUint8Array ? new patchedU8Array(inputAs8) : inputAs8 || [];
123
+ }
124
+ var resultingString = "", tmpStr = "", index = 0, len = inputAs8.length | 0, lenMinus32 = len - 32 | 0, nextEnd = 0, cp0 = 0, codePoint = 0, minBits = 0, cp1 = 0, pos = 0, tmp = -1;
125
+ for (; index < len;) {
126
+ nextEnd = index <= lenMinus32 ? 32 : len - index | 0;
127
+ for (; pos < nextEnd; index = index + 1 | 0, pos = pos + 1 | 0) {
128
+ cp0 = inputAs8[index] & 255;
129
+ switch (cp0 >> 4) {
130
+ case 15:
131
+ cp1 = inputAs8[index = index + 1 | 0] & 255;
132
+ if (cp1 >> 6 !== 2 || 247 < cp0) {
133
+ index = index - 1 | 0;
134
+ break;
135
+ }
136
+ codePoint = (cp0 & 7) << 6 | cp1 & 63;
137
+ minBits = 5;
138
+ cp0 = 256;
139
+ case 14:
140
+ cp1 = inputAs8[index = index + 1 | 0] & 255;
141
+ codePoint <<= 6;
142
+ codePoint |= (cp0 & 15) << 6 | cp1 & 63;
143
+ minBits = cp1 >> 6 === 2 ? minBits + 4 | 0 : 24;
144
+ cp0 = cp0 + 256 & 768;
145
+ case 13:
146
+ case 12:
147
+ cp1 = inputAs8[index = index + 1 | 0] & 255;
148
+ codePoint <<= 6;
149
+ codePoint |= (cp0 & 31) << 6 | cp1 & 63;
150
+ minBits = minBits + 7 | 0;
151
+ if (index < len && cp1 >> 6 === 2 && codePoint >> minBits && codePoint < 1114112) {
152
+ cp0 = codePoint;
153
+ codePoint = codePoint - 65536 | 0;
154
+ if (0 <= codePoint) {
155
+ tmp = (codePoint >> 10) + 55296 | 0;
156
+ cp0 = (codePoint & 1023) + 56320 | 0;
157
+ if (pos < 31) {
158
+ tmpBufferU16[pos] = tmp;
159
+ pos = pos + 1 | 0;
160
+ tmp = -1;
161
+ } else {
162
+ cp1 = tmp;
163
+ tmp = cp0;
164
+ cp0 = cp1;
165
+ }
166
+ } else nextEnd = nextEnd + 1 | 0;
167
+ } else {
168
+ cp0 >>= 8;
169
+ index = index - cp0 - 1 | 0;
170
+ cp0 = 65533;
171
+ }
172
+ minBits = 0;
173
+ codePoint = 0;
174
+ nextEnd = index <= lenMinus32 ? 32 : len - index | 0;
175
+ default:
176
+ tmpBufferU16[pos] = cp0;
177
+ continue;
178
+ case 11:
179
+ case 10:
180
+ case 9:
181
+ case 8:
182
+ }
183
+ tmpBufferU16[pos] = 65533;
184
+ }
185
+ tmpStr += fromCharCode(tmpBufferU16[0], tmpBufferU16[1], tmpBufferU16[2], tmpBufferU16[3], tmpBufferU16[4], tmpBufferU16[5], tmpBufferU16[6], tmpBufferU16[7], tmpBufferU16[8], tmpBufferU16[9], tmpBufferU16[10], tmpBufferU16[11], tmpBufferU16[12], tmpBufferU16[13], tmpBufferU16[14], tmpBufferU16[15], tmpBufferU16[16], tmpBufferU16[17], tmpBufferU16[18], tmpBufferU16[19], tmpBufferU16[20], tmpBufferU16[21], tmpBufferU16[22], tmpBufferU16[23], tmpBufferU16[24], tmpBufferU16[25], tmpBufferU16[26], tmpBufferU16[27], tmpBufferU16[28], tmpBufferU16[29], tmpBufferU16[30], tmpBufferU16[31]);
186
+ if (pos < 32) tmpStr = tmpStr.slice(0, pos - 32 | 0);
187
+ if (index < len) {
188
+ tmpBufferU16[0] = tmp;
189
+ pos = ~tmp >>> 31;
190
+ tmp = -1;
191
+ if (tmpStr.length < resultingString.length) continue;
192
+ } else if (tmp !== -1) tmpStr += fromCharCode(tmp);
193
+ resultingString += tmpStr;
194
+ tmpStr = "";
195
+ }
196
+ return resultingString;
197
+ }
198
+ }
199
+ TextEncoderPolyfill = TextEncoderImpl;
200
+ TextDecoderPolyfill = TextDecoderImpl;
201
+ if ("undefined" != globalThis) {
202
+ globalThis.TextDecoder = TextDecoderPolyfill;
203
+ globalThis.TextEncoder = TextEncoderPolyfill;
204
+ }
205
+ } else TextDecoderPolyfill = TextDecoder, TextEncoderPolyfill = TextEncoder;
206
+ exports.default = {
207
+ TextEncoderPolyfill,
208
+ TextDecoderPolyfill
209
+ }, module.exports = exports.default;
210
+ }));
211
+
212
+ //#endregion
213
+ export default require_textcoder();
@@ -491,7 +491,8 @@ var require_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
491
491
  Url.canParse = () => {};
492
492
  Url.createObjectURL = () => {};
493
493
  Url.revokeObjectURL = () => {};
494
- "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(Url.prototype, Symbol.toStringTag, { value: "URL" }), URLPolyfill = Url;
494
+ URLPolyfill = Url;
495
+ if ("undefined" != globalThis) globalThis.URL = URLPolyfill;
495
496
  } else URLPolyfill = URL;
496
497
  exports.default = URLPolyfill, module.exports = exports.default;
497
498
  }));
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "type": "git",
23
23
  "url": "https://codeberg.org/y0z0ng/halife.git"
24
24
  },
25
- "version": "0.1.8",
25
+ "version": "0.1.9",
26
26
  "workspaces": [
27
27
  "examples/*"
28
28
  ],