@binclusive/cli 0.1.0
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/LICENSE.md +46 -0
- package/README.md +91 -0
- package/dist/Menu-OSFE6ZQQ.js +2 -0
- package/dist/bin.js +352 -0
- package/dist/build-737TDK5H.js +2 -0
- package/dist/chunk-3MDNIFWR.js +38 -0
- package/dist/chunk-HPOSJQ4U.js +8 -0
- package/dist/chunk-PCQ2R3VR.js +2 -0
- package/dist/chunk-SNQ7SXG3.js +336 -0
- package/dist/chunk-VCKJNF7P.js +31 -0
- package/dist/devtools-RNURB4HU.js +2 -0
- package/dist/react-RAQ3DDSD.js +2 -0
- package/package.json +57 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module'; const require = __cjsCreateRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-SNQ7SXG3.js";import"./chunk-3MDNIFWR.js";import"./chunk-PCQ2R3VR.js";export{a as Box,i as Newline,j as Spacer,g as Static,b as Text,h as Transform,c as kittyFlags,d as kittyModifiers,t as measureElement,e as render,f as renderToString,m as useApp,s as useCursor,p as useFocus,q as useFocusManager,l as useInput,r as useIsScreenReaderEnabled,o as useStderr,k as useStdin,n as useStdout};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module'; const require = __cjsCreateRequire(import.meta.url);
|
|
2
|
+
import{b as J}from"./chunk-PCQ2R3VR.js";var qe=J(f=>{"use strict";var te=Symbol.for("react.transitional.element"),ot=Symbol.for("react.portal"),ut=Symbol.for("react.fragment"),st=Symbol.for("react.strict_mode"),it=Symbol.for("react.profiler"),at=Symbol.for("react.consumer"),ct=Symbol.for("react.context"),ft=Symbol.for("react.forward_ref"),lt=Symbol.for("react.suspense"),pt=Symbol.for("react.memo"),De=Symbol.for("react.lazy"),Pe=Symbol.iterator;function dt(t){return t===null||typeof t!="object"?null:(t=Pe&&t[Pe]||t["@@iterator"],typeof t=="function"?t:null)}var Ie={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ye=Object.assign,He={};function k(t,r,a){this.props=t,this.context=r,this.refs=He,this.updater=a||Ie}k.prototype.isReactComponent={};k.prototype.setState=function(t,r){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,r,"setState")};k.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Ue(){}Ue.prototype=k.prototype;function ne(t,r,a){this.props=t,this.context=r,this.refs=He,this.updater=a||Ie}var re=ne.prototype=new Ue;re.constructor=ne;Ye(re,k.prototype);re.isPureReactComponent=!0;var Ne=Array.isArray,g={H:null,A:null,T:null,S:null,V:null},xe=Object.prototype.hasOwnProperty;function oe(t,r,a,i,h,E){return a=E.ref,{$$typeof:te,type:t,key:r,ref:a!==void 0?a:null,props:E}}function _t(t,r){return oe(t.type,r,void 0,void 0,void 0,t.props)}function ue(t){return typeof t=="object"&&t!==null&&t.$$typeof===te}function yt(t){var r={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(a){return r[a]})}var Me=/\/+/g;function ee(t,r){return typeof t=="object"&&t!==null&&t.key!=null?yt(""+t.key):r.toString(36)}function $e(){}function ht(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then($e,$e):(t.status="pending",t.then(function(r){t.status==="pending"&&(t.status="fulfilled",t.value=r)},function(r){t.status==="pending"&&(t.status="rejected",t.reason=r)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function A(t,r,a,i,h){var E=typeof t;(E==="undefined"||E==="boolean")&&(t=null);var p=!1;if(t===null)p=!0;else switch(E){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case te:case ot:p=!0;break;case De:return p=t._init,A(p(t._payload),r,a,i,h)}}if(p)return h=h(t),p=i===""?"."+ee(t,0):i,Ne(h)?(a="",p!=null&&(a=p.replace(Me,"$&/")+"/"),A(h,r,a,"",function(P){return P})):h!=null&&(ue(h)&&(h=_t(h,a+(h.key==null||t&&t.key===h.key?"":(""+h.key).replace(Me,"$&/")+"/")+p)),r.push(h)),1;p=0;var R=i===""?".":i+":";if(Ne(t))for(var v=0;v<t.length;v++)i=t[v],E=R+ee(i,v),p+=A(i,r,a,E,h);else if(v=dt(t),typeof v=="function")for(t=v.call(t),v=0;!(i=t.next()).done;)i=i.value,E=R+ee(i,v++),p+=A(i,r,a,E,h);else if(E==="object"){if(typeof t.then=="function")return A(ht(t),r,a,i,h);throw r=String(t),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return p}function x(t,r,a){if(t==null)return t;var i=[],h=0;return A(t,i,"","",function(E){return r.call(a,E,h++)}),i}function mt(t){if(t._status===-1){var r=t._result;r=r(),r.then(function(a){(t._status===0||t._status===-1)&&(t._status=1,t._result=a)},function(a){(t._status===0||t._status===-1)&&(t._status=2,t._result=a)}),t._status===-1&&(t._status=0,t._result=r)}if(t._status===1)return t._result.default;throw t._result}var Le=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Et(){}f.Children={map:x,forEach:function(t,r,a){x(t,function(){r.apply(this,arguments)},a)},count:function(t){var r=0;return x(t,function(){r++}),r},toArray:function(t){return x(t,function(r){return r})||[]},only:function(t){if(!ue(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};f.Component=k;f.Fragment=ut;f.Profiler=it;f.PureComponent=ne;f.StrictMode=st;f.Suspense=lt;f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=g;f.__COMPILER_RUNTIME={__proto__:null,c:function(t){return g.H.useMemoCache(t)}};f.cache=function(t){return function(){return t.apply(null,arguments)}};f.cloneElement=function(t,r,a){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Ye({},t.props),h=t.key,E=void 0;if(r!=null)for(p in r.ref!==void 0&&(E=void 0),r.key!==void 0&&(h=""+r.key),r)!xe.call(r,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&r.ref===void 0||(i[p]=r[p]);var p=arguments.length-2;if(p===1)i.children=a;else if(1<p){for(var R=Array(p),v=0;v<p;v++)R[v]=arguments[v+2];i.children=R}return oe(t.type,h,void 0,void 0,E,i)};f.createContext=function(t){return t={$$typeof:ct,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:at,_context:t},t};f.createElement=function(t,r,a){var i,h={},E=null;if(r!=null)for(i in r.key!==void 0&&(E=""+r.key),r)xe.call(r,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(h[i]=r[i]);var p=arguments.length-2;if(p===1)h.children=a;else if(1<p){for(var R=Array(p),v=0;v<p;v++)R[v]=arguments[v+2];h.children=R}if(t&&t.defaultProps)for(i in p=t.defaultProps,p)h[i]===void 0&&(h[i]=p[i]);return oe(t,E,void 0,void 0,null,h)};f.createRef=function(){return{current:null}};f.forwardRef=function(t){return{$$typeof:ft,render:t}};f.isValidElement=ue;f.lazy=function(t){return{$$typeof:De,_payload:{_status:-1,_result:t},_init:mt}};f.memo=function(t,r){return{$$typeof:pt,type:t,compare:r===void 0?null:r}};f.startTransition=function(t){var r=g.T,a={};g.T=a;try{var i=t(),h=g.S;h!==null&&h(a,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Et,Le)}catch(E){Le(E)}finally{g.T=r}};f.unstable_useCacheRefresh=function(){return g.H.useCacheRefresh()};f.use=function(t){return g.H.use(t)};f.useActionState=function(t,r,a){return g.H.useActionState(t,r,a)};f.useCallback=function(t,r){return g.H.useCallback(t,r)};f.useContext=function(t){return g.H.useContext(t)};f.useDebugValue=function(){};f.useDeferredValue=function(t,r){return g.H.useDeferredValue(t,r)};f.useEffect=function(t,r,a){var i=g.H;if(typeof a=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,r)};f.useId=function(){return g.H.useId()};f.useImperativeHandle=function(t,r,a){return g.H.useImperativeHandle(t,r,a)};f.useInsertionEffect=function(t,r){return g.H.useInsertionEffect(t,r)};f.useLayoutEffect=function(t,r){return g.H.useLayoutEffect(t,r)};f.useMemo=function(t,r){return g.H.useMemo(t,r)};f.useOptimistic=function(t,r){return g.H.useOptimistic(t,r)};f.useReducer=function(t,r,a){return g.H.useReducer(t,r,a)};f.useRef=function(t){return g.H.useRef(t)};f.useState=function(t){return g.H.useState(t)};f.useSyncExternalStore=function(t,r,a){return g.H.useSyncExternalStore(t,r,a)};f.useTransition=function(){return g.H.useTransition()};f.version="19.1.2"});var We=J((c,q)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function t(e,n){Object.defineProperty(i.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1])}})}function r(e){return e===null||typeof e!="object"?null:(e=me&&e[me]||e["@@iterator"],typeof e=="function"?e:null)}function a(e,n){e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass";var o=e+"."+n;Ee[o]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",n,e),Ee[o]=!0)}function i(e,n,o){this.props=e,this.context=n,this.refs=Z,this.updater=o||ve}function h(){}function E(e,n,o){this.props=e,this.context=n,this.refs=Z,this.updater=o||ve}function p(e){return""+e}function R(e){try{p(e);var n=!1}catch{n=!0}if(n){n=console;var o=n.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),p(e)}}function v(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case de:return"Profiler";case pe:return"StrictMode";case he:return"Suspense";case Ze:return"SuspenseList";case Fe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case le:return"Portal";case _e:return(e.displayName||"Context")+".Provider";case X:return(e._context.displayName||"Context")+".Consumer";case ye:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return n=e.displayName||null,n!==null?n:v(e.type)||"Memo";case L:n=e._payload,e=e._init;try{return v(e(n))}catch{}}return null}function P(e){if(e===K)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===L)return"<...>";try{var n=v(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function ie(){var e=_.A;return e===null?null:e.getOwner()}function ae(){return Error("react-stack-top-frame")}function ce(e){if(I.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function ze(e,n){function o(){Te||(Te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function Ge(){var e=v(this.type);return Oe[e]||(Oe[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function W(e,n,o,u,s,y,l,m){return o=y.ref,e={$$typeof:Q,type:e,key:n,props:y,_owner:s},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Ge}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:m}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Be(e,n){return n=W(e.type,n,void 0,void 0,e._owner,e.props,e._debugStack,e._debugTask),e._store&&(n._store.validated=e._store.validated),n}function O(e){return typeof e=="object"&&e!==null&&e.$$typeof===Q}function Qe(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return n[o]})}function z(e,n){return typeof e=="object"&&e!==null&&e.key!=null?(R(e.key),Qe(""+e.key)):n.toString(36)}function fe(){}function Ke(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fe,fe):(e.status="pending",e.then(function(n){e.status==="pending"&&(e.status="fulfilled",e.value=n)},function(n){e.status==="pending"&&(e.status="rejected",e.reason=n)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function C(e,n,o,u,s){var y=typeof e;(y==="undefined"||y==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(y){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Q:case le:l=!0;break;case L:return l=e._init,C(l(e._payload),n,o,u,s)}}if(l){l=e,s=s(l);var m=u===""?"."+z(l,0):u;return we(s)?(o="",m!=null&&(o=m.replace(Se,"$&/")+"/"),C(s,n,o,"",function(b){return b})):s!=null&&(O(s)&&(s.key!=null&&(l&&l.key===s.key||R(s.key)),o=Be(s,o+(s.key==null||l&&l.key===s.key?"":(""+s.key).replace(Se,"$&/")+"/")+m),u!==""&&l!=null&&O(l)&&l.key==null&&l._store&&!l._store.validated&&(o._store.validated=2),s=o),n.push(s)),1}if(l=0,m=u===""?".":u+":",we(e))for(var d=0;d<e.length;d++)u=e[d],y=m+z(u,d),l+=C(u,n,o,y,s);else if(d=r(e),typeof d=="function")for(d===e.entries&&(Ce||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ce=!0),e=d.call(e),d=0;!(u=e.next()).done;)u=u.value,y=m+z(u,d++),l+=C(u,n,o,y,s);else if(y==="object"){if(typeof e.then=="function")return C(Ke(e),n,o,u,s);throw n=String(e),Error("Objects are not valid as a React child (found: "+(n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return l}function N(e,n,o){if(e==null)return e;var u=[],s=0;return C(e,u,"","",function(y){return n.call(o,y,s++)}),u}function Xe(e){if(e._status===-1){var n=e._result;n=n(),n.then(function(o){(e._status===0||e._status===-1)&&(e._status=1,e._result=o)},function(o){(e._status===0||e._status===-1)&&(e._status=2,e._result=o)}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return n=e._result,n===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
3
|
+
|
|
4
|
+
Your code should look like:
|
|
5
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
6
|
+
|
|
7
|
+
Did you accidentally put curly braces around the import?`,n),"default"in n||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
8
|
+
|
|
9
|
+
Your code should look like:
|
|
10
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,n),n.default;throw e._result}function w(){var e=_.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
11
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
12
|
+
2. You might be breaking the Rules of Hooks
|
|
13
|
+
3. You might have more than one copy of React in the same app
|
|
14
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function Ve(){}function M(e){if(Y===null)try{var n=("require"+Math.random()).slice(0,7);Y=(q&&q[n]).call(q,"timers").setImmediate}catch{Y=function(u){ke===!1&&(ke=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var s=new MessageChannel;s.port1.onmessage=u,s.port2.postMessage(void 0)}}return Y(e)}function j(e){return 1<e.length&&typeof AggregateError=="function"?new AggregateError(e):e[0]}function $(e,n){n!==H-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),H=n}function G(e,n,o){var u=_.actQueue;if(u!==null)if(u.length!==0)try{B(u),M(function(){return G(e,n,o)});return}catch(s){_.thrownErrors.push(s)}else _.actQueue=null;0<_.thrownErrors.length?(u=j(_.thrownErrors),_.thrownErrors.length=0,o(u)):n(e)}function B(e){if(!F){F=!0;var n=0;try{for(;n<e.length;n++){var o=e[n];do{_.didUsePromise=!1;var u=o(!1);if(u!==null){if(_.didUsePromise){e[n]=o,e.splice(0,n);return}o=u}else break}while(!0)}e.length=0}catch(s){e.splice(0,n+1),_.thrownErrors.push(s)}finally{F=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=Symbol.for("react.transitional.element"),le=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),pe=Symbol.for("react.strict_mode"),de=Symbol.for("react.profiler");Symbol.for("react.provider");var X=Symbol.for("react.consumer"),_e=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Ze=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),Fe=Symbol.for("react.activity"),me=Symbol.iterator,Ee={},ve={isMounted:function(){return!1},enqueueForceUpdate:function(e){a(e,"forceUpdate")},enqueueReplaceState:function(e){a(e,"replaceState")},enqueueSetState:function(e){a(e,"setState")}},ge=Object.assign,Z={};Object.freeze(Z),i.prototype.isReactComponent={},i.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var T={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},D;for(D in T)T.hasOwnProperty(D)&&t(D,T[D]);h.prototype=i.prototype,T=E.prototype=new h,T.constructor=E,ge(T,i.prototype),T.isPureReactComponent=!0;var we=Array.isArray,Je=Symbol.for("react.client.reference"),_={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},I=Object.prototype.hasOwnProperty,Re=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var Te,be,Oe={},et=T.react_stack_bottom_frame.bind(T,ae)(),tt=Re(P(ae)),Ce=!1,Se=/\/+/g,Ae=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ke=!1,Y=null,H=0,U=!1,F=!1,je=typeof queueMicrotask=="function"?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:M;T=Object.freeze({__proto__:null,c:function(e){return w().useMemoCache(e)}}),c.Children={map:N,forEach:function(e,n,o){N(e,function(){n.apply(this,arguments)},o)},count:function(e){var n=0;return N(e,function(){n++}),n},toArray:function(e){return N(e,function(n){return n})||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},c.Component=i,c.Fragment=K,c.Profiler=de,c.PureComponent=E,c.StrictMode=pe,c.Suspense=he,c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,c.__COMPILER_RUNTIME=T,c.act=function(e){var n=_.actQueue,o=H;H++;var u=_.actQueue=n!==null?n:[],s=!1;try{var y=e()}catch(d){_.thrownErrors.push(d)}if(0<_.thrownErrors.length)throw $(n,o),e=j(_.thrownErrors),_.thrownErrors.length=0,e;if(y!==null&&typeof y=="object"&&typeof y.then=="function"){var l=y;return je(function(){s||U||(U=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(d,b){s=!0,l.then(function(S){if($(n,o),o===0){try{B(u),M(function(){return G(S,d,b)})}catch(rt){_.thrownErrors.push(rt)}if(0<_.thrownErrors.length){var nt=j(_.thrownErrors);_.thrownErrors.length=0,b(nt)}}else d(S)},function(S){$(n,o),0<_.thrownErrors.length&&(S=j(_.thrownErrors),_.thrownErrors.length=0),b(S)})}}}var m=y;if($(n,o),o===0&&(B(u),u.length!==0&&je(function(){s||U||(U=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),_.actQueue=null),0<_.thrownErrors.length)throw e=j(_.thrownErrors),_.thrownErrors.length=0,e;return{then:function(d,b){s=!0,o===0?(_.actQueue=u,M(function(){return G(m,d,b)})):d(m)}}},c.cache=function(e){return function(){return e.apply(null,arguments)}},c.captureOwnerStack=function(){var e=_.getCurrentStack;return e===null?null:e()},c.cloneElement=function(e,n,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=ge({},e.props),s=e.key,y=e._owner;if(n!=null){var l;e:{if(I.call(n,"ref")&&(l=Object.getOwnPropertyDescriptor(n,"ref").get)&&l.isReactWarning){l=!1;break e}l=n.ref!==void 0}l&&(y=ie()),ce(n)&&(R(n.key),s=""+n.key);for(m in n)!I.call(n,m)||m==="key"||m==="__self"||m==="__source"||m==="ref"&&n.ref===void 0||(u[m]=n[m])}var m=arguments.length-2;if(m===1)u.children=o;else if(1<m){l=Array(m);for(var d=0;d<m;d++)l[d]=arguments[d+2];u.children=l}for(u=W(e.type,s,void 0,void 0,y,u,e._debugStack,e._debugTask),s=2;s<arguments.length;s++)y=arguments[s],O(y)&&y._store&&(y._store.validated=1);return u},c.createContext=function(e){return e={$$typeof:_e,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:X,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},c.createElement=function(e,n,o){for(var u=2;u<arguments.length;u++){var s=arguments[u];O(s)&&s._store&&(s._store.validated=1)}if(u={},s=null,n!=null)for(d in be||!("__self"in n)||"key"in n||(be=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),ce(n)&&(R(n.key),s=""+n.key),n)I.call(n,d)&&d!=="key"&&d!=="__self"&&d!=="__source"&&(u[d]=n[d]);var y=arguments.length-2;if(y===1)u.children=o;else if(1<y){for(var l=Array(y),m=0;m<y;m++)l[m]=arguments[m+2];Object.freeze&&Object.freeze(l),u.children=l}if(e&&e.defaultProps)for(d in y=e.defaultProps,y)u[d]===void 0&&(u[d]=y[d]);s&&ze(u,typeof e=="function"?e.displayName||e.name||"Unknown":e);var d=1e4>_.recentlyCreatedOwnerStacks++;return W(e,s,void 0,void 0,ie(),u,d?Error("react-stack-top-frame"):et,d?Re(P(e)):tt)},c.createRef=function(){var e={current:null};return Object.seal(e),e},c.forwardRef=function(e){e!=null&&e.$$typeof===V?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?console.error("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&e.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var n={$$typeof:ye,render:e},o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},c.isValidElement=O,c.lazy=function(e){return{$$typeof:L,_payload:{_status:-1,_result:e},_init:Xe}},c.memo=function(e,n){e==null&&console.error("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e),n={$$typeof:V,type:e,compare:n===void 0?null:n};var o;return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return o},set:function(u){o=u,e.name||e.displayName||(Object.defineProperty(e,"name",{value:u}),e.displayName=u)}}),n},c.startTransition=function(e){var n=_.T,o={};_.T=o,o._updatedFibers=new Set;try{var u=e(),s=_.S;s!==null&&s(o,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(Ve,Ae)}catch(y){Ae(y)}finally{n===null&&o._updatedFibers&&(e=o._updatedFibers.size,o._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),_.T=n}},c.unstable_useCacheRefresh=function(){return w().useCacheRefresh()},c.use=function(e){return w().use(e)},c.useActionState=function(e,n,o){return w().useActionState(e,n,o)},c.useCallback=function(e,n){return w().useCallback(e,n)},c.useContext=function(e){var n=w();return e.$$typeof===X&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),n.useContext(e)},c.useDebugValue=function(e,n){return w().useDebugValue(e,n)},c.useDeferredValue=function(e,n){return w().useDeferredValue(e,n)},c.useEffect=function(e,n,o){e==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var u=w();if(typeof o=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return u.useEffect(e,n)},c.useId=function(){return w().useId()},c.useImperativeHandle=function(e,n,o){return w().useImperativeHandle(e,n,o)},c.useInsertionEffect=function(e,n){return e==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),w().useInsertionEffect(e,n)},c.useLayoutEffect=function(e,n){return e==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),w().useLayoutEffect(e,n)},c.useMemo=function(e,n){return w().useMemo(e,n)},c.useOptimistic=function(e,n){return w().useOptimistic(e,n)},c.useReducer=function(e,n,o){return w().useReducer(e,n,o)},c.useRef=function(e){return w().useRef(e)},c.useState=function(e){return w().useState(e)},c.useSyncExternalStore=function(e,n,o){return w().useSyncExternalStore(e,n,o)},c.useTransition=function(){return w().useTransition()},c.version="19.1.2",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var vt=J((wt,se)=>{process.env.NODE_ENV==="production"?se.exports=qe():se.exports=We()});export{vt as a};
|
|
15
|
+
/*! Bundled license information:
|
|
16
|
+
|
|
17
|
+
react/cjs/react.production.js:
|
|
18
|
+
(**
|
|
19
|
+
* @license React
|
|
20
|
+
* react.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*)
|
|
27
|
+
|
|
28
|
+
react/cjs/react.development.js:
|
|
29
|
+
(**
|
|
30
|
+
* @license React
|
|
31
|
+
* react.development.js
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
*)
|
|
38
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module'; const require = __cjsCreateRequire(import.meta.url);
|
|
2
|
+
import{a as m,b as x,d as Y}from"./chunk-PCQ2R3VR.js";var k=x((mr,je)=>{"use strict";var Ge=["nodebuffer","arraybuffer","fragments"],$e=typeof Blob<"u";$e&&Ge.push("blob");je.exports={BINARY_TYPES:Ge,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:$e,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var K=x((gr,re)=>{"use strict";var{EMPTY_BUFFER:Yt}=k(),ye=Buffer[Symbol.species];function Kt(t,e){if(t.length===0)return Yt;if(t.length===1)return t[0];let s=Buffer.allocUnsafe(e),r=0;for(let i=0;i<t.length;i++){let n=t[i];s.set(n,r),r+=n.length}return r<e?new ye(s.buffer,s.byteOffset,r):s}function Ve(t,e,s,r,i){for(let n=0;n<i;n++)s[r+n]=t[n]^e[n&3]}function ze(t,e){for(let s=0;s<t.length;s++)t[s]^=e[s&3]}function Xt(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Se(t){if(Se.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new ye(t):ArrayBuffer.isView(t)?e=new ye(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Se.readOnly=!1),e}re.exports={concat:Kt,mask:Ve,toArrayBuffer:Xt,toBuffer:Se,unmask:ze};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=m("bufferutil");re.exports.mask=function(e,s,r,i,n){n<48?Ve(e,s,r,i,n):t.mask(e,s,r,i,n)},re.exports.unmask=function(e,s){e.length<32?ze(e,s):t.unmask(e,s)}}catch{}});var Ke=x((yr,Ye)=>{"use strict";var He=Symbol("kDone"),xe=Symbol("kRun"),Ee=class{constructor(e){this[He]=()=>{this.pending--,this[xe]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[xe]()}[xe](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[He])}}};Ye.exports=Ee});var Z=x((Sr,Je)=>{"use strict";var X=m("zlib"),Xe=K(),Zt=Ke(),{kStatusCode:Ze}=k(),Qt=Buffer[Symbol.species],Jt=Buffer.from([0,0,255,255]),ne=Symbol("permessage-deflate"),T=Symbol("total-length"),W=Symbol("callback"),N=Symbol("buffers"),F=Symbol("error"),ie,ve=class{constructor(e,s,r){if(this._maxPayload=r|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!s,this._deflate=null,this._inflate=null,this.params=null,!ie){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ie=new Zt(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[W];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let s=this._options,r=e.find(i=>!(s.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(s.serverMaxWindowBits===!1||typeof s.serverMaxWindowBits=="number"&&s.serverMaxWindowBits>i.server_max_window_bits)||typeof s.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return s.serverNoContextTakeover&&(r.server_no_context_takeover=!0),s.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof s.serverMaxWindowBits=="number"&&(r.server_max_window_bits=s.serverMaxWindowBits),typeof s.clientMaxWindowBits=="number"?r.client_max_window_bits=s.clientMaxWindowBits:(r.client_max_window_bits===!0||s.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let s=e[0];if(this._options.clientNoContextTakeover===!1&&s.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!s.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(s.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&s.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return s}normalizeParams(e){return e.forEach(s=>{Object.keys(s).forEach(r=>{let i=s[r];if(i.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(i=i[0],r==="client_max_window_bits"){if(i!==!0){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else if(r==="server_max_window_bits"){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=n}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else throw new Error(`Unknown parameter "${r}"`);s[r]=i})}),e}decompress(e,s,r){ie.add(i=>{this._decompress(e,s,(n,o)=>{i(),r(n,o)})})}compress(e,s,r){ie.add(i=>{this._compress(e,s,(n,o)=>{i(),r(n,o)})})}_decompress(e,s,r){let i=this._isServer?"client":"server";if(!this._inflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?X.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=X.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ne]=this,this._inflate[T]=0,this._inflate[N]=[],this._inflate.on("error",ts),this._inflate.on("data",Qe)}this._inflate[W]=r,this._inflate.write(e),s&&this._inflate.write(Jt),this._inflate.flush(()=>{let n=this._inflate[F];if(n){this._inflate.close(),this._inflate=null,r(n);return}let o=Xe.concat(this._inflate[N],this._inflate[T]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[T]=0,this._inflate[N]=[],s&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,s,r){let i=this._isServer?"server":"client";if(!this._deflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?X.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=X.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[T]=0,this._deflate[N]=[],this._deflate.on("data",es)}this._deflate[W]=r,this._deflate.write(e),this._deflate.flush(X.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=Xe.concat(this._deflate[N],this._deflate[T]);s&&(n=new Qt(n.buffer,n.byteOffset,n.length-4)),this._deflate[W]=null,this._deflate[T]=0,this._deflate[N]=[],s&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),r(null,n)})}};Je.exports=ve;function es(t){this[N].push(t),this[T]+=t.length}function Qe(t){if(this[T]+=t.length,this[ne]._maxPayload<1||this[T]<=this[ne]._maxPayload){this[N].push(t);return}this[F]=new RangeError("Max payload size exceeded"),this[F].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[F][Ze]=1009,this.removeListener("data",Qe),this.reset()}function ts(t){if(this[ne]._inflate=null,this[F]){this[W](this[F]);return}t[Ze]=1007,this[W](t)}});var q=x((xr,oe)=>{"use strict";var{isUtf8:et}=m("buffer"),{hasBlob:ss}=k(),rs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function is(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function be(t){let e=t.length,s=0;for(;s<e;)if((t[s]&128)===0)s++;else if((t[s]&224)===192){if(s+1===e||(t[s+1]&192)!==128||(t[s]&254)===192)return!1;s+=2}else if((t[s]&240)===224){if(s+2>=e||(t[s+1]&192)!==128||(t[s+2]&192)!==128||t[s]===224&&(t[s+1]&224)===128||t[s]===237&&(t[s+1]&224)===160)return!1;s+=3}else if((t[s]&248)===240){if(s+3>=e||(t[s+1]&192)!==128||(t[s+2]&192)!==128||(t[s+3]&192)!==128||t[s]===240&&(t[s+1]&240)===128||t[s]===244&&t[s+1]>143||t[s]>244)return!1;s+=4}else return!1;return!0}function ns(t){return ss&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}oe.exports={isBlob:ns,isValidStatusCode:is,isValidUTF8:be,tokenChars:rs};if(et)oe.exports.isValidUTF8=function(t){return t.length<24?be(t):et(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=m("utf-8-validate");oe.exports.isValidUTF8=function(e){return e.length<32?be(e):t(e)}}catch{}});var Ce=x((Er,at)=>{"use strict";var{Writable:os}=m("stream"),tt=Z(),{BINARY_TYPES:as,EMPTY_BUFFER:st,kStatusCode:fs,kWebSocket:ls}=k(),{concat:we,toArrayBuffer:hs,unmask:cs}=K(),{isValidStatusCode:us,isValidUTF8:rt}=q(),ae=Buffer[Symbol.species],v=0,it=1,nt=2,ot=3,Oe=4,ke=5,fe=6,Te=class extends os{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||as[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[ls]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=v}_write(e,s,r){if(this._opcode===8&&this._state==v)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new ae(r.buffer,r.byteOffset+e,r.length-e),new ae(r.buffer,r.byteOffset,e)}let s=Buffer.allocUnsafe(e);do{let r=this._buffers[0],i=s.length-e;e>=r.length?s.set(this._buffers.shift(),i):(s.set(new Uint8Array(r.buffer,r.byteOffset,e),i),this._buffers[0]=new ae(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return s}startLoop(e){this._loop=!0;do switch(this._state){case v:this.getInfo(e);break;case it:this.getPayloadLength16(e);break;case nt:this.getPayloadLength64(e);break;case ot:this.getMask();break;case Oe:this.getData(e);break;case ke:case fe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let s=this.consume(2);if((s[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let r=(s[0]&64)===64;if(r&&!this._extensions[tt.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(s[0]&128)===128,this._opcode=s[0]&15,this._payloadLength=s[1]&127,this._opcode===0){if(r){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(r){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(s[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=it:this._payloadLength===127?this._state=nt:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let s=this.consume(8),r=s.readUInt32BE(0);if(r>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=r*Math.pow(2,32)+s.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(s);return}this._masked?this._state=ot:this._state=Oe}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Oe}getData(e){let s=st;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}s=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&cs(s,this._mask)}if(this._opcode>7){this.controlMessage(s,e);return}if(this._compressed){this._state=ke,this.decompress(s,e);return}s.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(s)),this.dataMessage(e)}decompress(e,s){this._extensions[tt.extensionName].decompress(e,this._fin,(i,n)=>{if(i)return s(i);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");s(o);return}this._fragments.push(n)}this.dataMessage(s),this._state===v&&this.startLoop(s)})}dataMessage(e){if(!this._fin){this._state=v;return}let s=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=we(r,s):this._binaryType==="arraybuffer"?i=hs(we(r,s)):this._binaryType==="blob"?i=new Blob(r):i=r,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=v):(this._state=fe,setImmediate(()=>{this.emit("message",i,!0),this._state=v,this.startLoop(e)}))}else{let i=we(r,s);if(!this._skipUTF8Validation&&!rt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===ke||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=v):(this._state=fe,setImmediate(()=>{this.emit("message",i,!1),this._state=v,this.startLoop(e)}))}}controlMessage(e,s){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,st),this.end();else{let r=e.readUInt16BE(0);if(!us(r)){let n=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");s(n);return}let i=new ae(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!rt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");s(n);return}this._loop=!1,this.emit("conclude",r,i),this.end()}this._state=v;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=v):(this._state=fe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=v,this.startLoop(s)}))}createError(e,s,r,i,n){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${s}`:s);return Error.captureStackTrace(o,this.createError),o.code=n,o[fs]=i,o}};at.exports=Te});var Pe=x((br,ht)=>{"use strict";var{Duplex:vr}=m("stream"),{randomFillSync:ds}=m("crypto"),ft=Z(),{EMPTY_BUFFER:_s,kWebSocket:ps,NOOP:ms}=k(),{isBlob:G,isValidStatusCode:gs}=q(),{mask:lt,toBuffer:B}=K(),b=Symbol("kByteLength"),ys=Buffer.alloc(4),le=8*1024,R,$=le,w=0,Ss=1,xs=2,Le=class t{constructor(e,s,r){this._extensions=s||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=w,this.onerror=ms,this[ps]=void 0}static frame(e,s){let r,i=!1,n=2,o=!1;s.mask&&(r=s.maskBuffer||ys,s.generateMask?s.generateMask(r):($===le&&(R===void 0&&(R=Buffer.alloc(le)),ds(R,0,le),$=0),r[0]=R[$++],r[1]=R[$++],r[2]=R[$++],r[3]=R[$++]),o=(r[0]|r[1]|r[2]|r[3])===0,n=6);let f;typeof e=="string"?(!s.mask||o)&&s[b]!==void 0?f=s[b]:(e=Buffer.from(e),f=e.length):(f=e.length,i=s.mask&&s.readOnly&&!o);let l=f;f>=65536?(n+=8,l=127):f>125&&(n+=2,l=126);let a=Buffer.allocUnsafe(i?f+n:n);return a[0]=s.fin?s.opcode|128:s.opcode,s.rsv1&&(a[0]|=64),a[1]=l,l===126?a.writeUInt16BE(f,2):l===127&&(a[2]=a[3]=0,a.writeUIntBE(f,4,6)),s.mask?(a[1]|=128,a[n-4]=r[0],a[n-3]=r[1],a[n-2]=r[2],a[n-1]=r[3],o?[a,e]:i?(lt(e,r,a,n,f),[a]):(lt(e,r,e,0,f),[a,e])):[a,e]}close(e,s,r,i){let n;if(e===void 0)n=_s;else{if(typeof e!="number"||!gs(e))throw new TypeError("First argument must be a valid error code number");if(s===void 0||!s.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{let f=Buffer.byteLength(s);if(f>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+f),n.writeUInt16BE(e,0),typeof s=="string"?n.write(s,2):n.set(s,2)}}let o={[b]:n.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==w?this.enqueue([this.dispatch,n,!1,o,i]):this.sendFrame(t.frame(n,o),i)}ping(e,s,r){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):G(e)?(i=e.size,n=!1):(e=B(e),i=e.length,n=B.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[b]:i,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==w?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}pong(e,s,r){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):G(e)?(i=e.size,n=!1):(e=B(e),i=e.length,n=B.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[b]:i,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==w?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}send(e,s,r){let i=this._extensions[ft.extensionName],n=s.binary?2:1,o=s.compress,f,l;typeof e=="string"?(f=Buffer.byteLength(e),l=!1):G(e)?(f=e.size,l=!1):(e=B(e),f=e.length,l=B.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=f>=i._threshold),this._compress=o):(o=!1,n=0),s.fin&&(this._firstFragment=!0);let a={[b]:f,fin:s.fin,generateMask:this._generateMask,mask:s.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:l,rsv1:o};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,this._compress,a,r]):this.getBlobData(e,this._compress,a,r):this._state!==w?this.enqueue([this.dispatch,e,this._compress,a,r]):this.dispatch(e,this._compress,a,r)}getBlobData(e,s,r,i){this._bufferedBytes+=r[b],this._state=xs,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(Ne,this,f,i);return}this._bufferedBytes-=r[b];let o=B(n);s?this.dispatch(o,s,r,i):(this._state=w,this.sendFrame(t.frame(o,r),i),this.dequeue())}).catch(n=>{process.nextTick(Es,this,n,i)})}dispatch(e,s,r,i){if(!s){this.sendFrame(t.frame(e,r),i);return}let n=this._extensions[ft.extensionName];this._bufferedBytes+=r[b],this._state=Ss,n.compress(e,r.fin,(o,f)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Ne(this,l,i);return}this._bufferedBytes-=r[b],this._state=w,r.readOnly=!1,this.sendFrame(t.frame(f,r),i),this.dequeue()})}dequeue(){for(;this._state===w&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][b],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][b],this._queue.push(e)}sendFrame(e,s){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],s),this._socket.uncork()):this._socket.write(e[0],s)}};ht.exports=Le;function Ne(t,e,s){typeof s=="function"&&s(e);for(let r=0;r<t._queue.length;r++){let i=t._queue[r],n=i[i.length-1];typeof n=="function"&&n(e)}}function Es(t,e,s){Ne(t,e,s),t.onerror(e)}});var St=x((wr,yt)=>{"use strict";var{kForOnEventAttribute:Q,kListener:Be}=k(),ct=Symbol("kCode"),ut=Symbol("kData"),dt=Symbol("kError"),_t=Symbol("kMessage"),pt=Symbol("kReason"),j=Symbol("kTarget"),mt=Symbol("kType"),gt=Symbol("kWasClean"),C=class{constructor(e){this[j]=null,this[mt]=e}get target(){return this[j]}get type(){return this[mt]}};Object.defineProperty(C.prototype,"target",{enumerable:!0});Object.defineProperty(C.prototype,"type",{enumerable:!0});var U=class extends C{constructor(e,s={}){super(e),this[ct]=s.code===void 0?0:s.code,this[pt]=s.reason===void 0?"":s.reason,this[gt]=s.wasClean===void 0?!1:s.wasClean}get code(){return this[ct]}get reason(){return this[pt]}get wasClean(){return this[gt]}};Object.defineProperty(U.prototype,"code",{enumerable:!0});Object.defineProperty(U.prototype,"reason",{enumerable:!0});Object.defineProperty(U.prototype,"wasClean",{enumerable:!0});var V=class extends C{constructor(e,s={}){super(e),this[dt]=s.error===void 0?null:s.error,this[_t]=s.message===void 0?"":s.message}get error(){return this[dt]}get message(){return this[_t]}};Object.defineProperty(V.prototype,"error",{enumerable:!0});Object.defineProperty(V.prototype,"message",{enumerable:!0});var J=class extends C{constructor(e,s={}){super(e),this[ut]=s.data===void 0?null:s.data}get data(){return this[ut]}};Object.defineProperty(J.prototype,"data",{enumerable:!0});var vs={addEventListener(t,e,s={}){for(let i of this.listeners(t))if(!s[Q]&&i[Be]===e&&!i[Q])return;let r;if(t==="message")r=function(n,o){let f=new J("message",{data:o?n:n.toString()});f[j]=this,he(e,this,f)};else if(t==="close")r=function(n,o){let f=new U("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[j]=this,he(e,this,f)};else if(t==="error")r=function(n){let o=new V("error",{error:n,message:n.message});o[j]=this,he(e,this,o)};else if(t==="open")r=function(){let n=new C("open");n[j]=this,he(e,this,n)};else return;r[Q]=!!s[Q],r[Be]=e,s.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(let s of this.listeners(t))if(s[Be]===e&&!s[Q]){this.removeListener(t,s);break}}};yt.exports={CloseEvent:U,ErrorEvent:V,Event:C,EventTarget:vs,MessageEvent:J};function he(t,e,s){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,s):t.call(e,s)}});var Re=x((Or,xt)=>{"use strict";var{tokenChars:ee}=q();function O(t,e,s){t[e]===void 0?t[e]=[s]:t[e].push(s)}function bs(t){let e=Object.create(null),s=Object.create(null),r=!1,i=!1,n=!1,o,f,l=-1,a=-1,h=-1,c=0;for(;c<t.length;c++)if(a=t.charCodeAt(c),o===void 0)if(h===-1&&ee[a]===1)l===-1&&(l=c);else if(c!==0&&(a===32||a===9))h===-1&&l!==-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c);let g=t.slice(l,h);a===44?(O(e,g,s),s=Object.create(null)):o=g,l=h=-1}else throw new SyntaxError(`Unexpected character at index ${c}`);else if(f===void 0)if(h===-1&&ee[a]===1)l===-1&&(l=c);else if(a===32||a===9)h===-1&&l!==-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c),O(s,t.slice(l,h),!0),a===44&&(O(e,o,s),s=Object.create(null),o=void 0),l=h=-1}else if(a===61&&l!==-1&&h===-1)f=t.slice(l,c),l=h=-1;else throw new SyntaxError(`Unexpected character at index ${c}`);else if(i){if(ee[a]!==1)throw new SyntaxError(`Unexpected character at index ${c}`);l===-1?l=c:r||(r=!0),i=!1}else if(n)if(ee[a]===1)l===-1&&(l=c);else if(a===34&&l!==-1)n=!1,h=c;else if(a===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${c}`);else if(a===34&&t.charCodeAt(c-1)===61)n=!0;else if(h===-1&&ee[a]===1)l===-1&&(l=c);else if(l!==-1&&(a===32||a===9))h===-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c);let g=t.slice(l,h);r&&(g=g.replace(/\\/g,""),r=!1),O(s,f,g),a===44&&(O(e,o,s),s=Object.create(null),o=void 0),f=void 0,l=h=-1}else throw new SyntaxError(`Unexpected character at index ${c}`);if(l===-1||n||a===32||a===9)throw new SyntaxError("Unexpected end of input");h===-1&&(h=c);let _=t.slice(l,h);return o===void 0?O(e,_,s):(f===void 0?O(s,_,!0):r?O(s,f,_.replace(/\\/g,"")):O(s,f,_),O(e,o,s)),e}function ws(t){return Object.keys(t).map(e=>{let s=t[e];return Array.isArray(s)||(s=[s]),s.map(r=>[e].concat(Object.keys(r).map(i=>{let n=r[i];return Array.isArray(n)||(n=[n]),n.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xt.exports={format:ws,parse:bs}});var _e=x((Cr,Bt)=>{"use strict";var Os=m("events"),ks=m("https"),Ts=m("http"),bt=m("net"),Cs=m("tls"),{randomBytes:Ls,createHash:Ns}=m("crypto"),{Duplex:kr,Readable:Tr}=m("stream"),{URL:Ue}=m("url"),P=Z(),Ps=Ce(),Bs=Pe(),{isBlob:Rs}=q(),{BINARY_TYPES:Et,EMPTY_BUFFER:ce,GUID:Us,kForOnEventAttribute:Ie,kListener:Is,kStatusCode:Ds,kWebSocket:y,NOOP:wt}=k(),{EventTarget:{addEventListener:Ms,removeEventListener:As}}=St(),{format:Ws,parse:Fs}=Re(),{toBuffer:qs}=K(),Gs=30*1e3,Ot=Symbol("kAborted"),De=[8,13],L=["CONNECTING","OPEN","CLOSING","CLOSED"],$s=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,d=class t extends Os{constructor(e,s,r){super(),this._binaryType=Et[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ce,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,s===void 0?s=[]:Array.isArray(s)||(typeof s=="object"&&s!==null?(r=s,s=[]):s=[s]),kt(this,e,s,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Et.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,s,r){let i=new Ps({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),n=new Bs(e,this._extensions,r.generateMask);this._receiver=i,this._sender=n,this._socket=e,i[y]=this,n[y]=this,e[y]=this,i.on("conclude",zs),i.on("drain",Hs),i.on("error",Ys),i.on("message",Ks),i.on("ping",Xs),i.on("pong",Zs),n.onerror=Qs,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),s.length>0&&e.unshift(s),e.on("close",Lt),e.on("data",de),e.on("end",Nt),e.on("error",Pt),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[P.extensionName]&&this._extensions[P.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,s){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){E(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,s,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ct(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=s=void 0):typeof s=="function"&&(r=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Me(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.ping(e||ce,s,r)}pong(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=s=void 0):typeof s=="function"&&(r=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Me(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.pong(e||ce,s,r)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof s=="function"&&(r=s,s={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Me(this,e,r);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...s};this._extensions[P.extensionName]||(i.compress=!1),this._sender.send(e||ce,i,r)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){E(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(d,"CONNECTING",{enumerable:!0,value:L.indexOf("CONNECTING")});Object.defineProperty(d.prototype,"CONNECTING",{enumerable:!0,value:L.indexOf("CONNECTING")});Object.defineProperty(d,"OPEN",{enumerable:!0,value:L.indexOf("OPEN")});Object.defineProperty(d.prototype,"OPEN",{enumerable:!0,value:L.indexOf("OPEN")});Object.defineProperty(d,"CLOSING",{enumerable:!0,value:L.indexOf("CLOSING")});Object.defineProperty(d.prototype,"CLOSING",{enumerable:!0,value:L.indexOf("CLOSING")});Object.defineProperty(d,"CLOSED",{enumerable:!0,value:L.indexOf("CLOSED")});Object.defineProperty(d.prototype,"CLOSED",{enumerable:!0,value:L.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(d.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(d.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Ie])return e[Is];return null},set(e){for(let s of this.listeners(t))if(s[Ie]){this.removeListener(t,s);break}typeof e=="function"&&this.addEventListener(t,e,{[Ie]:!0})}})});d.prototype.addEventListener=Ms;d.prototype.removeEventListener=As;Bt.exports=d;function kt(t,e,s,r){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:De[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=i.autoPong,!De.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${De.join(", ")})`);let n;if(e instanceof Ue)n=e;else try{n=new Ue(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),t._url=n.href;let o=n.protocol==="wss:",f=n.protocol==="ws+unix:",l;if(n.protocol!=="ws:"&&!o&&!f?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:f&&!n.pathname?l="The URL's pathname is empty":n.hash&&(l="The URL contains a fragment identifier"),l){let u=new SyntaxError(l);if(t._redirects===0)throw u;ue(t,u);return}let a=o?443:80,h=Ls(16).toString("base64"),c=o?ks.request:Ts.request,_=new Set,g;if(i.createConnection=i.createConnection||(o?Vs:js),i.defaultPort=i.defaultPort||a,i.port=n.port||a,i.host=n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},i.path=n.pathname+n.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new P(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Ws({[P.extensionName]:g.offer()})),s.length){for(let u of s){if(typeof u!="string"||!$s.test(u)||_.has(u))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(u)}i.headers["Sec-WebSocket-Protocol"]=s.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(n.username||n.password)&&(i.auth=`${n.username}:${n.password}`),f){let u=i.path.split(":");i.socketPath=u[0],i.path=u[1]}let p;if(i.followRedirects){if(t._redirects===0){t._originalIpc=f,t._originalSecure=o,t._originalHostOrSocketPath=f?i.socketPath:n.host;let u=r&&r.headers;if(r={...r,headers:{}},u)for(let[S,M]of Object.entries(u))r.headers[S.toLowerCase()]=M}else if(t.listenerCount("redirect")===0){let u=f?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:n.host===t._originalHostOrSocketPath;(!u||t._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,u||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),p=t._req=c(i),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=c(i);i.timeout&&p.on("timeout",()=>{E(t,p,"Opening handshake has timed out")}),p.on("error",u=>{p===null||p[Ot]||(p=t._req=null,ue(t,u))}),p.on("response",u=>{let S=u.headers.location,M=u.statusCode;if(S&&i.followRedirects&&M>=300&&M<400){if(++t._redirects>i.maxRedirects){E(t,p,"Maximum redirects exceeded");return}p.abort();let z;try{z=new Ue(S,e)}catch{let A=new SyntaxError(`Invalid URL: ${S}`);ue(t,A);return}kt(t,z,s,r)}else t.emit("unexpected-response",p,u)||E(t,p,`Unexpected server response: ${u.statusCode}`)}),p.on("upgrade",(u,S,M)=>{if(t.emit("upgrade",u),t.readyState!==d.CONNECTING)return;p=t._req=null;let z=u.headers.upgrade;if(z===void 0||z.toLowerCase()!=="websocket"){E(t,S,"Invalid Upgrade header");return}let We=Ns("sha1").update(h+Us).digest("base64");if(u.headers["sec-websocket-accept"]!==We){E(t,S,"Invalid Sec-WebSocket-Accept header");return}let A=u.headers["sec-websocket-protocol"],H;if(A!==void 0?_.size?_.has(A)||(H="Server sent an invalid subprotocol"):H="Server sent a subprotocol but none was requested":_.size&&(H="Server sent no subprotocol"),H){E(t,S,H);return}A&&(t._protocol=A);let Fe=u.headers["sec-websocket-extensions"];if(Fe!==void 0){if(!g){E(t,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let me;try{me=Fs(Fe)}catch{E(t,S,"Invalid Sec-WebSocket-Extensions header");return}let qe=Object.keys(me);if(qe.length!==1||qe[0]!==P.extensionName){E(t,S,"Server indicated an extension that was not requested");return}try{g.accept(me[P.extensionName])}catch{E(t,S,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[P.extensionName]=g}t.setSocket(S,M,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(p,t):p.end()}function ue(t,e){t._readyState=d.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function js(t){return t.path=t.socketPath,bt.connect(t)}function Vs(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=bt.isIP(t.host)?"":t.host),Cs.connect(t)}function E(t,e,s){t._readyState=d.CLOSING;let r=new Error(s);Error.captureStackTrace(r,E),e.setHeader?(e[Ot]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ue,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Me(t,e,s){if(e){let r=Rs(e)?e.size:qs(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r}if(s){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${L[t.readyState]})`);process.nextTick(s,r)}}function zs(t,e){let s=this[y];s._closeFrameReceived=!0,s._closeMessage=e,s._closeCode=t,s._socket[y]!==void 0&&(s._socket.removeListener("data",de),process.nextTick(Tt,s._socket),t===1005?s.close():s.close(t,e))}function Hs(){let t=this[y];t.isPaused||t._socket.resume()}function Ys(t){let e=this[y];e._socket[y]!==void 0&&(e._socket.removeListener("data",de),process.nextTick(Tt,e._socket),e.close(t[Ds])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function vt(){this[y].emitClose()}function Ks(t,e){this[y].emit("message",t,e)}function Xs(t){let e=this[y];e._autoPong&&e.pong(t,!this._isServer,wt),e.emit("ping",t)}function Zs(t){this[y].emit("pong",t)}function Tt(t){t.resume()}function Qs(t){let e=this[y];e.readyState!==d.CLOSED&&(e.readyState===d.OPEN&&(e._readyState=d.CLOSING,Ct(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Ct(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),Gs)}function Lt(){let t=this[y];this.removeListener("close",Lt),this.removeListener("data",de),this.removeListener("end",Nt),t._readyState=d.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[y]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",vt),t._receiver.on("finish",vt))}function de(t){this[y]._receiver.write(t)||this.pause()}function Nt(){let t=this[y];t._readyState=d.CLOSING,t._receiver.end(),this.end()}function Pt(){let t=this[y];this.removeListener("error",Pt),this.on("error",wt),t&&(t._readyState=d.CLOSING,this.destroy())}});var Dt=x((Nr,It)=>{"use strict";var Lr=_e(),{Duplex:Js}=m("stream");function Rt(t){t.emit("close")}function er(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Ut(t){this.removeListener("error",Ut),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function tr(t,e){let s=!0,r=new Js({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(n,o){let f=!o&&r._readableState.objectMode?n.toString():n;r.push(f)||t.pause()}),t.once("error",function(n){r.destroyed||(s=!1,r.destroy(n))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(i,n){if(t.readyState===t.CLOSED){n(i),process.nextTick(Rt,r);return}let o=!1;t.once("error",function(l){o=!0,n(l)}),t.once("close",function(){o||n(i),process.nextTick(Rt,r)}),s&&t.terminate()},r._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},r._write=function(i,n,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(i,n,o)});return}t.send(i,o)},r.on("end",er),r.on("error",Ut),r}It.exports=tr});var At=x((Pr,Mt)=>{"use strict";var{tokenChars:sr}=q();function rr(t){let e=new Set,s=-1,r=-1,i=0;for(i;i<t.length;i++){let o=t.charCodeAt(i);if(r===-1&&sr[o]===1)s===-1&&(s=i);else if(i!==0&&(o===32||o===9))r===-1&&s!==-1&&(r=i);else if(o===44){if(s===-1)throw new SyntaxError(`Unexpected character at index ${i}`);r===-1&&(r=i);let f=t.slice(s,r);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);e.add(f),s=r=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(s===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let n=t.slice(s,i);if(e.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return e.add(n),e}Mt.exports={parse:rr}});var Vt=x((Rr,jt)=>{"use strict";var ir=m("events"),pe=m("http"),{Duplex:Br}=m("stream"),{createHash:nr}=m("crypto"),Wt=Re(),I=Z(),or=At(),ar=_e(),{GUID:fr,kWebSocket:lr}=k(),hr=/^[+/0-9A-Za-z]{22}==$/,Ft=0,qt=1,$t=2,Ae=class extends ir{constructor(e,s){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:ar,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=pe.createServer((r,i)=>{let n=pe.STATUS_CODES[426];i.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),i.end(n)}),this._server.listen(e.port,e.host,e.backlog,s)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=cr(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,n,o)=>{this.handleUpgrade(i,n,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Ft}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===$t){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(te,this);return}if(e&&this.once("close",e),this._state!==qt)if(this._state=qt,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(te,this):process.nextTick(te,this);else{let s=this._server;this._removeListeners(),this._removeListeners=this._server=null,s.close(()=>{te(this)})}}shouldHandle(e){if(this.options.path){let s=e.url.indexOf("?");if((s!==-1?e.url.slice(0,s):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,s,r,i){s.on("error",Gt);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,f=+e.headers["sec-websocket-version"];if(e.method!=="GET"){D(this,e,s,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){D(this,e,s,400,"Invalid Upgrade header");return}if(n===void 0||!hr.test(n)){D(this,e,s,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==13&&f!==8){D(this,e,s,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){se(s,400);return}let l=e.headers["sec-websocket-protocol"],a=new Set;if(l!==void 0)try{a=or.parse(l)}catch{D(this,e,s,400,"Invalid Sec-WebSocket-Protocol header");return}let h=e.headers["sec-websocket-extensions"],c={};if(this.options.perMessageDeflate&&h!==void 0){let _=new I(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=Wt.parse(h);g[I.extensionName]&&(_.accept(g[I.extensionName]),c[I.extensionName]=_)}catch{D(this,e,s,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:e.headers[`${f===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(_,(g,p,u,S)=>{if(!g)return se(s,p||401,u,S);this.completeUpgrade(c,n,a,e,s,r,i)});return}if(!this.options.verifyClient(_))return se(s,401)}this.completeUpgrade(c,n,a,e,s,r,i)}completeUpgrade(e,s,r,i,n,o,f){if(!n.readable||!n.writable)return n.destroy();if(n[lr])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ft)return se(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${nr("sha1").update(s+fr).digest("base64")}`],h=new this.options.WebSocket(null,void 0,this.options);if(r.size){let c=this.options.handleProtocols?this.options.handleProtocols(r,i):r.values().next().value;c&&(a.push(`Sec-WebSocket-Protocol: ${c}`),h._protocol=c)}if(e[I.extensionName]){let c=e[I.extensionName].params,_=Wt.format({[I.extensionName]:[c]});a.push(`Sec-WebSocket-Extensions: ${_}`),h._extensions=e}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
3
|
+
`).join(`\r
|
|
4
|
+
`)),n.removeListener("error",Gt),h.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(h),h.on("close",()=>{this.clients.delete(h),this._shouldEmitClose&&!this.clients.size&&process.nextTick(te,this)})),f(h,i)}};jt.exports=Ae;function cr(t,e){for(let s of Object.keys(e))t.on(s,e[s]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function te(t){t._state=$t,t.emit("close")}function Gt(){this.destroy()}function se(t,e,s,r){s=s||pe.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(s),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${pe.STATUS_CODES[e]}\r
|
|
5
|
+
`+Object.keys(r).map(i=>`${i}: ${r[i]}`).join(`\r
|
|
6
|
+
`)+`\r
|
|
7
|
+
\r
|
|
8
|
+
`+s)}function D(t,e,s,r,i,n){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,D),t.emit("wsClientError",o,s,e)}else se(s,r,i,n)}});var ur=Y(Dt(),1),dr=Y(Ce(),1),_r=Y(Pe(),1),zt=Y(_e(),1),pr=Y(Vt(),1);var Ur=zt.default;export{Ur as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module'; const require = __cjsCreateRequire(import.meta.url);
|
|
2
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|