From 80f01d06c59522c8d60efc07a7a7f78183c5b8b5 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Thu, 30 Mar 2023 14:21:05 +0200 Subject: [PATCH] dbug: return scry component WIP this adds the minimal things we have in the scry-state of a peer. Will revisit later on to present (more) information in a different way --- pkg/arvo/app/debug/js/index.js | 2 +- pkg/interface/dbug/src/js/views/ames.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/app/debug/js/index.js b/pkg/arvo/app/debug/js/index.js index 7ec1f051ee..13ff7dce10 100644 --- a/pkg/arvo/app/debug/js/index.js +++ b/pkg/arvo/app/debug/js/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("buffer")):"function"==typeof define&&define.amd?define("index",["buffer"],t):t((e=e||self).buffer)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=t.performance||{},r=(n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function i(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var s=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var c=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o1?t-1:0),r=1;r1?t-1:0),r=1;r0&&"string"==typeof n[n.length-1]&&0===n[n.length-1].indexOf("\n in"))){var r=A.ReactDebugCurrentFrame.getStackAddendum();""!==r&&(t+="%s",n=n.concat([r]))}var i=n.map(function(e){return""+e});i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i);try{var o=0,a="Warning: "+t.replace(/%s/g,function(){return n[o++]});throw new Error(a)}catch(e){}}e(A,{ReactDebugCurrentFrame:P,ReactComponentTreeHook:{}});var L={};function F(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;L[i]||(j("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.",t,r),L[i]=!0)}var z={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){F(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){F(e,"replaceState")},enqueueSetState:function(e,t,n,r){F(e,"setState")}},B={};function W(e,t,n){this.props=e,this.context=t,this.refs=B,this.updater=n||z}Object.freeze(B),W.prototype.isReactComponent={},W.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},W.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var Y={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)."]},H=function(e,t){Object.defineProperty(W.prototype,e,{get:function(){I("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var V in Y)Y.hasOwnProperty(V)&&H(V,Y[V]);function $(){}function q(e,t,n){this.props=e,this.context=t,this.refs=B,this.updater=n||z}$.prototype=W.prototype;var G=q.prototype=new $;G.constructor=q,e(G,W.prototype),G.isPureReactComponent=!0;var Q,K,Z,X=Object.prototype.hasOwnProperty,J={key:!0,ref:!0,__self:!0,__source:!0};function ee(e){if(X.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function te(e){if(X.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}Z={};var ne=function(e,t,n,r,o,a,s){var u={$$typeof:i,type:e,key:t,ref:n,props:s,_owner:a,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function re(e,t,n){var r,i={},o=null,a=null,s=null,u=null;if(null!=t)for(r in ee(t)&&(a=t.ref,function(e){if("string"==typeof e.ref&&C.current&&e.__self&&C.current.stateNode!==e.__self){var t=R(C.current.type);Z[t]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',R(C.current.type),e.ref),Z[t]=!0)}}(t)),te(t)&&(o=""+t.key),s=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)X.call(t,r)&&!J.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(1===l)i.children=n;else if(l>1){for(var c=Array(l),f=0;f.")}return t}(t);if(!xe[n]){xe[n]=!0;var r="";e&&e._owner&&e._owner!==C.current&&(r=" It was passed a child from "+R(e._owner.type)+"."),D(e),j('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),D(null)}}}function Se(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",u=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,j("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,u)}var f=re.apply(this,arguments);if(null==f)return f;if(s)for(var d=2;d1){for(var h=Array(d),p=0;p is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,j("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},t.createElement=Oe,t.createFactory=Ae,t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){return null!=e&&e.$$typeof===g?j("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?j("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&j("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||j("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:h,render:e}},t.isValidElement=ie,t.lazy=function(e){var t,n,r={$$typeof:v,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){j("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){j("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},t.memo=function(e,t){return _e(e)||j("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:g,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return we().useCallback(e,t)},t.useContext=function(e,t){var n=we();if(void 0!==t&&j("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?j("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&j("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},t.useDebugValue=function(e,t){return we().useDebugValue(e,t)},t.useEffect=function(e,t){return we().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return we().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return we().useLayoutEffect(e,t)},t.useMemo=function(e,t){return we().useMemo(e,t)},t.useReducer=function(e,t,n){return we().useReducer(e,t,n)},t.useRef=function(e){return we().useRef(e)},t.useState=function(e){return we().useState(e)},t.version="16.14.0"}()}),S=(E.Children,E.Component,E.Fragment,E.Profiler,E.PureComponent,E.StrictMode,E.Suspense,E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E.cloneElement,E.createContext,E.createElement,E.createFactory,E.createRef,E.forwardRef,E.isValidElement,E.lazy,E.memo,E.useCallback,E.useContext,E.useDebugValue,E.useEffect,E.useImperativeHandle,E.useLayoutEffect,E.useMemo,E.useReducer,E.useRef,E.useState,E.version,a(function(e){e.exports=E})),T=S.Component,C=S.createRef,M=S.createElement,N=S.useState,R=S.useRef,P=S.useEffect,O=S.Fragment,D=a(function(e,t){var n,r,i,o,a;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,u=null,l=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(l,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(l,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},o=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var v=!1,y=null,b=-1,_=5,w=0;o=function(){return t.unstable_now()>=w},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0C(a,n))void 0!==u&&0>C(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>C(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function C(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],N=[],R=1,P=null,O=3,D=!1,A=!1,I=!1;function j(e){for(var t=S(N);null!==t;){if(null===t.callback)T(N);else{if(!(t.startTime<=e))break;T(N),t.sortIndex=t.expirationTime,E(M,t)}t=S(N)}}function U(e){if(I=!1,j(e),!A)if(null!==S(M))A=!0,n(L);else{var t=S(N);null!==t&&r(U,t.startTime-e)}}function L(e,n){A=!1,I&&(I=!1,i()),D=!0;var a=O;try{for(j(n),P=S(M);null!==P&&(!(P.expirationTime>n)||e&&!o());){var s=P.callback;if(null!==s){P.callback=null,O=P.priorityLevel;var u=s(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?P.callback=u:P===S(M)&&T(M),j(n)}else T(M);P=S(M)}if(null!==P)var l=!0;else{var c=S(N);null!==c&&r(U,c.startTime-n),l=!1}return l}finally{P=null,O=a,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||D||(A=!0,n(L))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return S(M)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=z,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0s?(e.sortIndex=u,E(N,e),null===S(M)&&e===S(N)&&(I?i():I=!0,r(U,u-s))):(e.sortIndex=a,E(M,e),A||D||(A=!0,n(L))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();j(e);var n=S(M);return n!==P&&null!==P&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=x},o=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):k=e>0?Math.floor(1e3/e):5};var E=new MessageChannel,S=E.port2;E.port1.onmessage=function(){if(null!==_){var e=t.unstable_now();x=e+k;try{_(!0,e)?S.postMessage(null):(b=!1,_=null)}catch(e){throw S.postMessage(null),e}}else b=!1},e=function(e){_=e,b||(b=!0,S.postMessage(null))},n=function(e,n){w=p(function(){e(t.unstable_now())},n)},r=function(){m(w),w=-1}}function T(e,t){var n=e.length;e.push(t),function(e,t,n){var r=n;for(;;){var i=r-1>>>1,o=e[i];if(!(void 0!==o&&N(o,t)>0))return;e[i]=t,e[r]=o,r=i}}(e,t,n)}function C(e){var t=e[0];return void 0===t?null:t}function M(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){var r=n,i=e.length;for(;r$){if(($*=2)>V)return console.error("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`."),void oe();var n=new Int32Array(4*$);n.set(G),q=n.buffer,G=n}G.set(e,t)}}function oe(){var e=q;return $=0,q=null,G=null,Q=0,e}function ae(e,t){F[Y]++,null!==G&&ie([K,1e3*t,e.id,e.priorityLevel])}function se(e,t){F[z]=R,F[B]=0,F[Y]--,null!==G&&ie([Z,1e3*t,e.id])}function ue(e,t){F[z]=R,F[B]=0,F[W]=0,null!==G&&ie([te,1e3*t,e.id,j])}var le=-1,ce=250,fe=5e3,de=1e4,he=1073741823,pe=[],me=[],ge=1,ve=null,ye=D,be=!1,_e=!1,we=!1;function ke(e){for(var t=C(me);null!==t;){if(null===t.callback)M(me);else{if(!(t.startTime<=e))return;M(me),t.sortIndex=t.expirationTime,T(pe,t),ae(t,e),t.isQueued=!0}t=C(me)}}function xe(t){if(we=!1,ke(t),!_e)if(null!==C(pe))_e=!0,e(Ee);else{var r=C(me);null!==r&&n(xe,r.startTime-t)}}function Ee(e,n){var i;i=n,null!==G&&ie([re,1e3*i,U]),_e=!1,we&&(we=!1,r()),be=!0;var o=ye;try{if(!s)return Se(e,n);try{return Se(e,n)}catch(e){if(null!==ve){var a=t.unstable_now();!function(e,t){F[z]=R,F[B]=0,F[Y]--,null!==G&&ie([X,1e3*t,e.id])}(ve,a),ve.isQueued=!1}throw e}}finally{ve=null,ye=o,be=!1,function(e){U++,null!==G&&ie([ne,1e3*e,U])}(t.unstable_now())}}function Se(e,r){var o,s,u=r;for(ke(u),ve=C(pe);null!==ve&&!a&&(!(ve.expirationTime>u)||e&&!i());){var l=ve.callback;if(null!==l){ve.callback=null,ye=ve.priorityLevel;var c=ve.expirationTime<=u;o=ve,s=u,j++,F[z]=o.priorityLevel,F[B]=o.id,F[W]=j,null!==G&&ie([ee,1e3*s,o.id,j]);var f=l(c);u=t.unstable_now(),"function"==typeof f?(ve.callback=f,ue(ve,u)):(se(ve,u),ve.isQueued=!1,ve===C(pe)&&M(pe)),ke(u)}else M(pe);ve=C(pe)}if(null!==ve)return!0;var d=C(me);return null!==d&&n(xe,d.startTime-u),!1}function Te(e){switch(e){case P:return le;case O:return ce;case I:return he;case A:return de;case D:default:return fe}}var Ce=o,Me={startLoggingProfilingEvents:function(){$=H,q=new ArrayBuffer(4*$),G=new Int32Array(q),Q=0},stopLoggingProfilingEvents:oe,sharedProfilingBuffer:L};t.unstable_IdlePriority=I,t.unstable_ImmediatePriority=P,t.unstable_LowPriority=A,t.unstable_NormalPriority=D,t.unstable_Profiling=Me,t.unstable_UserBlockingPriority=O,t.unstable_cancelCallback=function(e){e.isQueued&&(function(e,t){F[Y]--,null!==G&&ie([J,1e3*t,e.id])}(e,t.unstable_now()),e.isQueued=!1),e.callback=null},t.unstable_continueExecution=function(){_e||be||(_e=!0,e(Ee))},t.unstable_getCurrentPriorityLevel=function(){return ye},t.unstable_getFirstCallbackNode=function(){return C(pe)},t.unstable_next=function(e){var t;switch(ye){case P:case O:case D:t=D;break;default:t=ye}var n=ye;ye=t;try{return e()}finally{ye=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=Ce,t.unstable_runWithPriority=function(e,t){switch(e){case P:case O:case D:case A:case I:break;default:e=D}var n=ye;ye=e;try{return t()}finally{ye=n}},t.unstable_scheduleCallback=function(i,o,a){var s,u,l=t.unstable_now();if("object"==typeof a&&null!==a){var c=a.delay;s="number"==typeof c&&c>0?l+c:l,u="number"==typeof a.timeout?a.timeout:Te(i)}else u=Te(i),s=l;var f=s+u,d={id:ge++,callback:o,priorityLevel:i,startTime:s,expirationTime:f,sortIndex:-1,isQueued:!1};return s>l?(d.sortIndex=s,T(me,d),null===C(pe)&&d===C(me)&&(we?r():we=!0,n(xe,s-l))):(d.sortIndex=f,T(pe,d),ae(d,l),d.isQueued=!0,_e||be||(_e=!0,e(Ee))),d},t.unstable_shouldYield=function(){var e=t.unstable_now();ke(e);var n=C(pe);return n!==ve&&null!==ve&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime